/** * @module tracing * @category Internal * * Centralized observability for the framework's internal pipelines. * * Trace decorators wrap a bare implementation with `logger.trace(...)` calls * at well-defined moments — entry points for {@link "event-sourcing"} (`load`, * `snap`, `action`) and exit points for the {@link "drain"} pipeline (`claim`, * `fetch`, `ack`, `block`, `subscribe`). `action` carries both an entry log * and a post-commit log to preserve the diagnostic value of the historical * mid-function trace points. * * Output styles: * - **Pretty mode** (`config().env !== "production"`) — event-sourcing logs * show only the colored target body (color carries the operation/phase), * drain logs keep a colored caption. * - **Plain mode** (production / log aggregators) — every log gets a textual * prefix; event-sourcing uses `caption: body`, drain uses `caption body`. * * The two factories — {@link build_es} and {@link build_drain} — let the * orchestrator choose bare or traced variants once at `.build()` time based * on the configured log level. Outside this module, no other source file * imports tracing primitives. * * @internal */ import type { Correlator, Logger, Schemas } from "../types/index.js"; import type { DrainOps } from "./drain.js"; import type { EsOps, PatchFn } from "./event-sourcing.js"; /** * Selects bare or traced event-sourcing handlers. Called once by the * orchestrator constructor. * * @internal */ export declare function build_es(logger: Logger, correlator?: Correlator, patch_fn?: PatchFn): EsOps; /** * Selects bare or traced drain-pipeline ops. Called once by the orchestrator * constructor. * * @internal */ export declare function build_drain(logger: Logger): DrainOps; /** * Emit one cycle-level drain trace summarizing what happened in a * single `run_drain_cycle` pass. Per-stream rendering shape — outcome + * post-state anchored on the right: * * stream<-source [events] ✓ @ — full success * stream<-source [events] ✗ @/ (error) — total failure → blocked * stream<-source [events] ⚠ @/ (error) — total failure → retrying * stream<-source [events] ✓ @ ✗ @/ (error) — partial then blocked * stream<-source [events] ✓ @ ⚠ @/ (error) — partial then retrying * stream<-source ⊘ @/ — deferred (backoff) * * Partial-success-then-failure is the dual-outcome case: events * 1..K succeeded (watermark advanced to K), event K+1 threw. The * trace renders both the lime `✓ @K` and the red/amber `✗`/`⚠ @K+1` * on the same line so an operator sees "we made progress *and* then * something broke" at a glance. * * Lane prefixes the caption in lilac when non-default. The outcome * marker and its adjacent post-state share the marker's color so the * eye reads "outcome + where it landed" as one unit. Per-stream * `[events]` and `(error)` stay dim — secondary context. * * @internal */ export declare function trace_cycle(logger: Logger, leased: ReadonlyArray<{ readonly stream: string; readonly at: number; readonly retry: number; readonly lane?: string; }>, fetched: ReadonlyArray<{ readonly stream: string; readonly source?: string; readonly events: ReadonlyArray<{ readonly id: number; readonly name: keyof TEvents; }>; }>, handled: ReadonlyArray<{ readonly lease: { readonly stream: string; }; readonly error?: string; readonly block?: boolean; readonly failed_at?: number; }>, acked: ReadonlyArray<{ readonly stream: string; readonly at: number; }>, blocked: ReadonlyArray<{ readonly stream: string; readonly error: string; }>): void; //# sourceMappingURL=tracing.d.ts.map