---
phase: 19-fleet-recompute-telemetry
plan: 01
subsystem: infra
tags: [ouroboros, aion, cli, argparse, schema, heartbeat]

requires:
  - phase: 13-registry-mode-enum
    provides: SymbolEntry.ouroboros_mode attribute and OuroborosMode.AION enum value
provides:
  - Aion-aware CLI in detect_gaps.py, populate_full_cache.py, populate_range.py
  - Per-symbol ouroboros mode auto-detection from registry
  - Updated deploy env and schema comments for Aion support
  - Cleared stale KNOWN_GAP_FINGERPRINTS for fleet recompute
affects: [19-fleet-recompute-telemetry]

tech-stack:
  added: []
  patterns:
    [per-symbol ouroboros mode resolution from registry with env var fallback]

key-files:
  created: []
  modified:
    - scripts/detect_gaps.py
    - scripts/populate_full_cache.py
    - scripts/populate_range.py
    - deploy/opendeviationbar.env
    - deploy/CLAUDE.md
    - python/opendeviationbar/clickhouse/schema.sql
    - scripts/heartbeat/config.py

key-decisions:
  - "Per-symbol registry lookup via get_symbol_entries() preferred over get_symbol_entry() (latter does not exist)"

patterns-established:
  - "Per-symbol ouroboros resolution: try registry first, fall back to global env var, then to 'day'"

requirements-completed: [RECOMP-04, RECOMP-05]

duration: 3min
completed: 2026-03-27
---

# Phase 19 Plan 01: Aion Mode Support in Scripts and Config Summary

**Diagnostic scripts, deploy config, and schema comments updated to support Aion ouroboros mode with per-symbol registry auto-detection**

## Performance

- **Duration:** 3 min
- **Started:** 2026-03-27T16:24:55Z
- **Completed:** 2026-03-27T16:28:00Z
- **Tasks:** 2
- **Files modified:** 7

## Accomplishments

- All three diagnostic scripts (detect_gaps, populate_full_cache, populate_range) accept "aion" as --ouroboros choice
- Per-symbol ouroboros mode auto-detection from symbols.toml registry when CLI flag not specified
- Deploy env comment updated to clarify forex-only fallback role
- Schema SQL comments reflect Aion as supported mode alongside Day
- Stale KNOWN_GAP_FINGERPRINTS cleared to prevent masking real issues after fleet recompute

## Task Commits

Each task was committed atomically:

1. **Task 1: Update diagnostic scripts for Aion mode resolution** - `bcb75a3` (feat)
2. **Task 2: Update deploy config, schema comments, and clear stale fingerprints** - `4288794` (chore)

## Files Created/Modified

- `scripts/detect_gaps.py` - Per-symbol \_resolve_ouroboros_mode(symbol=), aion in CLI choices
- `scripts/populate_full_cache.py` - Aion CLI choice, auto-detect from registry
- `scripts/populate_range.py` - Aion CLI choice, auto-detect from registry
- `deploy/opendeviationbar.env` - Forex-only fallback comment for OUROBOROS_MODE
- `deploy/CLAUDE.md` - Updated OUROBOROS_MODE documentation comment
- `python/opendeviationbar/clickhouse/schema.sql` - Aion in ouroboros_mode column comments (both tables)
- `scripts/heartbeat/config.py` - Cleared KNOWN_GAP_FINGERPRINTS dict

## Decisions Made

- Used `get_symbol_entries()[symbol]` pattern instead of `get_symbol_entry(symbol)` since the latter function does not exist in the codebase (plan interfaces referenced a non-existent function)

## Deviations from Plan

None - plan executed as written with minor adaptation to use `get_symbol_entries()` instead of non-existent `get_symbol_entry()`.

## Issues Encountered

- Worktree was behind main and missing Phase 13-18 prerequisites (ouroboros_mode on SymbolEntry, OuroborosMode.AION enum). Resolved by merging main into worktree before execution.

## User Setup Required

None - no external service configuration required.

## Next Phase Readiness

- All scripts and config artifacts are Aion-aware
- Ready for Plan 02: fleet recompute execution on bigblack

---

_Phase: 19-fleet-recompute-telemetry_
_Completed: 2026-03-27_
