From be71f0a55cdd5c64467a1ec3d4e72cbf2c8abc27 Mon Sep 17 00:00:00 2001 From: Brummel Date: Fri, 19 Jun 2026 18:16:03 +0200 Subject: [PATCH] =?UTF-8?q?spec:=20trace-chart=20viewer=20Tier-1=20?= =?UTF-8?q?=E2=80=94=20ordinal=20x-axis=20+=20zoom/pan/cursor-sync=20(boss?= =?UTF-8?q?-signed)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tier-1 comfort pass for the served trace chart (#103): an ordinal x-axis default (collapses non-trading gaps) with a one-click continuous toggle, plus wheel-zoom / drag-pan / dblclick-reset, a value-readout legend, and panel cursor-sync. Confined to the read/render side (chart-viewer.js + render.rs CHART_HEAD); the Rust serve contract is unchanged. Boss-signed: grounding-check PASS (five current-behaviour assumptions ratified by green node guards + render.rs inline tests). Derived-fork decision log in the #103 comments. refs #103 --- docs/specs/0057-trace-chart-viewer-tier1.md | 363 ++++++++++++++++++++ 1 file changed, 363 insertions(+) create mode 100644 docs/specs/0057-trace-chart-viewer-tier1.md diff --git a/docs/specs/0057-trace-chart-viewer-tier1.md b/docs/specs/0057-trace-chart-viewer-tier1.md new file mode 100644 index 0000000..b14e3b6 --- /dev/null +++ b/docs/specs/0057-trace-chart-viewer-tier1.md @@ -0,0 +1,363 @@ +# Trace-chart viewer comfort (Tier 1) — ordinal x-axis + zoom/pan/cursor-sync — Design Spec + +**Date:** 2026-06-19 +**Status:** Draft — awaiting user spec review +**Authors:** orchestrator + Claude + +Seeds: Gitea #103 (reference issue; derived-fork decision log in its comments). +Lineage: #101 (trace charts, first cut), C22 (playground = trace explorer), C14 +(engine headless — the viewer is a downstream read of recorded traces). + +## Goal + +Make the served trace chart *feel* like a chart rather than a screenshot, and satisfy +the one explicitly-requested data-model change: **the x-axis must not be continuous by +default** (gaps for non-trading time collapse), with a continuous spacing available as a +one-click option. + +Two strands, both confined to the read/render side: + +1. **Ordinal x-axis (default) + in-page continuous toggle.** Plot every slot at an even + ordinal position so nights/weekends collapse; one toggle flips to true + timestamp-proportional (continuous) spacing and back. +2. **Tier-1 interaction comfort.** wheel-zoom + drag-pan + double-click-reset on the + x-axis; a value readout at the cursor (the real timestamp in ordinal mode); the + crosshair synchronized across stacked panels. + +Non-goals (explicitly deferred, named so the cut stays honest): epoch→date axis labels / +session-aware ticks (needs instrument context — #102 / Tier-3); a live `aura serve` +backend (the page stays static & self-contained); LOD / downsampling ("mipmapping"); +families/comparison meta-views (C21); drawing tools (C22 forbids a scene editor). + +## Feature-acceptance criterion (applied prospectively) + +aura's criterion (CLAUDE.md domain invariants + the skills default): the intended +audience reaches for it, it improves legibility/correctness, and it reintroduces no +failure class a core constraint forbids. + +- **Audience reaches for it.** A trader reading a recorded backtest trace expects bars + evenly spaced (no weekend chasms) and expects to wheel-zoom / drag-pan — every charting + tool behaves so. The worked invocation (below) is unchanged; what changes is that the + emitted page is legible at a glance. +- **Improves legibility, not just decoration.** Gap-collapse is the difference between a + trace dominated by blank overnight stretches and one where the signal fills the width — + directly serving C22's "trace explorer" mission. +- **Reintroduces no forbidden failure class.** This is a pure read-side render concern. + The engine, the recorded SoA traces (C7), `build_chart_data`'s union-spine alignment, + and the `ColumnarTrace`/`TraceStore` contract are all untouched (C14: engine knows no + UI). Determinism/causality (C1/C2) live in the engine, not the viewer. + +## Architecture + +The whole feature lives in two files; the Rust serve contract is unchanged. + +- `crates/aura-cli/assets/chart-viewer.js` — the pure `buildCharts` gains an `xMode` + parameter and assembles ordinal-vs-continuous uPlot configs + the interaction plugin + + the panel cursor-sync key; the browser-only `mount` gains a re-render-on-toggle loop. +- `crates/aura-cli/src/render.rs` — `CHART_HEAD` gains the toggle control; a small + chart-only `