@cotal-ai/core 0.16.0 → 0.18.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 (145) hide show
  1. package/dist/acls.d.ts +21 -0
  2. package/dist/acls.d.ts.map +1 -1
  3. package/dist/acls.js +44 -1
  4. package/dist/acls.js.map +1 -1
  5. package/dist/artifact.d.ts +45 -0
  6. package/dist/artifact.d.ts.map +1 -0
  7. package/dist/artifact.js +82 -0
  8. package/dist/artifact.js.map +1 -0
  9. package/dist/backup-config.d.ts +9 -2
  10. package/dist/backup-config.d.ts.map +1 -1
  11. package/dist/backup-config.js +6 -2
  12. package/dist/backup-config.js.map +1 -1
  13. package/dist/broker-tls.d.ts +70 -0
  14. package/dist/broker-tls.d.ts.map +1 -0
  15. package/dist/broker-tls.js +195 -0
  16. package/dist/broker-tls.js.map +1 -0
  17. package/dist/canonical.d.ts +14 -1
  18. package/dist/canonical.d.ts.map +1 -1
  19. package/dist/canonical.js +21 -1
  20. package/dist/canonical.js.map +1 -1
  21. package/dist/channels.js +4 -4
  22. package/dist/channels.js.map +1 -1
  23. package/dist/endpoint-action.d.ts +108 -3
  24. package/dist/endpoint-action.d.ts.map +1 -1
  25. package/dist/endpoint-action.js +209 -20
  26. package/dist/endpoint-action.js.map +1 -1
  27. package/dist/endpoint-binding.d.ts +138 -8
  28. package/dist/endpoint-binding.d.ts.map +1 -1
  29. package/dist/endpoint-binding.js +233 -26
  30. package/dist/endpoint-binding.js.map +1 -1
  31. package/dist/endpoint-contract-store.d.ts +30 -1
  32. package/dist/endpoint-contract-store.d.ts.map +1 -1
  33. package/dist/endpoint-contract-store.js +100 -29
  34. package/dist/endpoint-contract-store.js.map +1 -1
  35. package/dist/endpoint-envelope.d.ts +15 -37
  36. package/dist/endpoint-envelope.d.ts.map +1 -1
  37. package/dist/endpoint-envelope.js +93 -44
  38. package/dist/endpoint-envelope.js.map +1 -1
  39. package/dist/endpoint-error.d.ts +33 -0
  40. package/dist/endpoint-error.d.ts.map +1 -0
  41. package/dist/endpoint-error.js +34 -0
  42. package/dist/endpoint-error.js.map +1 -0
  43. package/dist/endpoint-grants.d.ts +63 -7
  44. package/dist/endpoint-grants.d.ts.map +1 -1
  45. package/dist/endpoint-grants.js +118 -9
  46. package/dist/endpoint-grants.js.map +1 -1
  47. package/dist/endpoint-invoke.d.ts +138 -0
  48. package/dist/endpoint-invoke.d.ts.map +1 -0
  49. package/dist/endpoint-invoke.js +393 -0
  50. package/dist/endpoint-invoke.js.map +1 -0
  51. package/dist/endpoint-records.d.ts.map +1 -1
  52. package/dist/endpoint-records.js +17 -0
  53. package/dist/endpoint-records.js.map +1 -1
  54. package/dist/endpoint-serve-kv.d.ts +97 -0
  55. package/dist/endpoint-serve-kv.d.ts.map +1 -0
  56. package/dist/endpoint-serve-kv.js +336 -0
  57. package/dist/endpoint-serve-kv.js.map +1 -0
  58. package/dist/endpoint-serve.d.ts.map +1 -1
  59. package/dist/endpoint-serve.js +21 -1
  60. package/dist/endpoint-serve.js.map +1 -1
  61. package/dist/endpoint-service.d.ts +1 -1
  62. package/dist/endpoint-service.d.ts.map +1 -1
  63. package/dist/endpoint-service.js +34 -10
  64. package/dist/endpoint-service.js.map +1 -1
  65. package/dist/endpoint-session-rail.d.ts +127 -0
  66. package/dist/endpoint-session-rail.d.ts.map +1 -0
  67. package/dist/endpoint-session-rail.js +325 -0
  68. package/dist/endpoint-session-rail.js.map +1 -0
  69. package/dist/endpoint-session.d.ts +1 -115
  70. package/dist/endpoint-session.d.ts.map +1 -1
  71. package/dist/endpoint-session.js +4 -316
  72. package/dist/endpoint-session.js.map +1 -1
  73. package/dist/endpoint-subjects.d.ts +20 -1
  74. package/dist/endpoint-subjects.d.ts.map +1 -1
  75. package/dist/endpoint-subjects.js +20 -1
  76. package/dist/endpoint-subjects.js.map +1 -1
  77. package/dist/endpoint-verbs.d.ts +1 -2
  78. package/dist/endpoint-verbs.d.ts.map +1 -1
  79. package/dist/endpoint-verbs.js +6 -6
  80. package/dist/endpoint-verbs.js.map +1 -1
  81. package/dist/endpoint.d.ts +157 -11
  82. package/dist/endpoint.d.ts.map +1 -1
  83. package/dist/endpoint.js +471 -47
  84. package/dist/endpoint.js.map +1 -1
  85. package/dist/evict.d.ts +47 -0
  86. package/dist/evict.d.ts.map +1 -1
  87. package/dist/evict.js +191 -59
  88. package/dist/evict.js.map +1 -1
  89. package/dist/identity.d.ts +34 -0
  90. package/dist/identity.d.ts.map +1 -1
  91. package/dist/identity.js +46 -0
  92. package/dist/identity.js.map +1 -1
  93. package/dist/index.d.ts +8 -0
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +8 -0
  96. package/dist/index.js.map +1 -1
  97. package/dist/kv-scan.d.ts +8 -0
  98. package/dist/kv-scan.d.ts.map +1 -1
  99. package/dist/kv-scan.js +8 -0
  100. package/dist/kv-scan.js.map +1 -1
  101. package/dist/lease.d.ts +12 -5
  102. package/dist/lease.d.ts.map +1 -1
  103. package/dist/lease.js.map +1 -1
  104. package/dist/lifecycle-saga.d.ts +174 -0
  105. package/dist/lifecycle-saga.d.ts.map +1 -0
  106. package/dist/lifecycle-saga.js +418 -0
  107. package/dist/lifecycle-saga.js.map +1 -0
  108. package/dist/lifecycle-state.d.ts +202 -0
  109. package/dist/lifecycle-state.d.ts.map +1 -0
  110. package/dist/lifecycle-state.js +347 -0
  111. package/dist/lifecycle-state.js.map +1 -0
  112. package/dist/parts.d.ts +13 -0
  113. package/dist/parts.d.ts.map +1 -0
  114. package/dist/parts.js +17 -0
  115. package/dist/parts.js.map +1 -0
  116. package/dist/provision.d.ts +124 -15
  117. package/dist/provision.d.ts.map +1 -1
  118. package/dist/provision.js +578 -121
  119. package/dist/provision.js.map +1 -1
  120. package/dist/schema-profile.d.ts +3 -2
  121. package/dist/schema-profile.d.ts.map +1 -1
  122. package/dist/schema-profile.js +242 -18
  123. package/dist/schema-profile.js.map +1 -1
  124. package/dist/session-browser.d.ts +15 -0
  125. package/dist/session-browser.d.ts.map +1 -0
  126. package/dist/session-browser.js +14 -0
  127. package/dist/session-browser.js.map +1 -0
  128. package/dist/session-terminal-frames.d.ts +36 -0
  129. package/dist/session-terminal-frames.d.ts.map +1 -0
  130. package/dist/session-terminal-frames.js +149 -0
  131. package/dist/session-terminal-frames.js.map +1 -0
  132. package/dist/spaces.d.ts.map +1 -1
  133. package/dist/spaces.js +6 -1
  134. package/dist/spaces.js.map +1 -1
  135. package/dist/streams.d.ts +168 -1
  136. package/dist/streams.d.ts.map +1 -1
  137. package/dist/streams.js +299 -21
  138. package/dist/streams.js.map +1 -1
  139. package/dist/subjects.d.ts +34 -36
  140. package/dist/subjects.d.ts.map +1 -1
  141. package/dist/subjects.js +46 -35
  142. package/dist/subjects.js.map +1 -1
  143. package/dist/types.d.ts +27 -1
  144. package/dist/types.d.ts.map +1 -1
  145. package/package.json +6 -1
