@cotal-ai/core 0.51.0 → 0.52.1

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.
@@ -2,7 +2,7 @@ import { EventEmitter } from "node:events";
2
2
  import { connect } from "@nats-io/transport-node";
3
3
  import { type SecretStoreIdentity } from "./secret-store.js";
4
4
  import type { EpVerbTarget, EpAttributedReply } from "./endpoint-verbs.js";
5
- import type { AgentCard, ChannelConfig, ControlReply, ControlRequest, ControlRequestInit, EndpointRef, Part, Presence, PresenceStatus, PresenceCondition, AttentionMode, ChannelMode, CotalMessage, DeliveryClass, MembershipSnapshot } from "./types.js";
5
+ import type { AgentCard, ChannelConfig, ControlReply, ControlRequest, ControlRequestInit, EndpointRef, Part, Presence, PresenceStatus, PresenceCondition, AttentionMode, ChannelMode, CotalMessage, HistoryMessage, DeliveryClass, MembershipSnapshot } from "./types.js";
6
6
  import { type DeliveryLeaseInfo, type ManagerLeaseInfo } from "./lease.js";
7
7
  export declare const DEFAULT_SERVER = "nats://127.0.0.1:4222";
8
8
  /** Space joined when none is given on the CLI (the `cotal-<space>` cmux tab, etc.). */
