@cotal-ai/auth 0.70.1 → 0.72.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.
Files changed (45) hide show
  1. package/dist/auth-admin.d.ts +1 -0
  2. package/dist/auth-admin.d.ts.map +1 -1
  3. package/dist/auth-admin.js +1 -0
  4. package/dist/auth-admin.js.map +1 -1
  5. package/dist/authority-client.d.ts +2 -0
  6. package/dist/authority-client.d.ts.map +1 -1
  7. package/dist/authority-client.js +16 -3
  8. package/dist/authority-client.js.map +1 -1
  9. package/dist/barrier-evict.d.ts +1 -0
  10. package/dist/barrier-evict.d.ts.map +1 -1
  11. package/dist/barrier-evict.js +2 -0
  12. package/dist/barrier-evict.js.map +1 -1
  13. package/dist/drain-repair.d.ts +1 -0
  14. package/dist/drain-repair.d.ts.map +1 -1
  15. package/dist/drain-repair.js +3 -0
  16. package/dist/drain-repair.js.map +1 -1
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -11
  20. package/dist/index.js.map +1 -1
  21. package/dist/ledger-scanner.d.ts +1 -0
  22. package/dist/ledger-scanner.d.ts.map +1 -1
  23. package/dist/ledger-scanner.js +1 -0
  24. package/dist/ledger-scanner.js.map +1 -1
  25. package/dist/owned-connections.d.ts +25 -0
  26. package/dist/owned-connections.d.ts.map +1 -0
  27. package/dist/owned-connections.js +49 -0
  28. package/dist/owned-connections.js.map +1 -0
  29. package/dist/plane-claim.d.ts +59 -4
  30. package/dist/plane-claim.d.ts.map +1 -1
  31. package/dist/plane-claim.js +56 -20
  32. package/dist/plane-claim.js.map +1 -1
  33. package/dist/records-scanner.d.ts +1 -0
  34. package/dist/records-scanner.d.ts.map +1 -1
  35. package/dist/records-scanner.js +1 -0
  36. package/dist/records-scanner.js.map +1 -1
  37. package/dist/retirement-cleaner.d.ts +1 -0
  38. package/dist/retirement-cleaner.d.ts.map +1 -1
  39. package/dist/retirement-cleaner.js +1 -0
  40. package/dist/retirement-cleaner.js.map +1 -1
  41. package/dist/service.d.ts +24 -16
  42. package/dist/service.d.ts.map +1 -1
  43. package/dist/service.js +165 -143
  44. package/dist/service.js.map +1 -1
  45. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAwDA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAKpF,OAAO,EAAq+C,KAAK,iBAAiB,EAAiB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,yBAAyB,EAAE,KAAK,+BAA+B,EAAE,KAAK,8BAA8B,EAAE,KAAK,2BAA2B,EAAE,KAAK,mCAAmC,EAAE,KAAK,kCAAkC,EAAE,KAAK,0CAA0C,EAAE,KAAK,yCAAyC,EAAE,KAAK,sCAAsC,EAAE,KAAK,6BAA6B,EAAE,KAAK,+BAA+B,EAAE,KAAK,oCAAoC,EAAE,KAAK,WAAW,EAAgE,MAAM,gBAAgB,CAAC;AAChoE,OAAO,EAA4I,KAAK,mBAAmB,EAAyB,KAAK,mBAAmB,EAA2B,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAIjT,OAAO,EAA6F,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/J,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAoD,KAAK,gBAAgB,EAAsB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAElJ,OAAO,EAAE,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,EAA2K,KAAK,kBAAkB,EAAE,KAAK,iCAAiC,EAAE,MAAM,+BAA+B,CAAC;AAYzR,OAAO,EAA4H,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAA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AE,0BAA0B,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBrK;AAED;;oFAEoF;AACpF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUrE;AAaD;;;;;;sBAMsB;AACtB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;gGAE4F;IAC5F,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmB1B;AAED;;;mDAGmD;AACnD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAInG;AAED;;;cAGc;AACd,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUzE"}
