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.

22 lines (21 loc) 1.43 kB
/** * # org — pods and books (the org model in the language) * * Charter: the org is **data**, not structure around the code. The **Pod** is the * recursive node — an allocating role (**PM**) + a risk envelope + children, where each * child is a **Book** (the leaf, the only place positions and orders live, run by a * **Trader** under an assigned **Coverage**) or another Pod. Depth is unbounded; a * standing Kestrel document the PM revises even intraday. Depth-independent invariants * hold at every edge: **budgets nest** (child ⊆ parent), **authority only narrows * downward**, **positions live at leaves only**, and **Risk (L0) outranks every node * including the root**. Org facts are **path-scoped series** resolved lexically like ESM * (`pnl` = my scope; a child's `pnl` under its name; `children(any).drawdown` as a PM's * wake operand). Humans always sit above the root: a pod is the largest thing that runs * on its own. * * **DEFERRED (no code satisfies this charter).** This module is charter prose only: the Pod / Book / * PM / Trader / Coverage structure described above is NOT implemented here and no runtime path depends on * it. The org model that actually RUNS today is the path-scoped org-facts resolver in * {@link ../engine/orgfacts.ts} — that is the running source of truth for org series; treat this barrel as * a design charter awaiting a later milestone, not as live surface. */