@cotal-ai/core 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.
- package/dist/acls.d.ts +0 -7
- package/dist/acls.d.ts.map +1 -1
- package/dist/acls.js +10 -7
- package/dist/acls.js.map +1 -1
- package/dist/agui-kind.d.ts +71 -0
- package/dist/agui-kind.d.ts.map +1 -0
- package/dist/agui-kind.js +95 -0
- package/dist/agui-kind.js.map +1 -0
- package/dist/endpoint-action.d.ts +3 -3
- package/dist/endpoint-action.js +4 -4
- package/dist/endpoint-action.js.map +1 -1
- package/dist/endpoint-binding.d.ts +48 -5
- package/dist/endpoint-binding.d.ts.map +1 -1
- package/dist/endpoint-binding.js +82 -6
- package/dist/endpoint-binding.js.map +1 -1
- package/dist/endpoint-cluster.d.ts +20 -0
- package/dist/endpoint-cluster.d.ts.map +1 -1
- package/dist/endpoint-cluster.js +47 -0
- package/dist/endpoint-cluster.js.map +1 -1
- package/dist/endpoint-contract-store.d.ts +6 -0
- package/dist/endpoint-contract-store.d.ts.map +1 -1
- package/dist/endpoint-contract-store.js +21 -2
- package/dist/endpoint-contract-store.js.map +1 -1
- package/dist/endpoint-effects.d.ts +73 -0
- package/dist/endpoint-effects.d.ts.map +1 -0
- package/dist/endpoint-effects.js +46 -0
- package/dist/endpoint-effects.js.map +1 -0
- package/dist/endpoint-envelope.d.ts +32 -1
- package/dist/endpoint-envelope.d.ts.map +1 -1
- package/dist/endpoint-envelope.js +56 -2
- package/dist/endpoint-envelope.js.map +1 -1
- package/dist/endpoint-epname.d.ts +62 -0
- package/dist/endpoint-epname.d.ts.map +1 -0
- package/dist/endpoint-epname.js +273 -0
- package/dist/endpoint-epname.js.map +1 -0
- package/dist/endpoint-error.d.ts +155 -1
- package/dist/endpoint-error.d.ts.map +1 -1
- package/dist/endpoint-error.js +114 -2
- package/dist/endpoint-error.js.map +1 -1
- package/dist/endpoint-goaleff.d.ts +56 -0
- package/dist/endpoint-goaleff.d.ts.map +1 -0
- package/dist/endpoint-goaleff.js +212 -0
- package/dist/endpoint-goaleff.js.map +1 -0
- package/dist/endpoint-grants.d.ts +46 -0
- package/dist/endpoint-grants.d.ts.map +1 -1
- package/dist/endpoint-grants.js +68 -0
- package/dist/endpoint-grants.js.map +1 -1
- package/dist/endpoint-invoke.d.ts +1 -1
- package/dist/endpoint-invoke.d.ts.map +1 -1
- package/dist/endpoint-invoke.js +162 -27
- package/dist/endpoint-invoke.js.map +1 -1
- package/dist/endpoint-journal.d.ts +103 -0
- package/dist/endpoint-journal.d.ts.map +1 -1
- package/dist/endpoint-journal.js +290 -0
- package/dist/endpoint-journal.js.map +1 -1
- package/dist/endpoint-records.d.ts.map +1 -1
- package/dist/endpoint-records.js +37 -0
- package/dist/endpoint-records.js.map +1 -1
- package/dist/endpoint-serve.d.ts.map +1 -1
- package/dist/endpoint-serve.js +45 -1
- package/dist/endpoint-serve.js.map +1 -1
- package/dist/endpoint-subjects.d.ts +10 -0
- package/dist/endpoint-subjects.d.ts.map +1 -1
- package/dist/endpoint-subjects.js +10 -0
- package/dist/endpoint-subjects.js.map +1 -1
- package/dist/endpoint-verbs.d.ts +12 -3
- package/dist/endpoint-verbs.d.ts.map +1 -1
- package/dist/endpoint-verbs.js +113 -19
- package/dist/endpoint-verbs.js.map +1 -1
- package/dist/endpoint.d.ts +170 -6
- package/dist/endpoint.d.ts.map +1 -1
- package/dist/endpoint.js +472 -37
- package/dist/endpoint.js.map +1 -1
- package/dist/event-channel.d.ts +107 -0
- package/dist/event-channel.d.ts.map +1 -0
- package/dist/event-channel.js +139 -0
- package/dist/event-channel.js.map +1 -0
- package/dist/evict.d.ts +47 -0
- package/dist/evict.d.ts.map +1 -1
- package/dist/evict.js +191 -59
- package/dist/evict.js.map +1 -1
- package/dist/identity.d.ts +15 -0
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +34 -0
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/membership-feed.d.ts.map +1 -1
- package/dist/membership-feed.js +35 -12
- package/dist/membership-feed.js.map +1 -1
- package/dist/parts.d.ts +29 -5
- package/dist/parts.d.ts.map +1 -1
- package/dist/parts.js +46 -3
- package/dist/parts.js.map +1 -1
- package/dist/provision.d.ts +19 -7
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.js +75 -14
- package/dist/provision.js.map +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +38 -0
- package/dist/resolve.js.map +1 -1
- package/dist/streams.d.ts +142 -3
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +192 -17
- package/dist/streams.js.map +1 -1
- package/dist/subjects.d.ts +49 -15
- package/dist/subjects.d.ts.map +1 -1
- package/dist/subjects.js +130 -15
- package/dist/subjects.js.map +1 -1
- package/package.json +5 -2
package/dist/streams.js
CHANGED
|
@@ -36,10 +36,34 @@ export const DINBOX_MAX_ACK_PENDING = 1000;
|
|
|
36
36
|
* available on this stack — a deliberate simplicity choice, not a capability gap. See {@link deliveryBucket}.) */
|
|
37
37
|
export const LEASE_TTL_MS = 30_000;
|
|
38
38
|
/** Manager singleton-lease TTL (ms) — the bucket-level `max_age` on `cotal_manager_<space>`. Shorter
|
|
39
|
-
* than the delivery lease so a crashed manager frees the space for a replacement promptly
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* than the delivery lease so a crashed manager frees the space for a replacement promptly. Tune here
|
|
40
|
+
* (independent of the delivery lease above); the holder's pacing inside this window is
|
|
41
|
+
* {@link MANAGER_LEASE_RENEW_MS} / {@link MANAGER_LEASE_ATTEMPT_MS}. */
|
|
42
42
|
export const MANAGER_LEASE_TTL_MS = 10_000;
|
|
43
|
+
/** How often the holder refreshes its manager lease, and the deadline it gives each attempt.
|
|
44
|
+
*
|
|
45
|
+
* THESE TWO NUMBERS ARE ONE BUDGET, and neither means anything alone. The TTL above is the whole
|
|
46
|
+
* window a holder has to prove it is still there. Renewing at TTL/2 with the request deadline left
|
|
47
|
+
* at the JetStream default (5s, which is also TTL/2) puts exactly ONE attempt inside the window and
|
|
48
|
+
* lets that attempt's own deadline consume the entire remainder — so a single slow round trip is
|
|
49
|
+
* terminal, by construction, on a holder that is otherwise healthy. At TTL/4 with a deadline under
|
|
50
|
+
* the period, no single attempt can spend the window and there is room to ask again.
|
|
51
|
+
*
|
|
52
|
+
* HOW MUCH ROOM, EXACTLY, because "N attempts fit" is a claim about the composed path and not about
|
|
53
|
+
* these two numbers. A renew that times out is followed by a re-read with a deadline of its own, and
|
|
54
|
+
* the in-flight guard skips any tick that falls while the pair is running, so the unit to count is
|
|
55
|
+
* the pair and not the tick. On the path this budget exists for — the renew gets no answer and the
|
|
56
|
+
* re-read does — the pair costs about one deadline and three of them complete inside the TTL. Under a
|
|
57
|
+
* TOTAL blackout, where both halves spend their deadline, the pair costs two and exactly ONE completes
|
|
58
|
+
* inside the TTL while the next completes just after it. That second completion is the fail-close
|
|
59
|
+
* decision, and arriving one attempt past the TTL is the intended behaviour rather than a shortfall:
|
|
60
|
+
* the holder stops as soon as it can no longer prove anything, and not before.
|
|
61
|
+
*
|
|
62
|
+
* They are CLIENT-SIDE PACING ONLY. Unlike the TTL, which is written into the bucket at `cotal up`
|
|
63
|
+
* and so has to be reconciled on an existing mesh (see {@link ttlBuckets}), changing these two
|
|
64
|
+
* touches no stored config and needs no migration. */
|
|
65
|
+
export const MANAGER_LEASE_RENEW_MS = MANAGER_LEASE_TTL_MS / 4;
|
|
66
|
+
export const MANAGER_LEASE_ATTEMPT_MS = 2_000;
|
|
43
67
|
/** Bucket-level `max_bytes` cap on the derived membership feed (`cotal_membership_<space>`). The
|
|
44
68
|
* per-agent keying keeps each value tiny (a handful of channel patterns), so 64 MiB bounds the footprint
|
|
45
69
|
* far above any realistic readership while keeping the bucket from growing unbounded. A deliberate cap,
|
|
@@ -135,7 +159,7 @@ export function dmDurableConfig(space, owner, actor, lifecycleUid, opts = {}) {
|
|
|
135
159
|
// lifecycle scoping lives in the consumer: the NAME carries the uid (exact-name deprovision) and
|
|
136
160
|
// delivery starts at the ACTIVATION FRONTIER — the DM stream sequence captured when this lifecycle
|
|
137
161
|
// was provisioned — so a same-alias successor inherits none of the predecessor's pending DMs
|
|
138
|
-
// (SPEC
|
|
162
|
+
// (SPEC §8). `activationFrontier` = that captured `last_seq`; delivery begins at frontier+1.
|
|
139
163
|
// Callers that provision a genuinely fresh lifecycle pass the sequence they captured; 0 = from the
|
|
140
164
|
// stream start (an explicit choice, e.g. a stream created after the lifecycle in tests).
|
|
141
165
|
const frontier = opts.activationFrontier ?? 0;
|
|
@@ -218,6 +242,157 @@ export function fanoutDurableConfig(space, opts = {}) {
|
|
|
218
242
|
}
|
|
219
243
|
/** Connect with the given (privileged) creds, create the space's streams, and disconnect.
|
|
220
244
|
* Used by `cotal up` to pre-create streams once at setup. */
|
|
245
|
+
/** #286: reconcile a TTL'd KV bucket's `max_age` to `ttlMs`. `kvm.create` NEVER updates an existing
|
|
246
|
+
* bucket's config, so a presence/lease bucket created by a cotal that predated the TTL (or created
|
|
247
|
+
* without it) keeps NO expiry forever — dead presence records and stale leases never age out, and a
|
|
248
|
+
* raw-KV reader (a dashboard) shows a crashed agent as live indefinitely. Run at every `cotal up`, this
|
|
249
|
+
* `STREAM.UPDATE`s the backing stream when its `max_age` has drifted. Lowering `max_age` immediately
|
|
250
|
+
* ages out already-expired messages (the intended liveness effect; active leases are younger than their
|
|
251
|
+
* TTL and survive, a stale one dies and its holder self-fences on its next failed renewal). NATS requires
|
|
252
|
+
* `duplicate_window <= max_age`; an old unlimited bucket's 120s window would otherwise reject the update,
|
|
253
|
+
* so the window is lowered in the SAME update. Idempotent (a matching bucket is skipped). The `provisioner`
|
|
254
|
+
* cred holds `STREAM.UPDATE` on exactly these three streams (see provision.ts).
|
|
255
|
+
*
|
|
256
|
+
* WHAT THE READ-BACK PROVES, AND WHAT IT CANNOT. It verifies exactly two things: **`max_age` came back
|
|
257
|
+
* EXACTLY as intended**, and **`duplicate_window` does not violate the NATS constraint** (it is not
|
|
258
|
+
* above `max_age`). A no-op update, a `max_age` that came back other than intended, or a server that
|
|
259
|
+
* answers OK without changing anything is caught here and throws.
|
|
260
|
+
*
|
|
261
|
+
* Note what that does NOT include: the update sends a computed `dupNs`, but the read-back never checks
|
|
262
|
+
* the window came back as sent — omitted, zeroed, or clamped smaller all pass. Deliberate: any window
|
|
263
|
+
* `<= max_age` is legal and harmless for a liveness bucket, and demanding equality would turn a
|
|
264
|
+
* legitimate server-side clamp into a failed `cotal up`. (Confirmed by probe: the real function accepts
|
|
265
|
+
* a read-back with exact `max_age` and the window OMITTED.) It does NOT prove that file-store expiry is
|
|
266
|
+
* in force either, and the distinction is
|
|
267
|
+
* not theoretical — on the supported floor (nats-server 2.12.1) the effect is applied in two places and
|
|
268
|
+
* only one of them is visible to us:
|
|
269
|
+
* - `stream.go` assigns the new in-memory `mset.cfg`, then calls `mset.store.UpdateConfig(cfg)` and
|
|
270
|
+
* IGNORES its returned error;
|
|
271
|
+
* - `filestore.go`'s `UpdateConfig` restores the previous config and returns early when
|
|
272
|
+
* `writeStreamMeta()` fails — BEFORE `expireMsgs()`/age enforcement is ever started;
|
|
273
|
+
* - `STREAM.INFO` is answered from `mset.config()`, i.e. the in-memory copy.
|
|
274
|
+
* So a metadata-write fault (EACCES, ENOSPC) yields UPDATE OK, a read-back showing the intended
|
|
275
|
+
* `max_age`, and a backing store still running unlimited with no expiry timer. **This check cannot see
|
|
276
|
+
* that**, because both fields it reads come from the config that DID get updated.
|
|
277
|
+
*
|
|
278
|
+
* It is NOT, however, invisible everywhere — an earlier version of this comment said no check at this
|
|
279
|
+
* seam could see it, and that was false. `$JS.API.STREAM.SNAPSHOT` splits the useful way: the snapshot
|
|
280
|
+
* INITIATION response copies `mset.config()` and false-greens like INFO, but the STREAMED archive's
|
|
281
|
+
* first `meta.inf` entry marshals `fs.cfg` — the file store's own, rolled-back config. Reproduced live
|
|
282
|
+
* against an EACCES split: INFO and the initiation response both reported the requested TTL while the
|
|
283
|
+
* streamed `meta.inf` reported the old one. So a store-side detector EXISTS in the protocol, and this
|
|
284
|
+
* codebase has `downloadStreamSnapshot` plus a per-stream-scoped snapshot grant MODEL (`backup.ts`).
|
|
285
|
+
*
|
|
286
|
+
* **It is NOT available under current authority, and that — not the cost — is what blocks it.**
|
|
287
|
+
* `assertBackupStream` runs every scope through `canonicalBackupStreamConfig`, which accepts only the
|
|
288
|
+
* durable registries (channel / acl / members) among KV buckets and THROWS for presence, delivery and
|
|
289
|
+
* manager. So wiring this in needs a NEW EXACT SCOPE, or a widening of the reconcile credential to
|
|
290
|
+
* whole-body snapshot authority over liveness data — an unsettled authority question on the credential
|
|
291
|
+
* this change otherwise keeps to three `STREAM.UPDATE` subjects. The cost is real too (it scales with
|
|
292
|
+
* bucket size, and a snapshot carries the bucket's records), but quoting only the cost would read as
|
|
293
|
+
* "available but expensive", which is the wrong summary. See the tracking issue for the full spec.
|
|
294
|
+
*
|
|
295
|
+
* Stated here rather than left implied: this guard is a drift detector, not proof of enforcement — and
|
|
296
|
+
* "cannot be detected here" is the stronger claim it does NOT license.
|
|
297
|
+
*
|
|
298
|
+
* CONSEQUENCE OF READING FIRST, which follows from the same split and is worth naming because the
|
|
299
|
+
* skip is deliberate: once `STREAM.INFO` reports the intended `max_age`, later reconciles see no
|
|
300
|
+
* drift and issue no update, so a bucket left unenforced by a metadata-write fault is not retried
|
|
301
|
+
* for as long as that server process lives.
|
|
302
|
+
*
|
|
303
|
+
* WHERE THAT GOES depends on WHEN the write failed, and an earlier version of this comment got it
|
|
304
|
+
* wrong by generalising from one case. `writeStreamMeta` performs TWO writes — `meta.inf`, then
|
|
305
|
+
* `meta.sum` — and `UpdateConfig` rolls `fs.cfg` back if either fails:
|
|
306
|
+
* - **Failure BEFORE the first write commits** (the original EACCES reproduction): persisted state
|
|
307
|
+
* is coherent and old, so a restart makes `INFO` report the old value again and the next
|
|
308
|
+
* reconcile repairs it. Here the skip DEFERS a repair.
|
|
309
|
+
* - **Failure BETWEEN the two** (reproduced live by pointing `meta.sum.tmp` at `/dev/full`):
|
|
310
|
+
* `meta.inf` commits NEW while `meta.sum` stays OLD — a torn pair. On restart the server logs
|
|
311
|
+
* `checksums do not match` and recovery `continue`s past the stream, so it is SKIPPED: `INFO`
|
|
312
|
+
* returns **stream not found**, and the reconcile cannot repair it because its own first `INFO`
|
|
313
|
+
* gets not-found. **That case does not defer a repair, it loses the stream until an operator
|
|
314
|
+
* intervenes.**
|
|
315
|
+
* So "the persisted metadata is ground truth, restart repairs it" is TRUE ONLY of the
|
|
316
|
+
* before-first-atomic case, and "defers, never loses" is false in general. The read-first skip is
|
|
317
|
+
* still right — it keeps a healthy repeat `cotal up` to reads and no writes — but its worst case is
|
|
318
|
+
* worse than a deferred repair. Both branches reproduced live against 2.12.1 during review; see the
|
|
319
|
+
* tracking issue. */
|
|
320
|
+
export async function reconcileBucketTtl(jsm, streamName, ttlMs) {
|
|
321
|
+
const wantNs = nanos(ttlMs);
|
|
322
|
+
const info = await jsm.streams.info(streamName);
|
|
323
|
+
if (info.config.max_age === wantNs)
|
|
324
|
+
return undefined; // already at the intended TTL — no update
|
|
325
|
+
const fromNs = info.config.max_age;
|
|
326
|
+
const dupNs = Math.min(info.config.duplicate_window ?? wantNs, wantNs); // NATS constraint: duplicate_window <= max_age
|
|
327
|
+
await jsm.streams.update(streamName, { max_age: wantNs, duplicate_window: dupNs });
|
|
328
|
+
const after = await jsm.streams.info(streamName);
|
|
329
|
+
if (after.config.max_age !== wantNs)
|
|
330
|
+
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)`);
|
|
331
|
+
// Both fields are read back, not just the one we came for. On a CONFORMING server this cannot
|
|
332
|
+
// fail: NATS validates the whole StreamConfig (including `duplicate_window <= max_age`) and then
|
|
333
|
+
// applies it as ONE replacement — or one Raft stream assignment in cluster mode — so a partial
|
|
334
|
+
// apply that took `max_age` and dropped the window is not a supported outcome. The check exists
|
|
335
|
+
// because the read-back's whole purpose is to not depend on the server behaving as documented:
|
|
336
|
+
// verifying only the field we set would leave the guarantee resting on the same assumption it was
|
|
337
|
+
// written to remove. (Semantics confirmed at the NATS source rather than reasoned from our seam.)
|
|
338
|
+
if ((after.config.duplicate_window ?? 0) > wantNs)
|
|
339
|
+
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)`);
|
|
340
|
+
return { stream: streamName, fromMs: fromNs / 1e6, toMs: wantNs / 1e6 };
|
|
341
|
+
}
|
|
342
|
+
/** The TTL'd buckets and their intended `max_age`, in ONE place — and the ONLY place any of them is
|
|
343
|
+
* created.
|
|
344
|
+
*
|
|
345
|
+
* Creation is DRIVEN from this list, not merely checked against it. That distinction is the whole
|
|
346
|
+
* point: an earlier version had the reconcile paths read the list while `setupSpaceStreams` still
|
|
347
|
+
* named each `kvm.create(..., { ttl })` separately, and claimed in this comment that a bucket could
|
|
348
|
+
* therefore "never" be TTL'd on one path and forgotten on the other. It could — a fourth bucket
|
|
349
|
+
* added at a create site would have been created with a TTL and never reconciled, which is #286's
|
|
350
|
+
* shape exactly, recreated by the fix for it. (Caught in review; the claim was false when written.)
|
|
351
|
+
* Now a TTL'd bucket cannot be created without appearing here, so it cannot be missed on upgrade.
|
|
352
|
+
*
|
|
353
|
+
* NOT mode-gated: an open mesh carries the same buckets and drifts identically. */
|
|
354
|
+
export function ttlBuckets(space) {
|
|
355
|
+
return [
|
|
356
|
+
// Presence (liveness): dead agents' records must age out, or the roster reports a despawned
|
|
357
|
+
// agent as live. Pre-created so agents, denied KV stream-create, can open it.
|
|
358
|
+
[presenceBucket(space), PRESENCE_TTL_MS],
|
|
359
|
+
// Delivery-daemon single-flight lease + readiness: bucket-level TTL so a crashed holder's lease
|
|
360
|
+
// auto-expires and a fresh daemon can re-acquire. Lease keys only, `delivery`-cred write,
|
|
361
|
+
// world-readable (the non-gating delivery-health surface).
|
|
362
|
+
[deliveryBucket(space), LEASE_TTL_MS],
|
|
363
|
+
// Manager singleton lease, same shape as the delivery lease. Pre-created so the long-lived
|
|
364
|
+
// supervisor can lease-bind OPEN-ONLY (closure (ii), residual 2) — it holds no STREAM.CREATE.
|
|
365
|
+
// Config matches `managerLeaseRegistry()`'s create-first exactly, so that path stays idempotent.
|
|
366
|
+
[managerBucket(space), MANAGER_LEASE_TTL_MS],
|
|
367
|
+
];
|
|
368
|
+
}
|
|
369
|
+
/** #286: reconcile all three TTL'd buckets for a space, over a connection of its own.
|
|
370
|
+
*
|
|
371
|
+
* Exists because `setupSpaceStreams` is only reachable on the CREATE path (`cotal up` starting a
|
|
372
|
+
* mesh), while the drifted-bucket case this fixes is by definition a mesh that is ALREADY RUNNING —
|
|
373
|
+
* an old deployment being upgraded in place. That path starts nothing and so must not run the
|
|
374
|
+
* create-everything routine; it needs exactly the reconcile and nothing else.
|
|
375
|
+
*
|
|
376
|
+
* Read-first by construction: each bucket is skipped when its `max_age` already matches, so a
|
|
377
|
+
* steady-state repeat `cotal up` issues three `STREAM.INFO` reads and ZERO writes. Returns only the
|
|
378
|
+
* buckets it actually changed. `creds` is omitted on an open mesh, exactly as `setupSpaceStreams`
|
|
379
|
+
* documents — the TTL'd buckets are NOT mode-gated, so an open mesh drifts identically. */
|
|
380
|
+
export async function reconcileSpaceTtls(opts) {
|
|
381
|
+
const nc = await connect({ servers: opts.servers, ...standaloneConnectOpts({ creds: opts.creds, tls: false }) });
|
|
382
|
+
try {
|
|
383
|
+
const jsm = await jetstreamManager(nc);
|
|
384
|
+
const changed = [];
|
|
385
|
+
for (const [bucket, ttl] of ttlBuckets(opts.space)) {
|
|
386
|
+
const done = await reconcileBucketTtl(jsm, `KV_${bucket}`, ttl);
|
|
387
|
+
if (done)
|
|
388
|
+
changed.push(done);
|
|
389
|
+
}
|
|
390
|
+
return changed;
|
|
391
|
+
}
|
|
392
|
+
finally {
|
|
393
|
+
await nc.drain();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
221
396
|
/**
|
|
222
397
|
* Create the space's artifact Object Store, or VERIFY an existing one — never silently adopt it.
|
|
223
398
|
*
|
|
@@ -310,11 +485,13 @@ export async function setupSpaceStreams(opts) {
|
|
|
310
485
|
try {
|
|
311
486
|
const jsm = await jetstreamManager(nc);
|
|
312
487
|
await createSpaceStreams(jsm, opts.space);
|
|
313
|
-
//
|
|
314
|
-
//
|
|
315
|
-
//
|
|
488
|
+
// KV buckets are streams too — pre-create them so agents (denied KV stream-create) can open
|
|
489
|
+
// them. Idempotent. The TTL'd ones come from `ttlBuckets` and ONLY from there, so a new one
|
|
490
|
+
// cannot be created on this path without also being reconciled on the upgrade path; the
|
|
491
|
+
// channel/members/acl registries below are durable config and carry no TTL.
|
|
316
492
|
const kvm = new Kvm(nc);
|
|
317
|
-
|
|
493
|
+
for (const [bucket, ttl] of ttlBuckets(opts.space))
|
|
494
|
+
await kvm.create(bucket, { ttl });
|
|
318
495
|
await jsm.streams.add(canonicalBackupStreamConfig(opts.space, `KV_${channelBucket(opts.space)}`));
|
|
319
496
|
// Durable-membership registry (Plane-3): privileged-write, no TTL (durable config, like the
|
|
320
497
|
// channel registry). Pre-created so the delivery daemon (and open-mode self) can OPEN it; agents
|
|
@@ -328,21 +505,19 @@ export async function setupSpaceStreams(opts) {
|
|
|
328
505
|
// (only the latest record per agent matters) + a `max_bytes` cap (footprint bound). Pre-created so the
|
|
329
506
|
// scoped writer holds no STREAM.CREATE. Idempotent.
|
|
330
507
|
await kvm.create(membershipBucket(opts.space), { history: 1, max_bytes: MEMBERSHIP_MAX_BYTES });
|
|
331
|
-
// Delivery-daemon single-flight lease + readiness bucket: bucket-level TTL (`max_age`) so a crashed
|
|
332
|
-
// holder's lease auto-expires and a fresh daemon can re-acquire. Holds ONLY lease keys, writable
|
|
333
|
-
// only by the `delivery` cred, world-readable (the non-gating delivery-health surface). Idempotent.
|
|
334
|
-
await kvm.create(deliveryBucket(opts.space), { ttl: LEASE_TTL_MS });
|
|
335
|
-
// Manager singleton-lease bucket (bucket-level TTL, like the delivery lease). PRE-CREATED here so the
|
|
336
|
-
// long-lived supervisor can lease-bind OPEN-ONLY (closure (ii), residual 2) — it holds no STREAM.CREATE.
|
|
337
|
-
// Config matches `managerLeaseRegistry()`'s create-first exactly, so that path stays idempotent until
|
|
338
|
-
// the supervisor profile drops bucket-create. Idempotent.
|
|
339
|
-
await kvm.create(managerBucket(opts.space), { ttl: MANAGER_LEASE_TTL_MS });
|
|
340
508
|
// The two §13.12 AUTHORITY stores (records + auth): every auth-mode mesh now carries a
|
|
341
509
|
// lifecycle registry — user mode's service re-ensures at its own boot, the STATIC manager's
|
|
342
510
|
// start reconcile re-ensures for pre-existing spaces (Unit B) — and the up-time seed creates
|
|
343
511
|
// them so neither daemon needs first-write stream creation. Create-or-verify, idempotent,
|
|
344
512
|
// drift fails loud.
|
|
345
513
|
await ensureAuthorityStores(jsm, kvm, opts.space);
|
|
514
|
+
// #286: `kvm.create` above is a no-op on an ALREADY-EXISTING bucket, so a bucket from a cotal that
|
|
515
|
+
// predated these TTLs keeps its old (often unlimited) `max_age` and never expires dead presence /
|
|
516
|
+
// stale leases. Reconcile the three TTL'd buckets' `max_age` here (STREAM.UPDATE), idempotently.
|
|
517
|
+
// Same list as `reconcileSpaceTtls`, from one source: two copies would let a fourth TTL'd bucket
|
|
518
|
+
// be added to the create path and silently miss the upgrade path, which is this defect exactly.
|
|
519
|
+
for (const [bucket, ttl] of ttlBuckets(opts.space))
|
|
520
|
+
await reconcileBucketTtl(jsm, `KV_${bucket}`, ttl);
|
|
346
521
|
// Artifact Object Store (SPEC section 5): the bytes an `artifact` reference part points at.
|
|
347
522
|
// Create-or-VERIFY, drift fails loud - see ensureArtifactStore for why create alone is not enough.
|
|
348
523
|
await ensureArtifactStore(nc, opts.space);
|
package/dist/streams.js.map
CHANGED
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AAC;QACH,MAAM,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,uFAAuF;QACvF,gGAAgG;QAChG,kGAAkG;QAClG,gGAAgG;QAChG,IAAK,CAAuB,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,8BAA8B,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC;YAAE,MAAM,CAAC,CAAC;IACnH,CAAC;AACH,CAAC"}
|
package/dist/subjects.d.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
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
7
|
* cotal.<space>.ctl.<service> control request/reply to a SERVER-SIDE service — the delivery
|
|
8
|
-
* daemon's delivery/delivery-admin
|
|
9
|
-
* The manager's ctl tiers were deleted in 1d
|
|
10
|
-
*
|
|
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.
|
|
11
12
|
* cotal.<space>.trace.<instance> ambient lifecycle trace (later)
|
|
12
13
|
*
|
|
13
14
|
* Presence lives in a JetStream KV bucket, not a subject (see presenceBucket()).
|
|
@@ -237,6 +238,48 @@ export declare function patternCovers(cap: string, pattern: string): boolean;
|
|
|
237
238
|
* is conservative — it can refuse a technically-covered pattern, never admit an uncovered one —
|
|
238
239
|
* and keeps the refusal explainable ("name the entry that covers it, or widen the grant"). */
|
|
239
240
|
export declare function patternInAllow(allow: string[], pattern: string): boolean;
|
|
241
|
+
/** A WITNESS subject that `pattern` matches and that `channelFor` would really build — or `undefined`
|
|
242
|
+
* when no such subject exists, i.e. the grant is mute against every principal-keyed channel.
|
|
243
|
+
*
|
|
244
|
+
* Witness-based ON PURPOSE. The decision could be made by inspecting tokens, but then this function
|
|
245
|
+
* would hold a SECOND copy of the channel's shape and could drift from the builder silently — the
|
|
246
|
+
* drift being, once again, invisible. Instead the candidate is handed to `channelFor` (which
|
|
247
|
+
* validates its own tokens and THROWS on an impossible one, e.g. a literal carrying the `-` that
|
|
248
|
+
* owner/actor tokens ban) and the verdict is delegated to {@link subjectMatches}, the shipped
|
|
249
|
+
* matcher the broker's rule is expressed in. The prefix and arity are read off a probe built by
|
|
250
|
+
* `channelFor` itself, so nothing here names a particular namespace.
|
|
251
|
+
*
|
|
252
|
+
* Returning the witness rather than a boolean is what makes the refusal explainable: a caller can
|
|
253
|
+
* show an operator a subject their grant WOULD have covered, or state that none exists.
|
|
254
|
+
*
|
|
255
|
+
* DEEPER-THAN-PRINCIPAL PATTERNS YIELD NO WITNESS. A grant naming more tokens than the principal key
|
|
256
|
+
* (a per-session sub-channel, say) matches no principal-keyed channel, so it is reported mute here
|
|
257
|
+
* like any other. That is the conservative reading and it is deliberate: such a grant is minted by
|
|
258
|
+
* whatever change starts emitting on those subjects, in that same change. */
|
|
259
|
+
export declare function principalChannelWitness(pattern: string, channelFor: (principal: {
|
|
260
|
+
owner: string;
|
|
261
|
+
actor: string;
|
|
262
|
+
}) => string): string | undefined;
|
|
263
|
+
/** Refuse, by name, any `patterns` entry that sits in `channelFor`'s namespace but can never match a
|
|
264
|
+
* principal-keyed channel in it. Entries OUTSIDE that namespace are not this function's business and
|
|
265
|
+
* pass untouched — `chat.>` is not a broken event grant, it is a different grant.
|
|
266
|
+
*
|
|
267
|
+
* Namespace membership is tested LITERALLY (the entry spells the prefix out) rather than by match,
|
|
268
|
+
* so a deliberately broad grant like `*.>` is left alone: it genuinely covers, and refusing it would
|
|
269
|
+
* turn a guard against mute streams into a guard against working ones.
|
|
270
|
+
*
|
|
271
|
+
* Throws rather than filtering. A filtered grant list would launch, and the operator would learn
|
|
272
|
+
* they had asked for something impossible only from the absence of data.
|
|
273
|
+
*
|
|
274
|
+
* THE REFUSAL WITNESSES, IT DOES NOT MERELY REFUSE. "invalid grant" would absorb the fact and emit
|
|
275
|
+
* only a verdict, leaving the operator to re-derive what this function already knew. So the message
|
|
276
|
+
* reports WHAT WAS SEEN — the grant as written, the arity it actually addresses, and the arity the
|
|
277
|
+
* keying requires — and only then what to write instead. The difference is an operator fixing it in
|
|
278
|
+
* ten seconds versus filing a bug against this guard. */
|
|
279
|
+
export declare function assertPrincipalChannelGrants(patterns: readonly string[] | undefined, channelFor: (principal: {
|
|
280
|
+
owner: string;
|
|
281
|
+
actor: string;
|
|
282
|
+
}) => string, context: string): void;
|
|
240
283
|
/** Drop exact duplicates and any subject subsumed by a more-general one — JetStream
|
|
241
284
|
* rejects a consumer whose `filter_subjects` overlap, so `[team.>, team.backend]`
|
|
242
285
|
* must collapse to `[team.>]` before binding the chat consumer. A parent and its subtree
|
|
@@ -259,8 +302,9 @@ export declare function anycastSubject(space: string, service: string, owner: st
|
|
|
259
302
|
* sender principal (the sender slot widened from one token to two, so the tail is `.>`). */
|
|
260
303
|
export declare function anycastServeFilter(space: string, service: string): string;
|
|
261
304
|
/** Control request/reply to a service — since 1d ONLY the delivery daemon (`ctl.delivery` /
|
|
262
|
-
* `ctl.delivery-admin`)
|
|
263
|
-
*
|
|
305
|
+
* `ctl.delivery-admin`); the manager's own control moved to its v0.4 `service` endpoint on the
|
|
306
|
+
* `ep.*` rails, and the auth plane's rail followed it there (#350).
|
|
307
|
+
* `ctl.<service>.<owner>.<actor>` — tagged with the
|
|
264
308
|
* caller principal; anycast via queue group. Identity slots accept `*` (serve side: `ctl.<svc>.*.*`). */
|
|
265
309
|
export declare function controlServiceSubject(space: string, service: string, owner: string, actor: string): string;
|
|
266
310
|
/** The delivery service — a control service served by the server-side **delivery daemon** (NOT the
|
|
@@ -279,16 +323,6 @@ export declare const CONTROL_DELIVERY: "delivery";
|
|
|
279
323
|
* cred is default-denied — nats-server is the boundary);
|
|
280
324
|
* the `delivery` cred holds the serve + bounded-reply side. */
|
|
281
325
|
export declare const CONTROL_DELIVERY_ADMIN: "delivery-admin";
|
|
282
|
-
/** The AUTH service's control rail (#29 piece 3; SPEC 13.2 reserved): lifecycle-authority ops the
|
|
283
|
-
* AUTH plane serves — the D5 split's other half (retirement is the auth plane's operation; it
|
|
284
|
-
* never rides the DELIVERY daemon's rail). The surface is GENERIC — "retire a lifecycle
|
|
285
|
-
* (owner, actor, lifecycleUid)" — never caller-specific: the manager's despawn is ONE caller,
|
|
286
|
-
* and the serve-time authz (the space-manager-lease holder check, leader-read fresh per
|
|
287
|
-
* request) is the auth service's, not the subject grammar's. Caller attribution is
|
|
288
|
-
* SUBJECT-derived (`ctl.auth-admin.<owner>.<actor>`, broker-ACL-enforced): only a credential
|
|
289
|
-
* minted with that principal's request-publish grant reaches it, and replies are bound under
|
|
290
|
-
* the sender's own `<request>.reply.>` subtree. */
|
|
291
|
-
export declare const CONTROL_AUTH_ADMIN: "auth-admin";
|
|
292
326
|
export declare function traceSubject(space: string, agentId: string): string;
|
|
293
327
|
/** Wildcard matching every subject within a space. */
|
|
294
328
|
export declare function spaceWildcard(space: string): string;
|
package/dist/subjects.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subjects.d.ts","sourceRoot":"","sources":["../src/subjects.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"subjects.d.ts","sourceRoot":"","sources":["../src/subjects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,gEAAgE;AAChE,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvC;AAED,eAAO,MAAM,IAAI,UAAU,CAAC;AAE5B,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;gFAEgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,SA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