package/dist/service.js CHANGED
@@ -64,6 +64,7 @@ import { findCotalRoot, loadManagerInstanceIdentity, userAuthStateDir, workspace
64
64
  import { decodeJwt } from "jose";
65
65
  import { deriveOwnerForIdpSubject, platformControlOwner } from "./derive.js";
66
66
  import { makePlatformControlAuthority, makePlatformControlReadiness, requireManagerAuthorityHolder } from "./platform-control.js";
67
+ import { OwnedConnections } from "./owned-connections.js";
67
68
  import { startAuthCallout } from "./callout.js";
68
69
  import { createIdpBridge, verifyIdpToken } from "./idp.js";
69
70
  import { PUBLIC_EXCHANGE_VIEWS, assertTransferWriterClaim } from "./token.js";
@@ -84,7 +85,7 @@ import { ensureRootCredential } from "./root-credential.js";
84
85
  import { activateLifecycleAtUid, observeGate, openLifecycleRegistry, readLifecycleHeadForOperation } from "./lifecycle-registry.js";
85
86
  import { openAuthLedgerScannerCandidate } from "./ledger-scanner.js";
86
87
  import { openRecordsScannerCandidate } from "./records-scanner.js";
87
- import { acquirePlaneClaim, makeDeliveryAdminPlaneOracle, makeDeliveryAdminPrincipalOracle, scannerDeathCopy } from "./plane-claim.js";
88
+ import { acquirePlaneClaim, makeDeliveryAdminPlaneOracle, makeDeliveryAdminPrincipalOracle, scannerDeathCopy, planeClaimRefusal } from "./plane-claim.js";
88
89
  import { enumerateOperationIntents, resumeAgentTakeover } from "./credential-ledger.js";
89
90
  import { makeDeliveryAdminEvictor, makeDeliveryAdminHolderEvictor } from "./barrier-evict.js";
90
91
  import { resumeAgentRetirement, runAgentRetirementBarrier } from "./retirement-barrier.js";
@@ -199,21 +200,31 @@ async function registerSelfAuthorizedInstance(nc, args, register) {
199
200
  * transit the auth callout — the callout cannot deadlock on its own reader.
200
201
  */
201
202
  export async function openAuthAuthorityPlane(opts) {
202
- const { server, space, dataAccount, log } = opts;
203
- const standingTtl = opts.standingRenewableTtlSeconds ?? STANDING_RENEWABLE_TTL_SEC;
204
- if (!Number.isSafeInteger(standingTtl) || standingTtl < 5 || standingTtl > STANDING_RENEWABLE_TTL_SEC) {
205
- throw new Error(`standingRenewableTtlSeconds must be an integer between 5 and ${STANDING_RENEWABLE_TTL_SEC} seconds (got ${standingTtl})`);
206
- }
207
- const writer = await openAuthorityClient({ server, space, dataAccount, label: `cotal:auth-mint:${space}`, grants: (id) => authorityWriterGrants(space, id), log });
208
- let registry;
203
+ return await openAuthAuthorityPlaneWithCustody(opts);
204
+ }
205
+ /** The context's custody callback is private. Failed construction unwinds from one place. */
206
+ async function openAuthAuthorityPlaneWithCustody(opts, onConnection) {
207
+ const unwind = [];
209
208
  try {
210
- await ensureAuthorityStores(await jetstreamManager(writer.nc), new Kvm(writer.nc), space);
211
- registry = await openLifecycleRegistry(writer.nc, space);
209
+ return await buildAuthAuthorityPlane(opts, unwind, onConnection);
212
210
  }
213
211
  catch (e) {
214
- await writer.close();
212
+ for (const close of unwind.reverse())
213
+ await close();
215
214
  throw e;
216
215
  }
216
+ }
217
+ /** The body of the plane opener, which owns the unwind of a failed construction. */
218
+ async function buildAuthAuthorityPlane(opts, unwind, onConnection) {
219
+ const { server, space, dataAccount, log } = opts;
220
+ const standingTtl = opts.standingRenewableTtlSeconds ?? STANDING_RENEWABLE_TTL_SEC;
221
+ if (!Number.isSafeInteger(standingTtl) || standingTtl < 5 || standingTtl > STANDING_RENEWABLE_TTL_SEC) {
222
+ throw new Error(`standingRenewableTtlSeconds must be an integer between 5 and ${STANDING_RENEWABLE_TTL_SEC} seconds (got ${standingTtl})`);
223
+ }
224
+ const writer = await openAuthorityClient({ onConnection, server, space, dataAccount, label: `cotal:auth-mint:${space}`, grants: (id) => authorityWriterGrants(space, id), log });
225
+ unwind.push(() => writer.close());
226
+ await ensureAuthorityStores(await jetstreamManager(writer.nc), new Kvm(writer.nc), space);
227
+ const registry = await openLifecycleRegistry(writer.nc, space);
217
228
  // #399 M2: register the auth plane itself as an ordinary `auth` service endpoint — the SAME
218
229
  // §13.7 registration ceremony the manager runs (`manager.ts:6562-6690`), before the listener
219
230
  // below serves a single request. The persisted instance id + serve nkey (in `identityRoot`,
@@ -222,7 +233,7 @@ export async function openAuthAuthorityPlane(opts) {
222
233
  // fences the predecessor; a first registration stays at epoch 0.
223
234
  let authServeInstanceId;
224
235
  let authServeGrant;
225
- try {
236
+ {
226
237
  const persisted = loadAuthInstanceIdentity(opts.identityRoot, space);
227
238
  const authIdentity = persisted ?? createAuthInstanceIdentity(opts.identityRoot, space, {
228
239
  instanceId: mintLifecycleUid(),
@@ -231,7 +242,7 @@ export async function openAuthAuthorityPlane(opts) {
231
242
  const iid = authIdentity.instanceId;
232
243
  const artifacts = authClusterArtifacts();
233
244
  const values = [...authContractArtifactValues(), artifacts.document, artifacts.manifest];
234
- const regClient = await openAuthorityClient({
245
+ const regClient = await openAuthorityClient({ onConnection,
235
246
  server, space, dataAccount, label: `cotal:auth-registration:${space}`,
236
247
  grants: (id) => registrationExecutorGrants(space, id, AUTH_SERVICE_ENDPOINT, iid),
237
248
  log,
@@ -249,31 +260,14 @@ export async function openAuthAuthorityPlane(opts) {
249
260
  await regClient.close();
250
261
  }
251
262
  }
252
- catch (e) {
253
- await writer.close();
254
- throw e;
255
- }
256
- let reader;
257
- try {
258
- reader = await openSupervisedConnectReader({ server, space, dataAccount, log });
259
- }
260
- catch (e) {
261
- await writer.close();
262
- throw e;
263
- }
263
+ const reader = await openSupervisedConnectReader({ onConnection, server, space, dataAccount, log });
264
+ unwind.push(() => reader.close());
264
265
  // The typed remote-manager issuer is a distinct self-minted connection. It adds only the
265
266
  // endpoint-manager gate/credential family to the root issuance surface and is never exposed as
266
267
  // a generic mint endpoint. Its JWTs are signed for caller-generated public nkeys; private seeds
267
268
  // stay on the participant machine.
268
- let remoteIssuer;
269
- try {
270
- remoteIssuer = await openAuthorityClient({ server, space, dataAccount, label: `cotal:remote-manager-issuer:${space}`, grants: (id) => remoteManagerIssuerGrants(space, id), log });
271
- }
272
- catch (e) {
273
- await reader.close();
274
- await writer.close();
275
- throw e;
276
- }
269
+ const remoteIssuer = await openAuthorityClient({ onConnection, server, space, dataAccount, label: `cotal:remote-manager-issuer:${space}`, grants: (id) => remoteManagerIssuerGrants(space, id), log });
270
+ unwind.push(() => remoteIssuer.close());
277
271
  // The BARRIER EXECUTOR: the third self-minted connection, with its own registry bind — the
278
272
  // mint writer stays the minimal issuance credential ("barriers are NOT this credential's
279
273
  // job") and the barrier's stage-write authority lives here alone. The barrier profile holds NO
@@ -295,64 +289,49 @@ export async function openAuthAuthorityPlane(opts) {
295
289
  // sweep, adjudicated over the delivery-admin rail (auth holds no $SYS). A mid-life scanner
296
290
  // disconnect FENCES the plane: the guard refuses every later scan, the sibling closes, and the
297
291
  // in-flight enumeration's result is discarded by the post-scan claim check.
298
- let barrier;
299
- let ledgerCand;
300
- let recordsCand;
301
292
  let hold;
302
- let scanner;
303
- let recordsScanner;
304
- let barrierReg;
305
293
  let closing = false;
306
- // A failed open throws its own error, so a release failing on the way out is only logged: the
307
- // row stays held and the next open reclaims it like a crash.
308
- const releaseAfterFailedOpen = async () => hold?.release().catch((r) => log(r.message));
294
+ let closeScanners;
309
295
  // The plane-fatal channel (fact HIGH: a fenced plane must never keep serving): the mid-life
310
296
  // fence resolves it, every authority operation refuses from then on, and the composition root
311
297
  // downs the daemon. A clean close never resolves it.
312
298
  let fatalReason;
313
299
  let fireFatal;
314
300
  const fenced = new Promise((r) => { fireFatal = r; });
315
- try {
316
- barrier = await openAuthorityClient({ server, space, dataAccount, label: `cotal:auth-barrier:${space}`, grants: (id) => authorityBarrierGrants(space, id), log });
317
- ledgerCand = await openAuthLedgerScannerCandidate({ server, space, dataAccount, log });
318
- recordsCand = await openRecordsScannerCandidate({ server, space, dataAccount, log });
319
- const oracle = opts.probePlaneOracle ?? makeDeliveryAdminPlaneOracle({ space, server, dataAccount, log });
320
- hold = await acquirePlaneClaim({ nc: barrier.nc, space, ledger: ledgerCand.tuple, records: recordsCand.tuple, oracle, log });
321
- scanner = ledgerCand.activate(hold.guard);
322
- recordsScanner = recordsCand.activate(hold.guard);
323
- // Mid-life disconnect = the FENCING event (security req: an owned scanner that dies must not
324
- // leave the plane half-running). First death wins: fence the guard with the ux state-3 copy,
325
- // close the sibling so a successor's reclaim isn't blocked by a half-dead pair, log loud.
326
- const fenceOnDeath = (role, sibling) => {
327
- if (closing)
328
- return;
329
- const copy = scannerDeathCopy(space, role);
330
- hold?.fence(copy);
331
- fatalReason = fatalReason ?? copy;
332
- fireFatal(copy);
333
- log(`auth-plane: ${copy}`);
334
- void sibling().catch(() => { });
335
- };
336
- void ledgerCand.gone.then(() => fenceOnDeath("auth-ledger", () => recordsCand?.close() ?? Promise.resolve()));
337
- void recordsCand.gone.then(() => fenceOnDeath("records", () => ledgerCand?.close() ?? Promise.resolve()));
338
- const lc = ledgerCand, rc = recordsCand;
339
- opts.probePlaneDeath?.({ ledger: () => lc.close(), records: () => rc.close() });
340
- barrierReg = await openLifecycleRegistry(barrier.nc, space, scanner, recordsScanner);
341
- }
342
- catch (e) {
343
- // Clean-close order even on a failed open: scan-capable clients first, THEN the claim release
344
- // (held → released is valid only once neither scanner can act), then the rest.
345
- closing = true;
346
- await recordsCand?.close();
347
- await ledgerCand?.close();
348
- await releaseAfterFailedOpen();
349
- await barrier?.close();
350
- await remoteIssuer.close();
351
- await reader.close();
352
- await writer.close();
353
- throw e;
354
- }
355
- const evictPrincipal = opts.probeEvictor ?? makeDeliveryAdminEvictor({ space, server, dataAccount, log });
301
+ const barrier = await openAuthorityClient({ onConnection, server, space, dataAccount, label: `cotal:auth-barrier:${space}`, grants: (id) => authorityBarrierGrants(space, id), log });
302
+ unwind.push(() => barrier.close());
303
+ // Unwound after both scanners close: held → released is valid only once neither scanner can act.
304
+ // A failed open throws its own error, so a release failing on the way out is only logged: the
305
+ // row stays held and the next open reclaims it like a crash.
306
+ unwind.push(async () => hold?.release().catch((r) => log(r.message)));
307
+ const ledgerCand = await openAuthLedgerScannerCandidate({ onConnection, server, space, dataAccount, log });
308
+ unwind.push(() => ledgerCand.close());
309
+ const recordsCand = await openRecordsScannerCandidate({ onConnection, server, space, dataAccount, log });
310
+ unwind.push(() => recordsCand.close());
311
+ const oracle = opts.probePlaneOracle ?? makeDeliveryAdminPlaneOracle({ onConnection, space, server, dataAccount, log });
312
+ hold = await acquirePlaneClaim({ nc: barrier.nc, space, ledger: ledgerCand.tuple, records: recordsCand.tuple, oracle, log });
313
+ const scanner = ledgerCand.activate(hold.guard);
314
+ const recordsScanner = recordsCand.activate(hold.guard);
315
+ // Mid-life disconnect = the FENCING event (security req: an owned scanner that dies must not
316
+ // leave the plane half-running). First death wins: fence the guard with the ux state-3 copy,
317
+ // close the sibling so a successor's reclaim isn't blocked by a half-dead pair, log loud.
318
+ const fenceOnDeath = (role, sibling) => {
319
+ if (closing)
320
+ return;
321
+ const copy = scannerDeathCopy(space, role);
322
+ hold?.fence(copy);
323
+ fatalReason = fatalReason ?? copy;
324
+ fireFatal(copy);
325
+ log(`auth-plane: ${copy}`);
326
+ void sibling().catch(() => { });
327
+ };
328
+ void ledgerCand.gone.then(() => fenceOnDeath("auth-ledger", () => recordsCand.close()));
329
+ void recordsCand.gone.then(() => fenceOnDeath("records", () => ledgerCand.close()));
330
+ // A failed open closes the scanners deliberately, which must not fence like a mid-life death.
331
+ unwind.push(async () => { closing = true; });
332
+ opts.probePlaneDeath?.({ ledger: () => ledgerCand.close(), records: () => recordsCand.close() });
333
+ const barrierReg = await openLifecycleRegistry(barrier.nc, space, scanner, recordsScanner);
334
+ const evictPrincipal = opts.probeEvictor ?? makeDeliveryAdminEvictor({ onConnection, space, server, dataAccount, log });
356
335
  // The RETIREMENT deps (#29 piece 4): the barrier's injected mechanics, assembled from reviewed
357
336
  // §13.9 profiles only. The obligation drain runs per endpoint on a SHORT-LIVED client minted
358
337
  // with that endpoint's admission-mediator profile (the daemon owns no standing mediator; the
@@ -375,11 +354,11 @@ export async function openAuthAuthorityPlane(opts) {
375
354
  // effect gets the EffectCancelledFact union member. Never a forged success: a reader sees
376
355
  // the effect did NOT run and which retirement cancelled it; a racing real completion wins
377
356
  // by landing first.
378
- const repairers = makeDrainRepairers({ server, space, dataAccount, log });
357
+ const repairers = makeDrainRepairers({ onConnection, server, space, dataAccount, log });
379
358
  const retirement = {
380
359
  evictPrincipal,
381
360
  drainTargetObligations: async (endpoint, targetUid, opId) => {
382
- const drain = await openAuthorityClient({
361
+ const drain = await openAuthorityClient({ onConnection,
383
362
  server, space, dataAccount,
384
363
  label: `cotal:ep-drain:${space}:${endpoint}`,
385
364
  grants: (id) => admissionMediatorGrants(space, endpoint, id),
@@ -396,7 +375,7 @@ export async function openAuthAuthorityPlane(opts) {
396
375
  await drain.close();
397
376
  }
398
377
  },
399
- ...makeRetirementCleaners({ server, space, dataAccount, log }),
378
+ ...makeRetirementCleaners({ onConnection, server, space, dataAccount, log }),
400
379
  now: Date.now,
401
380
  };
402
381
  // Boot crash-resume BEFORE the plane answers anything (SPEC 13.1): finish every takeover this
@@ -404,20 +383,7 @@ export async function openAuthAuthorityPlane(opts) {
404
383
  // know what we owe); an individual resume failure is LOUD but non-fatal — that alias stays
405
384
  // frozen (nothing mints for it, fail-closed) while every other alias keeps working, and a
406
385
  // later restart re-drives it.
407
- try {
408
- await resumeOpenOperations(barrierReg, evictPrincipal, retirement, log);
409
- }
410
- catch (e) {
411
- closing = true;
412
- await recordsScanner.close();
413
- await scanner.close();
414
- await releaseAfterFailedOpen();
415
- await barrier.close();
416
- await remoteIssuer.close();
417
- await reader.close();
418
- await writer.close();
419
- throw e;
420
- }
386
+ await resumeOpenOperations(barrierReg, evictPrincipal, retirement, log);
421
387
  // ONE in-flight map for the rail and the loopback managed-retire door: both run the same
422
388
  // `managedRetirementOpId(uid)` operation, and a process must never execute it twice at once.
423
389
  const retirementFlights = new Map();
@@ -426,21 +392,8 @@ export async function openAuthAuthorityPlane(opts) {
426
392
  // stays with the plane's own registry + retirement deps (the drain rides the ONE sealed records
427
393
  // scanner exactly like the boot resume); the listener only authorizes (subject attribution +
428
394
  // the FRESH space-manager-lease holder check) and dispatches.
429
- let authAdmin;
430
- try {
431
- authAdmin = await openAuthAdminListener({ server, space, dataAccount, reg: barrierReg, retirement, barrierFlight: retirementFlights, instanceId: authServeInstanceId, epoch: authServeGrant.epoch, grant: authServeGrant, log });
432
- }
433
- catch (e) {
434
- closing = true;
435
- await recordsScanner.close();
436
- await scanner.close();
437
- await releaseAfterFailedOpen();
438
- await barrier.close();
439
- await remoteIssuer.close();
440
- await reader.close();
441
- await writer.close();
442
- throw e;
443
- }
395
+ const authAdmin = await openAuthAdminListener({ onConnection, server, space, dataAccount, reg: barrierReg, retirement, barrierFlight: retirementFlights, instanceId: authServeInstanceId, epoch: authServeGrant.epoch, grant: authServeGrant, log });
396
+ unwind.push(() => authAdmin.close());
444
397
  const fileArm = ledgerAuthorizeConnect(opts.dir);
445
398
  const recordsJsm = await jetstreamManager(remoteIssuer.nc);
446
399
  const authKv = await new Kvm(remoteIssuer.nc).open(epAuthBucket(space));
@@ -545,7 +498,7 @@ export async function openAuthAuthorityPlane(opts) {
545
498
  // window, not the operator — the agent cannot "restart the auth service", so it gets a retryable
546
499
  // unavailability, while the operator's state-3 copy stays on the log and the exit line.
547
500
  const refuseIfFenced = () => {
548
- if (fatalReason !== undefined)
501
+ if (fatalReason !== undefined || closing)
549
502
  throw new EpEnvelopeError("unavailable", `the auth service for space "${space}" is momentarily unavailable (it detected a fault and is restarting); retry shortly`);
550
503
  };
551
504
  // The plane holds only the data account's signing key. The operator and system halves stay blank
@@ -944,12 +897,12 @@ export async function openAuthAuthorityPlane(opts) {
944
897
  scanner,
945
898
  observeManagerGate,
946
899
  });
947
- const evictHolders = makeDeliveryAdminHolderEvictor({ space, server, dataAccount, log });
900
+ const evictHolders = makeDeliveryAdminHolderEvictor({ onConnection, space, server, dataAccount, log });
948
901
  if (authorized.operation === "evict-family-principal") {
949
902
  const evictions = await evictHolders(authorized.principals);
950
903
  return completeRemoteManagerMaintenance(authorized, owner, { evictions });
951
904
  }
952
- const principalOracle = makeDeliveryAdminPrincipalOracle({ space, server, dataAccount, log });
905
+ const principalOracle = makeDeliveryAdminPrincipalOracle({ onConnection, space, server, dataAccount, log });
953
906
  const executorIdentity = newIdentity();
954
907
  const executorCreds = await mintCreds(issuerAuth(), executorIdentity, "endpoint-serve-executor", {
955
908
  endpointServeExecutor: { endpoint: "manager", instanceId: authorized.targetInstanceId },
@@ -960,6 +913,7 @@ export async function openAuthAuthorityPlane(opts) {
960
913
  ...standaloneConnectOpts({ creds: executorCreds, tls: false }),
961
914
  maxReconnectAttempts: 0,
962
915
  });
916
+ onConnection?.(maintenanceNc, `cotal:remote-manager-maintenance:${space}`);
963
917
  let report;
964
918
  try {
965
919
  const maintenanceKvm = new Kvm(maintenanceNc);
@@ -1049,6 +1003,7 @@ export async function openAuthAuthorityPlane(opts) {
1049
1003
  const provisioner = new CotalEndpoint({
1050
1004
  space,
1051
1005
  servers: server,
1006
+ onConnection: (nc) => onConnection?.(nc, `cotal:provisioner:${space}`),
1052
1007
  channels: [],
1053
1008
  creds: await mintCreds(issuerAuth(), identity, "provisioner"),
1054
1009
  card: { id: identity.id, name: "provisioner", role: "provisioner", kind: "endpoint" },
@@ -1176,6 +1131,7 @@ export async function openAuthAuthorityPlane(opts) {
1176
1131
  }),
1177
1132
  maxReconnectAttempts: 0,
1178
1133
  });
1134
+ onConnection?.(admitterNc, `cotal:run-admitter:${space}`);
1179
1135
  try {
1180
1136
  return await admitRemoteRun({
1181
1137
  request, owner, space, accountPublicKey: dataAccount.pub, proofSecret: dataAccount.signingSeed, endpoint: "manager",
@@ -1230,6 +1186,7 @@ export async function openAuthAuthorityPlane(opts) {
1230
1186
  }),
1231
1187
  maxReconnectAttempts: 0,
1232
1188
  });
1189
+ onConnection?.(readerNc, `cotal:run-attempt-reader:${space}`);
1233
1190
  try {
1234
1191
  const replay = await replayRunJournal(jetstream(readerNc), await jetstreamManager(readerNc), space, runId, takeoverId);
1235
1192
  return replay.records.flatMap((stored) => stored.record.kind === "step" ? [stored.record.entry] : []);
@@ -1310,7 +1267,7 @@ export async function openAuthAuthorityPlane(opts) {
1310
1267
  },
1311
1268
  registerHostInstance: async (host, instanceId) => {
1312
1269
  refuseIfFenced();
1313
- const regClient = await openAuthorityClient({
1270
+ const regClient = await openAuthorityClient({ onConnection,
1314
1271
  server, space, dataAccount, label: `cotal:host-registration:${space}`,
1315
1272
  grants: (id) => registrationExecutorGrants(space, id, host.endpoint, instanceId),
1316
1273
  log,
@@ -1335,20 +1292,43 @@ export async function openAuthAuthorityPlane(opts) {
1335
1292
  close: async () => {
1336
1293
  // Clean-close order (SPEC 13.13): the rail stops answering first, then scan-capable
1337
1294
  // clients down, then `held → released` (never released while either scanner can still
1338
- // act), then the barrier that wrote it.
1295
+ // act), then the barrier that wrote it. An unreachable release keeps the barrier alive
1296
+ // for a later close retry; successful scanner teardown is not run a second time.
1339
1297
  closing = true;
1340
- await authAdmin?.close();
1341
- await reader.close();
1342
- await recordsScanner.close();
1343
- await scanner.close();
1298
+ const scannerFlight = closeScanners ??= (async () => {
1299
+ await authAdmin?.close();
1300
+ const results = await Promise.allSettled([reader.close(), recordsScanner.close(), scanner.close()]);
1301
+ const errors = results.filter((r) => r.status === "rejected").map((r) => r.reason);
1302
+ if (errors.length)
1303
+ throw new AggregateError(errors, "auth scan-capable clients failed to close");
1304
+ })();
1305
+ try {
1306
+ await scannerFlight;
1307
+ }
1308
+ catch (e) {
1309
+ if (closeScanners === scannerFlight)
1310
+ closeScanners = undefined;
1311
+ throw e;
1312
+ }
1313
+ let releaseFailure;
1344
1314
  try {
1345
1315
  await hold.release();
1346
1316
  }
1347
- finally {
1348
- await barrier.close();
1349
- await remoteIssuer.close();
1350
- await writer.close();
1317
+ catch (e) {
1318
+ releaseFailure = e;
1319
+ }
1320
+ // Keep the barrier for an unreachable release retry. All other release refusals terminate
1321
+ // the remaining clients but retain the release failure, even if their closes fail too.
1322
+ if (planeClaimRefusal(releaseFailure) !== "release-unreachable") {
1323
+ const results = await Promise.allSettled([barrier.close(), remoteIssuer.close(), writer.close()]);
1324
+ const errors = results.filter((r) => r.status === "rejected").map((r) => r.reason);
1325
+ if (releaseFailure !== undefined && errors.length)
1326
+ throw new AggregateError([releaseFailure, ...errors], "auth claim release and connection close failed");
1327
+ if (errors.length)
1328
+ throw new AggregateError(errors, "auth remaining clients failed to close");
1351
1329
  }
1330
+ if (releaseFailure !== undefined)
1331
+ throw releaseFailure;
1352
1332
  },
1353
1333
  };
1354
1334
  }
@@ -1535,8 +1515,8 @@ export async function runAuthService(args, store) {
1535
1515
  * and the loopback listener are bound. A failed start releases what it acquired and throws. A
1536
1516
  * mid-life fence or broker loss makes only this context `unavailable` and closes its resources.
1537
1517
  * `close()` rejects when the context did not release its plane claim (SPEC 13.13): the row was
1538
- * no longer its own, or the release write failed. The next start reclaims a row left held through
1539
- * the liveness oracle. */
1518
+ * no longer its own, or the release write failed. A retryable release refusal keeps the barrier
1519
+ * open so `close()` can be retried after reconnection; the context stays draining. */
1540
1520
  export async function startAuthService(inputs) {
1541
1521
  if (!inputs.context?.accountPublicKey || !inputs.context.lifecycleUid || !inputs.space || !inputs.servers || !inputs.stateDir)
1542
1522
  throw new Error("auth-service: hosted context needs an account, lifecycle, space, server and stateDir");
@@ -1600,7 +1580,9 @@ async function startAuthContext(o) {
1600
1580
  throw new Error(`auth-service: can't reach the broker at ${server} with the callout creds - is the mesh up (with the callout account preloaded)?`);
1601
1581
  // ---- The authority plane (R1): stores ensured + registry + supervised reader, BEFORE the
1602
1582
  // callout exists — a connect must never be answered without the credential arm bound.
1603
- const plane = await openAuthAuthorityPlane({
1583
+ const owned = new OwnedConnections();
1584
+ const onConnection = (nc, label) => owned.track(nc, label);
1585
+ const plane = await openAuthAuthorityPlaneWithCustody({
1604
1586
  server,
1605
1587
  space,
1606
1588
  dir,
@@ -1609,7 +1591,7 @@ async function startAuthContext(o) {
1609
1591
  log: (l) => console.error(l),
1610
1592
  localManager: o.localManager,
1611
1593
  ...(o.standingRenewableTtlSeconds !== undefined ? { standingRenewableTtlSeconds: o.standingRenewableTtlSeconds } : {}),
1612
- });
1594
+ }, onConnection);
1613
1595
  let nc;
1614
1596
  let http;
1615
1597
  let publicHttp;
@@ -1632,6 +1614,7 @@ async function startAuthContext(o) {
1632
1614
  authenticator: credsAuthenticator(new TextEncoder().encode(callout.calloutCreds)),
1633
1615
  name: `cotal:auth-service:${space}`,
1634
1616
  });
1617
+ onConnection(nc, `cotal:auth-service:${space}`);
1635
1618
  startAuthCallout(nc, {
1636
1619
  xkeySeed: callout.xkey.seed,
1637
1620
  authAccount: { pub: callout.account.pub, signingSeed: callout.account.signingSeed },
@@ -1736,36 +1719,70 @@ async function startAuthContext(o) {
1736
1719
  let state = "ready";
1737
1720
  let cause;
1738
1721
  let closePromise;
1722
+ let closeAdmission;
1723
+ let closeStarted = false;
1739
1724
  // The readiness reader: one standing connection pinned to the assigned instance, replaced when
1740
1725
  // the assignment names another instance.
1741
1726
  let reader;
1742
1727
  const close = () => {
1743
1728
  if (closePromise !== undefined)
1744
1729
  return closePromise;
1730
+ closeStarted = true;
1745
1731
  if (state === "ready")
1746
1732
  state = "draining";
1747
- closePromise = (async () => {
1748
- await Promise.all([closeServer(http), closeServer(publicHttp)]);
1749
- await reader?.client.then((c) => c.close(), () => { });
1733
+ const flight = (async () => {
1734
+ const admissionFlight = closeAdmission ??= (async () => {
1735
+ await Promise.all([closeServer(http), closeServer(publicHttp)]);
1736
+ await reader?.client.then((c) => c.close(), () => { });
1737
+ })();
1738
+ let admissionFailure;
1739
+ try {
1740
+ await admissionFlight;
1741
+ }
1742
+ catch (e) {
1743
+ admissionFailure = e;
1744
+ if (closeAdmission === admissionFlight)
1745
+ closeAdmission = undefined;
1746
+ }
1747
+ let planeFailure;
1750
1748
  try {
1751
1749
  await plane.close();
1752
1750
  }
1753
- finally {
1751
+ catch (e) {
1752
+ planeFailure = e;
1753
+ }
1754
+ let calloutFailure;
1755
+ try {
1754
1756
  await callNc.close();
1755
1757
  }
1758
+ catch (cause) {
1759
+ calloutFailure = new Error(`auth connection cotal:auth-service:${space} failed to close`, { cause });
1760
+ }
1761
+ const failures = [admissionFailure, planeFailure, calloutFailure].filter((e) => e !== undefined);
1762
+ if (failures.length > 1)
1763
+ throw new AggregateError(failures, "auth context close failed");
1764
+ if (failures.length)
1765
+ throw failures[0];
1766
+ await owned.closeRemaining();
1767
+ owned.complete();
1756
1768
  })();
1757
- return closePromise;
1769
+ closePromise = flight;
1770
+ void flight.catch(() => {
1771
+ if (closePromise === flight)
1772
+ closePromise = undefined;
1773
+ });
1774
+ return flight;
1758
1775
  };
1759
1776
  const ended = Promise.race([
1760
1777
  callNc.closed().then((err) => ({ kind: "broker", ...(err ? { cause: err.message } : {}) })),
1761
1778
  plane.fenced.then((reason) => ({ kind: "fenced", cause: reason })),
1762
1779
  ]).then((end) => {
1763
1780
  // A clean broker close after this context's own close() is the orderly end, not a failure.
1764
- if (end.kind === "fenced" || end.cause !== undefined || closePromise === undefined) {
1781
+ if (end.kind === "fenced" || end.cause !== undefined || !closeStarted) {
1765
1782
  state = "unavailable";
1766
1783
  cause = end.kind === "fenced" ? end.cause : `broker connection closed${end.cause !== undefined ? ` (${end.cause})` : ""}`;
1767
- // A later close() returns this same promise, so its failure still reaches the host.
1768
- close().catch(() => { });
1784
+ if (!closeStarted)
1785
+ close().catch(() => { });
1769
1786
  }
1770
1787
  return end;
1771
1788
  });
@@ -1799,9 +1816,12 @@ async function startAuthContext(o) {
1799
1816
  const readStatus = (owner) => async (instanceId) => {
1800
1817
  refuseUnlessReady();
1801
1818
  if (reader?.instanceId !== instanceId) {
1802
- void reader?.client.then((c) => c.close(), () => { });
1819
+ void reader?.client.then((c) => c.close(), () => { }).catch((e) => {
1820
+ console.error(`auth readiness reader close failed: ${e instanceof Error ? e.message : String(e)}`);
1821
+ });
1803
1822
  const caller = { owner, actor: `manager_ready_${instanceId}`, uid: mintLifecycleUid() };
1804
1823
  const client = openAuthorityClient({
1824
+ onConnection,
1805
1825
  server,
1806
1826
  space,
1807
1827
  dataAccount: { pub: keys.dataAccount.pub, signingSeed: keys.dataAccount.signingSeed },
@@ -1822,6 +1842,8 @@ async function startAuthContext(o) {
1822
1842
  url,
1823
1843
  ...(publicUrl !== undefined ? { publicUrl } : {}),
1824
1844
  cap,
1845
+ closed: owned.closed,
1846
+ connections: () => owned.connections(),
1825
1847
  ...(platformDeps !== undefined ? {
1826
1848
  platformControlAuthority: makePlatformControlAuthority({
1827
1849
  ...platformDeps,
@@ -1874,7 +1896,7 @@ async function startAuthContext(o) {
1874
1896
  drain: close,
1875
1897
  close,
1876
1898
  };
1877
- const status = () => state === "unavailable" ? { state, cause: cause ?? "auth-service context is unavailable" } : { state: closePromise === undefined ? "ready" : "draining" };
1899
+ const status = () => state === "unavailable" ? { state, cause: cause ?? "auth-service context is unavailable" } : { state: closeStarted ? "draining" : "ready" };
1878
1900
  return { handle: service, status, ended };
1879
1901
  }
1880
1902
  catch (e) {