Commit Graph

116 Commits

Author SHA1 Message Date
jgrusewski
d45692934a docs: production safety audit implementation plan (38 tasks, 5 layers)
Layer 0: Data Integrity (7 fixes) — position race, price validation, counters
Layer 1: Risk Enforcement (10 fixes) — order atomicity, overfill, risk bypass
Layer 2: ML Pipeline (10 fixes) — random weights, epsilon-greedy, NaN validation
Layer 3: Broker Safety (5 fixes) — connection drops, volume overflow, DB sync
Layer 4: Auth & Ops (6 fixes) — auth stub gating, live trading confirmation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:00:29 +01:00
jgrusewski
7e9a3841f0 docs: production safety audit design — 38 fixes across 5 layers
4-domain code audit found 13 CRITICAL, 14 HIGH, 10 MEDIUM issues.
Organized as layer-by-layer remediation:
- Layer 0: Data integrity (positions, prices, market data)
- Layer 1: Risk enforcement (make checks actually block)
- Layer 2: ML pipeline (real weights, bounded predictions)
- Layer 3: Broker safety (connection handling, volumes)
- Layer 4: Auth & ops (credentials, rate limiting, monitoring)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:51:54 +01:00
jgrusewski
17c49f0788 docs: add real data training pipeline design and implementation plan
Design: Download 730 days Databento OHLCV-1m for 4 CME futures,
train DQN + PPO with hyperopt, walk-forward evaluation.

