# Phase 13: Registry + Mode Enum - Context

**Gathered:** 2026-03-26
**Status:** Ready for planning
**Mode:** Auto-generated (infrastructure phase — discuss skipped)

<domain>
## Phase Boundary

Every consumer (sidecar, kintsugi, heartbeat, validation) can query any symbol's ouroboros mode from the registry, with Aion as a first-class variant alongside Day.

</domain>

<decisions>
## Implementation Decisions

### Claude's Discretion

All implementation choices are at Claude's discretion — pure infrastructure phase. Use ROADMAP phase goal, success criteria, and codebase conventions to guide decisions.

Key constraints from conversation:

- Aion = Greek deity of unbounded eternal time (OuroborosMode.AION = "aion")
- symbols.toml is SSoT — add `ouroboros_mode` field per symbol
- Crypto symbols get "aion", forex symbols stay "day"
- Registry validation must reject Aion for non-crypto asset_class
- OuroborosMode enum in ouroboros.py expanded (currently only DAY = "day")
- SymbolEntry dataclass in symbol_registry.py gets ouroboros_mode field
- Public API signatures expand Literal["day"] to Literal["day", "aion"]
- Config/population.py Literal["day"] also needs expansion

</decisions>

<code_context>

## Existing Code Insights

### Key Files

- `python/opendeviationbar/ouroboros.py` — OuroborosMode enum (line 27-34), validation functions
- `python/opendeviationbar/data/symbols.toml` — SSoT symbol registry
- `python/opendeviationbar/symbol_registry.py` — SymbolEntry dataclass, get_symbol_entries(), validate_symbol_registered()
- `python/opendeviationbar/config/population.py` — PopulationConfig with ouroboros_mode: Literal["day"]
- `python/opendeviationbar/__init__.py` — Public API signatures
- `python/opendeviationbar/__init__.pyi` — Type stubs

### Established Patterns

- Enum uses (str, Enum) pattern: `class OuroborosMode(str, Enum): DAY = "day"`
- Registry loaded via importlib.resources + @lru_cache + MappingProxyType (immutable)
- SymbolEntry is a frozen dataclass with per-field parsing from TOML
- Validation via pydantic-settings in PopulationConfig
- Rust reads symbols.toml at compile time via build.rs (only market field)

### Integration Points

- Every service reads from symbol_registry.py → must propagate ouroboros_mode
- Public API functions accept ouroboros_mode parameter → type expansion needed
- validate_ouroboros_mode() in ouroboros.py → must accept "aion"
- get_operational_ouroboros_mode() → may need per-symbol variant

</code_context>

<specifics>
## Specific Ideas

- CEO directive: Aion is crypto-only; forex stays Day (Week-mode deferred)
- Gap taxonomy (G1-G4, O1) documented in PROJECT.md Key Decisions
- All ClickHouse schema changes must follow clickhouse-architect skill from ~/eon/cc-skills

</specifics>

<deferred>
## Deferred Ideas

- Week-mode for forex (separate milestone)
- Rust-side ouroboros_mode reading (currently compile-time market field only; Python propagates mode to Rust at runtime via processor config)

</deferred>
