@cotal-ai/manager 0.17.0 → 0.19.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.
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAA4E,YAAY,EAA4C,eAAe,EAAY,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAC1N,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAsC5B,OAAO,EAsCL,KAAK,QAAQ,EAEd,MAAM,gBAAgB,CAAC;AAsBxB;;;;;;;sDAOsD;AACtD,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAsD3C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;iGAE6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;4GAIwG;IACxG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;4GAEwG;IACxG,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;6FAMyF;IACzF,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;+FAK2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW,CA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;YACd,OAAO;IAgBrB;;;;;;;;4GAQwG;IACxG,OAAO,CAAC,eAAe;IAqCvB;;;;uGAImG;YACrF,gBAAgB;IAkC9B;;;;;;2GAMuG;YACzF,uBAAuB;IAmCrC,wFAAwF;IACxF;gGAC4F;IAC5F,OAAO,CAAC,IAAI;CA8Bb"}
package/dist/manager.js CHANGED
@@ -3,7 +3,7 @@ import { createHash, randomUUID, randomBytes } from "node:crypto";
3
3
  import { connect, credsAuthenticator } from "@nats-io/transport-node";
4
4
  import { existsSync, lstatSync, readFileSync, rmSync } from "node:fs";
5
5
  import { join, dirname, resolve } from "node:path";
6
- import { CotalEndpoint, DEFAULT_SERVER, DEV_OWNER, MANAGER_LEASE_TTL_MS, STANDING_RENEWABLE_TTL_SEC, agentFilePath, clearSpaceHistory, connectorServers, deprovisionAgent, firstFreeName, idFromCreds, inspectCredHealth, loadAgentFile, loadCotalConfig, mintCreds, mintLifecycleUid, mkSecretDir, newIdentity, actionContext, parsePrincipalKey, parseShareSelection, principalKey, probeConnect, provisionAgent, provisionAgentDurables, registry, resolveAuthProvider, saveAgentFile, subjectMatches, CONTROL_AUTH_ADMIN, controlServiceSubject, } from "@cotal-ai/core";
6
+ import { CotalEndpoint, DEFAULT_SERVER, DEV_OWNER, MANAGER_LEASE_TTL_MS, MANAGER_LEASE_RENEW_MS, STANDING_RENEWABLE_TTL_SEC, agentFilePath, clearSpaceHistory, connectorServers, deprovisionAgent, firstFreeName, idFromCreds, inspectCredHealth, loadAgentFile, loadCotalConfig, mintCreds, mintLifecycleUid, mkSecretDir, newIdentity, actionContext, parsePrincipalKey, parseShareSelection, principalKey, probeConnect, provisionAgent, provisionAgentDurables, registry, resolveAuthProvider, saveAgentFile, subjectMatches, AUTH_ENDPOINT, EP_CMD_RETIRE_LIFECYCLE, epRequestSubject, epCallerReplyFilter, parseEpSubject, controlServiceSubject, } from "@cotal-ai/core";
7
7
  import { agentAuthState, agentCredsDir, agentLifecycleSecretFilePaths, agentSecretFilePaths, agentSecretKeyForFile, authDir, connectorInstallHint, DEFAULT_CONNECTOR, defaultAgentType, DELIVERY_CREDS_KEY, findCotalRoot, getSpaceAuth, hasUserAuthState, loadManagerInstanceIdentity, loadMeshes, manifestExtensionNames, materializeFromManifest, materializeSecretToFile, MEMBERSHIP_RW_CREDS_KEY, mergeLaunchOptions, remintDaemonCreds, resolveOnPath, saveManagerInstanceIdentity, SYSTEM_CREDS_FILES, userAuthStateDir, workspaceSecretStore, writeRenewalRecord } from "@cotal-ai/workspace";
8
8
  import { createRuntime, } from "./runtime/index.js";
9
9
  import { AttachEndpoint } from "./attach-endpoint.js";
