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 (32 loc) 2.51 kB
# Streaming renderings are append-only (cache-monotone); 2D layouts are keyframe-only The agent-native live tape is **vertical**: one row per candle, time flowing down, newest appended last. This is a binding rendering-architecture rule, not a style choice, because the author is a context window: an append-only rendering is **KV-cache-monotone** — a long-running agent's entire prior tape remains cached and each perception update costs O(new bars). A 2D price×time grid (the classic chart shape) must redraw on every update, invalidating the cache for the whole screen on every wake; for an agent that watches all day, that is the difference between paying for a few appended rows and re-paying for the screen hundreds of times. Therefore: **every Rendering consumed continuously by an agent is append-only** (delta frames are appended suffixes; state changes arrive as new lines, never as in-place edits), and **2D layouts are reserved for one-shot keyframes** (orientation screens, where the redraw happens once by definition) **and for human-facing formats** (`html` charts of the same Frame). The two-parameter Rendering model (format × tokenizer) is unchanged; this ADR adds the temporal discipline. **Row format (a first candidate, not doctrine — graded per ADR-0009): relative candles with keyframe anchors.** A tape row is candle *shape*, not levels: direction glyph, body in bps vs prior close, wick extents, volume glyph; the open is implied by the prior close (a gap prints only when nonzero). Absolute prices on every row are rejected as tokenizer waste — digit strings fragment under BPE and every row re-spends the same high-order digits — while small signed integers tokenize cleanly and remain legible arithmetic the model can reason over (the **legibility floor**: never compress past interpretable units into opaque symbols; that converts a reasoning model into a poor tokenizer). Absolute levels live in a periodic **anchor** (the keyframe re-stamps the level; re-anchor on keyframes and round-level crosses) and in the levels registry. Exact glyph choices are measured per target tokenizer, never assumed. The rejected alternative — leading with 2D ASCII charts and absolute-OHLC rows for agents — reads better in a screenshot and worse in production: it optimizes the demo, not the context window. Historical footnote that makes the rule easy to remember: the original ticker tape was an append-only stream; reading the tape has always meant reading appended rows.