Implementation: 9 tasks — quarterly download binary, walk-forward
splitter, hyperopt runner, training binary, evaluation binary,
DBN wiring, integration tests, manual execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:07:03 +01:00
jgrusewski
7b870726ab docs: add production pipeline wiring implementation plan (10 tasks)
Detailed TDD implementation plan for wiring all 10 ML models into
the ensemble coordinator. Covers 5 new inference adapters (KAN, TGGN,
xLSTM, TLOB, Diffusion), main.rs registration with equal weights,
market data wiring, E2E integration test, Docker/CI validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:59:18 +01:00
jgrusewski
d268a9dca8 docs: add production pipeline wiring design (6 tasks)
Wire existing components into end-to-end pipeline: 5 missing inference
adapters, 10-model registration, market data feeding, integration test,
Docker build validation, and CI pipeline triage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:43:22 +01:00
jgrusewski
ae225b0e31 docs: add trading universe & data organization implementation plan
10-task plan: unify AssetClass, add trading_symbol field, futures_baseline()
preset, TOML config loading, DatasetSpec::from_universe() wiring, data
reorganization into cache structure, stale data cleanup, manifest generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:21:48 +01:00
jgrusewski
66966806c7 docs: add trading universe & data organization design
Define futures baseline universe (ES, NQ, ZN, 6E) with micro
contract mapping for limited capital. Reorganize scattered test
data into cache structure. Download spec for 730 days of OHLCV-1m.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:17:22 +01:00
jgrusewski
9f499282ac docs: add data pipeline & asset selection implementation plan
8-task plan across 3 phases: data pipeline (types, cache, manager,
prepared dataset), asset selection (universe, scorer, selector),
and integration wiring. 7 new files, ~51 tests estimated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:36:45 +01:00
jgrusewski
df251a9d7e docs: add data pipeline and asset selection design
Covers automated data downloading/caching for ML training and
a tiered asset selection funnel (universe → predictability → regime → signal).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:28:02 +01:00
jgrusewski
f0bafdf30b docs: add operational maturity implementation plan (12 tasks, 6 phases)
Three pillars: 7-gate conviction system, autonomous feedback loop
with kill switch, Rust-native model registry. QuestDB analytics layer.
~55 tests, 7 new files planned across ml/ and trading_service/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:11:28 +01:00
jgrusewski
abf4baf30e docs: add operational maturity system design (3 pillars)
7-gate conviction system, autonomous feedback loop with kill switch,
and Rust-native model registry — backed by PostgreSQL + QuestDB.
Resolve merge conflicts in hyperopt/adapters/mod.rs and enhanced_ml.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:02:52 +01:00
jgrusewski
10f9cfadb7 feat(infra): GPU training launcher with local/cloud routing
Add train_launcher.sh that detects local GPU VRAM and routes training
to local or Scaleway cloud. Auto-selects batch size per model based on
available VRAM tier. Maps model names to actual ml/examples/train_*.rs
cargo targets. Document Scaleway GPU instance types, setup procedure,
batch size tables, and cost estimates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:19:58 +01:00
jgrusewski
17727d5db9 docs: add dynamic GPU detection implementation plan
8 bite-sized tasks with TDD approach, exact file paths, and complete code.
Covers: DeviceConfig relocation, GpuCapabilities detection,
ModelMemoryEstimate per-model profiles, and wiring into PPO trainer
and hyperopt campaign.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:56:45 +01:00
jgrusewski
ea81c751c0 docs: add dynamic GPU detection design plan
Centralizes GPU device selection, capability detection, and per-model
batch size optimization to replace hardcoded RTX 3050 Ti limits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:53:04 +01:00
jgrusewski
15c0fb5397 merge: pull liquid CfC v2 and codebase deduplication from main into production-hardening 2026-02-23 10:09:25 +01:00
jgrusewski
7fd5ad4286 docs: production hardening phase 2 implementation plan — 19 tasks
4 layers: Safety Net (6 tasks), Correctness (6 tasks incl. CfC ensemble),
Verification (4 tasks), Training Infrastructure (3 tasks incl. Databento).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:39:13 +01:00
jgrusewski
fad71033ff docs: production hardening phase 2 design — $100K live trading readiness
4-layer risk-prioritized approach: safety net (crash prevention),
correctness (accurate calculations + liquid CfC ensemble integration),
verification (test coverage), training infrastructure (Databento + GPU).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:33:55 +01:00
jgrusewski
d9fa536511 docs: add ML ensemble expansion implementation plan (36 tasks, 6 phases)
Sequential build plan for 5 model integrations (TGGN, TLOB, KAN,
xLSTM, Diffusion) with TDD, worktree isolation, and full trait
implementations (UnifiedTrainable + ParameterSpace + hyperopt).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 00:05:28 +01:00
jgrusewski
1408d33f4f docs: add ML ensemble expansion design (7→10 models, 5 integrations)
Approved design for expanding the ensemble with KAN, xLSTM, and
Diffusion architectures plus bringing TGGN/TLOB to full integration.
Sequential build order, no god classes, modular decomposition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 23:56:38 +01:00
jgrusewski
8b74a9a42e docs: add production hardening implementation plan (53 tasks, 5 phases)
Phase 1: ML pipeline verification (checkpoint roundtrip, feature extraction)
Phase 2: Service production logic (hardcoded values, stub responses)
Phases 3-5: Backtesting, ML crate TODOs, infrastructure/security/cleanup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:51:56 +01:00
jgrusewski
340ec0d68f docs: add production hardening design (53 tasks, 5 phases)
Covers all TODO/FIXME items across workspace, checkpoint roundtrip
tests, feature extraction pipeline tests, and infrastructure cleanup.
No overlap with dedup-cleanup or liquid-cfc plans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:33:08 +01:00
jgrusewski
3e1c415b8d docs: add codebase de-duplication implementation plan
18 tasks across 4 phases:
- Phase 1: OrderType, ConfigError, TLS types (zero risk)
- Phase 2: ErrorCategory, ModelType, re-export cleanup (low risk)
- Phase 3: Dead code audit, config warnings, Adam move (low risk)
- Phase 4: CircuitBreaker trait + inline CB replacement (medium risk)