@@ -91,6 +91,61 @@ function withTimeout(p, ms, msg) {
91
91
  function sameStrings(a, b) {
92
92
  return JSON.stringify([...(a ?? [])].sort()) === JSON.stringify([...(b ?? [])].sort());
93
93
  }
94
+ /** One ep request/reply round-trip on the caller's OWN reply-plane filter (§13.2). The responder
95
+ * derives the reply subject from the authenticated request, so there is no caller-selected reply
96
+ * target to honour; the caller binds the answer off the reply SUBJECT — endpoint and nonce, both
97
+ * broker-pinned by the responder's serve publish grant. A reply on another nonce belongs to a
98
+ * different request (the rail is shared) and is ignored rather than allowed to fail this one. */
99
+ export async function epAwaitReply(nc, space, caller, nonce, requestId, requestSubject, body, timeoutMs) {
100
+ let sub;
101
+ let timer;
102
+ try {
103
+ const got = new Promise((resolve, reject) => {
104
+ sub = nc.subscribe(epCallerReplyFilter(space, caller), {
105
+ callback: (err, msg) => {
106
+ if (err) {
107
+ reject(new Error(`the retirement reply subscription failed: ${err.message}`));
108
+ return;
109
+ }
110
+ const parsed = parseEpSubject(msg.subject);
111
+ if (!parsed || parsed.plane !== "reply" || parsed.endpoint !== AUTH_ENDPOINT || parsed.nonce !== nonce)
112
+ return;
113
+ let body;
114
+ try {
115
+ body = JSON.parse(new TextDecoder().decode(msg.data));
116
+ }
117
+ catch {
118
+ return;
119
+ } // a malformed body on our nonce is not an answer; keep waiting
120
+ // REQUIRE THE ID ECHO. Binding on (endpoint, nonce) alone would accept a malformed or
121
+ // WRONG-ID `{ok:true}` and clear a retirement hold on it. Ignore rather than fail: the
122
+ // rail is shared across concurrent requests and a responder may publish at any nonce, so
123
+ // an unmatched reply is someone else's answer, never grounds to fail the honest one.
124
+ if (body.id !== requestId)
125
+ return;
126
+ resolve(body);
127
+ },
128
+ });
129
+ timer = setTimeout(() => reject(new Error("timeout")), timeoutMs);
130
+ nc.publish(requestSubject, new TextEncoder().encode(body));
131
+ });
132
+ return await got;
133
+ }
134
+ finally {
135
+ if (timer)
136
+ clearTimeout(timer);
137
+ try {
138
+ sub?.unsubscribe();
139
+ }
140
+ catch { /* connection already down */ }
141
+ }
142
+ }
143
+ /**
144
+ * The agent supervisor: a long-lived mesh node that owns agent process lifecycle.
145
+ * It serves control requests on the "manager" service and spawns/kills agents
146
+ * through a pluggable {@link Runtime} (pty by default). It does NOT proxy agent
147
+ * mesh traffic — terminal I/O streams over its own attach endpoint instead.
148
+ */
94
149
  export class Manager {
95
150
  space;
96
151
  servers;
@@ -229,6 +284,22 @@ export class Manager {
229
284
  leaseInfo;
230
285
  leaseRevision;
231
286
  leaseTimer;
287
+ /** When this instance last knew the key's TTL had been REFRESHED: a successful acquire or renew, or
288
+ * a re-read showing the revision moved past the one we held (our write landed, only its ack was
289
+ * lost). The gap since then is the only thing bounding how long we may keep serving with no answer
290
+ * at all, so it must track the last TTL-refreshing WRITE and not the last successful observation.
291
+ * A re-read at the same revision is deliberately NOT a refresh: it proves the key exists at that
292
+ * instant, while the key still expires when the last landed write said it would.
293
+ *
294
+ * MONOTONIC (`performance.now`), not wall clock, because it is only ever read as an ELAPSED time.
295
+ * `Date.now` steps on an NTP correction or a suspend/resume, and a backward step would shorten the
296
+ * measured gap and let this instance serve past the TTL with no proof it still holds the key. The
297
+ * initial value is `-Infinity` so "never refreshed" reads as an infinite gap and fails closed,
298
+ * rather than as a small one at process start when a monotonic clock is still near zero. */
299
+ leaseConfirmedAt = Number.NEGATIVE_INFINITY;
300
+ /** A renew is in flight. The tick must not start a second one: both would read the same cached
301
+ * revision, so whichever lands second CASes against a sequence the first already moved. */
302
+ leaseRenewInFlight = false;
232
303
  /** The class-2 renewal owner's half-TTL schedule (D5 slice 5); armed only on auth meshes. */
233
304
  credRenewTimer;
234
305
  maintenanceState = "active";
@@ -386,6 +457,7 @@ export class Manager {
386
457
  this.leaseInfo = { holder: this.ep.ref().id, instanceId: this.managerInstanceId, runtime: this.runtime.kind, root: resolve(this.workspaceRoot), pid: process.pid };
387
458
  try {
388
459
  this.leaseRevision = await this.ep.acquireManagerLease(this.leaseInfo);
460
+ this.leaseConfirmedAt = performance.now();
389
461
  }
390
462
  catch (e) {
391
463
  // Our OWN instance id already holds a live key ⇒ refuse. Anything else (e.g. a KV/JS error) is a
@@ -397,7 +469,7 @@ export class Manager {
397
469
  ? `manager instance ${this.managerInstanceId} already serves space "${this.space}" from this workspace root (${held.runtime}, pid ${held.pid}, root ${held.root}) - stop it first before restarting the same instance`
398
470
  : `could not acquire the manager lease for space "${this.space}": ${e.message}`);
399
471
  }
400
- this.leaseTimer = setInterval(() => { void this.renewLease(); }, MANAGER_LEASE_TTL_MS / 2);
472
+ this.leaseTimer = setInterval(() => { void this.renewLease(); }, MANAGER_LEASE_RENEW_MS);
401
473
  this.leaseTimer.unref?.();
402
474
  // Unit B (static §13.1): ensure the two authority stores exist with their normative shape,
403
475
  // then sweep the durable slot rows and reconcile — re-drive any crashed activation/terminal
@@ -1075,45 +1147,131 @@ export class Manager {
1075
1147
  catch { /* best effort */ }
1076
1148
  }
1077
1149
  }
1078
- /** Refresh THIS instance's liveness lease before the bucket TTL expires it. On loss (missed the TTL —
1079
- * this instance stalled past the renew window) FAIL CLOSED for THIS INSTANCE ONLY: stop serving +
1080
- * tear down OUR managed agents + exit, so a stalled instance can't keep double-processing under a key
1081
- * a same-id restart may re-acquire. Keyed per instance, so this NEVER frees or touches a sibling
1082
- * manager's key and NEVER freezes the space (security pin 6) the sibling keeps serving. We do NOT
1083
- * re-acquire (a same-id restart may already be live) and do NOT release the key (it may be the
1084
- * restart's). A DIFFERENT instance losing ITS key is a separate, independent event. */
1150
+ /** Refresh THIS instance's liveness lease before the bucket TTL expires it.
1151
+ *
1152
+ * A FAILED RENEW IS NOT A LOST LEASE, and the difference is the whole shape of this method. The CAS
1153
+ * renew throws for reasons that prove entirely different things, and one of them proves nothing at
1154
+ * all: a request that gets NO ANSWER within its deadline does not establish that the write failed,
1155
+ * that the key expired, or that anyone else took it. It may even have LANDED, with only the
1156
+ * acknowledgement lost. Terminating on it kills a healthy manager and takes its agents with it.
1157
+ *
1158
+ * So the renew failing is a question, not a verdict, and the verdict comes from RE-READING the key
1159
+ * ({@link CotalEndpoint.readOwnManagerLease}, which separates "it is gone" from "I could not find
1160
+ * out"). We fail closed on PROOF — the key is absent, or it is present and holds someone else — and
1161
+ * otherwise keep serving, adopting whatever revision the broker actually has.
1162
+ *
1163
+ * WHEN NO ANSWER IS AVAILABLE AT ALL, the bound is time, not attempts: past one whole TTL with no
1164
+ * renew that LANDED, the key may have expired and been re-acquired, so this instance can no longer
1165
+ * claim to hold it and fails closed on that ground, said plainly. A re-read answering "still yours,
1166
+ * same revision" IS an answer and we keep serving on it, but it did not touch the key, so it buys
1167
+ * no time — reading a key is not refreshing it. Inside the TTL the budget affords another
1168
+ * renew-and-re-read pair ({@link MANAGER_LEASE_RENEW_MS}), which is what makes waiting safe.
1169
+ *
1170
+ * FAILING CLOSED IS FOR THIS INSTANCE ONLY: stop serving + tear down OUR managed agents + exit, so a
1171
+ * stalled instance can't keep double-processing under a key a same-id restart may re-acquire. Keyed
1172
+ * per instance, so it NEVER frees or touches a sibling manager's key and NEVER freezes the space
1173
+ * (security pin 6) — the sibling keeps serving. We do NOT re-acquire (a same-id restart may already
1174
+ * be live) and do NOT release the key (it may be the restart's). */
1085
1175
  async renewLease() {
1176
+ // A renew that runs long must not be overlapped by the next tick: both would CAS against the same
1177
+ // cached revision, so whichever lands second is refused over a sequence the first legitimately
1178
+ // moved — a conflict this instance manufactured itself.
1179
+ if (this.leaseRenewInFlight)
1180
+ return;
1181
+ this.leaseRenewInFlight = true;
1086
1182
  try {
1087
1183
  if (!this.leaseInfo || this.leaseRevision === undefined)
1088
1184
  return;
1089
- this.leaseRevision = await this.ep.renewManagerLease(this.leaseInfo, this.leaseRevision);
1090
- }
1091
- catch (e) {
1092
- console.error(`! manager instance ${this.managerInstanceId} lost its liveness lease for space "${this.space}" (${e.message}) - shutting down THIS instance (its serving only; siblings keep the space)`);
1093
- if (this.leaseTimer)
1094
- clearInterval(this.leaseTimer);
1095
- // Tear down our managed agents' footprints too (#159 B2) — this exit path leaks them otherwise. Do
1096
- // NOT release the lease key (it may belong to the replacement holder). Best-effort, like ep/attach.
1097
- try {
1098
- if (this.maintenanceState === "active" && !this.resumeRequired)
1099
- await this.teardownManagedAgents();
1100
- else
1101
- await this.stopRetainedAgentsOnExit();
1102
- }
1103
- catch { /* best effort */ }
1104
- await this.stopServiceServe();
1105
- await this.stopGoalWriter();
1106
- await this.stopSessionPlane();
1107
1185
  try {
1108
- await this.ep.stop();
1186
+ this.leaseRevision = await this.ep.renewManagerLease(this.leaseInfo, this.leaseRevision);
1187
+ this.leaseConfirmedAt = performance.now();
1188
+ return;
1109
1189
  }
1110
- catch { /* best effort */ }
1111
- try {
1112
- await this.attach.stop();
1190
+ catch (renewError) {
1191
+ const why = renewError.message;
1192
+ const verdict = await this.reconcileLease();
1193
+ if (verdict.kind === "held") {
1194
+ // WHETHER THIS REFILLS THE BUDGET TURNS ON ONE THING: did our write land? It did, with only
1195
+ // its acknowledgement lost, exactly when the stored revision has moved past the one we hold.
1196
+ // That write is what restarted the key's TTL, so only it may reset the clock below.
1197
+ //
1198
+ // A re-read at the SAME revision proves the key exists AT THAT INSTANT and nothing more. Our
1199
+ // write did not land, the TTL was not restarted, and the key still expires when the last
1200
+ // landed write said it would. Resetting the clock here would measure the budget from the last
1201
+ // OBSERVATION rather than from the last TTL-refreshing write, and the budget would then
1202
+ // outlive the key: a streak of same-revision re-reads keeps refilling it, and if reads then
1203
+ // stop answering too, this instance goes on serving for a further whole TTL after the key has
1204
+ // actually expired and a same-id restart has taken it. Serving on a key we can still SEE is
1205
+ // right; buying more time to serve on a key we cannot see is not.
1206
+ const landed = verdict.revision > this.leaseRevision;
1207
+ this.leaseRevision = verdict.revision;
1208
+ if (landed)
1209
+ this.leaseConfirmedAt = performance.now();
1210
+ console.error(`! manager instance ${this.managerInstanceId} could not renew its liveness lease for space "${this.space}" (${why}) - the key is still ours at revision ${verdict.revision}${landed ? ", and that renew had in fact landed" : ", though this renew did not land, so the key's TTL was not restarted"}, so this instance keeps serving`);
1211
+ return;
1212
+ }
1213
+ if (verdict.kind === "unknown") {
1214
+ const since = performance.now() - this.leaseConfirmedAt;
1215
+ if (since < MANAGER_LEASE_TTL_MS) {
1216
+ console.error(`! manager instance ${this.managerInstanceId} could not renew its liveness lease for space "${this.space}" (${why}) and could not re-read it either (${verdict.why}) - that proves nothing about the key, and its lease was last refreshed ${Math.round(since)}ms ago, so this instance keeps serving and will retry`);
1217
+ return;
1218
+ }
1219
+ return await this.failClosedOnLeaseLoss(`its lease key ${Number.isFinite(since) ? `has not been refreshed for ${Math.round(since)}ms, longer than the ${MANAGER_LEASE_TTL_MS}ms lease TTL` : "was never refreshed"}, so this instance can no longer prove it holds it (renew: ${why}; re-read: ${verdict.why})`);
1220
+ }
1221
+ return await this.failClosedOnLeaseLoss(verdict.kind === "gone"
1222
+ ? `its lease key is GONE from the bucket - expired or released (renew: ${why})`
1223
+ : `its lease key is now held by ${verdict.by} and not by this process (renew: ${why})`);
1113
1224
  }
1114
- catch { /* best effort */ }
1115
- process.exit(1);
1116
1225
  }
1226
+ finally {
1227
+ this.leaseRenewInFlight = false;
1228
+ }
1229
+ }
1230
+ /** What the broker actually says about THIS instance's lease key, right now. `unknown` is a first-class
1231
+ * answer and never collapses into `gone`: not being able to look is not the same fact as looking and
1232
+ * finding nothing, and only the latter may end a manager. */
1233
+ async reconcileLease() {
1234
+ let current;
1235
+ try {
1236
+ current = await this.ep.readOwnManagerLease(this.managerInstanceId);
1237
+ }
1238
+ catch (e) {
1239
+ return { kind: "unknown", why: e.message };
1240
+ }
1241
+ if (current === undefined)
1242
+ return { kind: "gone" };
1243
+ // The pid is what distinguishes US from a same-id restart: the logical instance id and the serve
1244
+ // identity both PERSIST across restart by design, so neither can tell the two processes apart.
1245
+ if (current.info.pid !== process.pid)
1246
+ return { kind: "taken", by: `pid ${current.info.pid} (${current.info.runtime}, root ${current.info.root})` };
1247
+ return { kind: "held", revision: current.revision };
1248
+ }
1249
+ /** Stop serving and end this process, naming what was PROVED rather than what merely failed. */
1250
+ async failClosedOnLeaseLoss(proof) {
1251
+ console.error(`! manager instance ${this.managerInstanceId} lost its liveness lease for space "${this.space}": ${proof} - shutting down THIS instance (its serving only; siblings keep the space)`);
1252
+ if (this.leaseTimer)
1253
+ clearInterval(this.leaseTimer);
1254
+ // Tear down our managed agents' footprints too (#159 B2) — this exit path leaks them otherwise. Do
1255
+ // NOT release the lease key (it may belong to the replacement holder). Best-effort, like ep/attach.
1256
+ try {
1257
+ if (this.maintenanceState === "active" && !this.resumeRequired)
1258
+ await this.teardownManagedAgents();
1259
+ else
1260
+ await this.stopRetainedAgentsOnExit();
1261
+ }
1262
+ catch { /* best effort */ }
1263
+ await this.stopServiceServe();
1264
+ await this.stopGoalWriter();
1265
+ await this.stopSessionPlane();
1266
+ try {
1267
+ await this.ep.stop();
1268
+ }
1269
+ catch { /* best effort */ }
1270
+ try {
1271
+ await this.attach.stop();
1272
+ }
1273
+ catch { /* best effort */ }
1274
+ process.exit(1);
1117
1275
  }
1118
1276
  async opFinalizeResume(rawArgs) {
1119
1277
  {
@@ -1888,8 +2046,10 @@ export class Manager {
1888
2046
  }
1889
2047
  await this.deprovisionBroker(a);
1890
2048
  // #29 piece 3: after the footprint teardown, ask the AUTH plane to RETIRE the lifecycle over
1891
- // the auth-admin rail. The rail re-checks the space-manager lease at serve time; the terminal
1892
- // (or an already-retired answer) clears the name reservation. Failures keep the hold with
2049
+ // the auth endpoint rail. The rail re-checks the SERVE-ISSUANCE GATE at serve time (not the
2050
+ // space-manager lease - that check was replaced in 02794b2f) and refuses unless the registration
2051
+ // this request names belongs to our own principal; the terminal (or an already-retired answer)
2052
+ // clears the name reservation. Failures keep the hold with
1893
2053
  // their operator copy — legible, retryable, never a silent half-state.
1894
2054
  await this.requestRetirement(a);
1895
2055
  }
@@ -1934,20 +2094,44 @@ export class Manager {
1934
2094
  }
1935
2095
  const uncertain = (why) => `the despawn stopped "${a.name}", but the retirement's completion could NOT be confirmed (${why}). The name stays held - not failed, not done - and a same-name spawn re-drives the same teardown; the auth service also finishes any started retirement on its next boot. NEXT: if the auth rail stays unreachable, recover the stack (\`cotal supervise\`), then re-attempt the same-name spawn.`;
1936
2096
  try {
1937
- const creds = await mintCreds(this.auth, newIdentity(), "retirement-requester", { retirementRequester: { owner: me.owner, actor: me.actor } });
2097
+ // The caller triple and the TARGET are both grant-pinned now (#350): the `handle` target
2098
+ // rides the subject, so this ephemeral credential can ask to retire exactly this
2099
+ // incarnation and nothing else.
2100
+ const caller = { owner: me.owner, actor: me.actor, uid: this.managerLifecycleUid };
2101
+ const creds = await mintCreds(this.auth, newIdentity(), "retirement-requester", {
2102
+ retirementRequester: { ...caller, target: { owner: target.owner, actor: target.actor, lifecycleUid: a.lifecycleUid } },
2103
+ });
1938
2104
  const nc = await connect({ servers: this.servers ?? DEFAULT_SERVER, authenticator: credsAuthenticator(new TextEncoder().encode(creds)), maxReconnectAttempts: 0 });
1939
2105
  try {
1940
- const subject = controlServiceSubject(this.space, CONTROL_AUTH_ADMIN, me.owner, me.actor);
1941
- const m = await nc.request(subject,
1942
- // P2 item 3 (3b-3): declare THIS manager instance's current serve identity so the rail's
1943
- // holder check is registration-record-derived (the serve-issuance gate), not a name-derived
1944
- // "the manager". A superseded predecessor (same instanceId, OLD epoch after a restart) is
1945
- // then refused at the rail — its declared epoch no longer matches the gate's current one.
1946
- JSON.stringify({ op: "retireLifecycle", args: {
1947
- owner: target.owner, actor: target.actor, lifecycleUid: a.lifecycleUid, opId: retireOpId(a.lifecycleUid),
2106
+ // §13.2 nonce: >=128 bits of CSPRNG entropy, base64url (the `endpoint-invoke` idiom).
2107
+ const nonce = randomBytes(24).toString("base64url");
2108
+ // The caller-chosen request id the reply MUST echo (the minimal correctness guard from the
2109
+ // not-yet-migrated endpoint envelope - see the residual in the auth listener).
2110
+ const requestId = randomBytes(16).toString("base64url");
2111
+ const subject = epRequestSubject(this.space, {
2112
+ route: { mode: "one" },
2113
+ endpoint: AUTH_ENDPOINT,
2114
+ command: EP_CMD_RETIRE_LIFECYCLE,
2115
+ // The TARGET rides the subject (authz mode `handle`, arity 3) — broker-enforced, and
2116
+ // pinned by the grant minted above, so it is not a body claim the caller can vary.
2117
+ target: { mode: "handle", tOwner: target.owner, tActor: target.actor, tUid: a.lifecycleUid },
2118
+ caller,
2119
+ nonce,
2120
+ });
2121
+ // The responder derives its OWN reply subject from this request (caller triple + nonce,
2122
+ // prefixed with the RESPONDER's instance identity), so a caller-supplied `reply` header
2123
+ // would be ignored — that is the confused-deputy boundary being structural. The caller
2124
+ // therefore reads its own reply-plane filter and binds the answer off the reply SUBJECT.
2125
+ const m = await epAwaitReply(nc, this.space, caller, nonce, requestId, subject,
2126
+ // Declare THIS manager instance's serve identity. Since #350 these SELECT the gate row;
2127
+ // they no longer authorize — the rail refuses unless the row they name belongs to this
2128
+ // caller's own subject-derived principal. A superseded predecessor (same instanceId, OLD
2129
+ // epoch after a restart) is still refused by the epoch comparison.
2130
+ JSON.stringify({ id: requestId, op: "retireLifecycle", args: {
2131
+ opId: retireOpId(a.lifecycleUid),
1948
2132
  serveEndpoint: MANAGER_ENDPOINT, serveInstanceId: this.managerInstanceId, serveEpoch: this.serviceServe?.grant.epoch ?? 0,
1949
- } }), { timeout: 20_000, noMux: true, reply: `${subject}.reply.${randomUUID()}` });
1950
- const r = m.json();
2133
+ } }), 20_000);
2134
+ const r = m;
1951
2135
  if (r.ok) {
1952
2136
  // CAS the hold clear (audit #1 ABA): free the alias ONLY if the current hold is still THIS
1953
2137
  // lifecycle's - a late reply for a retired predecessor must never clear a successor's newer hold.
@@ -2040,16 +2224,6 @@ export class Manager {
2040
2224
  ? undefined
2041
2225
  : `unsafe name ${JSON.stringify(name)} (allowed: letters, digits, _ -)`;
2042
2226
  }
2043
- /** First free name in the series `base`, `base-2`, `base-3`, … — checked against live slots,
2044
- * in-flight (reserved) slots, names held pending retirement, AND the live mesh roster. The
2045
- * roster check covers occupants this manager does not manage (a foreground `cotal spawn`, a
2046
- * connector session, another manager's agent): allocating their name would mint a sibling the
2047
- * broker/auth then refuses to admit, surfacing as a 30s launch-uncertain black hole instead of
2048
- * the auto-number the join path gives. Presence is ADVISORY (SPEC §6) — this is an availability
2049
- * choice at allocation, never an authority check (the broker still enforces): a stale
2050
- * still-live-looking row only costs a numbered suffix, and a missed freshly-joined occupant is
2051
- * still refused downstream exactly as before. Offline rows do NOT occupy — a properly retired
2052
- * name stays reusable. */
2053
2227
  /** The roster's LIVE occupant names (status !== offline) — occupants this manager may NOT manage
2054
2228
  * (a foreground `cotal spawn`, a connector session, ANOTHER manager's agent). Allocating over any
2055
2229
  * of them mints a sibling the broker/auth then refuses to admit, surfacing as the 30s launch-
@@ -2068,6 +2242,16 @@ export class Manager {
2068
2242
  nameInUse(name, live = this.liveRosterNames()) {
2069
2243
  return this.agents.has(name) || this.reserved.has(name) || this.retiring.has(name) || live.has(name);
2070
2244
  }
2245
+ /** First free name in the series `base`, `base-2`, `base-3`, … — checked against live slots,
2246
+ * in-flight (reserved) slots, names held pending retirement, AND the live mesh roster. The
2247
+ * roster check covers occupants this manager does not manage (a foreground `cotal spawn`, a
2248
+ * connector session, another manager's agent): allocating their name would mint a sibling the
2249
+ * broker/auth then refuses to admit, surfacing as a 30s launch-uncertain black hole instead of
2250
+ * the auto-number the join path gives. Presence is ADVISORY (SPEC §6) — this is an availability
2251
+ * choice at allocation, never an authority check (the broker still enforces): a stale
2252
+ * still-live-looking row only costs a numbered suffix, and a missed freshly-joined occupant is
2253
+ * still refused downstream exactly as before. Offline rows do NOT occupy — a properly retired
2254
+ * name stays reusable. */
2071
2255
  uniqueName(base) {
2072
2256
  const live = this.liveRosterNames();
2073
2257
  return firstFreeName(base, (n) => this.nameInUse(n, live));
@@ -3247,7 +3431,7 @@ export class Manager {
3247
3431
  // resolve "uncertain"; caught by the lifecycle e2e).
3248
3432
  const wanted = this.managedPrincipal(a);
3249
3433
  // READINESS LIFECYCLE FENCE (SPEC 13.1): match the exact principal AND the exact lifecycle uid
3250
- // the manager minted for THIS spawn (presence carries it, §6/:315). The endpoint's own
3434
+ // the manager minted for THIS spawn (presence carries it, §6). The endpoint's own
3251
3435
  // register-only broker proof is gated on the CLIENT-authored `card.kind`, which a managed child
3252
3436
  // holding a valid agent credential could set to "endpoint" to skip - so it is defense-in-depth,
3253
3437
  // NOT the authority boundary. This equality is: the manager (not the child) owns the expected
@@ -3417,11 +3601,6 @@ export class Manager {
3417
3601
  }
3418
3602
  return undefined;
3419
3603
  }
3420
- /** Open a short-lived PROVISIONER connection, run the onboarding ops on it, and drain it (closure (ii),
3421
- * residual 2). The DM/DLV consumer-create surface — the irreducible onboarding power — lives only for
3422
- * this window, never as a standing grant on the long-lived supervisor. A provision-only endpoint
3423
- * (no presence/consume/channel-watch) connected with memory-only `provisioner` creds; it sets its own
3424
- * `inboxPrefix` so JS-API replies land on the `_INBOX_<id>.>` the provisioner cred subscribes. */
3425
3604
  /** Run one static §13.1 lifecycle OPERATION over an ephemeral, key-pinned `lifecycle-executor`
3426
3605
  * connection (Unit B): the credential's grants name exactly ONE incarnation's head/uid/gate/
3427
3606
  * cred-family/slot keys, so the write authority exists only for this operation's window and
@@ -4087,7 +4266,7 @@ export class Manager {
4087
4266
  // itself (`iid`, written at accept), which is the honest coordinate: a same-instanceId restart
4088
4267
  // inherits its predecessor's orphans, and a goal accepted by a DIFFERENT (possibly still-live)
4089
4268
  // sibling is left for its owner. This replaces the goal spec's `executor` pin, which existed
4090
- // only to epoch-scope the terminal subject and is gone with it (SPEC:1394).
4269
+ // only to epoch-scope the terminal subject and is gone with it (§13.2 reserved subjects).
4091
4270
  if (acceptedByIid !== this.managerInstanceId) {
4092
4271
  console.error(`goal reconcile ${ref.goalId}: accepted by instance "${acceptedByIid}", not this incarnation "${this.managerInstanceId}"; left for its owner (never a cross-instance settle)`);
4093
4272
  return;
@@ -4217,7 +4396,7 @@ export class Manager {
4217
4396
  // caller cannot publish it). TWO COMPOSED FENCES (defense in depth): must-5 (a) reads THIS
4218
4397
  // incarnation's OWN gate epoch and REFUSES a superseded commit (the currency belt), and (b)
4219
4398
  // barrier-revoke evicts this connection on takeover. The terminal lands on the ONE subject
4220
- // SPEC:1394 reserves; first-terminal-fact-wins is global, so a committed outcome is visible
4399
+ // SPEC §13.2 (reserved subjects) reserves; first-terminal-fact-wins is global, so a committed outcome is visible
4221
4400
  // to every reader in every incarnation. On success the reconcile-index entry is cleared.
4222
4401
  //
4223
4402
  // Named rather than inlined into the hooks below so the H1 post-accept fallback drives THIS
@@ -4599,6 +4778,11 @@ export class Manager {
4599
4778
  return "the caller's lifecycle is retired; a retired incarnation's credential holds no control authority (F5)";
4600
4779
  return undefined;
4601
4780
  }
4781
+ /** Open a short-lived PROVISIONER connection, run the onboarding ops on it, and drain it (closure (ii),
4782
+ * residual 2). The DM/DLV consumer-create surface — the irreducible onboarding power — lives only for
4783
+ * this window, never as a standing grant on the long-lived supervisor. A provision-only endpoint
4784
+ * (no presence/consume/channel-watch) connected with memory-only `provisioner` creds; it sets its own
4785
+ * `inboxPrefix` so JS-API replies land on the `_INBOX_<id>.>` the provisioner cred subscribes. */
4602
4786
  async withProvisioner(fn) {
4603
4787
  if (!this.auth)
4604
4788
  throw new Error("withProvisioner: no space auth (an open mesh has no scoped creds)");