# Requirements: v8.0 Aion-Native Pipeline — Zero-Gap Restarts

**Defined:** 2026-03-28
**Source:** Production session — sidecar restart creates gaps from day-mode thinking (crossover TID, date-based DELETE)
**Core Value:** Every sidecar restart produces zero new gaps. Parquet-first, exchange-gap-aware, Aion-native from top to bottom.

## v8.0 Requirements

### Resume — Aion-Native Sidecar Restart

- [x] **RESUME-01**: Sidecar clamps resume TID above known exchange gaps from kintsugi_log — never tries to fill unfillable ranges
- [x] **RESUME-02**: Sidecar reads Parquet tick cache before REST API during gap fill — 3ms/file vs REST round-trips
- [x] **RESUME-03**: Sidecar logs junction quality at REST→WS handoff (junction_gap_tid_delta, ws_buffer_depth, skipped_trades)
- [x] **RESUME-04**: Spike and implement safest DELETE strategy — prefer extra bars (RMT dedup) over gaps, minimize partition scan time

### Defaults — Aion-First Everywhere

- [ ] **DEFAULT-01**: All function parameter defaults changed from "day" to "aion" (~30 call sites)
- [ ] **DEFAULT-02**: Config model defaults (pydantic-settings) changed from "day" to "aion"
- [ ] **DEFAULT-03**: Fallback values in `_modes.get(sym, "day")` changed to "aion"
- [ ] **DEFAULT-04**: Script CLI defaults changed from "day" to "aion"
- [ ] **DEFAULT-05**: Forex symbols use registry lookup (not default), maintaining day mode via symbols.toml

### Cleanup — Historical Gap Resolution + Dead Code

- [x] **CLEANUP-01**: Bulk reprocess 98K day-boundary gaps from Parquet as continuous Aion streams
- [x] **CLEANUP-02**: Remove midnight preflight code path for crypto (guard behind day-mode check for forex)
- [x] **CLEANUP-03**: Remove crossover TID seeding and checkpoint injection for Aion symbols
- [x] **CLEANUP-04**: Remove dead day-mode code paths unreachable with Aion-only crypto

## Future Requirements

### Performance (deferred)

- **PERF-01**: Parallel DELETE across partitions (concurrent mutations)
- **PERF-02**: process_trades_arrow_multi() for 2-3x multi-threshold speedup (backlog 999.1)

## Out of Scope

| Feature                                             | Reason                                                                    |
| --------------------------------------------------- | ------------------------------------------------------------------------- |
| ClickHouse re-partitioning (monthly sub-partitions) | Major schema change, requires full data migration                         |
| Forex re-enablement                                 | Deliberately disabled, separate milestone if needed                       |
| Rust-side Parquet reading                           | fill_from_rest is Rust-native REST; Parquet-first is Python-side pre-fill |
| Real-time bar recomputation for historical gaps     | Kintsugi handles this; sidecar only handles restart gaps                  |

## Traceability

| Requirement | Phase | Status  |
| ----------- | ----- | ------- |
| RESUME-01   | 29    | Complete |
| RESUME-02   | 30    | Complete |
| RESUME-03   | 30    | Complete |
| RESUME-04   | 29    | Complete |
| DEFAULT-01  | 31    | Pending |
| DEFAULT-02  | 31    | Pending |
| DEFAULT-03  | 31    | Pending |
| DEFAULT-04  | 31    | Pending |
| DEFAULT-05  | 31    | Pending |
| CLEANUP-01  | 32    | Complete |
| CLEANUP-02  | 33    | Complete |
| CLEANUP-03  | 33    | Complete |
| CLEANUP-04  | 33    | Complete |

**Coverage:**

- v8.0 requirements: 13 total
- Mapped to phases: 13
- Unmapped: 0

---

_Requirements defined: 2026-03-28_
_Last updated: 2026-03-28 after roadmap creation_