package/dist/streams.js CHANGED
@@ -1,9 +1,11 @@
1
- import { jetstreamManager, AckPolicy, DeliverPolicy, } from "@nats-io/jetstream";
1
+ import { jetstream, jetstreamManager, AckPolicy, DeliverPolicy, } from "@nats-io/jetstream";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { connect, credsAuthenticator, tokenAuthenticator, nanos } from "@nats-io/transport-node";
4
4
  import { Kvm } from "@nats-io/kv";
5
- import { spacePrefix, chatStream, chatSubject, chatWildcard, isConcreteChannel, dmStream, dmDurable, unicastRecvFilter, taskStream, taskDurable, anycastServeFilter, presenceBucket, channelBucket, membersBucket, aclBucket, membershipBucket, deliveryBucket, managerBucket, inboxStream, dlvStream, dlvSubject, dlvDurable, fanoutDurable, readerDurable, DEV_OWNER, principalKey, deprovisionTargetPrincipal, } from "./subjects.js";
5
+ import { Objm } from "@nats-io/obj";
6
+ import { spacePrefix, artifactBucket, objectStoreStream, chatStream, chatSubject, chatWildcard, isConcreteChannel, dmStream, dmDurable, unicastRecvFilter, taskStream, taskDurable, anycastServeFilter, presenceBucket, channelBucket, membersBucket, aclBucket, membershipBucket, deliveryBucket, managerBucket, inboxStream, dlvStream, dlvSubject, dlvDurable, fanoutDurable, readerDurable, DEV_OWNER, principalKey, deprovisionTargetPrincipal, } from "./subjects.js";
6
7
  import { idFromCreds } from "./identity.js";
8
+ import { ensureAuthorityStores } from "./endpoint-binding.js";
7
9
  import { openAclRegistry, deleteAcl } from "./acls.js";
8
10
  import { BACKUP_MAX_MSGS_PER_SUBJECT, BACKUP_PLANE3_DEDUP_WINDOW_MS, canonicalBackupStreamConfig, } from "./backup-config.js";
9
11
  /** Default presence-bucket entry TTL (ms) — matches the endpoint's default liveness window. */
@@ -43,6 +45,19 @@ export const MANAGER_LEASE_TTL_MS = 10_000;
43
45
  * far above any realistic readership while keeping the bucket from growing unbounded. A deliberate cap,
44
46
  * not a guess at scale — the design is cap-safe by construction (per-agent, store-patterns-not-expanded). */
45
47
  export const MEMBERSHIP_MAX_BYTES = 64 * 1024 * 1024;
48
+ /** Bucket-level `max_bytes` cap on the per-space artifact Object Store (`cotal_artifacts_<space>`).
49
+ *
50
+ * THIS NUMBER IS THE ONLY THING BOUNDING ARTIFACT STORAGE, so it is a decision rather than a
51
+ * default. A fresh Object Store bucket ships `max_bytes: -1`, and the space account is provisioned
52
+ * `disk_storage: -1`, so nothing above it says no: without this cap an artifact flood grows until
53
+ * the disk does, starving the chat/DM/delivery streams that share it.
54
+ *
55
+ * 4 GiB is roughly sixteen artifacts at the 256 MiB per-artifact ceiling, which is generous for the
56
+ * transfer use case (screenshots, reports, build outputs) and small enough that filling it is a
57
+ * visible event rather than a silent disk exhaustion. `discard: new` on the bucket means hitting it
58
+ * REFUSES the write rather than evicting older artifacts — the loud failure, not the silent one
59
+ * where a reference published yesterday quietly stops resolving. */
60
+ export const ARTIFACT_STORE_MAX_BYTES = 4 * 1024 * 1024 * 1024;
46
61
  /** Connection options for a privileged STANDALONE helper (`setupSpaceStreams`, `clearSpaceHistory`,
47
62
  * `clearChannel`, the channel-registry helpers): pin the reply inbox to the connection's own
48
63
  * identity. A scoped cred (provisioner/purger/operator) subscribes only `_INBOX_<id>.>`, so without
@@ -53,7 +68,21 @@ export const MEMBERSHIP_MAX_BYTES = 64 * 1024 * 1024;
53
68
  * sentinel creds land the connection in the callout account, the bearer rides `auth_token`, and a
54
69
  * client-chosen inbox NONCE goes out as the connect `name` — the callout scopes `_INBOX_<nonce>.>`
55
70
  * from it (the client cannot know its nkey pre-connect). Open mode (no auth) connects bare. */