Scoped out: ErrorSeverity (semantically different variants),
RetryStrategy (complex merge), trading_engine/risk CBs (domain-specific)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 20:01:12 +01:00
jgrusewski
f31c852a45 docs: add codebase de-duplication design
4-phase bottom-up consolidation plan:
- Phase 1: TLS, ErrorSeverity, ConfigError, OrderType (zero risk)
- Phase 2: RetryStrategy, ErrorCategory, ModelType, re-exports (low risk)
- Phase 3: Dead code audit, hardcoded config warnings, Adam move (low risk)
- Phase 4: CircuitBreaker trait hierarchy (medium risk)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 19:54:53 +01:00
jgrusewski
30a96db895 infra: update cloud-init with lessons from Gitea deployment
Fixes discovered during live provisioning: app.ini permissions
(root:gitea + 660→640 for token generation), HTTPS via acme.sh
DNS-01, setcap for port 443, admin user creation, INSTALL_LOCK
lifecycle. Secrets replaced with placeholders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 19:23:30 +01:00
jgrusewski
2fc92c80d5 docs: Phase 5 production readiness design and implementation plan
24 tasks across 5 pillars: runtime crash elimination, service wiring,
credential cleanup, clippy hardening, and remaining HIGH items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 23:06:50 +01:00
jgrusewski
3e410f29e3 docs: Phase 4 production readiness design and implementation plan
16 tasks across 4 pillars: Safety & Crash Elimination, Trading
Correctness, Compliance & Code Quality, ML Pipeline Quality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 20:21:01 +01:00
jgrusewski
86712a1216 docs: production readiness phase 3 implementation plan — 18 tasks
Bite-sized steps for each task with exact file paths, code snippets,
verification commands, and parallel execution strategy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 19:00:43 +01:00
jgrusewski
aa6669ede0 docs: production readiness phase 3 design — 18 tasks across 4 pillars
Safety, live trading, security, and observability gaps identified
from comprehensive codebase audit. Organized for parallel swarm execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 18:53:38 +01:00
jgrusewski
4069eb473c docs: backtesting vertical slice implementation plan
8-task TDD plan to bridge 8 disconnected layers in the backtesting
pipeline: DBN converter, replay engine, 51-dim feature wiring,
model loader, registry startup, position tracking, PnL tracking,
and end-to-end integration test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:30:00 +01:00
jgrusewski
4354098d11 docs: Phase 1-2 data pipeline and trading service implementation plan
13-task plan covering data pipeline fixes (Databento stream, data acquisition,
DBN uploader) and trading service core wiring (RiskEngine, MLEngine, VaR,
feature extraction, order matching, API gateway, Prometheus panics).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:25:17 +01:00
jgrusewski
30241e858d docs: backtesting vertical slice production readiness design
8-task plan to bridge disconnected backtesting pipeline layers:
DBN parser → feature extraction → ML inference → position tracking → PnL

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:21:22 +01:00
jgrusewski
e2a712593a docs: full system production readiness design (6-phase plan)
Covers data pipeline, trading service core, broker connectivity
(FIX 4.4 + TWS), execution algorithms, security/compliance, and
observability — based on comprehensive non-ML audit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:18:19 +01:00
jgrusewski
faa7b85cea docs: real-data ensemble backtest and hyperopt deploy design
Two-phase design:
A) Real 6E.FUT data → 4-model ensemble → PaperBroker → P&L metrics
B) Best hyperopt params → train → deploy to ensemble → ValidationHarness

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 15:04:58 +01:00
jgrusewski
2dd3326aec docs: ensemble real inference design and implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 14:58:36 +01:00
jgrusewski
919773a741 docs: full-stack ML integration design (cleanup → ensemble → hyperopt → paper trading)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 13:19:17 +01:00
jgrusewski
fbf9c8a5aa docs: capital-ready validation roadmap implementation plan
14 TDD tasks across 4 sections: data integrity (TemporalGuard,
SlippageModel), walk-forward robustness (DegradationTracker, NoiseInjector,
SensitivityAnalyzer), risk enforcement (RiskAction, RiskEnforcer,
GraduatedRecovery, CorrelationMonitor), and E2E integration (pipeline
traits, RiskGate, operating modes, DriftResponder, observability).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 10:39:54 +01:00
jgrusewski
9641250382 docs: capital-ready validation roadmap design
Bottom-up design covering data integrity (leakage prevention, dynamic
slippage), walk-forward robustness (degradation curves, noise injection),
risk auto-enforcement (drawdown→position reduction, kill switch→liquidation),
and end-to-end pipeline integration with operating mode transitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 10:33:54 +01:00
jgrusewski
4b51c300ad feat(validation): add PPO adapter for validation harness (MLP + LSTM)
Create PpoStrategy and PpoLstmStrategy implementing ValidatableStrategy
to run PPO through walk-forward validation with DSR, PBO, and permutation
tests. Both variants validated on real 6E.FUT data (29,937 bars, 15 folds).

