feat(tolaria): C3I final individual decisions — reconcile modul-12 + migrate modul-18/19 root-only to schema v1

C3I FINAL INDIVIDUAL DECISIONS:
- modul-12: CONTROLLED ROOT<->CANONICAL RECONCILIATION + PAIRED MIGRATION.
  Canonical auf aktuellen Root-Stand (inkl. Phase 10e Intrabar/Gap Execution)
  gebracht, Root unveraendert, atomare Unit, derived_from=Root-ID.
- modul-18/19: ROOT-ONLY MIGRATION (kein Canonical-Partner).
- vps.md: NICHT migriert/löschen/archivieren, DEFERRED_STUB_CLEANUP dokumentiert.
Body byte-genau. IDs stabil. Knowledge schema v1. (Red Queen)
This commit is contained in:
Red Queen 2026-08-25 19:27:07 +00:00
parent 022c30e537
commit 35446c03df
4 changed files with 84 additions and 2 deletions

View file

@ -1,3 +1,11 @@
---
knowledge_schema: 1
id: object/302e9929-e186-c930-2406-ad4a8f17c6fd
type: arch
role: module
representation: source
state: current
---
# Modul-12: Backtesting
**Status: FREIGEGEBEN** · Container `Modul-12-Backtesting` · Image `backtesting:0.1.2` (V1 + V1.1 parallel)

View file

@ -1,3 +1,11 @@
---
knowledge_schema: 1
id: object/2ad746ca-67f1-ce90-1304-4a1f4b052eb7
type: arch
role: module
representation: source
state: current
---
# Modul-18: Position-Manager
**Status: FREIGEGEBEN (21.08.2026)** · Container `Modul-18-Position-Manager` · Port `55018` (nur intern/expose)

View file

@ -1,3 +1,11 @@
---
knowledge_schema: 1
id: object/3f834840-867d-9e9f-c7d2-8f1caf1550a4
type: arch
role: module
representation: source
state: current
---
# Modul-19: Broker-Reconciliation
**Status: FREIGEGEBEN (21.08.2026)** · Container `Modul-19-Broker-Reconciliation` · Port `55019` (nur intern/expose)

View file