56
- export function standaloneConnectOpts(auth = {}) {
71
+ export function standaloneConnectOpts(auth) {
72
+ // The `= {}` default is deliberately GONE. It was the omission hole: it let a caller build
73
+ // connect options without ever naming a transport, and the result silently connected non-strict.
74
+ //
75
+ // The throw exists because the type alone does not reach far enough. Smoke files sit outside the
76
+ // tsconfigs, so 16 of this seam's 28 call sites are never typechecked - the compile error covers
77
+ // every TYPECHECKED caller, not every caller. Without this guard those would keep passing no
78
+ // transport and degrade to non-strict in silence, which is precisely the defect being fixed.
79
+ // Positioned BEFORE the options are built and before any connect: a guard only fences what comes
80
+ // after it.
81
+ if (auth?.tls === undefined)
82
+ throw new Error("standaloneConnectOpts requires an explicit `tls` boolean: pass `tls: true` to REQUIRE TLS, " +
83
+ "or `tls: false` for a plaintext broker. It has no default, because defaulting it would " +
84
+ "silently connect without the requirement that protects the credentials being passed.");
85
+ const tlsOpt = auth.tls ? { tls: {} } : {};
57
86
  if (auth.bearer !== undefined) {
58
87
  if (!auth.sentinelCreds)
59
88
  throw new Error("user-mode standalone connect requires sentinelCreds alongside the bearer");
@@ -64,14 +93,16 @@ export function standaloneConnectOpts(auth = {}) {
64
93
  name: nonce,
65
94
  inboxPrefix: `_INBOX_${nonce}`,
66
95
  authenticator: [credsAuthenticator(new TextEncoder().encode(auth.sentinelCreds)), tokenAuthenticator(auth.bearer)],
96
+ ...tlsOpt,
67
97
  };
68
98
  }
69
99
  return auth.creds
70
100
  ? {
71
101
  authenticator: credsAuthenticator(new TextEncoder().encode(auth.creds)),
72
102
  inboxPrefix: `_INBOX_${idFromCreds(auth.creds)}`,
103
+ ...tlsOpt,
73
104
  }
74
- : {};
105
+ : { ...tlsOpt };
75
106
  }
76
107
  /**
77
108
  * Create (idempotently) the five message streams for a space.
@@ -187,16 +218,256 @@ export function fanoutDurableConfig(space, opts = {}) {
187
218
  }
188
219
  /** Connect with the given (privileged) creds, create the space's streams, and disconnect.
189
220
  * Used by `cotal up` to pre-create streams once at setup. */
221
+ /** #286: reconcile a TTL'd KV bucket's `max_age` to `ttlMs`. `kvm.create` NEVER updates an existing
222
+ * bucket's config, so a presence/lease bucket created by a cotal that predated the TTL (or created
223
+ * without it) keeps NO expiry forever — dead presence records and stale leases never age out, and a
224
+ * raw-KV reader (a dashboard) shows a crashed agent as live indefinitely. Run at every `cotal up`, this
225
+ * `STREAM.UPDATE`s the backing stream when its `max_age` has drifted. Lowering `max_age` immediately
226
+ * ages out already-expired messages (the intended liveness effect; active leases are younger than their
227
+ * TTL and survive, a stale one dies and its holder self-fences on its next failed renewal). NATS requires
228
+ * `duplicate_window <= max_age`; an old unlimited bucket's 120s window would otherwise reject the update,
229
+ * so the window is lowered in the SAME update. Idempotent (a matching bucket is skipped). The `provisioner`
230
+ * cred holds `STREAM.UPDATE` on exactly these three streams (see provision.ts).
231
+ *
232
+ * WHAT THE READ-BACK PROVES, AND WHAT IT CANNOT. It verifies exactly two things: **`max_age` came back
233
+ * EXACTLY as intended**, and **`duplicate_window` does not violate the NATS constraint** (it is not
234
+ * above `max_age`). A no-op update, a `max_age` that came back other than intended, or a server that
235
+ * answers OK without changing anything is caught here and throws.
236
+ *
237
+ * Note what that does NOT include: the update sends a computed `dupNs`, but the read-back never checks
238
+ * the window came back as sent — omitted, zeroed, or clamped smaller all pass. Deliberate: any window
239
+ * `<= max_age` is legal and harmless for a liveness bucket, and demanding equality would turn a
240
+ * legitimate server-side clamp into a failed `cotal up`. (Confirmed by probe: the real function accepts
241
+ * a read-back with exact `max_age` and the window OMITTED.) It does NOT prove that file-store expiry is
242
+ * in force either, and the distinction is
243
+ * not theoretical — on the supported floor (nats-server 2.12.1) the effect is applied in two places and
244
+ * only one of them is visible to us:
245
+ * - `stream.go` assigns the new in-memory `mset.cfg`, then calls `mset.store.UpdateConfig(cfg)` and
246
+ * IGNORES its returned error;
247
+ * - `filestore.go`'s `UpdateConfig` restores the previous config and returns early when
248
+ * `writeStreamMeta()` fails — BEFORE `expireMsgs()`/age enforcement is ever started;
249
+ * - `STREAM.INFO` is answered from `mset.config()`, i.e. the in-memory copy.
250
+ * So a metadata-write fault (EACCES, ENOSPC) yields UPDATE OK, a read-back showing the intended
251
+ * `max_age`, and a backing store still running unlimited with no expiry timer. **This check cannot see
252
+ * that**, because both fields it reads come from the config that DID get updated.
253
+ *
254
+ * It is NOT, however, invisible everywhere — an earlier version of this comment said no check at this
255
+ * seam could see it, and that was false. `$JS.API.STREAM.SNAPSHOT` splits the useful way: the snapshot
256
+ * INITIATION response copies `mset.config()` and false-greens like INFO, but the STREAMED archive's
257
+ * first `meta.inf` entry marshals `fs.cfg` — the file store's own, rolled-back config. Reproduced live
258
+ * against an EACCES split: INFO and the initiation response both reported the requested TTL while the
259
+ * streamed `meta.inf` reported the old one. So a store-side detector EXISTS in the protocol, and this
260
+ * codebase has `downloadStreamSnapshot` plus a per-stream-scoped snapshot grant MODEL (`backup.ts`).
261
+ *
262
+ * **It is NOT available under current authority, and that — not the cost — is what blocks it.**
263
+ * `assertBackupStream` runs every scope through `canonicalBackupStreamConfig`, which accepts only the
264
+ * durable registries (channel / acl / members) among KV buckets and THROWS for presence, delivery and
265
+ * manager. So wiring this in needs a NEW EXACT SCOPE, or a widening of the reconcile credential to
266
+ * whole-body snapshot authority over liveness data — an unsettled authority question on the credential
267
+ * this change otherwise keeps to three `STREAM.UPDATE` subjects. The cost is real too (it scales with
268
+ * bucket size, and a snapshot carries the bucket's records), but quoting only the cost would read as
269
+ * "available but expensive", which is the wrong summary. See the tracking issue for the full spec.
270
+ *
271
+ * Stated here rather than left implied: this guard is a drift detector, not proof of enforcement — and
272
+ * "cannot be detected here" is the stronger claim it does NOT license.
273
+ *
274
+ * CONSEQUENCE OF READING FIRST, which follows from the same split and is worth naming because the
275
+ * skip is deliberate: once `STREAM.INFO` reports the intended `max_age`, later reconciles see no
276
+ * drift and issue no update, so a bucket left unenforced by a metadata-write fault is not retried
277
+ * for as long as that server process lives.
278
+ *
279
+ * WHERE THAT GOES depends on WHEN the write failed, and an earlier version of this comment got it
280
+ * wrong by generalising from one case. `writeStreamMeta` performs TWO writes — `meta.inf`, then
281
+ * `meta.sum` — and `UpdateConfig` rolls `fs.cfg` back if either fails:
282
+ * - **Failure BEFORE the first write commits** (the original EACCES reproduction): persisted state
283
+ * is coherent and old, so a restart makes `INFO` report the old value again and the next
284
+ * reconcile repairs it. Here the skip DEFERS a repair.
285
+ * - **Failure BETWEEN the two** (reproduced live by pointing `meta.sum.tmp` at `/dev/full`):
286
+ * `meta.inf` commits NEW while `meta.sum` stays OLD — a torn pair. On restart the server logs
287
+ * `checksums do not match` and recovery `continue`s past the stream, so it is SKIPPED: `INFO`
288
+ * returns **stream not found**, and the reconcile cannot repair it because its own first `INFO`
289
+ * gets not-found. **That case does not defer a repair, it loses the stream until an operator
290
+ * intervenes.**
291
+ * So "the persisted metadata is ground truth, restart repairs it" is TRUE ONLY of the
292
+ * before-first-atomic case, and "defers, never loses" is false in general. The read-first skip is
293
+ * still right — it keeps a healthy repeat `cotal up` to reads and no writes — but its worst case is
294
+ * worse than a deferred repair. Both branches reproduced live against 2.12.1 during review; see the
295
+ * tracking issue. */
296
+ export async function reconcileBucketTtl(jsm, streamName, ttlMs) {
297
+ const wantNs = nanos(ttlMs);
298
+ const info = await jsm.streams.info(streamName);
299
+ if (info.config.max_age === wantNs)
300
+ return undefined; // already at the intended TTL — no update
301
+ const fromNs = info.config.max_age;
302
+ const dupNs = Math.min(info.config.duplicate_window ?? wantNs, wantNs); // NATS constraint: duplicate_window <= max_age
303
+ await jsm.streams.update(streamName, { max_age: wantNs, duplicate_window: dupNs });
304
+ const after = await jsm.streams.info(streamName);
305
+ if (after.config.max_age !== wantNs)
306
+ throw new Error(`TTL reconcile failed for ${streamName}: max_age is ${after.config.max_age}ns, expected ${wantNs}ns (the STREAM.UPDATE did not take)`);
307
+ // Both fields are read back, not just the one we came for. On a CONFORMING server this cannot
308
+ // fail: NATS validates the whole StreamConfig (including `duplicate_window <= max_age`) and then
309
+ // applies it as ONE replacement — or one Raft stream assignment in cluster mode — so a partial
310
+ // apply that took `max_age` and dropped the window is not a supported outcome. The check exists
311
+ // because the read-back's whole purpose is to not depend on the server behaving as documented:
312
+ // verifying only the field we set would leave the guarantee resting on the same assumption it was
313
+ // written to remove. (Semantics confirmed at the NATS source rather than reasoned from our seam.)
314
+ if ((after.config.duplicate_window ?? 0) > wantNs)
315
+ throw new Error(`TTL reconcile left ${streamName} inconsistent: duplicate_window is ${after.config.duplicate_window}ns, which exceeds max_age ${wantNs}ns (a conforming server rejects this combination, so the update was applied partially)`);
316
+ return { stream: streamName, fromMs: fromNs / 1e6, toMs: wantNs / 1e6 };
317
+ }
318
+ /** The TTL'd buckets and their intended `max_age`, in ONE place — and the ONLY place any of them is
319
+ * created.
320
+ *
321
+ * Creation is DRIVEN from this list, not merely checked against it. That distinction is the whole
322
+ * point: an earlier version had the reconcile paths read the list while `setupSpaceStreams` still
323
+ * named each `kvm.create(..., { ttl })` separately, and claimed in this comment that a bucket could
324
+ * therefore "never" be TTL'd on one path and forgotten on the other. It could — a fourth bucket
325
+ * added at a create site would have been created with a TTL and never reconciled, which is #286's
326
+ * shape exactly, recreated by the fix for it. (Caught in review; the claim was false when written.)
327
+ * Now a TTL'd bucket cannot be created without appearing here, so it cannot be missed on upgrade.
328
+ *
329
+ * NOT mode-gated: an open mesh carries the same buckets and drifts identically. */
330
+ export function ttlBuckets(space) {
331
+ return [
332
+ // Presence (liveness): dead agents' records must age out, or the roster reports a despawned
333
+ // agent as live. Pre-created so agents, denied KV stream-create, can open it.
334
+ [presenceBucket(space), PRESENCE_TTL_MS],
335
+ // Delivery-daemon single-flight lease + readiness: bucket-level TTL so a crashed holder's lease
336
+ // auto-expires and a fresh daemon can re-acquire. Lease keys only, `delivery`-cred write,
337
+ // world-readable (the non-gating delivery-health surface).
338
+ [deliveryBucket(space), LEASE_TTL_MS],
339
+ // Manager singleton lease, same shape as the delivery lease. Pre-created so the long-lived
340
+ // supervisor can lease-bind OPEN-ONLY (closure (ii), residual 2) — it holds no STREAM.CREATE.
341
+ // Config matches `managerLeaseRegistry()`'s create-first exactly, so that path stays idempotent.
342
+ [managerBucket(space), MANAGER_LEASE_TTL_MS],
343
+ ];
344
+ }
345
+ /** #286: reconcile all three TTL'd buckets for a space, over a connection of its own.
346
+ *
347
+ * Exists because `setupSpaceStreams` is only reachable on the CREATE path (`cotal up` starting a
348
+ * mesh), while the drifted-bucket case this fixes is by definition a mesh that is ALREADY RUNNING —
349
+ * an old deployment being upgraded in place. That path starts nothing and so must not run the
350
+ * create-everything routine; it needs exactly the reconcile and nothing else.
351
+ *
352
+ * Read-first by construction: each bucket is skipped when its `max_age` already matches, so a
353
+ * steady-state repeat `cotal up` issues three `STREAM.INFO` reads and ZERO writes. Returns only the
354
+ * buckets it actually changed. `creds` is omitted on an open mesh, exactly as `setupSpaceStreams`
355
+ * documents — the TTL'd buckets are NOT mode-gated, so an open mesh drifts identically. */
356
+ export async function reconcileSpaceTtls(opts) {
357
+ const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ creds: opts.creds, tls: false }) });
358
+ try {
359
+ const jsm = await jetstreamManager(nc);
360
+ const changed = [];
361
+ for (const [bucket, ttl] of ttlBuckets(opts.space)) {
362
+ const done = await reconcileBucketTtl(jsm, `KV_${bucket}`, ttl);
363
+ if (done)
364
+ changed.push(done);
365
+ }
366
+ return changed;
367
+ }
368
+ finally {
369
+ await nc.drain();
370
+ }
371
+ }
372
+ /**
373
+ * Create the space's artifact Object Store, or VERIFY an existing one — never silently adopt it.
374
+ *
375
+ * `Objm.create(bucket, { max_bytes })` is create-if-MISSING. Measured on nats-server 2.14.4 with
376
+ * `@nats-io/obj` 3.4.0: creating at `max_bytes: 1024`, then calling create again with `4096`, leaves
377
+ * the stream at **1024** — it neither updates the config nor refuses. A bare `create()` with no
378
+ * options does the same.
379
+ *
380
+ * That makes create-alone actively dangerous here, because {@link setupSpaceStreams} is idempotent
381
+ * and re-runs on every `cotal up`. A store that predates this cap, or that an operator widened by
382
+ * hand, would be adopted forever: the code would look like it enforces a 4 GiB ceiling while the
383
+ * broker enforced whatever was there first, and nothing would ever say so. The cap is the ONLY thing
384
+ * bounding artifact storage (account disk is provisioned unlimited), so an unenforced cap is not a
385
+ * smaller cap — it is no cap.
386
+ *
387
+ * So: create, then read the config back and refuse loudly on drift. Same create-or-verify discipline
388
+ * `ensureAuthorityStores` already uses, and the same reason: an idempotent setup path must either
389
+ * converge the resource or report that it cannot.
390
+ */
391
+ export async function ensureArtifactStore(nc, space) {
392
+ const bucket = artifactBucket(space);
393
+ const stream = objectStoreStream(bucket);
394
+ await new Objm(jetstream(nc)).create(bucket, { max_bytes: ARTIFACT_STORE_MAX_BYTES });
395
+ const { config } = await (await jetstreamManager(nc)).streams.info(stream);
396
+ const drift = [];
397
+ // SUBJECTS FIRST, because they decide whether this is an object store AT ALL. A stream created
398
+ // under the right name with the right cap and the right discard, but bound to other subjects, is
399
+ // adopted by a cap-only check while artifact puts can never land - and setup reports success.
400
+ // (Measured: a stream named OBJ_<bucket> over `foreign.capture.>` survived setup untouched.)
401
+ const want = [`$O.${bucket}.C.>`, `$O.${bucket}.M.>`];
402
+ if (JSON.stringify(config.subjects ?? []) !== JSON.stringify(want))
403
+ drift.push(`subjects are ${JSON.stringify(config.subjects ?? [])}, expected ${JSON.stringify(want)}`);
404
+ // A MIRROR or SOURCE under this name makes the space's artifact store a view of someone else's
405
+ // stream. Nothing about the cap would look wrong; the bytes would simply not be the space's own.
406
+ if (config.mirror)
407
+ drift.push("it is a MIRROR of another stream");
408
+ if (config.sources?.length)
409
+ drift.push(`it SOURCES ${config.sources.length} other stream(s)`);
410
+ if (config.max_bytes !== ARTIFACT_STORE_MAX_BYTES)
411
+ drift.push(`max_bytes is ${config.max_bytes}, expected ${ARTIFACT_STORE_MAX_BYTES}`);
412
+ // `discard: new` is what makes a full store REFUSE a put instead of evicting a live artifact whose
413
+ // reference is already published. Drift here is silent data loss, not a capacity difference.
414
+ if (String(config.discard) !== "new")
415
+ drift.push(`discard is ${config.discard}, expected new`);
416
+ // File storage: memory-backed artifacts vanish on a broker restart while every published reference
417
+ // survives, which turns a restart into a wave of unresolvable references.
418
+ if (String(config.storage) !== "file")
419
+ drift.push(`storage is ${config.storage}, expected file`);
420
+ // Limits retention: any interest/work-queue retention DELETES messages once consumed, so a fetch
421
+ // would destroy the artifact it just read.
422
+ if (String(config.retention) !== "limits")
423
+ drift.push(`retention is ${config.retention}, expected limits`);
424
+ // Rollup headers: WRITE-CRITICAL, and measured rather than assumed. With `allow_rollup_hdrs:false`
425
+ // on an otherwise canonical store, `put` fails outright with "rollup not permitted" - the object
426
+ // store uses a rollup to replace an object's metadata. So a store drifted here accepts setup and
427
+ // then rejects every artifact, which is the worst shape: green provisioning, broken feature.
428
+ //
429
+ // `allow_direct` is deliberately NOT checked. Measured on the same probe: with it false, put and
430
+ // get both still succeed, because this client's info path uses STREAM.MSG.GET rather than
431
+ // DIRECT.GET. Asserting it would refuse a store that works.
432
+ if (config.allow_rollup_hdrs !== true)
433
+ drift.push("allow_rollup_hdrs is false, expected true (put fails without it)");
434
+ // max_age: SILENT DATA LOSS, measured. With max_age 1s on an otherwise canonical store, a put
435
+ // succeeds and the object is GONE 1.8s later (stream messages back to 0) - while every reference
436
+ // already published to a channel survives forever. That is the dangling-reference wave this design
437
+ // refuses everywhere else, arriving from a config field rather than from GC.
438
+ if (config.max_age !== 0)
439
+ drift.push(`max_age is ${config.max_age}, expected 0 (a non-zero age silently deletes stored artifacts)`);
440
+ // sealed: cheap to check, and the mechanism is NOT the one it is usually described by. Measured:
441
+ // the broker REFUSES to create a sealed stream at all ("stream configuration for create can not be
442
+ // sealed"), so a sealed store cannot arrive through the create path - only by a later update. That
443
+ // narrows it to a deliberate operator action, which is exactly the drift worth naming.
444
+ if (config.sealed === true)
445
+ drift.push("the stream is SEALED (writes permanently refused)");
446
+ // The message-count and size limits must stay unbounded, because THE CAP IS SUPPOSED TO BE THE
447
+ // OPERATIVE BOUND. Reproduced: max_msgs=2 accepts setup, the first 1-byte object succeeds (chunk +
448
+ // meta = 2 messages), and the second fails "maximum messages exceeded" with 4 GiB still free. A
449
+ // hidden limit that overrides the advertised capacity makes the number this code reports a lie -
450
+ // loud rather than silent, but still a bound nobody configured deliberately.
451
+ for (const [field, value] of [["max_msgs", config.max_msgs], ["max_msgs_per_subject", config.max_msgs_per_subject],
452
+ ["max_msg_size", config.max_msg_size]])
453
+ if (value !== -1)
454
+ drift.push(`${field} is ${value}, expected -1 (max_bytes is the only bound this store advertises)`);
455
+ if (drift.length)
456
+ throw new Error(`artifact store ${stream} has drifted: ${drift.join("; ")} - refusing to adopt a store whose ` +
457
+ `bounds are not the ones this space enforces (delete it, or reconcile it deliberately)`);
458
+ }
190
459
  export async function setupSpaceStreams(opts) {
191
- const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ creds: opts.creds }) });
460
+ const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ creds: opts.creds, /* not yet wired to a recorded transport - see broker-policy/MeshEntry work */ tls: false }) });
192
461
  try {
193
462
  const jsm = await jetstreamManager(nc);
194
463
  await createSpaceStreams(jsm, opts.space);
195
- // The presence + channels KV buckets are streams too — pre-create them so agents (denied
196
- // KV stream-create) can open them. Idempotent. Presence is TTL'd (liveness); the channel
197
- // registry is durable config, so no TTL.
464
+ // KV buckets are streams too — pre-create them so agents (denied KV stream-create) can open
465
+ // them. Idempotent. The TTL'd ones come from `ttlBuckets` and ONLY from there, so a new one
466
+ // cannot be created on this path without also being reconciled on the upgrade path; the
467
+ // channel/members/acl registries below are durable config and carry no TTL.
198
468
  const kvm = new Kvm(nc);
199
- await kvm.create(presenceBucket(opts.space), { ttl: PRESENCE_TTL_MS });
469
+ for (const [bucket, ttl] of ttlBuckets(opts.space))
470
+ await kvm.create(bucket, { ttl });
200
471
  await jsm.streams.add(canonicalBackupStreamConfig(opts.space, `KV_${channelBucket(opts.space)}`));
201
472
  // Durable-membership registry (Plane-3): privileged-write, no TTL (durable config, like the
202
473
  // channel registry). Pre-created so the delivery daemon (and open-mode self) can OPEN it; agents
@@ -210,15 +481,22 @@ export async function setupSpaceStreams(opts) {
210
481
  // (only the latest record per agent matters) + a `max_bytes` cap (footprint bound). Pre-created so the
211
482
  // scoped writer holds no STREAM.CREATE. Idempotent.
212
483
  await kvm.create(membershipBucket(opts.space), { history: 1, max_bytes: MEMBERSHIP_MAX_BYTES });
213
- // Delivery-daemon single-flight lease + readiness bucket: bucket-level TTL (`max_age`) so a crashed
214
- // holder's lease auto-expires and a fresh daemon can re-acquire. Holds ONLY lease keys, writable
215
- // only by the `delivery` cred, world-readable (the non-gating delivery-health surface). Idempotent.
216
- await kvm.create(deliveryBucket(opts.space), { ttl: LEASE_TTL_MS });
217
- // Manager singleton-lease bucket (bucket-level TTL, like the delivery lease). PRE-CREATED here so the
218
- // long-lived supervisor can lease-bind OPEN-ONLY (closure (ii), residual 2) — it holds no STREAM.CREATE.
219
- // Config matches `managerLeaseRegistry()`'s create-first exactly, so that path stays idempotent until
220
- // the supervisor profile drops bucket-create. Idempotent.
221
- await kvm.create(managerBucket(opts.space), { ttl: MANAGER_LEASE_TTL_MS });
484
+ // The two §13.12 AUTHORITY stores (records + auth): every auth-mode mesh now carries a
485
+ // lifecycle registry user mode's service re-ensures at its own boot, the STATIC manager's
486
+ // start reconcile re-ensures for pre-existing spaces (Unit B) — and the up-time seed creates
487
+ // them so neither daemon needs first-write stream creation. Create-or-verify, idempotent,
488
+ // drift fails loud.
489
+ await ensureAuthorityStores(jsm, kvm, opts.space);
490
+ // #286: `kvm.create` above is a no-op on an ALREADY-EXISTING bucket, so a bucket from a cotal that
491
+ // predated these TTLs keeps its old (often unlimited) `max_age` and never expires dead presence /
492
+ // stale leases. Reconcile the three TTL'd buckets' `max_age` here (STREAM.UPDATE), idempotently.
493
+ // Same list as `reconcileSpaceTtls`, from one source: two copies would let a fourth TTL'd bucket
494
+ // be added to the create path and silently miss the upgrade path, which is this defect exactly.
495
+ for (const [bucket, ttl] of ttlBuckets(opts.space))
496
+ await reconcileBucketTtl(jsm, `KV_${bucket}`, ttl);
497
+ // Artifact Object Store (SPEC section 5): the bytes an `artifact` reference part points at.
498
+ // Create-or-VERIFY, drift fails loud - see ensureArtifactStore for why create alone is not enough.
499
+ await ensureArtifactStore(nc, opts.space);
222
500
  }
223
501
  finally {
224
502
  await nc.drain();
@@ -227,7 +505,7 @@ export async function setupSpaceStreams(opts) {
227
505
  /** Purge retained message history for a running space. This intentionally leaves TASK alone:
228
506
  * anycast is queued work, not replay history. */
229
507
  export async function clearSpaceHistory(opts) {
230
- const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts(opts) });
508
+ const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ ...opts, /* not yet wired to a recorded transport - see broker-policy/MeshEntry work */ tls: false }) });
231
509
  try {
232
510
  const jsm = await jetstreamManager(nc);
233
511
  const chat = (await jsm.streams.purge(chatStream(opts.space))).purged;
@@ -249,7 +527,7 @@ export async function clearSpaceHistory(opts) {
249
527
  export async function clearChannel(opts) {
250
528
  if (!isConcreteChannel(opts.channel))
251
529
  throw new Error(`"${opts.channel}" is a wildcard, not a deletable channel`);
252
- const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts(opts) });
530
+ const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ ...opts, /* not yet wired to a recorded transport - see broker-policy/MeshEntry work */ tls: false }) });
253
531
  try {
254
532
  const jsm = await jetstreamManager(nc);
255
533
  const { purged } = await jsm.streams.purge(chatStream(opts.space), {
@@ -285,7 +563,7 @@ export async function clearChannel(opts) {
285
563
  export async function deprovisionAgent(opts) {
286
564
  const nc = await connect({
287
565
  servers: opts.servers,
288
- ...standaloneConnectOpts({ creds: opts.creds }),
566
+ ...standaloneConnectOpts({ creds: opts.creds, /* not yet wired to a recorded transport - see broker-policy/MeshEntry work */ tls: false }),
289
567
  // This is a detached, fire-and-forget teardown — it must FAIL FAST, never hang, so the caller's
290
568
  // fail-loud `.catch` is load-bearing: no reconnect loop (a wedged broker rejects promptly instead of
291
569
  // looping silently) and a bounded initial connect. Without this a broker-down deprovision would sit
@@ -1 +1 @@
1
- {"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY,EACZ,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,+FAA+F;AAC/F,MAAM,e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AK,CAAuB,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC;YAAE,MAAM,CAAC,CAAC;IACnH,CAAC;AACH,CAAC"}
@@ -4,9 +4,12 @@
4
4
  * cotal.<space>.chat.<channel> multicast to a channel (dotted + hierarchical: team.backend, subscribe team.>)
5
5
  * cotal.<space>.svc.<service> anycast to any one instance of a service (queue group)
6
6
  * cotal.<space>.inst.<instance> unicast to one specific instance
7
- * cotal.<space>.ctl.<service> control request/reply to a service (e.g. manager)
7
+ * cotal.<space>.ctl.<service> control request/reply to a SERVER-SIDE service the delivery
8
+ * daemon's delivery/delivery-admin carve-outs ONLY.
9
+ * The manager's ctl tiers were deleted in 1d, and the auth
10
+ * plane's rail moved to ep.one.auth in #350: both serve their
11
+ * control surface as v0.4 endpoints on the ep.* rails.
8
12
  * cotal.<space>.trace.<instance> ambient lifecycle trace (later)
9
- * cotal.<space>.control.<instance> control-plane commands (later)
10
13
  *
11
14
  * Presence lives in a JetStream KV bucket, not a subject (see presenceBucket()).
12
15
  */
@@ -256,21 +259,12 @@ export declare function anycastSubject(space: string, service: string, owner: st
256
259
  /** The serve-side TASK filter/grant for a role: `svc.<role>.>` — every anycast to the role, from any
257
260
  * sender principal (the sender slot widened from one token to two, so the tail is `.>`). */
258
261
  export declare function anycastServeFilter(space: string, service: string): string;
259
- /** Control request/reply to a service (e.g. the manager): `ctl.<service>.<owner>.<actor>` — tagged with
260
- * the caller principal; anycast via queue group. Identity slots accept `*` (serve side: `ctl.<tier>.*.*`). */
262
+ /** Control request/reply to a service since 1d ONLY the delivery daemon (`ctl.delivery` /
263
+ * `ctl.delivery-admin`); the manager's own control moved to its v0.4 `service` endpoint on the
264
+ * `ep.*` rails, and the auth plane's rail followed it there (#350).
265
+ * `ctl.<service>.<owner>.<actor>` — tagged with the
266
+ * caller principal; anycast via queue group. Identity slots accept `*` (serve side: `ctl.<svc>.*.*`). */
261
267
  export declare function controlServiceSubject(space: string, service: string, owner: string, actor: string): string;
262
- /** Control-plane service names — the three-tier split (P2a). The manager subscribes to ALL
263
- * three; the cred layer grants {@link CONTROL_SELF_SERVICE} to every agent and
264
- * {@link CONTROL_PRIVILEGED} only to spawn-capable agents (default-deny otherwise), while
265
- * {@link CONTROL_ADMIN} is reached only by the manager's own allow-all profile (no agent ever
266
- * gets it). nats-server — not a handler — is the coarse boundary. The handler then routes by
267
- * op↔service (fail-closed on mismatch) and refines own-child vs admin among holders of the
268
- * privileged subject. `CONTROL_PRIVILEGED` is the existing `manager` service; `CONTROL_SELF_SERVICE`
269
- * carries only the no-name self stop/despawn; `CONTROL_ADMIN` carries the operator-only ops
270
- * (purge, cross-agent stop/despawn/attach/definePersona). */
271
- export declare const CONTROL_PRIVILEGED: "manager";
272
- export declare const CONTROL_SELF_SERVICE: "self";
273
- export declare const CONTROL_ADMIN: "admin";
274
268
  /** The delivery service — a control service served by the server-side **delivery daemon** (NOT the
275
269
  * manager), carrying the runtime durable `join` / `leave` / `listMemberships` ops agents call. Agents
276
270
  * publish a request to `ctl.delivery.<agentId>` and receive the reply on `ctl.delivery.<agentId>.…`,
@@ -284,24 +278,10 @@ export declare const CONTROL_DELIVERY: "delivery";
284
278
  * EXECUTES for the mesh's renewal/repair owner — credential reload (`reloadCreds`, the class-2
285
279
  * standing-renewal adoption step) now; the live-eviction executor rides here next. Cred-enforced
286
280
  * caller set: only the manager's `supervisor` profile holds the request-publish grant (every agent
287
- * cred is default-denied — nats-server is the boundary, same pattern as {@link CONTROL_ADMIN});
281
+ * cred is default-denied — nats-server is the boundary);
288
282
  * the `delivery` cred holds the serve + bounded-reply side. */
289
283
  export declare const CONTROL_DELIVERY_ADMIN: "delivery-admin";
290
- /** The AUTH service's control rail (#29 piece 3; SPEC 13.2 reserved): lifecycle-authority ops the
291
- * AUTH plane serves — the D5 split's other half (retirement is the auth plane's operation; it
292
- * never rides the DELIVERY daemon's rail). The surface is GENERIC — "retire a lifecycle
293
- * (owner, actor, lifecycleUid)" — never caller-specific: the manager's despawn is ONE caller,
294
- * and the serve-time authz (the space-manager-lease holder check, leader-read fresh per
295
- * request) is the auth service's, not the subject grammar's. Caller attribution is
296
- * SUBJECT-derived (`ctl.auth-admin.<owner>.<actor>`, broker-ACL-enforced): only a credential
297
- * minted with that principal's request-publish grant reaches it, and replies are bound under
298
- * the sender's own `<request>.reply.>` subtree. */
299
- export declare const CONTROL_AUTH_ADMIN: "auth-admin";
300
- /** The three control-plane tiers the manager serves — values tie to the `CONTROL_*` service
301
- * names so handler routing can't drift from the subject names. */
302
- export type ControlTier = typeof CONTROL_PRIVILEGED | typeof CONTROL_SELF_SERVICE | typeof CONTROL_ADMIN;
303
284
  export declare function traceSubject(space: string, agentId: string): string;
304
- export declare function controlSubject(space: string, agentId: string): string;
305
285
  /** Wildcard matching every subject within a space. */
306
286
  export declare function spaceWildcard(space: string): string;
307
287
  /** Wildcard matching every chat (multicast) subject in a space — the read surface an
@@ -454,13 +434,31 @@ export declare function channelFromChatSubscription(space: string, subject: stri
454
434
  export declare function deliveryBucket(space: string): string;
455
435
  /** KV key for one shard's delivery lease/readiness (N=1 → `lease.0`). */
456
436
  export declare function leaseKey(shardIndex: number): string;
457
- /** Name of the KV bucket holding the per-space MANAGER singleton leaseone key
458
- * ({@link MANAGER_LEASE_KEY}), the live manager for the space. Bucket-level TTL (max_age =
459
- * LEASE_TTL_MS) auto-expires a crashed manager's lease so a replacement can acquire. Created by the
460
- * manager (allow-all profile); read by `spawn -f` to reuse the running manager not start a duplicate. */
437
+ /** Name of the KV bucket holding the per-space MANAGER liveness leasesONE KEY PER LOGICAL MANAGER
438
+ * INSTANCE ({@link managerLeaseKey}), each the live-liveness marker of one manager instance in the
439
+ * space (P2 item 3 demoted the old per-space singleton to per-instance liveness two managers = two
440
+ * workspace roots = two instance ids = two keys, so they coexist). Bucket-level TTL (max_age =
441
+ * LEASE_TTL_MS) auto-expires a crashed instance's key so a replacement can re-acquire. */
461
442
  export declare function managerBucket(space: string): string;
462
- /** The single key in {@link managerBucket} there is exactly one manager per space. */
443
+ /** Name of the per-space **Object Store bucket** holding artifact bytes (SPEC §5's `artifact` part).
444
+ *
445
+ * Its backing stream is `OBJ_<bucket>` over `$O.<bucket>.C.>` (chunks) and `$O.<bucket>.M.>`
446
+ * (metadata) — a grammar owned by the Object Store, so it sits **outside** the `cotal.<space>.>`
447
+ * subject tree while staying **inside** the per-space account. Account isolation therefore holds,
448
+ * but the space's own subject audit cannot see it: it has to be enumerated by NAME everywhere a
449
+ * space's resources are listed, never swept by prefix. {@link objectStoreStream} is that name. */
450
+ export declare function artifactBucket(space: string): string;
451
+ /** The JetStream stream backing an Object Store bucket. The `OBJ_` prefix is the Object Store's own
452
+ * convention, not Cotal's — measured against `@nats-io/obj` 3.4.0 rather than assumed, because this
453
+ * name is what every stream inventory, teardown list and backup check matches on. */
454
+ export declare function objectStoreStream(bucket: string): string;
455
+ /** The lease-key PREFIX token in {@link managerBucket}. The demoted per-instance key is
456
+ * `${MANAGER_LEASE_KEY}.<instanceId>` ({@link managerLeaseKey}); this bare prefix is no longer written
457
+ * on its own (it stays exported as the grant/subtree anchor `${MANAGER_LEASE_KEY}.*`). */
463
458
  export declare const MANAGER_LEASE_KEY = "lease";
459
+ /** The per-logical-instance liveness key in {@link managerBucket}. `instanceId` is a single lifecycle-uid
460
+ * token (lowercase alnum, no dots/wildcards), so it is a safe trailing subject token under `lease.*`. */
461
+ export declare function managerLeaseKey(instanceId: string): string;
464
462
  /** Deterministic FNV-1a (32-bit) hash of `key` into `[0, n)` — stable across processes/restarts, so a
465
463
  * shard assignment never moves under a running daemon. The Plane-3 partition seam (sharding):
466
464
  * **N=1 is the only operating mode shipped** (`shards > 1` is hard-rejected at the daemon entrypoint)
@@ -1 +1 @@
1
- {"version":3,"file":"subjects.d.ts","sourceRoot":"","sources":["../src/subjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,gEAAgE;AAChE,wBAAgB,KAAK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