UNPKG

kestrel.markets

Version:

A typed, token-efficient language + runtime for agentic trading: agents author bounded plans, the runtime fires them at the tick. CLI + typed library + MCP server.

37 lines 2.56 kB
/** * # blotter/project — the pure Blotter projector (kestrel-a57.1 slice 2, ADR-0011) * * `project(bus)` is the **permanent, deterministic** fold from one canonical GRADED bus into a * {@link Blotter}. Its one invariant (ADR-0011): **it is a pure function of the bus** — the same bus * projects to a byte-identical Blotter, and no engine-state scrape is ever permitted. Everything the * Blotter carries is re-derived from bus bytes: * * • META (seq 0) → session identity / judge / fidelity / bus receipt * • JOURNAL events → journals[] (full body inline) + plan reasoning_ref (by seq) * • PLAN events → plans[] (lifecycle + final_state) * • ORDER + TELEMETRY events → orders[] (place ⋈ fill/cancel/reject ⋈ esc/reprice ⋈ settle) * • settle-outcome TELEMETRY → totals{floor, expected} + headline taint + orders[].support + * fill_claim[] (expected-$ partitioned calibrated|extrapolated, a57.4) * • settle_mark TELEMETRY → totals.settle_mark (the settle spot's provenance + staleness * verdict, kestrel-xwf; a stale mark taints the headline) * • META fill_model → fidelity.self_limitation (what the judge could NOT observe, a57.4) * * **Fail closed (ADR-0011).** The projector requires a GRADED bus: a bus whose opening META lacks the * judge self-description (`fill_model`/`instance`/`fidelity`) is a fill-model-agnostic INPUT tape, not a * graded bus — `project` refuses it with a logged reason rather than inventing a judge (the two-bus rule). * * **Scope.** The aggregated `fill_claim[]` rollup and the fidelity self-limitation stamp land in a57.4 * (this slice); the paper/live certification legs (a57.3) and all human/legible rendering (a57.13) remain * OUT — the projector never renders. The * report→Blotter unification (the existing {@link ../session EpisodeReport} still stands beside the * Blotter) is a LATER cleanup. */ import type { BusEvent } from "../bus/index.ts"; import type { Blotter } from "./types.ts"; /** * Project one GRADED bus into its canonical {@link Blotter}. Pure and deterministic (ADR-0011): no wall * clock, no RNG, no engine-state scrape — the same bus in ⇒ a byte-identical Blotter out (proven by * {@link ./certify.ts}). Refuses a non-graded bus loudly (fail-closed). */ export declare function project(bus: readonly BusEvent[]): Blotter; //# sourceMappingURL=project.d.ts.map