@rotorsoft/act 1.33.14 → 1.33.16

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.
@@ -34,23 +34,9 @@ export type CloseCycleDeps = {
34
34
  * it, tests set a small value to exercise the multi-page path.
35
35
  */
36
36
  readonly probe_page_size?: number;
37
- /**
38
- * Advance correlation to at least `until` (an event id) and return how
39
- * far it actually got.
40
- *
41
- * The safety probe can only judge events correlate has resolved (an
42
- * uncorrelated event has raised no mark and may not even have created its
43
- * subscription yet). An autoclose fires from its own, often uncorrelated,
44
- * trigger, so the cycle correlates the tail first; anything still above
45
- * the cursor is held back as pending.
46
- */
37
+ /** See {@link catch_up_correlation}. */
47
38
  readonly catch_up_correlation: (until: number) => Promise<number>;
48
- /**
49
- * Per-stream critical section, so two closers of one stream (a manual
50
- * close has no drain lease to exclude an autoclose) never archive the same
51
- * prefix, and a second full closer never mistakes the first one's
52
- * tombstone for an interrupted close. Identity when run in isolation.
53
- */
39
+ /** See {@link CloseLock}; identity when run in isolation. */
54
40
  readonly with_stream_lock?: <T>(stream: string, work: () => Promise<T>) => Promise<T>;
55
41
  /**
56
42
  * Drop retired streams from correlate's in-process "already subscribed"
@@ -64,7 +50,9 @@ export type CloseCycleDeps = {
64
50
  /**
65
51
  * Advance correlation until the read cursor reaches `until`, and report
66
52
  * where it landed. The safety probe cannot judge a subscription's pending
67
- * work over events correlate has not resolved yet.
53
+ * work over events correlate has not resolved yet, and an autoclose often
54
+ * fires from an uncorrelated trigger; anything still above the cursor is
55
+ * held back as pending.
68
56
  *
69
57
  * Stops as soon as a pass makes no progress (the log has no more to give),
70
58
  * and after {@link CLOSE_CATCH_UP_PASSES} windows.
@@ -75,8 +63,10 @@ export declare function catch_up_correlation(cursor: {
75
63
  }, correlate: (limit: number) => Promise<unknown>, until: number): Promise<number>;
76
64
  /**
77
65
  * Per-stream serialization for close critical sections: two closers of the
78
- * same stream never prune or archive concurrently, while different streams
79
- * proceed in parallel. One instance per Act.
66
+ * same stream never prune or archive concurrently (a manual close has no
67
+ * drain lease to exclude an autoclose), and a second full closer never
68
+ * mistakes the first one's tombstone for an interrupted close. Different
69
+ * streams proceed in parallel. One instance per Act.
80
70
  */
81
71
  export declare class CloseLock {
82
72
  private readonly _tails;
@@ -1 +1 @@
1
- {"version":3,"file":"close-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/close-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,MAAM,EAEN,KAAK,EACN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC;;;;;;;;;OASG;IACH,QAAQ,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KACnB,OAAO,CAAC,CAAC,C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BAAsB,eAAe,CACnC,OAAO,EAAE,WAAW,EAAE,EACtB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,WAAW,CAAC,CA+BtB"}
@@ -1,13 +1,6 @@
1
1
  /**
2
- * Correlation-id generator and the default implementation.
3
- *
4
- * The default produces a readable, time-monotonic-within-window, lowercase
5
- * id like `coun-incr-lwxk9p3a` — short enough to scan in logs, structured
6
- * enough to identify the originating state/action, and well-distributed
7
- * enough that competing-consumer workers don't collide.
8
- *
9
- * Apps override via {@link ActOptions.correlator} to plug in any scheme
10
- * (tenant-prefixed, trace-id-propagated, DB-sequence-backed, etc.).
2
+ * The default correlation-id generator. Apps plug in their own scheme
3
+ * through {@link ActOptions.correlator}.
11
4
  */
12
5
  import type { Actor, Correlator } from "../types/index.js";
13
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"correlation-id.d.ts","sourceRoot":"","sources":["../../../src/internal/correlation-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAMhC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GACX,MAAM,CAOR"}
1
+ {"version":3,"file":"correlation-id.d.ts","sourceRoot":"","sources":["../../../src/internal/correlation-id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,EAAE,UAMhC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GACX,MAAM,CAOR"}
@@ -1,21 +1,11 @@
1
1
  /**
2
2
  * Turning stored text back into `Date`s, driven by the declared schema.
3
3
  *
4
- * JSON has no date type, so a `Date` is stored as its ISO form and something
5
- * has to revive it on the way out. Which fields those are is a property of the
6
- * Zod schema, so working it out is a Zod concern rather than an event one —
7
- * this module knows nothing about events, states or PII. It takes a declared
8
- * schema and returns the schema that revives its dates, or `undefined` when
9
- * there are none to revive.
10
- *
11
- * Sits beside the other schema utilities rather than inside the event builder,
12
- * which composes it: `event_tags` asks for one reviver for an event's `data`
13
- * and another for the sensitive fields held in its `pii` sidecar. One function
14
- * is the whole interface — how a Zod schema is taken apart stays in here.
15
- *
16
- * The shape-based {@link dateReviver} in `utils.ts` is the predecessor this
17
- * replaced — it revived anything ISO-8601-looking, including fields declared
18
- * `z.string()`.
4
+ * JSON has no date type, so a `Date` is stored as its ISO form. Which fields
5
+ * to revive is a property of the Zod schema, so this module takes a schema
6
+ * and returns one that revives its dates (or `undefined` when there are
7
+ * none); it knows nothing about events. A field declared `z.string()` stays
8
+ * a string even when it looks like an ISO date.
19
9
  */
20
10
  import { z } from "zod";
21
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"date-reviver.d.ts","sourceRoot":"","sources":["../../../src/internal/date-reviver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6CxB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,GAAG,SAAS,CAwD1E"}
1
+ {"version":3,"file":"date-reviver.d.ts","sourceRoot":"","sources":["../../../src/internal/date-reviver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6CxB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,GAAG,SAAS,CAwD1E"}
@@ -12,9 +12,9 @@
12
12
  * same due-time, which is what makes a defer correct across restarts and
13
13
  * competing workers.
14
14
  *
15
- * Validation follows the config-schema standard (CLAUDE.md): an internal
16
- * `*OptionsSchema` const, a public inferred type, and a resolver. Slice 2
17
- * ships `after` / `at`; recurrence (`every`) extends this in Slice 3.
15
+ * Validation follows the config-schema standard
16
+ * (`.claude/rules/config-validation.md`): an internal `*OptionsSchema`
17
+ * const, a public inferred type, and a resolver.
18
18
  */
19
19
  import type { Committed, DeferWhen, Schemas } from "../types/index.js";
20
20
  /**
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Tiny bounded LRU map / set built on insertion-ordered `Map`. Used to cap
3
- * memory in long-running orchestrators that mint large numbers of keys —
4
- * notably:
2
+ * Tiny bounded LRU map built on insertion-ordered `Map`. Caps memory in
3
+ * long-running orchestrators that mint large numbers of keys:
5
4
  *
6
5
  * - {@link InMemoryCache}: stream → state checkpoint
7
- * - `Act._subscribed_streams`: stream → presence (LruSet)
6
+ * - correlate's dynamic subscriptions (stream → priority and lane) and its
7
+ * compiled source patterns
8
8
  *
9
9
  * Apps with millions of dynamic streams (one target per aggregate) can't
10
- * afford an unbounded `Set<string>` — eviction is required.
10
+ * afford an unbounded map: eviction is required.
11
11
  */
12
12
  /**
13
13
  * Bounded LRU map. `get()` promotes; `has()` does not. `set()` always
@@ -24,18 +24,4 @@ export declare class LruMap<K, V> {
24
24
  clear(): void;
25
25
  get size(): number;
26
26
  }
27
- /**
28
- * Bounded LRU set built on top of {@link LruMap}. `has()` does not promote;
29
- * `add()` does (re-inserting if already present, evicting the oldest at
30
- * capacity).
31
- */
32
- export declare class LruSet<T> {
33
- private readonly _map;
34
- constructor(maxSize: number);
35
- has(value: T): boolean;
36
- add(value: T): void;
37
- delete(value: T): boolean;
38
- clear(): void;
39
- get size(): number;
40
- }
41
27
  //# sourceMappingURL=lru-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lru-map.d.ts","sourceRoot":"","sources":["../../../src/internal/lru-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,qBAAa,MAAM,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAOzB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEnB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAS1B;IAED,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEtB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;;GAIG;AACH,qBAAa,MAAM,CAAC,CAAC;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IAEvC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAErB;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAElB;IAED,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAExB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
1
+ {"version":3,"file":"lru-map.d.ts","sourceRoot":"","sources":["../../../src/internal/lru-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,qBAAa,MAAM,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAOzB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEnB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAS1B;IAED,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEtB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
@@ -6,13 +6,9 @@
6
6
  import type { Actor, Committed, Schemas } from "../types/index.js";
7
7
  /**
8
8
  * Split an emitted event's `data` into `data` (non-sensitive) + `pii`
9
- * (sensitive) using the field list precomputed at build time. Used by the
10
- * State's `_pii_split` decorator just before `Store.commit`.
11
- *
12
- * Single forward pass over `Object.keys(validated)` — same shape as the
13
- * spread-and-delete-free implementation in slice 3, just hoisted out of the
14
- * orchestrator hot path so it's only invoked when the State actually has a
15
- * sensitive event.
9
+ * (sensitive) using the field list precomputed at build time. Called by the
10
+ * state's `message` hook (`event-builder.ts`) on the way to `Store.commit`,
11
+ * and only for events that declare sensitive fields.
16
12
  */
17
13
  export declare function pii_split<TName, TData extends Record<string, unknown>>(emitted: {
18
14
  name: TName;
@@ -23,39 +19,18 @@ export declare function pii_split<TName, TData extends Record<string, unknown>>(
23
19
  pii: Record<string, unknown>;
24
20
  };
25
21
  /**
26
- * A prebuilt per-event read gate: given a committed event and the reading
27
- * actor, return the caller-visible form. This is the single gating primitive
28
- * the builder prebuilds for **every** read surface — both the actor-less
29
- * `query` / `query_array` (which pass no actor → default-deny) and the
30
- * actor-aware `load` / `do`-return view (which pass the reader). Non-sensitive
31
- * events use the shared {@link IDENTITY_GATE}; sensitive events use a redactor
32
- * built by {@link make_gate} that closes over the field list and the state's
33
- * disclosure predicate, so the read path never recomputes the sensitive-field
34
- * lookup nor allocates per event.
35
- *
36
- * The `actor` is optional so the actor-less surfaces can call `gate(event)`.
22
+ * A prebuilt per-event read gate: the event as the reading actor may see
23
+ * it. The builder prebuilds one per event for every read surface; the
24
+ * actor-less `query` / `query_array` pass no actor (default-deny), `load`
25
+ * and `do`'s reply pass the reader.
37
26
  */
38
27
  export type EventGate = <TEvents extends Schemas, TKey extends keyof TEvents>(event: Committed<TEvents, TKey>, actor?: Actor) => Committed<TEvents, TKey>;
39
- /**
40
- * Shared zero-cost gate for every event with no `sensitive(...)` fields — a
41
- * single frozen reference the builder hands back for non-sensitive events, so
42
- * the common path is one `Map` miss and an identity call, no allocation. This
43
- * is the "by default, return the event" half of the prebuilt per-event gate.
44
- */
28
+ /** The gate for every event with no sensitive fields: no allocation. */
45
29
  export declare const IDENTITY_GATE: EventGate;
46
30
  /**
47
- * Prebuild a read gate for a sensitive event, capturing its field list and the
48
- * disclosure predicate once at build time. The returned closure defers to
49
- * {@link pii_gate} with the reading actor supplied per call:
50
- *
51
- * - `predicate = null` (the actor-less `query` surfaces, or a state that never
52
- * declared `.discloses`) → default-deny: declared fields come back
53
- * {@link REDACTED} (or {@link SHREDDED} once the pii column is forgotten).
54
- * - `predicate` set + an authorized actor → plaintext merged into `data`.
55
- *
56
- * Either way the isolated `pii` sidecar is dropped. The builder stores one gate
57
- * per sensitive event (per state for the load path; predicate-less for the
58
- * query path); non-sensitive events fall back to {@link IDENTITY_GATE}.
31
+ * Prebuild a sensitive event's read gate: its field list and disclosure
32
+ * predicate are captured once, and {@link pii_gate} applies them per read
33
+ * (`predicate = null` is the default-deny of the actor-less surfaces).
59
34
  */
60
35
  export declare function make_gate(fields: readonly string[], predicate: ((event: any, actor: Actor) => boolean) | null): EventGate;
61
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pii.d.ts","sourceRoot":"","sources":["../../../src/internal/pii.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;;;;;;;GASG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 * One-shot reporting for a misdeclaration a build-time guard can't see: a
3
+ * `.to(fn)` target, lane or priority is only known once an event arrives,
4
+ * so correlate and drain apply those rules and report what breaks them.
5
+ * A resolver fires for every matching event, so reporting once per
6
+ * declaration is what keeps the log readable.
4
7
  *
5
- * The guards in `build_events` and `classify` can only inspect a static
6
- * `.to({...})` — a `.to(fn)` target, lane and priority are a function until an
7
- * event arrives. The pipelines that resolve them (correlate for lane and
8
- * target, drain for the payload) are therefore where the same rules have to be
9
- * applied, and where the operator has to be told.
8
+ * The key is the whole design: build it only from what the declaration
9
+ * names (handler, event, lane, a static target), never from a value a
10
+ * resolver computed. A resolved target is the trap: the per-aggregate shape
11
+ * `.to(e => ({ target: e.stream }))` would turn one typo into one line per
12
+ * aggregate. Runtime values still belong in the message, as the example.
10
13
  *
11
- * Reporting there has one hazard the build-time guards don't: a resolver fires
12
- * for *every* matching event, so a naive log turns one bad declaration into a
13
- * line per event on a busy stream. Reporting once per offending declaration is
14
- * what makes the message readable.
15
- *
16
- * Which makes the key the whole design. It may only be built from things the
17
- * *declaration* names — handler names, event names, lane names, a statically
18
- * declared target — and never from a value a resolver computed at runtime.
19
- * A resolved target is the trap: the documented per-aggregate shape is
20
- * `.to(e => ({target: e.stream}))`, so a target-keyed report dedups nothing
21
- * across aggregates and one typo scales into one line per aggregate — the
22
- * unbounded volume this module exists to prevent. Runtime values
23
- * still belong in the *message*, as the concrete example that turns "a
24
- * reaction misdeclared its lane" into something an operator can go look at.
25
- *
26
- * Never throws. A throw inside correlate pins the checkpoint for the whole app;
27
- * inside drain it reaches the circuit breaker as a store failure and
28
- * stalls every stream.
14
+ * Never throws: a throw in correlate pins the checkpoint for the whole app,
15
+ * and in drain it reaches the breaker as a store failure.
29
16
  */
30
17
  /**
31
- * Report `message` the first time `key` is seen, and never again.
32
- *
33
- * `seen` belongs to the calling pipeline and is passed in, so a resolver
34
- * firing for every matching event still reports once without this module
35
- * remembering anything between calls — `internal/` holds no module state.
36
- *
37
- * @param seen - The caller's set of already-reported keys. Mutated.
38
- * @param key - Identifies the offending declaration, not the occurrence —
39
- * declared identifiers only, never a runtime-resolved target.
40
- * @param message - Wrapped in an `Error` so the logger renders a stack.
18
+ * Report `message` the first time `key` is seen. `seen` belongs to the
19
+ * caller, since `internal/` holds no module state.
41
20
  */
42
21
  export declare function report_once(seen: Set<string>, key: string, message: string): void;
43
22
  //# sourceMappingURL=report-once.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-once.d.ts","sourceRoot":"","sources":["../../../src/internal/report-once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
1
+ {"version":3,"file":"report-once.d.ts","sourceRoot":"","sources":["../../../src/internal/report-once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH;;;GAGG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
@@ -16,17 +16,11 @@ import type { CorrelatePass } from "./correlate-cycle.js";
16
16
  * independently testable.
17
17
  */
18
18
  export type SettleDeps<TEvents extends Schemas> = {
19
- /** Scans from its own checkpoint; `read` is true when it read events. */
19
+ /** Scans from correlation's own checkpoint. */
20
20
  readonly correlate: (query: Query) => Promise<CorrelatePass>;
21
21
  readonly drain: (options: DrainOptions) => Promise<Drain<TEvents>>;
22
22
  readonly on_settled: (drain: Drain<TEvents>) => void;
23
- /**
24
- * Shared orchestrator circuit breaker. The settle loop's
25
- * `correlate` (subscribe + query) is a store consumer too: a successful
26
- * pass records `passed()`, a failed one `failed(now, err)` — feeding the
27
- * same breaker that paces the drain loop, which also surfaces the failure
28
- * to the `error` lifecycle event.
29
- */
23
+ /** The shared breaker: settle records correlate's store outcome on it. */
30
24
  readonly breaker: CircuitBreaker;
31
25
  };
32
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"settle.d.ts","sourceRoot":"","sources":["../../../src/internal/settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,KAAK,EACL,OAAO,EACP,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,OAAO,IAAI;IAChD,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,qBAAa,UAAU,CAAC,OAAO,SAAS,OAAO;IAC7C,OAAO,CAAC,MAAM,CAAwD;IACtE;;;OAGG;IACH,OAAO,CAAC,SAAS,CAA4B;IAC7C,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAS;IACzB,wDAAwD;IACxD,OAAO,CAAC,KAAK,CAAwC;IACrD,gDAAgD;IAChD,OAAO,CAAC,IAAI,CAAK;IACjB,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CA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IACtE;;;OAGG;IACH,OAAO,CAAC,SAAS,CAA4B;IAC7C,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAS;IACzB,wDAAwD;IACxD,OAAO,CAAC,KAAK,CAAwC;IACrD,gDAAgD;IAChD,OAAO,CAAC,IAAI,CAAK;IACjB,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;IAC5C,+FAA+F;IAC/F,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAE9C,YAAY,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,mBAAmB,EAAE,MAAM,EAGjE;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAsEtC;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAExC;IAED;;;OAGG;IACH,IAAI,CAAC,KAAK,UAAQ,GAAG,IAAI,CAUxB;CACF"}
@@ -4,9 +4,8 @@
4
4
  * Trace decorators wrap a bare implementation with `logger.trace(...)` calls
5
5
  * at well-defined moments — entry points for {@link "event-sourcing"} (`load`,
6
6
  * `snap`, `action`) and exit points for the {@link "drain"} pipeline (`claim`,
7
- * `fetch`, `ack`, `block`, `subscribe`). `action` carries both an entry log
8
- * and a post-commit log to preserve the diagnostic value of the historical
9
- * mid-function trace points.
7
+ * `fetch`, `ack`, `block`, `subscribe`). `action` logs both on entry and
8
+ * after its commit.
10
9
  *
11
10
  * Output styles:
12
11
  * - **Pretty mode** (`config().env !== "production"`) — event-sourcing logs
@@ -1 +1 @@
1
- {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../src/internal/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAEV,UAAU,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACR,MAAM,mBAAmB,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