# Phase 33: Dead Code Removal - Context

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

<domain>
## Phase Boundary

Remove day-mode code paths unreachable with Aion-only crypto. Guard midnight preflight, crossover TID seeding, and checkpoint injection behind day-mode checks so they only run for forex symbols (currently disabled). Remove dead fallback paths.

</domain>

<decisions>
## Implementation Decisions

### Claude's Discretion

All implementation choices are at Claude's discretion — cleanup phase.

Key context:

- All crypto symbols are Aion (16 symbols). Forex disabled (10 symbols, `enabled=false`).
- The day-mode path in `_create_engine()` still exists but only runs for `day_symbols` (currently empty list)
- CLEANUP-02: Guard midnight preflight behind day-mode check
- CLEANUP-03: Remove crossover TID seeding and checkpoint injection for Aion (already done in Phase 29)
- CLEANUP-04: Remove dead day-mode code paths unreachable with Aion-only crypto
- Keep day-mode code guarded (not deleted) in case forex is re-enabled later
- The Aion path (Phase 29) already replaced checkpoints + crossover seeding

</decisions>

<code_context>

## Existing Code Insights

### Key Files

- `python/opendeviationbar/sidecar/__init__.py` — day path at lines 376+
- `python/opendeviationbar/sidecar/midnight.py` — midnight preflight, crossover TID
- `python/opendeviationbar/sidecar/config_helpers.py` — `_seed_trade_ids_from_clickhouse()`
- `python/opendeviationbar/sidecar/checkpoint.py` — checkpoint injection

### What to Guard/Remove

1. `_run_midnight_preflight()` — guard: only called if `day_symbols` non-empty (already is)
2. `_check_yesterday_integrity()` — guard: only for day symbols (already is)
3. `_seed_trade_ids_from_clickhouse()` with `symbol_modes` param — remove the unused param
4. Crossover TID references in Aion paths — already removed in Phase 29
5. Any remaining `"day"` fallback defaults — already changed to `"aion"` in Phase 31

</code_context>

<specifics>
## Specific Ideas

Focus on verifying that the guards are in place and removing truly dead code, not on large refactors.

</specifics>

<deferred>
## Deferred Ideas

None.

</deferred>
