โ€บNavigation

Iteration 10 (FINAL) ยท 2026-06-09 ยท driver: native Claude Code /loop (laptop run)

Feature #9 โ€” spectral_log_slope (PR #99) ยท campaign complete 9/9

โ† Dashboard ยท PR terrylica/mql5#99 ยท card 75 ยท cut off bootstrap #90

Done โ€” final feature. The ninth and last ฮพ-confirmed implementable candidate โ€” the FIRST spectral / log-log-PSD feature โ€” is a REAL continuous-float production column on 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.

What it computes

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).

The chain โ€” one SSoT, bit-faithful to the column

LayerArtifactResult
Python SSoToracle_spectral_log_slope.py โ€” bit-faithful reproduction of probe k_spectral_slope over the "close" 200-bar windowsha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar
Rust kernelorthogonal_extension_kernels::spectral_log_slope โ€” mean-center โ†’ direct real DFT (mod-n twiddle) โ†’ drop DC โ†’ numerical-zero mask โ†’ closed-form OLS slope; no new depclippy clean; 8 unit tests pin probe values
Differential parityvs the pinned oracle on the frozen fixture11200 == oracle, 12000 bars == rows, max|dev| 4.641e-14 โ‰ช 1e-6
Producer columnBarOrthogonalExtV1 { spectral_log_slope } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yamltest_schema_contract 4/4
Producer populateSpectralLogSlopeRollingState โ€” 200-bar close ring (no gap-null, like sevcik); read-before-push observe(close_mid) @ finalizeโ€”
batchโ‰กstreamingstreaming observe() over the fixture per partition11200 == oracle, max|dev| 4.641e-14 (identical to batch)
3-way FOSSprobe-form vs clean-room hand-DFT + closed-form OLS vs scipy.fft.rfft + scipy.stats.linregressPASS โ€” 0 mismatches, 0 mask divergences, max|dev| 2.7e-14 (clean-room) / 1.4e-14 (scipy) / 11200

The load-bearing finding โ€” FFT-mask fragility (the P>0 trap)

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.

3-way FOSS finding (the librosa trap)

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).

Challenge-and-Held (inline; sub-agent dispatch skipped per the tick-3 signal)

Gates / scope

Campaign complete

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.