@@ -217,6 +217,10 @@ export declare class CotalEndpoint extends EventEmitter {
217
217
  * `DrainingConnectionError` out of `reset()` on a timer nothing awaits. */
218
218
  private presenceWatchIter?;
219
219
  private channelWatchIter?;
220
+ /** The daemon's lease-loss watch (#1596): the INTENT that survives a connection rebuild, plus the
221
+ * live iterator. See {@link watchDeliveryLease}. */
222
+ private leaseWatchIntent?;
223
+ private leaseWatchIter?;
220
224
  /** Plane-3 durable-membership registry KV — lazily opened by the privileged delivery daemon (or a
221
225
  * short-lived provisioner). */
222
226
  private membersKv?;
@@ -297,6 +301,14 @@ export declare class CotalEndpoint extends EventEmitter {
297
301
  private presenceWriteFailingSince?;
298
302
  /** #1356: the broker's last refusal message, kept alongside the start time for diagnosis. */
299
303
  private lastPresenceWriteError?;
304
+ /** #1461: monotonic per-put generation on the presence path, so a settle can tell whether it is
305
+ * the latest evidence on its epoch. {@link publishPresence} snapshots it at put start and every
306
+ * settle records its generation here: a settle is the latest evidence only while no put that
307
+ * started after it has already settled. */
308
+ private presencePutGeneration;
309
+ /** #1461: the generation of the newest presence put that has SETTLED (succeeded or rejected),
310
+ * or `undefined` when none ever has. A put that is merely in flight is not evidence yet. */
311
+ private presencePutSettled?;
300
312
  private readonly roster;
301
313
  /** Resolves when the current presence watch has consumed its complete initial KV snapshot. */
302
314
  private presenceSnapshot;
@@ -983,11 +995,14 @@ export declare class CotalEndpoint extends EventEmitter {
983
995
  /** Rebind every live membership-watch intent after a connection rebuild. */
984
996
  private rearmMembershipWatches;
985
997
  /** Fetch recent messages from a channel's JetStream backlog. `signal` cancels the active pull and
986
- * reclaims its ephemeral consumer before the promise rejects. */
998
+ * reclaims its ephemeral consumer before the promise rejects. Returns `HistoryMessage[]`
999
+ * (#1413): every field present on a row was checked by the drain before the row was
1000
+ * returned — a stored row missing `ts` / `space` / `parts` / `from.name` is dropped, never
1001
+ * returned with that member silently `undefined`. */
987
1002
  channelHistory(channel: string, opts?: {
988
1003
  limit?: number;
989
1004
  signal?: AbortSignal;
990
- }): Promise<CotalMessage[]>;
1005
+ }): Promise<HistoryMessage[]>;
991
1006
  /**
992
1007
  * The newest `limit` chat messages across MANY channels at once, oldest-first within the page,
993
1008
  * each tagged with the channel the BROKER delivered it on.
@@ -1030,7 +1045,7 @@ export declare class CotalEndpoint extends EventEmitter {
1030
1045
  batch?: number;
1031
1046
  }): Promise<{
1032
1047
  channel: string;
1033
- msg: CotalMessage;
1048
+ msg: HistoryMessage;
1034
1049
  }[]>;
1035
1050
  /** Read a channel's recent history THROUGH THE DELIVERY DAEMON instead of through a consumer this
1036
1051
  * connection creates itself — the mediated read of SPEC's "Mediated reads (normative)" rule (no raw
@@ -1065,11 +1080,14 @@ export declare class CotalEndpoint extends EventEmitter {
1065
1080
  /** Fetch recent DMs (any sender→any recipient) from the space's DM backlog. `signal` cancels the
1066
1081
  * active pull and reclaims its ephemeral consumer. God-view only:
1067
1082
  * a normal agent/observer's ACL denies CONSUMER.CREATE on DM_<space>, so this throws-and-
1068
- * skips for them — only an `admin`-profile cred can read it. */
1083
+ * skips for them — only an `admin`-profile cred can read it. Returns `HistoryMessage[]`
1084
+ * (#1413): every field present on a row was checked by the drain before the row was
1085
+ * returned — a stored row missing `ts` / `space` / `parts` / `from.name` is dropped, never
1086
+ * returned with that member silently `undefined`. */
1069
1087
  dmHistory(opts?: {
1070
1088
  limit?: number;
1071
1089
  signal?: AbortSignal;
1072
- }): Promise<CotalMessage[]>;
1090
+ }): Promise<HistoryMessage[]>;
1073
1091
  /**
1074
1092
  * The `limit` MOST RECENT messages matching `subject`, oldest-first within the page.
1075
1093
  *
@@ -1263,6 +1281,26 @@ export declare class CotalEndpoint extends EventEmitter {
1263
1281
  * READ-ONLY surface — drives Component 6's `cotal_channels` delivery-health field (an agent reads it
1264
1282
  * under its own cred, which holds lease-bucket read but no write). */
1265
1283
  readDeliveryLease(shardIndex: number): Promise<DeliveryLeaseInfo | undefined>;
1284
+ /** Watch THIS shard's lease key and nothing else, for the daemon's loss trigger (#1596).
1285
+ *
1286
+ * A KV watch is the native JetStream push for "the row changed hands NOW": a filtered ordered
1287
+ * consumer on the lease bucket delivers the row's own writes the moment the broker applies them,
1288
+ * instead of the daemon waiting for its next renew tick to notice. The watch is a TRIGGER, never a
1289
+ * decision: every event is handed to `onEvent` with the row as the broker now states it (PUT) or
1290
+ * the fact it is gone (DEL/PURGE, `info` undefined), and the caller re-runs the SAME decision tree
1291
+ * its renew tick would (`leaseAction`, `mayServeOn`, `readOwnLease`-style ownership tests). An
1292
+ * event the daemon itself caused (its acquire, its renew, its ready flip) is an ordinary input to
1293
+ * that tree — the row still reads `held` by this endpoint — so it never quiesces on its own write;
1294
+ * no event filtering happens here.
1295
+ *
1296
+ * Like the presence watch, this survives a connection rebuild as INTENT: the iterator dies with
1297
+ * its connection and {@link connectAndBind} rebinds it onto the fresh one, so a reconnect can
1298
+ * never leave the daemon blind to the row for the rest of its life. The rebind replays the
1299
+ * bucket's current last-per-subject state, so a change that landed during the null window is
1300
+ * delivered on the fresh watch. Resolves a stop handle. */
1301
+ watchDeliveryLease(shardIndex: number, onEvent: (info: DeliveryLeaseInfo | undefined) => void): Promise<() => void>;
1302
+ private stopDeliveryLeaseWatch;
1303
+ private bindDeliveryLeaseWatch;
1266
1304
  /** The lease row AND the KV revision it is at. The revision is the CAS token every renew and the
1267
1305
  * CAS release are argued against, so a caller re-establishing ownership after a failed renew
1268
1306
  * needs the BROKER's sequence, not the one it last cached: a renew can fail with its write
@@ -1692,8 +1730,9 @@ export declare class CotalEndpoint extends EventEmitter {
1692
1730
  * endpoint's own `connectionIssue` already said "connection refused". */
1693
1731
  private clearPresenceWriteFailure;
1694
1732
  /** #1356: the presence bucket has been refusing writes since this time, or `undefined` when the
1695
- * last publish succeeded. Cleared by the first successful write, so a survived blip reads as
1696
- * healthy and only a SUSTAINED failure carries a duration.
1733
+ * last publish succeeded. Cleared by a successful write that is the latest evidence on its
1734
+ * epoch (#1461), so a survived blip reads as healthy and only a SUSTAINED failure carries a
1735
+ * duration.
1697
1736
  *
1698
1737
  * Presence writes are the CANARY, not the scope: the broker can disable JetStream account-wide
1699
1738
  * while the NATS connection stays up, so a caller must not read this as "only presence is
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../src/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EACL,OAAO,EAYR,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAsB3E,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EAEb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAElB,WAAW,EAEX,IAA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,GAAG,MAAM,CAE7D;AAED;;;;;kGAKkG;AAClG,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,OAAO,CAMzD;AA6FD;;;;;;;0GAO0G;AAC1G,wBAAsB,WAAW,CAC/B,OAAO,GAAE,MAAuB,EAChC,IAAI,GAAE,QAAQ,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,OAAO,CAAC,OAAO,CAAC,CAyClB;AAED;;;;;;;kFAOkF;AAClF,MAAM,MAAM,WAAW,GACnB;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GACZ;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,CAAA;CAAE,GACtC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAEzC;;;;oDAIoD;AACpD,wBAAsB,YAAY,CAChC,MAAM,GAAE,MAAuB,EAC/B,IAAI,GAAE,QAAQ,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,OAAO,CAAC,WAAW,CAAC,CAyBtB"}
package/dist/endpoint.js CHANGED
@@ -141,6 +141,10 @@ export class CotalEndpoint extends EventEmitter {
141
141
  * `DrainingConnectionError` out of `reset()` on a timer nothing awaits. */
142
142
  presenceWatchIter;
143
143
  channelWatchIter;
144
+ /** The daemon's lease-loss watch (#1596): the INTENT that survives a connection rebuild, plus the
145
+ * live iterator. See {@link watchDeliveryLease}. */
146
+ leaseWatchIntent;
147
+ leaseWatchIter;
144
148
  /** Plane-3 durable-membership registry KV — lazily opened by the privileged delivery daemon (or a
145
149
  * short-lived provisioner). */
146
150
  membersKv;
@@ -221,6 +225,14 @@ export class CotalEndpoint extends EventEmitter {
221
225
  presenceWriteFailingSince;
222
226
  /** #1356: the broker's last refusal message, kept alongside the start time for diagnosis. */
223
227
  lastPresenceWriteError;
228
+ /** #1461: monotonic per-put generation on the presence path, so a settle can tell whether it is
229
+ * the latest evidence on its epoch. {@link publishPresence} snapshots it at put start and every
230
+ * settle records its generation here: a settle is the latest evidence only while no put that
231
+ * started after it has already settled. */
232
+ presencePutGeneration = 0;
233
+ /** #1461: the generation of the newest presence put that has SETTLED (succeeded or rejected),
234
+ * or `undefined` when none ever has. A put that is merely in flight is not evidence yet. */
235
+ presencePutSettled;
224
236
  roster = new Map();
225
237
  /** Resolves when the current presence watch has consumed its complete initial KV snapshot. */
226
238
  presenceSnapshot = Promise.resolve();
@@ -983,6 +995,12 @@ export class CotalEndpoint extends EventEmitter {
983
995
  if (watchChannels)
984
996
  await this.startChannelWatch();
985
997
  }
998
+ // Rebind the daemon's lease-loss watch onto the fresh connection (#1596). The intent survived
999
+ // clearConnectionScoped; a bind that completes after a stop or another rebuild found no intent
1000
+ // and released itself. The replay re-delivers the row's current state, so a change that landed
1001
+ // in the null window still reaches the trigger.
1002
+ if (this.leaseWatchIntent)
1003
+ await this.bindDeliveryLeaseWatch();
986
1004
  // FAIL BEFORE PRESENCE (SPEC 13.1): an AUTHED endpoint that will register on the roster or
987
1005
  // bind lifecycle-keyed consumers must hold its launcher-supplied lifecycle uid BEFORE anything
988
1006
  // makes it visible - a missing uid must never leave a roster ghost that could not bind (false
@@ -1107,6 +1125,7 @@ export class CotalEndpoint extends EventEmitter {
1107
1125
  /* already closed with the connection */
1108
1126
  }
1109
1127
  this.channelWatchIter = undefined;
1128
+ this.stopDeliveryLeaseWatch();
1110
1129
  for (const sub of this.chatSubs.values()) {
1111
1130
  try {
1112
1131
  sub.unsubscribe();
@@ -1483,6 +1502,7 @@ export class CotalEndpoint extends EventEmitter {
1483
1502
  /* already closed */
1484
1503
  }
1485
1504
  this.channelWatchIter = undefined;
1505
+ this.stopDeliveryLeaseWatch();
1486
1506
  try {
1487
1507
  if (this.doRegister) {
1488
1508
  this.status = "offline";
@@ -1687,6 +1707,7 @@ export class CotalEndpoint extends EventEmitter {
1687
1707
  if (!Array.isArray(opts.parts) || opts.parts.length === 0)
1688
1708
  throw new Error("multicastExpecting requires at least one part");
1689
1709
  const message = this.casEnvelope(opts);
1710
+ assertPartsSerializable(message.parts);
1690
1711
  // Publish DIRECTLY rather than through publishMsg: this path must set the expectation and read
1691
1712
  // the ack, and publishMsg deliberately does neither.
1692
1713
  const ack = await this.js.publish(chatSubject(this.space, this.owner, this.actor, opts.channel), JSON.stringify(message), { msgID: opts.id, expect: { lastSubjectSequence: expected } });
@@ -2529,7 +2550,10 @@ export class CotalEndpoint extends EventEmitter {
2529
2550
  }));
2530
2551
  }
2531
2552
  /** Fetch recent messages from a channel's JetStream backlog. `signal` cancels the active pull and
2532
- * reclaims its ephemeral consumer before the promise rejects. */
2553
+ * reclaims its ephemeral consumer before the promise rejects. Returns `HistoryMessage[]`
2554
+ * (#1413): every field present on a row was checked by the drain before the row was
2555
+ * returned — a stored row missing `ts` / `space` / `parts` / `from.name` is dropped, never
2556
+ * returned with that member silently `undefined`. */
2533
2557
  async channelHistory(channel, opts) {
2534
2558
  // history from any sender
2535
2559
  return (await this.streamHistory(chatStream(this.space), [chatSubject(this.space, "*", "*", channel)], opts?.limit ?? 100, undefined, opts?.signal)).map((r) => r.msg);
@@ -2676,7 +2700,10 @@ export class CotalEndpoint extends EventEmitter {
2676
2700
  /** Fetch recent DMs (any sender→any recipient) from the space's DM backlog. `signal` cancels the
2677
2701
  * active pull and reclaims its ephemeral consumer. God-view only:
2678
2702
  * a normal agent/observer's ACL denies CONSUMER.CREATE on DM_<space>, so this throws-and-
2679
- * skips for them — only an `admin`-profile cred can read it. */
2703
+ * skips for them — only an `admin`-profile cred can read it. Returns `HistoryMessage[]`
2704
+ * (#1413): every field present on a row was checked by the drain before the row was
2705
+ * returned — a stored row missing `ts` / `space` / `parts` / `from.name` is dropped, never
2706
+ * returned with that member silently `undefined`. */
2680
2707
  async dmHistory(opts) {
2681
2708
  // every inst.<recipOwner>.<recipActor>.<sndOwner>.<sndActor> DM — the whole DM subtree (god-view)
2682
2709
  return (await this.streamHistory(dmStream(this.space), [`${spacePrefix(this.space)}.inst.>`], opts?.limit ?? 100, undefined, opts?.signal)).map((r) => r.msg);
@@ -3054,6 +3081,7 @@ export class CotalEndpoint extends EventEmitter {
3054
3081
  async publishMsg(subject, msg) {
3055
3082
  if (!this.js)
3056
3083
  throw new Error(this.notLiveMsg());
3084
+ assertPartsSerializable(msg.parts);
3057
3085
  // msgID = message id → free server-side dedup across JetStream redelivery.
3058
3086
  await this.js.publish(subject, JSON.stringify(msg), { msgID: msg.id });
3059
3087
  }
@@ -3305,6 +3333,68 @@ export class CotalEndpoint extends EventEmitter {
3305
3333
  async readDeliveryLease(shardIndex) {
3306
3334
  return (await this.readDeliveryLeaseEntry(shardIndex))?.info;
3307
3335
  }
3336
+ /** Watch THIS shard's lease key and nothing else, for the daemon's loss trigger (#1596).
3337
+ *
3338
+ * A KV watch is the native JetStream push for "the row changed hands NOW": a filtered ordered
3339
+ * consumer on the lease bucket delivers the row's own writes the moment the broker applies them,
3340
+ * instead of the daemon waiting for its next renew tick to notice. The watch is a TRIGGER, never a
3341
+ * decision: every event is handed to `onEvent` with the row as the broker now states it (PUT) or
3342
+ * the fact it is gone (DEL/PURGE, `info` undefined), and the caller re-runs the SAME decision tree
3343
+ * its renew tick would (`leaseAction`, `mayServeOn`, `readOwnLease`-style ownership tests). An
3344
+ * event the daemon itself caused (its acquire, its renew, its ready flip) is an ordinary input to
3345
+ * that tree — the row still reads `held` by this endpoint — so it never quiesces on its own write;
3346
+ * no event filtering happens here.
3347
+ *
3348
+ * Like the presence watch, this survives a connection rebuild as INTENT: the iterator dies with
3349
+ * its connection and {@link connectAndBind} rebinds it onto the fresh one, so a reconnect can
3350
+ * never leave the daemon blind to the row for the rest of its life. The rebind replays the
3351
+ * bucket's current last-per-subject state, so a change that landed during the null window is
3352
+ * delivered on the fresh watch. Resolves a stop handle. */
3353
+ async watchDeliveryLease(shardIndex, onEvent) {
3354
+ this.leaseWatchIntent = { shardIndex, onEvent };
3355
+ await this.bindDeliveryLeaseWatch();
3356
+ return () => {
3357
+ if (this.leaseWatchIntent?.onEvent !== onEvent)
3358
+ return; // a later watch owns the slot
3359
+ this.leaseWatchIntent = undefined;
3360
+ this.stopDeliveryLeaseWatch();
3361
+ };
3362
+ }
3363
+ stopDeliveryLeaseWatch() {
3364
+ try {
3365
+ this.leaseWatchIter?.stop();
3366
+ }
3367
+ catch { /* already closed with its connection */ }
3368
+ this.leaseWatchIter = undefined;
3369
+ }
3370
+ async bindDeliveryLeaseWatch() {
3371
+ const intent = this.leaseWatchIntent;
3372
+ const iter = await (await this.deliveryRegistry()).watch({ key: leaseKey(intent.shardIndex) });
3373
+ if (this.leaseWatchIntent !== intent) {
3374
+ try {
3375
+ iter.stop();
3376
+ }
3377
+ catch { /* already closed */ }
3378
+ return;
3379
+ }
3380
+ this.leaseWatchIter = iter;
3381
+ void (async () => {
3382
+ for await (const e of iter) {
3383
+ if (this.leaseWatchIter !== iter)
3384
+ break;
3385
+ if (e.operation === "DEL" || e.operation === "PURGE") {
3386
+ intent.onEvent(undefined);
3387
+ continue;
3388
+ }
3389
+ try {
3390
+ intent.onEvent(e.json());
3391
+ }
3392
+ catch {
3393
+ intent.onEvent(undefined);
3394
+ }
3395
+ }
3396
+ })().catch((e) => this.emit("error", e));
3397
+ }
3308
3398
  /** The lease row AND the KV revision it is at. The revision is the CAS token every renew and the
3309
3399
  * CAS release are argued against, so a caller re-establishing ownership after a failed renew
3310
3400
  * needs the BROKER's sequence, not the one it last cached: a renew can fail with its write
@@ -5189,6 +5279,11 @@ export class CotalEndpoint extends EventEmitter {
5189
5279
  // refusal on the connection that just published successfully.
5190
5280
  const epoch = this.presenceEpoch;
5191
5281
  const conditionRevision = this.conditionRevision;
5282
+ // #1461: snapshot the put's generation BEFORE the put. A settle (success or rejection) is the
5283
+ // latest evidence on its epoch only while no put that started after it has ALREADY settled —
5284
+ // a newer put merely in flight is not evidence yet. Same-epoch puts overlap routinely
5285
+ // (heartbeat 2s against a ~5s JetStream put timeout), so "succeeded" alone is not "newest".
5286
+ const generation = ++this.presencePutGeneration;
5192
5287
  try {
5193
5288
  await this.kv.put(this.card.id, JSON.stringify(record));
5194
5289
  }
@@ -5198,20 +5293,31 @@ export class CotalEndpoint extends EventEmitter {
5198
5293
  // nothing else here notices. Record WHEN the refusals started, at the one site that knows the
5199
5294
  // failing write was a presence write; a caller cannot infer that from the generic `warning`
5200
5295
  // stream, which carries any recoverable error.
5201
- if (epoch === this.presenceEpoch && !this.stopped) {
5296
+ //
5297
+ // #1461: a rejection speaks when it is the newest SETTLED evidence — a newer put that has
5298
+ // merely started does not silence it, but a newer put that already settled (either way)
5299
+ // does.
5300
+ const superseded = (this.presencePutSettled ?? 0) > generation;
5301
+ this.presencePutSettled = Math.max(this.presencePutSettled ?? 0, generation);
5302
+ if (epoch === this.presenceEpoch && !this.stopped && !superseded) {
5202
5303
  this.presenceWriteFailingSince ??= Date.now();
5203
5304
  this.lastPresenceWriteError = e?.message ?? String(e);
5204
5305
  }
5205
5306
  throw e;
5206
5307
  }
5207
- // A late SUCCESS is the same hazard mirrored, and this fence answers only the cross-epoch half
5208
- // of it: a success belonging to a retired epoch cannot erase a refusal the current one
5209
- // established from its own evidence. It does NOT order puts within a single epoch, because it
5210
- // compares epoch identity rather than which put is the latest evidence, so an earlier put that
5211
- // succeeds late still clears a later put's refusal. Heartbeats run at 2s against a ~5s put
5212
- // timeout, so that overlap is routine rather than a corner, and the next failing put re-plants
5213
- // the record with a fresh `since`. Tracked in #1461, not repaired here.
5214
- if (epoch !== this.presenceEpoch || this.stopped)
5308
+ // A late SUCCESS cannot erase a refusal from newer evidence. Two fences, each answering half:
5309
+ // the epoch fence (#1356) keeps a put that outlives its connection from writing or erasing a
5310
+ // record that belongs to a later connection; the generation fence (#1461) orders puts WITHIN
5311
+ // one epoch by SETTLE order, not start order: a settle is the latest evidence only while no
5312
+ // put that started after it has already settled, whichever way that newer put settled. So an
5313
+ // earlier put settling AFTER a later put settled no longer speaks — success cannot clear a
5314
+ // newer refusal (#1461's original case), and a newer settle is not blocked by being merely
5315
+ // started (panel round 1). Without the fence, an earlier put succeeding late cleared a later
5316
+ // put's refusal while the bucket still refused writes (heartbeat 2s against a ~5s put timeout,
5317
+ // so the overlap is routine rather than a corner).
5318
+ const superseded = (this.presencePutSettled ?? 0) > generation;
5319
+ this.presencePutSettled = Math.max(this.presencePutSettled ?? 0, generation);
5320
+ if (epoch !== this.presenceEpoch || this.stopped || superseded)
5215
5321
  return;
5216
5322
  // Presence writes may overlap. If this put carried an older condition, repair the KV with the
5217
5323
  // latest local state before returning so a late failure publish cannot resurrect after a new
@@ -5236,8 +5342,9 @@ export class CotalEndpoint extends EventEmitter {
5236
5342
  this.lastPresenceWriteError = undefined;
5237
5343
  }
5238
5344
  /** #1356: the presence bucket has been refusing writes since this time, or `undefined` when the
5239
- * last publish succeeded. Cleared by the first successful write, so a survived blip reads as
5240
- * healthy and only a SUSTAINED failure carries a duration.
5345
+ * last publish succeeded. Cleared by a successful write that is the latest evidence on its
5346
+ * epoch (#1461), so a survived blip reads as healthy and only a SUSTAINED failure carries a
5347
+ * duration.
5241
5348
  *
5242
5349
  * Presence writes are the CANARY, not the scope: the broker can disable JetStream account-wide
5243
5350
  * while the NATS connection stays up, so a caller must not read this as "only presence is
@@ -5629,7 +5736,8 @@ function kindFromParsed(kind) {
5629
5736
  * unparseable subject, or `from.id !== parsed.sender` (SPEC §5). This derives the remaining
5630
5737
  * routing tokens from the subject for rows that survived — it does not rewrite a mismatched
5631
5738
  * `from.id`. Live tails, channel backfill, and channel recall skip the mismatch; history
5632
- * does the same (#388). */
5739
+ * does the same (#388). The row's other fields pass through UNTOUCHED, so what the caller's
5740
+ * row type already verified stays verified (#1413). */
5633
5741
  function authenticatedMessage(msg, parsed) {
5634
5742
  if (parsed.kind === "chat")
5635
5743
  return authenticatedChannelMessage(msg, parsed.rest);
@@ -5664,6 +5772,8 @@ function historyMessageFromDelivery(m) {
5664
5772
  }
5665
5773
  if (!isHistoryDrainEnvelope(raw))
5666
5774
  return undefined;
5775
+ if (!isVerifiedHistoryRow(raw))
5776
+ return undefined;
5667
5777
  const parsed = parseSubject(m.subject);
5668
5778
  if (!parsed || !isPrincipalOwnerToken(parsed.owner))
5669
5779
  return undefined;
@@ -5671,17 +5781,59 @@ function historyMessageFromDelivery(m) {
5671
5781
  return undefined;
5672
5782
  return authenticatedMessage(raw, parsed);
5673
5783
  }
5784
+ /** The members `HistoryMessage` promises beyond the drain envelope (#1413): a full
5785
+ * `EndpointRef` (`from.name`, and `from.role` only when a string), a finite `ts`, a string
5786
+ * `space`, `parts` the drain could read, and the optional members in their promised shape
5787
+ * when present. Every field the PUBLIC row type promises is checked here, before the row is
5788
+ * returned. A row missing one is dropped, never returned with that member silently
5789
+ * `undefined` under the full type — a consumer reading `msg.ts`, `msg.space`, `msg.parts`
5790
+ * or `msg.from.name` must not be able to reach one that was never there. Nothing is invented
5791
+ * for an absent field.
5792
+ *
5793
+ * `parts` is held to READABLE, not to `isMessagePart`: every member must be an object with a
5794
+ * string `kind` (so `partsToText` can read `part.kind` without throwing), but a keyless
5795
+ * `{kind:"data"}` row from a pre-#1404 producer is not dropped — history must surface it.
5796
+ * `mentions`, `replyTo`, and `contextId` keep exactly their `CotalMessage` shapes when
5797
+ * present: an array of strings, a string, a string. */
5798
+ function isVerifiedHistoryRow(row) {
5799
+ if (typeof row.from.name !== "string")
5800
+ return false;
5801
+ if (row.from.role !== undefined && typeof row.from.role !== "string")
5802
+ return false;
5803
+ if (typeof row.ts !== "number" || !Number.isFinite(row.ts))
5804
+ return false;
5805
+ if (typeof row.space !== "string")
5806
+ return false;
5807
+ if (!Array.isArray(row.parts) || !row.parts.every(isReadableMessagePart))
5808
+ return false;
5809
+ if (row.mentions !== undefined &&
5810
+ (!Array.isArray(row.mentions) || !row.mentions.every((name) => typeof name === "string")))
5811
+ return false;
5812
+ if (row.replyTo !== undefined && typeof row.replyTo !== "string")
5813
+ return false;
5814
+ if (row.contextId !== undefined && typeof row.contextId !== "string")
5815
+ return false;
5816
+ return true;
5817
+ }
5818
+ /** A part `partsToText` can read without throwing: an object with a string `kind` (#1413).
5819
+ * Deliberately weaker than `isMessagePart` — a keyless `{kind:"data"}` part passes here —
5820
+ * because history must surface rows a pre-#1404 producer wrote, not drop them. */
5821
+ function isReadableMessagePart(value) {
5822
+ return isRecord(value) && typeof value.kind === "string";
5823
+ }
5674
5824
  /**
5675
5825
  * Narrow enough for the type checker and for fail-closed history: object envelope, usable `id`,
5676
5826
  * object `from`. That is what lets `from.id !== parsed.sender` run without throwing, and what
5677
5827
  * lets `authenticatedMessage` take the row without a cast.
5678
5828
  *
5679
5829
  * Does NOT verify SPEC §5 message shape. It does not require a string `from.id` (the SPEC §5
5680
- * comparison still rejects a mismatch), exactly one route key, a finite `ts`, a string
5681
- * `space`, a full EndpointRef `from` (`name`/`role`), or well-formed `parts`. Those belong
5682
- * to `isCotalMessage` (Plane-3). History must not use that guard: a public
5683
- * `unicast(..., { parts: [{ kind: "data", data: undefined }] })` serializes to `{kind:"data"}`
5684
- * and must still surface.
5830
+ * comparison still rejects a mismatch) or exactly one route key. The members the PUBLIC
5831
+ * history row promises beyond this envelope — a full EndpointRef `from` (`name`/`role`), a
5832
+ * finite `ts`, a string `space` — are checked by {@link isVerifiedHistoryRow} before the row
5833
+ * is returned (#1413). Well-formed `parts` still belong to `isCotalMessage` (Plane-3), and
5834
+ * history must not use that guard: a publisher now REFUSES a `data` part carrying a non-JSON
5835
+ * value, but a keyless `{kind:"data"}` row from a pre-fix producer can still sit in a stream,
5836
+ * and history must surface it rather than drop it.
5685
5837
  */
5686
5838
  function isHistoryDrainEnvelope(value) {
5687
5839
  return isRecord(value) && isUsableMessageId(value.id) && isRecord(value.from);
@@ -5739,6 +5891,85 @@ function isMessagePart(value) {
5739
5891
  function isRecord(value) {
5740
5892
  return !!value && typeof value === "object" && !Array.isArray(value);
5741
5893
  }
5894
+ /** A `data` part value the wire can carry faithfully: a JSON value at EVERY depth (SPEC §5's
5895
+ * `<any JSON value>`). `JSON.stringify` does not reject what it cannot represent — it silently
5896
+ * rewrites: `undefined` (and a function-valued member) drops the key, `NaN`/`Infinity` store as
5897
+ * `null`, a `Date` stores as a string, a sparse array's holes store as `null`, a `Map` stores as
5898
+ * `{}`, a `Buffer` stores as `{"type":"Buffer",...}`. A reader then cannot tell a stored `null`
5899
+ * from a real one (#1404 fix round). So the producer checks structurally, matching the exported
5900
+ * `JsonValue`: null, boolean, finite number, string, an array whose every slot (holes included)
5901
+ * passes, or a plain object (prototype `null` or `Object.prototype`) whose every defined member
5902
+ * passes. A cycle is refused here too, never left for stringify's TypeError.
5903
+ *
5904
+ * THE OBJECT/ARRAY ASYMMETRY ON `undefined`: an `undefined`-valued MEMBER of a plain object is
5905
+ * allowed — stringify drops just that key, which is faithful (and the exported type says so) —
5906
+ * while `undefined` at the top level or in an ARRAY SLOT is refused, because there stringify
5907
+ * cannot drop a position: it stores `null`, which is a rewrite a reader cannot distinguish from
5908
+ * a real `null`.
5909
+ *
5910
+ * `seen` is the set of ANCESTORS on the current path, not every object visited: it is deleted
5911
+ * from on the way out, so a SHARED subtree (`{a: x, b: x}`) passes — stringify carries it twice,
5912
+ * which is faithful — while an object that contains itself at any depth still reports its path. */
5913
+ function jsonPathProblem(path, value, seen) {
5914
+ if (value === null)
5915
+ return undefined;
5916
+ const t = typeof value;
5917
+ if (t === "boolean" || t === "string")
5918
+ return undefined;
5919
+ if (t === "number")
5920
+ return Number.isFinite(value) ? undefined : `${path} is not a finite number`;
5921
+ if (t === "undefined" || t === "function" || t === "symbol" || t === "bigint")
5922
+ return `${path} is not a JSON value`;
5923
+ if (typeof value === "object") {
5924
+ if (seen.has(value))
5925
+ return `${path} is cyclic`;
5926
+ seen.add(value);
5927
+ let problem;
5928
+ if (Array.isArray(value)) {
5929
+ for (let i = 0; i < value.length; i++) {
5930
+ problem = jsonPathProblem(`${path}[${i}]`, value[i], seen);
5931
+ if (problem)
5932
+ return problem;
5933
+ }
5934
+ }
5935
+ else {
5936
+ const proto = Object.getPrototypeOf(value);
5937
+ if (proto !== null && proto !== Object.prototype) {
5938
+ seen.delete(value);
5939
+ return `${path} is not a plain object`;
5940
+ }
5941
+ for (const key of Object.keys(value)) {
5942
+ // A member whose value is undefined is the allowed key-drop, not a defect: stringify omits
5943
+ // the key, the object stays a JSON object, so skip it rather than walk it.
5944
+ if (value[key] === undefined)
5945
+ continue;
5946
+ problem = jsonPathProblem(`${path}.${key}`, value[key], seen);
5947
+ if (problem)
5948
+ return problem;
5949
+ }
5950
+ }
5951
+ seen.delete(value);
5952
+ return undefined;
5953
+ }
5954
+ return `${path} is not a JSON value`;
5955
+ }
5956
+ /** Refuse, at publish, a `data` part `JSON.stringify` would silently rewrite. The guard is the
5957
+ * runtime half of `Part`'s `data: JsonValue` arm: with it, a non-JSON value at any depth never
5958
+ * reaches the wire, so every reader (live core-sub, Plane-3 durable, history) gives one answer —
5959
+ * the message was never sent — instead of the old split where history returned a rewritten row
5960
+ * while Plane-3 terminated a keyless one as malformed. The error names the path to the offending
5961
+ * value (e.g. `data[2].at`), so a caller learns which member to fix rather than that stringify
5962
+ * would have mangled something. Throws rather than coercing: no fallback. */
5963
+ function assertPartsSerializable(parts) {
5964
+ for (const p of parts) {
5965
+ if (p.kind !== "data")
5966
+ continue;
5967
+ const problem = jsonPathProblem("data", p.data, new Set());
5968
+ if (problem !== undefined) {
5969
+ throw new Error(`cannot publish a data part carrying a non-JSON value (SPEC §5) - ${problem}`);
5970
+ }
5971
+ }
5972
+ }
5742
5973
  /** Shallow-equal two per-channel-mode maps (presence dedup): a change must re-emit, so an attention
5743
5974
  * toggle isn't swallowed as a quiet heartbeat. Absent and empty compare equal. */
5744
5975
  function sameChannelModes(a, b) {