โ€บNavigation

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

Feature #3 โ€” hvg_clustering (PR #93)

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

Done. The third ฮพ-confirmed candidate โ€” and the FIRST graph-topology feature โ€” is a REAL continuous-float production column on 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 FOSS corroboration. PR #93 open (base main; diff auto-cleans once #90 + #91 + #92 land).

What it computes

Mean local clustering coefficient of the Horizontal Visibility Graph (Luque-Lacasa PRE 2009) of the raw 200-bar strictly-trailing close window. Causal: the window is the 200 bars BEFORE bar i (current bar excluded). Value โˆˆ [0,1]. None on warmup (<200 bars). Substrate distinction from #1: the HVG consumes raw closes DIRECTLY โ€” NO log-return, NO gap-NULL; weekend/Ouroboros gaps are part of the shape the graph sees.

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

LayerArtifactResult
Python SSoToracle_hvg_clustering.py โ€” networkx.average_clustering(ts2vg.HorizontalVG().build(closes)) (ts2vg 1.2.4 MIT + networkx 3.6.1 BSD)sha-pinned jsonl (12000 rows, 11200 finite) + .sha256 sidecar
Rust kernelorthogonal_extension_kernels::hvg_clustering โ€” O(nยฒ) running-max HVG (strict visibility, ties block) + 2e_i/(k_i(k_i-1)) clustering, node-order average; no transcendentals, no new depclippy clean
Differential parityvs the pinned oracle on the frozen fixture11200 == oracle, 12000 bars == rows, max|dev| 9.99e-16 (1 ulp)
Producer columnBarOrthogonalExtV1 { hvg_clustering } + BarRow + schema.sql Nullable(Float64) CODEC(Gorilla(8),ZSTD(1)) + feature_metadata.yamltest_schema_contract 4/4
Producer populateHvgClusteringRollingState (200-bar close ring, read-before-push, NO gap-NULL, persists across gaps) @ finalizeโ€”
batchโ‰กstreamingstreaming observe() over the fixture per partition11200 == oracle, max|dev| 9.99e-16 (identical to batch)
3-way FOSSts2vg+networkx vs clean-room numpy HVG+clusteringPASS โ€” 0 edge-set mismatches / 11200, clustering 9.99e-16

3-way FOSS finding (it earned its keep)

No second mainstream Python HVG-clustering library exists โ€” ts2vg+networkx is canonical. So the independent leg is a from-scratch clean-room numpy implementation sharing NO code with the SSoT: HVG built via a cumulative-max formulation (distinct from ts2vg's internal algorithm AND the Rust kernel's sequential scan), clustering via explicit neighbour-pair adjacency lookups (distinct from networkx's triangle iterator). The HVG edge set is uniquely determined by the rule, so the strongest check is edge-set equality: 0 mismatches across all 11200 windows โ€” the bug-prone graph construction corroborated by two independent algorithms โ€” and the clustering matched to 9.99e-16. Triangulates with Rust==SSoT at 9.99e-16: ts2vg+networkx == clean-room numpy == Rust.

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

Gates / scope

Next

Feature #4 โ€” kendall_taub_ret_spread (card 79, scipy.kendalltau(variant='b') over the returnร—spread window, EXACT+ฮต).

Presentation only โ€” never the SSoT.