Iteration 07 · 2026-06-09 · driver: native Claude Code /loop (laptop run)
← Dashboard · PR terrylica/mql5#96 · card 20 · cut off bootstrap #90
fxview_cache.forex_bars: bit-exact Rust verified against a pinned Python SSoT, populated through the wired producer, with batch≡streaming parity and an independent 3-way FOSS corroboration. PR #96 open (base main; diff auto-cleans once #90 + #91 + #92 + #93 + #94 + #95 land).
Normalized Mann-Kendall monotonic-trend Z (Mann 1945 / Kendall 1975, DOI:10.2307/1907187) of the per-bar mid-close level over the 200-bar strictly-trailing window — a rank-based, distribution-free measure of directional drift. Causal: the window is the 200 bars BEFORE bar i (current bar excluded). None on warmup (<200 trailing closes). Two SSoT subtleties pinned bit-for-bit to the probe k_mann_kendall (NOT pymannkendall): (1) sign convention — S = Σ_{i<j} sign(close[i]−close[j]) via np.triu(np.sign(np.subtract.outer(y,y)),1) (EARLIER−LATER, the negated textbook MK; since (S−sign(S))/√var is odd in S, an uptrend yields a NEGATIVE Z); (2) variance — n(n-1)(2n+5)/18 with NO tie correction. Substrate = RAW mid-close level (NO log-return, NO weekend/Ouroboros gap-null — gaps are part of the level path, identical to hvg_clustering).
| Layer | Artifact | Result |
|---|---|---|
| Python SSoT | oracle_mann_kendall_z.py — bit-faithful reproduction of probe k_mann_kendall over the "close" 200-bar window | sha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar |
| Rust kernel | orthogonal_extension_kernels::mann_kendall_z — integer-exact i64 pair-sign S + simple variance + (S−sign(S))/√var; no new dep (f64::sqrt) | clippy clean; 8 unit tests pin probe-exact values |
| Differential parity | vs the pinned oracle on the frozen fixture | 11200 == oracle, 12000 bars == rows, max|dev| 3.553e-15 (S exact, Z ≈1 ulp) |
| Producer column | BarOrthogonalExtV1 { mann_kendall_z } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yaml | test_schema_contract 4/4 |
| Producer populate | MannKendallZRollingState — 200-bar RAW close ring (no logret, no gap-null); read-before-push observe(close_mid) @ finalize | — |
| batch≡streaming | streaming observe() over the fixture per partition | 11200 == oracle, max|dev| 3.553e-15 (identical to batch) |
| 3-way FOSS | probe-form vs clean-room nested-loop vs pymannkendall@MIT integer S | PASS — 0 S-mismatches (3-way), 0 Z-mismatches, max|dev_Z| 0.000e+00 / 11200 |
The integer S statistic is corroborated by THREE independent counters: the probe's np.triu(np.sign(outer)), a from-scratch clean-room O(n²) nested-loop pair-sign sum, and pymannkendall@MIT's tau-based .s (asserting pmk.s == −S_probe) — all agree integer-exact over 11200 windows; S_probe ≡ S_cleanroom Z-values agree bit-for-bit (max|dev| 0.000e+00). KEY FINDING: the "close" substrate is TIE-PERVASIVE — 100% of 200-close windows contain ties (ODB range-bar closes recur at discrete broker-tick levels), so pymannkendall's tie-corrected Z diverges from the SSoT simple-variance Z by up to ~1.7e-3. This is the load-bearing reason the probe (hence the kernel) uses the simple variance: adopting pymannkendall as the oracle would have made the production column materially WRONG. The 2-way Rust↔probe parity alone could not have surfaced this — the FOSS leg did. (cran/Kendall is GPL-2 and is NOT used; only pymannkendall@MIT + a clean-room-from-formula leg.)
observe(close_mid) reads the MK Z over the trailing 200 raw closes BEFORE this bar, then folds this close in; no gap-null / no reset (gaps are part of the level path). Residual: live bigblack producer-vs-oracle smoke (no CH/MT5 on laptop — deferred to operator).dec10 == −inc10) and the simple, no-tie-correction variance; the FOSS tie-pervasive finding proves the no-tie-correction choice is load-bearing (NOT a defect).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. rust-bash-line-ref-bounds 199 refs / 0 failures.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. Same pattern as #91–#95.mann_kendall_z; field-unions with #91–#95 at operator merge. Merge order: #90 → #91 → #92 → #93 → #94 → #95 → #96.research-orthogonality substrate-skip recurs as a STANDING foreign item (first surfaced #92; rust-enhancement loop follow-up; scripts/research/ untouched — 0 files).Feature #7 — sevcik_fd (card 10, Sevcik fractal dimension of the close path; ε ~1e-9; FOSS ref neurokit2.fractal_sevcik, NOT antropy — per the bootstrap errata).
Presentation only — never the SSoT.