feat: neural trader — market graph types, MinCut coherence gate, reservoir replay#244
Open
feat: neural trader — market graph types, MinCut coherence gate, reservoir replay#244
Conversation
ADR-084 defines the RuVector-native Neural Trader architecture using dynamic market graphs, mincut coherence gating, and proof-gated mutation. Includes three starter crates (neural-trader-core, neural-trader-coherence, neural-trader-replay) with canonical types, threshold gate, reservoir memory store, and 10 passing tests. https://claude.ai/code/session_01EExDkEDv4eejvfgqUWnSks
ADR: - Add SQL indexes on (symbol_id, ts_ns) for all tables - Add HNSW index on nt_embeddings.embedding - Range-partition nt_event_log and nt_segments by timestamp - Add retention config (hot/warm/cold TTL) to example YAML - Add retrieval weight normalization constraint (α+β+γ+δ=1) - Cross-reference existing examples/neural-trader/ Code: - core: Replace String property keys with PropertyKey enum (zero alloc) - core: Add PartialEq on MarketEvent for test assertions - coherence: Fix redundant drift check — learning now requires half drift margin (stricter than act/write) - coherence: Add boundary_stable_count to GateContext and enforce boundary stability window threshold from ADR gate policy - coherence: Add PartialEq on CoherenceDecision - coherence: Add 2 new tests (high_drift, boundary_instability) - replay: Switch ReservoirStore from Vec to VecDeque for O(1) eviction - replay: Use RegimeLabel enum instead of Option<String> in MemoryQuery 12 tests pass (was 10). https://claude.ai/code/session_01EExDkEDv4eejvfgqUWnSks
- Rename ADR-084-neural-trader to ADR-085 (ADR-084 is taken by ruvllm-wasm-publish) - Move serde_json to dev-dependencies in neural-trader-core (only used in tests) - Remove unused neural-trader-core dependency from neural-trader-coherence Co-Authored-By: claude-flow <ruv@ruv.net>
9 tasks
Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
neural-trader-core— Canonical market event types (MarketEvent,GraphDelta), ingest pipeline traits (EventIngestor,GraphUpdater,Embedder), and graph schemaneural-trader-coherence— MinCut coherence gate with CUSUM drift detection, tiered permission system (retrieve > write/act > learn), and regime-dependent volatility floorsneural-trader-replay— Reservoir store with capacity-boundedVecDeque, gated writes through coherence gate, and witness receipt loggingserde_jsonmoved to dev-deps in core, unusedneural-trader-coredep removed from coherenceArchitecture (ADR-085)
Six-layer pipeline treating the limit order book as a dynamic heterogeneous typed graph:
This PR implements L1 (types/ingest), L5 (coherence gate), and L4 (replay store). Remaining layers (L2 graph construction, L3 GNN embeddings, L6 policy actuation) are tracked for follow-up.
Test plan
cargo check -p neural-trader-{core,coherence,replay}— compiles cleancargo test -p neural-trader-{core,coherence,replay}— 12/12 pass🤖 Generated with claude-flow