Key implementation detail: LSTM hidden states are detached from the
computation graph after each step to prevent stack overflow from
unbounded graph growth across 30k+ sequential forward passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 10:23:48 +01:00
jgrusewski
b4e1ce30e1 docs: add gradient accumulation implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:59:14 +01:00
jgrusewski
1d6663027e docs: add gradient accumulation design
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:53:45 +01:00
jgrusewski
079f3192eb docs: add DQN pipeline production readiness design
4-phase plan: fix tests + OOM safety, inference path,
longer training, hyperopt end-to-end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:49:41 +01:00
jgrusewski
ee601149de docs: add DQN training smoke test implementation plan
4-task plan: add trainer accessors, write smoke test with 6 core
assertions (loss convergence, finite losses, Q-value divergence,
checkpoint integrity, epsilon decay), add Sharpe comparison vs
untrained baseline, final verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:03:10 +01:00
jgrusewski
525355fe73 docs: add DQN training smoke test design
Single integration test that verifies the complete train → checkpoint →
validate pipeline works on real 6E.FUT data. 7 assertions covering
loss convergence, Q-value divergence, checkpoint round-trip, epsilon
decay, and Sharpe improvement vs untrained baseline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:56:20 +01:00
jgrusewski
6007f98c26 docs: Add DQN algorithm fix implementation plan (11 tasks)
Detailed TDD implementation plan for:
- Task 1: Bug fixes (NaN panic, Adam eps, dedup enum)
- Task 2: State dimension consolidation (→51)
- Task 3-5: CQL offline RL regularization
- Task 4,6-9: IQN distributional RL (replaces broken C51)
- Task 8: CVaR risk-aware action selection
- Task 10-11: Integration test and verification

Each task has exact file paths, code, test commands, and safety gates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:44:44 +01:00
jgrusewski
91af2b9334 docs: Add DQN algorithm fix & 2026 modernization design
Research-validated design for fixing critical DQN issues:
- CQL regularization for offline RL training on historical data
- IQN integration replacing broken C51 (Candle scatter_add bug)
- CVaR risk-aware action selection
- State dimension consolidation (51 is canonical)
- NaN panic fix, Adam epsilon fix per Rainbow paper

Verified against 20+ papers and 2026 SOTA.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:39:58 +01:00
jgrusewski
71444f9471 chore: purge all documentation except implementation plans
Remove 1,307 AI-generated markdown files (984 in docs/, 323 in archive/).
No code references these files. Plans directory preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:25:14 +01:00
jgrusewski
2b914728c6 docs: Add codebase deep clean implementation plan
16-task bottom-up execution plan with exact file paths, commands,
and safety gates. Covers: doc purge, dead code removal, module
consolidation, test reorganization, file splitting, and folder
restructuring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:21:25 +01:00
jgrusewski
cec36d3072 docs: Add codebase deep clean design document
Comprehensive cleanup plan covering: documentation purge, dead code
removal (~4,846 lines across 11 files), module consolidation,
test reorganization, large file splitting, and folder restructuring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:08:10 +01:00
jgrusewski
49ad0050aa chore: Major documentation cleanup - remove 2,060 obsolete files
BREAKING: Removes 746,569 lines of outdated documentation from root folder

## Summary
- Deleted 2,060 report/documentation files from root folder
- Kept only essential files: README.md, CLAUDE.md
- Updated .gitignore and config/tarpaulin.toml
- Reorganized config files into config/ directory

## Removed Content Categories
- Agent reports (AGENT_*.md, AGENT*.txt)
- Wave reports (WAVE_*.md, DQN_*.md)
- Implementation summaries
- Quick references and summaries
- Test reports and validation docs
- Deployment scripts (obsolete .sh files)
- Legacy config files and logs

## Preserved
- README.md - Main project documentation
- CLAUDE.md - Claude Code configuration
- docs/archive/ - Historical files for reference
- docs/ folder - Current documentation
- All source code unchanged

🐝 Hive Mind Collective Intelligence Cleanup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 10:29:45 +01:00
jgrusewski
4080f73ba4 feat(ml): WAVE 30 - Implement optimized DQN logging module
Add comprehensive logging utilities for DQN training with best practices:

- LoggingConfig: Configurable log levels, intervals, and sampling rates
- MetricsAggregator: Windowed statistics (mean, std_dev) for training metrics
- SampledLogger: Rate-limited logging for high-frequency events

Key features:
- Structured logging with tracing crate (info/debug/trace hierarchy)
- 23 unit tests for full coverage
- Integration with existing DQN training pipeline

Bug fixes:
- Fix u8 overflow in prioritized_replay.rs test (500 > u8::MAX)
- Fix GradStore assertion in residual.rs (no is_empty method)
- Fix Tensor::get() Option/Result handling in quantile_regression.rs
- Fix Device PartialEq comparison in ensemble_network.rs

Documentation:
- Add Rust logging best practices guide for ML training
- Add DQN logging analysis and design summary

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 00:15:23 +01:00