# Requirements Archive: v1.2 Performance

**Archived:** 2026-03-20
**Status:** SHIPPED

For current requirements, see `.planning/REQUIREMENTS.md`.

---

# Requirements: v1.2 — Performance

**Defined:** 2026-03-20
**Core Value:** Kintsugi repairs in minutes, no crashes, memory-efficient hot paths

## v1 Requirements

### Critical Stability (P0-P2)

- [x] **STAB-01**: Telegram log sink uses bounded thread pool (max 2 threads), not unbounded Thread per message
- [x] **STAB-02**: Failed Telegram threads do not prevent kintsugi from completing repairs
- [x] **STAB-03**: Kintsugi REST repairs use separate concurrency limit (MAX_CONCURRENT_REST=2), not shared with Parquet workers
- [x] **STAB-04**: Single BTCUSDT full-day REST repair completes in <30 minutes (currently 1h+)
- [x] **STAB-05**: Kintsugi uses thread-local OpenDeviationBarCache (one per worker thread, not per day)
- [x] **STAB-06**: No fd exhaustion from CH connection churn during 24-worker repairs

### Rust Hot Path (P3-P5)

- [x] **RUST-01**: Vision CSV parsing uses FixedPoint::from_f64() or direct string deserialization, not f64→String→FixedPoint
- [x] **RUST-02**: IntraDayChunkIterator persists CSV reader across chunks (O(N) not O(N²))
- [x] **RUST-03**: Burst frame Vec in WS select loop is reused via clear(), not re-allocated per trade

### Python Efficiency (P6-P8)

- [x] **PYEF-01**: \_kintsugi_cfg() called once per \_repair() invocation, not 3× per frame
- [x] **PYEF-02**: Vision 404 negative cache TTL reduced to 15min for T-1 dates (currently 1h)
- [x] **PYEF-03**: store_bars_bulk() removes redundant df = bars.copy() on non-DatetimeIndex path

## v2 Requirements

- **RUST-10**: OpenDeviationBar struct split into CoreBar (200B) + Optional FeatureSet (350B)
- **RUST-11**: load_historical_range() conservative Vec preallocation
- **PYEF-10**: FeatureProvider protocol extended to accept Polars (eliminate pandas round-trip)

## Out of Scope

| Feature                           | Reason                                                    |
| --------------------------------- | --------------------------------------------------------- |
| Monitoring threshold adjustment   | Fix performance, not alerts                               |
| OpenDeviationBar struct split     | Major refactor, needs own milestone                       |
| Plugin Polars→Pandas optimization | No plugins in production                                  |
| Ariadne-anchored parallel REST    | Requires knowing trade-ID bounds upfront, separate effort |

## Traceability

| Requirement | Phase   | Status  |
| ----------- | ------- | ------- |
| STAB-01     | Phase 1 | Complete |
| STAB-02     | Phase 1 | Complete |
| STAB-03     | Phase 2 | Complete |
| STAB-04     | Phase 2 | Complete |
| STAB-05     | Phase 2 | Complete |
| STAB-06     | Phase 2 | Complete |
| RUST-01     | Phase 3 | Complete |
| RUST-02     | Phase 3 | Complete |
| RUST-03     | Phase 3 | Complete |
| PYEF-01     | Phase 4 | Complete |
| PYEF-02     | Phase 4 | Complete |
| PYEF-03     | Phase 4 | Complete |

**Coverage:**

- v1 requirements: 12 total
- Mapped to phases: 12/12
- Unmapped: 0

---

_Requirements defined: 2026-03-20_
