Iteration 10 (FINAL) · 2026-06-09 · driver: native Claude Code /loop (laptop run)
← Dashboard · PR terrylica/mql5#99 · card 75 · cut off bootstrap #90
fxview_cache.forex_bars: bit-faithful Rust verified against a pinned Python SSoT, populated through the wired producer, with batch≡streaming parity and an independent 3-way FOSS corroboration. PR #99 open (base main; diff auto-cleans once #90–#98 land). §11 STOP CONDITION reached: all 9 implementable feature PRs + bootstrap opened; 5 deferred (3 substrate-blocked + 2 parameter-flagged) NOT attempted per locked scope.
Full-band log-spectral slope (the 1/fα exponent; Peeters/CUIDADO 2004 spectral-slope lineage) of the per-bar mid-close curve across the 200-bar strictly-trailing window — a parameter-free measure of spectral colour (~0 white/flat; increasingly negative for pink/Brownian, low-frequency-dominated dynamics). Causal: the window is the 200 bars BEFORE bar i (current bar excluded). Mean-center the window → one-sided real-DFT power spectrum → drop the DC bin → fit an OLS line to log(power) vs log(frequency) over all surviving positive-power bins (≥8 required). Slope reported verbatim (NOT negated). None on warmup (<200 trailing closes), a flat window, or <8 surviving bins. No new dep (direct DFT via std cos/sin, twiddle index reduced mod-n; closed-form OLS). Substrate = "close" = RAW mid-close level (NO logret, NO weekend/Ouroboros gap-null — gaps are part of the level path, like sevcik_fd / hvg_clustering / mann_kendall_z).
| Layer | Artifact | Result |
|---|---|---|
| Python SSoT | oracle_spectral_log_slope.py — bit-faithful reproduction of probe k_spectral_slope over the "close" 200-bar window | sha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar |
| Rust kernel | orthogonal_extension_kernels::spectral_log_slope — mean-center → direct real DFT (mod-n twiddle) → drop DC → numerical-zero mask → closed-form OLS slope; no new dep | clippy clean; 8 unit tests pin probe values |
| Differential parity | vs the pinned oracle on the frozen fixture | 11200 == oracle, 12000 bars == rows, max|dev| 4.641e-14 ≪ 1e-6 |
| Producer column | BarOrthogonalExtV1 { spectral_log_slope } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yaml | test_schema_contract 4/4 |
| Producer populate | SpectralLogSlopeRollingState — 200-bar close ring (no gap-null, like sevcik); read-before-push observe(close_mid) @ finalize | — |
| batch≡streaming | streaming observe() over the fixture per partition | 11200 == oracle, max|dev| 4.641e-14 (identical to batch) |
| 3-way FOSS | probe-form vs clean-room hand-DFT + closed-form OLS vs scipy.fft.rfft + scipy.stats.linregress | PASS — 0 mismatches, 0 mask divergences, max|dev| 2.7e-14 (clean-room) / 1.4e-14 (scipy) / 11200 |
The probe's literal (P>0) mask drops bins numpy's pocketfft rounds to EXACTLY 0.0 (the even-n Nyquist alternating sum landing on 0 for a near-symmetric window). A direct DFT cannot reproduce pocketfft's exact-zero rounding — it leaves those bins at the f64 noise floor (~1e-60), and one such bin at log(P) ≈ −138 has enormous OLS leverage: it caused a 1.4-slope divergence on EURUSD@5 window 1885 (Rust −2.957 vs oracle −1.590). Fixed with a relative numerical-zero floor P > ε²·max_P — a machine-defined guard (ε² = squared f64 representable-precision floor; a Fourier coefficient below ε·√max_P carries no f64-distinguishable information), NOT a tuned knob and NOT a frequency-band restriction (card-75 parameterless preserved). Empirically swept 4 candidates: ε²-floor → 0 windows >1e-6 / max|dev| 1.95e-14; raw P>0 → 1 divergence; ε·max floor → over-drops 9 genuine bins; drop-Nyquist → breaks 11199. The ε²-floor reproduces numpy's surviving-bin set on all 11200 windows.
Corroborated THREE independent ways: the probe-form (SSoT; numpy.fft + numpy.polyfit), a from-scratch clean-room hand DFT + closed-form OLS (no library FFT, no polyfit; mirrors the Rust kernel incl. its ε²-floor; agrees at 2.7e-14), and scipy (scipy.fft.rfft + scipy.stats.linregress; agrees at 1.4e-14) — the split cleanly confirms numpy.fft (via the hand DFT) and numpy.polyfit (via scipy's independent OLS). The trap: card 75 lists librosa (poly_features, order 1), but librosa.feature.poly_features fits a polynomial to spectrogram magnitude over LINEAR frequency (S≈c1·f+c0) — it is not a log-power-vs-log-frequency PSD slope and is the WRONG tool for this 1/fα exponent. The correct discrete reference is a log-log OLS over the one-sided power spectrum: scipy (FFT + linregress, BSD-3). Same errata pattern as sevcik (antropy→neurokit2) + sign_entropy (NPEET→pyitlib).
observe(close_mid) reads the slope over the trailing 200 raw closes BEFORE this bar, then folds this close in; persists across gaps (no gap-null, no reset). Residual: live bigblack producer-vs-oracle smoke (no CH/MT5 on laptop — deferred to operator).mise run check:all-gates green on macOS except (a) worktree-context check:git-hook-installed and (b) the STANDING foreign research-orthogonality substrate-skip (see handoff). feature-metadata:verify-offline PASS.CompletedBar field required a 1-line Default::default() in 9 explicit literals (2 blocklisted test files) — exact-match on the stripped literal opener, so -> CompletedBar { return-type lines are never touched (verified exactly 9 hits). Same pattern as #91–#98.spectral_log_slope; field-unions with #91–#98 at operator merge. Merge order: #90 → #91 → … → #98 → #99.research-orthogonality substrate-skip recurs as a STANDING foreign item (first surfaced #92; rust-enhancement loop follow-up; scripts/research/ untouched — 0 files).9 of 9 implementable orthogonal features shipped (#91–#99) + bootstrap (#90). The 5 deferred candidates (3 substrate-blocked: local_variation_lv, pietra_hoover_durations, spread_sign_reversal_rate; 2 parameter-flagged: dhvg_indeg_outdeg_kld, mean_cosine_turning_angle) were NOT attempted per the locked 9-of-14 scope. Operator merges PRs in order #90 → … → #99 (field-union resolution on BarOrthogonalExtV1 / BarRow / schema.sql).
Presentation only — never the SSoT.