โ€บNavigation
opendeviationbar-py ยท canonical terminology
๐Ÿ“– GLOSSARY 17 terms ยท cross-checked against source CLAUDE.md

Project Glossary

Canonical definitions for project-invented terminology used in the pipeline visualization and CLAUDE.md chronicles. Every entry is cross-checked against its source CLAUDE.md before inclusion โ€” no paraphrases, no inventions.

โ–ธ Core concepts

4 terms

Open Deviation Bar (ODB)

A bar that closes when the price has moved a fixed percentage from the bar's open price (instead of when a clock ticks). Open-anchored, bidirectional, percentage-threshold: breach when price >= open ร— (1 + threshold) or price <= open ร— (1 โˆ’ threshold). Distinct from classic Nicolellis-style range bars (which use dynamic high-low distance). Variable duration โ€” a bar can last seconds in volatile markets or hours in calm ones. The root project identity.

Source: opendeviationbar-py/CLAUDE.md (Naming callout) ยท cross-confirmed in opendeviationbar-patterns/CLAUDE.md

dbps โ€” decimal basis points

The threshold unit. 1 dbps = 0.00001 = 0.001%. Example: 250 dbps = 0.25%. All threshold values across the project use dbps. Crypto thresholds: 250 / 500 / 750 / 1000. Forex thresholds: 5 / 10 / 25 / 50 (50ร— tighter, reflecting forex's lower inherent volatility).

Source: opendeviationbar-py/CLAUDE.md (Terminology table)

Stathera โ€” ฯƒฯ„ฮฑฮธฮตฯฮฌ (Greek for "constant")

The trade-ID alignment invariant. For consecutive bars in the same (symbol, threshold): bar[i].last_agg_trade_id + 1 == bar[i+1].first_agg_trade_id. Replaces ALL time-based gap detection. If this holds, no trades were dropped between bars. If tid_delta > 0 = gap (missing trades). If tid_delta < 0 = overlap (two writers wrote the same range).

Source: opendeviationbar-py/CLAUDE.md (Terminology table)

Ouroboros / OuroborosMode

Bar-reset framework โ€” when, if ever, the bar processor's internal state resets.

  • aion (default for crypto): continuous stream, no resets, bars span across days. Crypto markets are 24/7 so there's no natural reset point.
  • week (forex only): weekly reset at Fri 21 UTC โ†’ Sun 22 UTC. Forex markets close on weekends; without this reset, a single bar could span the ~49-hour weekend gap, which is meaningless.
  • day (deprecated): never use.

Source: opendeviationbar-py/CLAUDE.md (Terminology table) ยท forex week-mode mechanics in mql5/tools/CLAUDE.md

โ–ธ Self-healing layers (sidecar mythology)

8 terms

Puck

Inline Rust gap-fill on every WebSocket trade. Detects trade-ID discontinuity (a missed event) the moment it happens and fills in sub-3 seconds via parallel REST fetch. Named after Shakespeare's quick mischievous sprite โ€” fast and sneaks in fixes. The first defense against gaps; everything else is a backstop.

Source: opendeviationbar-py/CLAUDE.md (Terminology table)

Antaeus

Resilient WebSocket reconnection. Uses exponential backoff with jitter (via the backon Rust crate) when the WS connection drops, and resets the backoff state after the connection has been stable for โ‰ฅ60 seconds. Named after the Greek giant who regained strength on contact with the earth โ€” a reconnection mechanism that gets stronger after reconnecting.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

Argus

Per-symbol liveness monitor inside the sidecar. Tracks the timestamp of the last bar produced for each symbol; alerts via Telegram if a symbol has gone silent for โ‰ฅ30 minutes. Named after the hundred-eyed Greek giant โ€” watches every symbol independently.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

Lethe

Ring buffer overflow alerting. Detects when the dropped_bars metric increments (meaning bars were dropped because the writer can't keep up) and sends Telegram alerts. Layered throttling: first-drop alert immediately, then re-alert after every 100 more drops, with a 60-second minimum between alerts to prevent burst-fail storms. Named after the river of forgetfulness โ€” when bars are dropped, they're literally forgotten.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

Watchdog

Stale trade-flow detection inside the sidecar. If the trade stream goes silent (no events for an extended period), Watchdog triggers an engine restart via recovery.py. The last-resort detector when Antaeus has reconnected the socket but no data is flowing.

Source: python/opendeviationbar/sidecar/CLAUDE.md

Niffler

Immediate dead-letter replay on ClickHouse write failure. When a batch of bars fails to write, Niffler serializes them to Parquet on local disk, then attempts immediate replay. Sub-5 second recovery. Named after the magical creature that hoards lost things โ€” Niffler picks up bars that would otherwise be lost.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

Charon

Dead-letter ferry. If Niffler's immediate replay fails, the Parquet dead-letter files persist. Charon auto-replays them on sidecar startup AND every 5 minutes during normal operation. Named after the ferryman of the dead โ€” moves stuck bars across the river to ClickHouse.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

Ariadne

fromId REST pagination for gap-fill. Given a starting trade ID, walks forward through Binance's REST aggregate-trade API in pages, anchoring on trade IDs (not timestamps) so it's zero-gap by construction. The repair tool used by Kintsugi to backfill arbitrary historical ranges. Named after Ariadne's thread โ€” a continuous chain back through the labyrinth.

Source: opendeviationbar-py/scripts/CLAUDE.md (Streaming Reliability Concepts)

โ–ธ Engines & boundaries

3 terms

Kintsugi

Self-healing gap reconciliation engine. Discovers Stathera gaps via trade-ID audit (looking for tid_delta != 0 in ClickHouse) and repairs them using Ariadne pagination + Ouroboros. Named after the Japanese art of repairing pottery with gold โ€” the cracks are made beautiful, not hidden.

The repair flow: discover shards โ†’ repair shard (Vision ZIP โ†’ REST fallback โ†’ local Parquet trust gate) โ†’ verify (post-repair Stathera check) โ†’ log.

Source: opendeviationbar-py/CLAUDE.md (Terminology table) ยท detailed in python/opendeviationbar/kintsugi/CLAUDE.md

Writer ownership boundary

The clean line between the sidecar and Kintsugi. The sidecar owns the live stream from resume_tid forward; Kintsugi owns historical gaps before resume_tid. Eliminates concurrent-writer races that recurred across 4 fix cycles in March 2026 (Issue #280). When the sidecar restarts, its resume_tid is computed from the latest committed bar in ClickHouse โ€” that becomes the new boundary.

Source: opendeviationbar-py/scripts/CLAUDE.md (Writer Ownership Model #280)

Circuit breaker (fatal_write_breaker)

Module-level state machine that protects against cascading ClickHouse write failures. Three states:

  • CLOSED โ€” writes proceed normally. After 3 consecutive write failures, transitions to OPEN.
  • OPEN โ€” all writes immediately fail. Stays open for 60 seconds. Sends Telegram alert on transition.
  • HALF_OPEN โ€” after the 60-second cool-down, the next write probes the system. On success, transitions back to CLOSED. On failure, returns to OPEN.

Pattern: CLOSED โ†’ (3 failures) โ†’ OPEN โ†’ (60s) โ†’ HALF_OPEN โ†’ (success) โ†’ CLOSED.

Source: python/opendeviationbar/clickhouse/CLAUDE.md (Issue #108)

โ–ธ Forex track (mql5)

2 terms

fxview-core

The forex-side Open Deviation Bar synthesis engine. Rust crate at mql5/crates/fxview-core/, internal-only (not on crates.io). Used by both fxview-sidecar (live path) and fxview-backfiller (historical path). Independent of opendeviationbar-py's opendeviationbar-core crate โ€” verified by grepping mql5/Cargo.toml; no opendeviationbar dependency exists. Both pipelines implement the same Open Deviation Bar concept but in separate codebases.

Modules: bars.rs (BarBuilder + CompletedBar with 200+ fields), writer.rs (ChWriter with circuit breaker + 100K-bar drop ceiling + async_insert), pending_queue.rs (forward-window labels with Abdi-Ranaldo 2017 spread estimator), bars_derived.rs (28 rolling-quantile + 13 pattern features).

Source: mql5/crates/fxview-core/CLAUDE.md

Antifragile 4-signal HALT

Fail-fast mechanism inside TickCollector.mq5 (the MT5 Expert Advisor on the forex track). Every OnTimer cycle validates the proposed broker UTC offset across four independent signals:

  • S1: TimeTradeServer() โˆ’ TimeGMT() โ€” authoritative in live mode.
  • S2: hardcoded EU DST rule (EET winter / EEST summer) โ€” should agree with S1 within 60 seconds outside DST transitions.
  • S3: previous observed offset (temporal continuity) โ€” should jump only by exactly 3600 seconds (a real DST transition) or 0.
  • S4: sanity bounds โ€” anything outside ยฑ14 hours is impossible.

Any disagreement fires RaiseOffsetHaltAlert: modal alert + chart comment + mobile push + email + flag file. g_offset_halt blocks all subsequent tw_write_tick calls โ€” better to lose live ticks than silently write miscomputed UTC. Manual human flag-removal required to resume.

Source: mql5/mql5_ea/CLAUDE.md