forked from chiki2bum2/SniperGold_ML
81 lines
4 KiB
Markdown
81 lines
4 KiB
Markdown
# P3-S22.3 — RESEARCH M30 CONSTRUCTION REPAIR (additive namespace)
| |||
| |||
```text
| |||
Session : P3-S22.3 — RESEARCH M30 CONSTRUCTION REPAIR &
| |||
POPULATION REDERIVATION
| |||
Status : COMPLETE (research-only; corrected pipeline implemented + verified)
| |||
Policy : docs/CODE_VERIFICATION_AND_SILENT_BUG_POLICY_v1.md
| |||
Disposable : YES — this namespace is the corrected RESEARCH construction,
| |||
its independent oracle, deterministic replay and evidence. It is
| |||
NOT part of production MQL5, FEATURE_CONTRACT, labels, or the
| |||
frozen P3-S16..P3-S22 artifacts (those are unchanged).
| |||
Owner : chiki2bum2 (authoritative repo)
| |||
Root : ml/p3/p3_s223_m30_repair/
| |||
```
| |||
| |||
## What this namespace is
| |||
| |||
The historical research M30 gate series used an **index-pair resample** of the
| |||
M15 feed (2 x M15 per M30 via `spec_tests_engine2_gates.m30_from_m15`). That
| |||
construction drifts from the runtime (broker UTC-grid) M30 at session/data,
| |||
weekend, holiday and DST gaps (ADJ-2, established in P3-S22.1/P3-S22.2). This
| |||
namespace implements the **corrected research M30 construction** on fixed UTC
| |||
30-minute buckets, an **independent oracle**, the deterministic replay of the
| |||
Candidate Setup population, and the full regression/mutation/agreement suite.
| |||
| |||
No production MQL5, F1/F2/F3/F4 contract, P3-S16 label, TP/SL/horizon,
| |||
FEATURE_CONTRACT, or frozen historical artifact is modified. Nothing here
| |||
trains, calibrates, or trades.
| |||
| |||
## Modules
| |||
| |||
| File | Role |
| |||
|---|---|
| |||
| `s223_common.py` | frozen input loaders + corrected UTC M30 construction + as-of gate + invariant |
| |||
| `s223_partB_oracle.py` | corrected construction (Part B) + independent oracle + 100% agreement (Part C) |
| |||
| `s223_partDR_mutation.py` | Part D: 12 regression scenarios + 6 mutation tests |
| |||
| `s223_run_main.py` | Parts A..J: invariant, construction, oracle, regression, baseline repro (694/686), corrected replay (707), population/label impact, audit, comparison |
| |||
| `s223_run_repro.py` | reproducibility runner (2 runs, byte-identical substantive outputs) |
| |||
| |||
## Key results (single source: `output/s223_main_pipeline.json`)
| |||
| |||
- PART A invariant: `M30_open = floor(M15_open/1800)*1800` verified on all
| |||
100,764 UTC buckets; 0 mismatches.
| |||
- PART B corrected construction: 100,764 M30 bars; gate nonzero 180,774/197,032.
| |||
- PART C oracle agreement: corrected vs independent oracle **100%** on
| |||
timestamps / OHLC / dirs / gate.
| |||
- PART D: 12/12 regression invariants hold; 6/6 mutations detected.
| |||
- PART E frozen baseline: committed gates reproduce **694 created / 686
| |||
in-scope / 0 per-bar mismatch** (frozen contract).
| |||
- PART F corrected replay: corrected gates -> **717 created / 707 in-scope**;
| |||
shared 484, old-only 202, corrected-only 223 (matches P3-S22.2 validated).
| |||
- PART G: common 484 rows identical-label; 202 previously-absent; 223
| |||
newly-available; UNRESOLVED corrected 28, AMBIGUOUS 6.
| |||
- PART H audit: old 686 (594+92); corrected 707 (610+97); total==leads+followons.
| |||
- PART I dataset: M30 gate diff 38,399 full / 37,651 scope.
| |||
- PART J machine-repro: oracle_100pct=true, mutation_all_detected=true, deterministic=true.
| |||
| |||
## Files produced (output/)
| |||
| |||
```text
| |||
s223_main_pipeline.json Parts A..J machine evidence
| |||
s223_rows.csv row-level old/corrected population (909 rows)
| |||
s223_partD_regression_mutation.json
| |||
s223_partB_construction.json
| |||
s223_partC_agreement.json
| |||
s223_reproducibility.json 2-run byte determinism manifest
| |||
```
| |||
| |||
## Design boundaries
| |||
| |||
- The corrected construction is new and additive; it never rewrites the
| |||
committed `p3_s17r1_gate_series_cache.npz` index-pair m30.
| |||
- The independent oracle uses a distinct accumulation path
| |||
(`oracle_clock_m30`) + a searchsorted as-of (distinct from the np.searchsorted
| |||
in `s_common.as_io_m30_gate` implementation detail, but same rule).
| |||
- All tests use disposable copies; mutation faults are never committed to the
| |||
real pipeline.
| |||
- No timing/window/tolerance tuning; all constants come from the frozen
| |||
research contracts (P3-S16/P3-S17/P3-S18).
| |||
| |||
*End of P3-S22.3 namespace README.*
|