@rotorsoft/act 1.33.18 → 1.33.19

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/index.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  sleep,
41
41
  store,
42
42
  validate
43
- } from "./chunk-3OTABSIB.js";
43
+ } from "./chunk-5Z53Y7SG.js";
44
44
  import {
45
45
  ActorSchema,
46
46
  CausationEventSchema,
@@ -70,7 +70,7 @@ import {
70
70
  pii_fields,
71
71
  pii_schemas,
72
72
  sensitive
73
- } from "./chunk-SD7SW47Z.js";
73
+ } from "./chunk-HEHGZHHA.js";
74
74
 
75
75
  // src/signals.ts
76
76
  process.once("SIGINT", async (arg) => {
@@ -1177,7 +1177,7 @@ var CorrelateCycle = class {
1177
1177
  _restoring = false;
1178
1178
  _init_promise;
1179
1179
  // Bounded by `maxSubscribedStreams`; static records live apart so eviction
1180
- // never drops their +Infinity floor.
1180
+ // never lets a resolution re-lane them.
1181
1181
  _dynamic_subscriptions;
1182
1182
  _static_subscriptions = /* @__PURE__ */ new Map();
1183
1183
  _patterns = new LruMap(PATTERN_CACHE_SIZE);
@@ -1226,7 +1226,6 @@ var CorrelateCycle = class {
1226
1226
  this._checkpoint = correlated_at >= 0 ? correlated_at : Math.max(-1, watermark - COLD_START_BACK_SCAN);
1227
1227
  for (const { stream, priority = 0, lane } of this._static_targets) {
1228
1228
  this._static_subscriptions.set(stream, {
1229
- floor: Number.POSITIVE_INFINITY,
1230
1229
  priority,
1231
1230
  lane
1232
1231
  });
@@ -1330,9 +1329,10 @@ var CorrelateCycle = class {
1330
1329
  );
1331
1330
  lane = void 0;
1332
1331
  }
1333
- const recorded = this._static_subscriptions.get(resolved.target) ?? this._dynamic_subscriptions.get(resolved.target);
1332
+ const fixed = this._static_subscriptions.get(resolved.target);
1333
+ const recorded = fixed ?? this._dynamic_subscriptions.get(resolved.target);
1334
1334
  const priority = resolved.priority ?? 0;
1335
- const upgraded = !recorded || priority > recorded.floor;
1335
+ const upgraded = !recorded || !fixed && priority > recorded.priority;
1336
1336
  const carried = upgraded ? { priority, lane } : { priority: recorded.priority, lane: recorded.lane };
1337
1337
  const entry = correlated.get(resolved.target) || {
1338
1338
  source: resolved.source,
@@ -1402,7 +1402,6 @@ var CorrelateCycle = class {
1402
1402
  for (const { stream, priority, lane } of streams) {
1403
1403
  if (correlated.get(stream)?.upgraded)
1404
1404
  this._dynamic_subscriptions.set(stream, {
1405
- floor: priority,
1406
1405
  priority,
1407
1406
  lane
1408
1407
  });
@@ -1431,7 +1430,6 @@ var CorrelateCycle = class {
1431
1430
  );
1432
1431
  if (!row) return;
1433
1432
  this._dynamic_subscriptions.set(stream, {
1434
- floor: row.priority,
1435
1433
  priority: row.priority,
1436
1434
  lane: row.lane
1437
1435
  });
@@ -2857,8 +2855,8 @@ var SettleLoop = class {
2857
2855
  * queues one more pass after it. Callers pass options, which the next
2858
2856
  * pass uses; internal wake-ups pass none, so they never discard a
2859
2857
  * caller's. The cycle runs correlate→drain in a
2860
- * loop until no progress is made (no new subscriptions, no events read,
2861
- * no streams leased) or `maxPasses` is reached, then emits the
2858
+ * loop until a pass makes no progress (it read no events and leased no
2859
+ * streams) or `maxPasses` is reached, then emits the
2862
2860
  * `"settled"` lifecycle event via {@link SettleDeps.on_settled}.
2863
2861
  */
2864
2862
  schedule(options) {
@@ -3737,8 +3735,8 @@ var Act = class {
3737
3735
  * `__snapshot__` events (counted in the result); `on_progress`
3738
3736
  * fires once per event.
3739
3737
  * @param sink - Where the events land. Defaults to this Act's store.
3740
- * @returns {@link ScanResult} with `kept`, `duration_ms`, and
3741
- * `dropped` per-category counters.
3738
+ * @returns The {@link ScanResult}: what was kept, migrated and dropped,
3739
+ * and how long it took.
3742
3740
  *
3743
3741
  * @example Restore a CSV backup into the connected store
3744
3742
  * ```typescript
@@ -3909,7 +3907,7 @@ var Act = class {
3909
3907
  * sets `autoSettle: false`. Call it at startup, to run what was pending
3910
3908
  * before a restart, or with options for the next pass; the scheduling
3911
3909
  * rule is in the event-sourcing docs (§ settle). Runs correlate→drain in a loop until a pass makes no
3912
- * progress — no new subscriptions, no events read, no streams leased —
3910
+ * progress — it read no events and leased no streams —
3913
3911
  * then emits the `"settled"` lifecycle event, so one call fully catches
3914
3912
  * up paginated streams without forcing callers to loop.
3915
3913
  *