@ -1,8 +1,14 @@
---
type: Trading-Modul-System
knowledge_schema: 1
id: object/47b8029c-5874-e73f-0279-d335785b359a
type: arch
role: module
representation: canonical
state: current
derived_from: object/302e9929-e186-c930-2406-ad4a8f17c6fd
_organized: true
---
# Modul-12: Backtesting
**Status: FREIGEGEBEN** · Container `Modul-12-Backtesting` · Image `backtesting:0.1.2` (V1 + V1.1 parallel)
@ -121,10 +127,62 @@ Jede Tabelle FK auf `backtest_run(run_id) ON DELETE CASCADE`.
- **Modul-13: Optimization** — Image `optimization:0.1.0`, E2E-verifiziert (12/12 Punkte), **FREIGEGEBEN** (20.08.2026). Details: `modul-13-optimization.md`.
- **V1.1-Strategie**: `trend_pullback_v1.1` (Image `backtesting:0.1.2`) — Spezifikation und Parameter: `trend-pullback-v1.1-spec.md`.
---
## Phase 10e — Intrabar Execution + Gap Execution Realism (23.08.2026)
Versionierung der Gap-/Intrabar-Semantik (KEIN separates `gap_execution_version`):
- Träger: `intrabar_policy` + `intrabar_policy_version = "intrabar_policy_v1"` im
`ExecutionContext` (`shared/historical/execution_context.py`). Dadurch ist die neue
Semantik eindeutig versioniert und ändert den V2-`run_hash` bei Policy-Wechsel
(PESSIMISTIC ≠ OPTIMISTIC → anderer run_hash).
- Legacy-Pfad bleibt unangetastet (PESSIMISTIC-Default, identisches Verhalten).
Intrabar-Policy (nur V2/BID_ASK): `PESSIMISTIC` | `OPTIMISTIC` | `STOP_FIRST` |
`TARGET_FIRST` | `TICK_RESOLUTION` | `UNKNOWN`. **Fail-closed** §18: `UNKNOWN`/
`TICK_RESOLUTION`/`BOGUS` → `ValueError`/`NotImplementedError`, kein Auto-Default.
Gap-Semantik (deterministisch, kein Lookahead):
- LONG: Stop/Target/Exit auf **BID**; SHORT auf **ASK**.
- Gap-Stop → Fill zum Gap-Open (schlechter, NICHT auf Stop-Level geclampt).
- Target-Gap → Fill zum besseren Gap-Open (nicht geclampt auf Target).
- Intrabar-Target füllt auf `target` (nicht low/high); Intrabar-Ambiguity (Stop UND
Target in einer Bar) per Policy (PESSIMISTIC→Stop, OPTIMISTIC→Target).
- Slippage wird adversial auf den tatsächlichen Fill (Trigger ≠ Market ≠ Final Fill
bei Gap + Slippage); Commission auf finalem Fill (rate × qty × fill pro Seite).
- **Kein Doppelspread/Slippage/Commission** (Vier-Ebenen-Trennung 10b/10c/10d/10e).
Audit (18 Felder, forensisch rekonstruierbar): `reason`, `intrabar_policy`,
`trigger_price`, `market_execution_price`, `exit_fill_price`, `gap_execution`,
`gap_open_price`, `execution_model`, `price_basis`, `spread_model`, `slippage_model`,
`slippage_value`, `cost_model`, `entry_fee`, `exit_fee`, `gross_pnl`, `net_pnl`
(verwendete vorhandene Feldnamen, keine künstlichen).
Verifikation 23.08.2026:
- Unit-Suite `test_phase10e_intrabar_gap.py`: 40/40 grün (Intrabar, Gap, Slippage
nach Gap, Commission auf Final Fill, BID/ASK-Seiten, Doppelzählung, Audit-18,
pathologische Fälle, 4 numerische PnL-E2E-Beispiele).
- Fixture-E2E (`test_phase10e_fixture_e2e.py`): 7/7 grün (A LONG Stop-Gap, B SHORT
Stop-Gap, C Intrabar PESSIMISTIC, D Intrabar OPTIMISTIC run_hash-Differenz,
E LONG Target-Gap, F SHORT Target-Gap, ENV-RESET); numerische Kette
Trigger → Gap-Open → Slippage → Final Fill → Commission → Gross → Net nachgewiesen.
- Regression Lauf 1 + Lauf 2: vollständig grün (M12 169 inkl. 10e, Phase5 20,
Phase6 14, Phase7 AJ Legacy-Hash `8a5760ae…`, M13 Shared AJ, M13 Compat 5/5).
- Legacy Production Smoke 2×: A==B==VORHER (run_hash `bc6e2553…`, data_hash
`d76a7549…`, net_pnl 196.586062, 1× LONG target). DB-Wahrheit verifiziert
(backtest_run/backtest_trade konsistent). Legacy unverändert durch Phase 10e.
- Production Gates M12+M13: `HISTORICAL_DATA_SOURCE`/`ALLOW_FIXTURE_DATA` UNSET.
- Deployt: `core/engine.py`, `core/service.py`, `api/schemas.py` (Container-Hashes
aktualisiert); `shared/historical/execution_context.py` + `pricing.py` unverändert.
---
## Geändert
```
Geändert von: Rain Ocampo
Datum: 23.08.2026
Grund: Modul-12-Doku um Phase 10e (Intrabar Execution + Gap Realism) ergänzt — Versionierung, Intrabar-Policy, Gap-Semantik, Audit-18, Verifikation, Deploy, Smoke, Production Gates.
```
```
Geändert von: Rain Ocampo
Datum: 20.08.2026
Grund: Modul-12-Backtesting als FREIGEGEBEN markiert (deployt + E2E verifiziert: deterministisch, kein Lookahead, Stop/Target/Gap, LONG/SHORT, run_hash+data_hash).
```