Files
gavindiazandClaude Code 3a005ddcc6
Docs / Validate documentation (push) Canceled after 0s
Docs / Deploy GitHub Pages (push) Canceled after 0s
CI Final Summary (AI) / AI Final Summary (push) Canceled after 0s
CI Final Summary (AI) / Push/PR event feed (push) Canceled after 0s
CI / CI Integrity and Change Classification (push) Canceled after 0s
CI / Code Quality & Tests (push) Canceled after 0s
Dependency Lock & Migration Safety / Dependency drift (lock vs pyproject) (push) Canceled after 0s
Dependency Lock & Migration Safety / Migration safety (fail-loud + version postconditions) (push) Canceled after 0s
JS Tests / Frontend JS Unit Tests (push) Canceled after 0s
Security / CodeQL Analysis (push) Canceled after 0s
Security / Trivy Vulnerability Scan (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (macos-latest) (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (windows-latest) (push) Canceled after 0s
CI / Extended Validation (Tier 2) (push) Canceled after 0s
CI / Heavy CI (database-provider) (push) Canceled after 0s
CI / Heavy CI (e2e) (push) Canceled after 0s
CI / Heavy CI (integration) (push) Canceled after 0s
CI / Heavy CI (model-validation) (push) Canceled after 0s
CI / Heavy CI (research-backtest) (push) Canceled after 0s
CI / Aggregate CI Results (push) Canceled after 0s
chore(repo): initial import of Nexus Trading Forex Bot into self-hosted hosting
Full project import for the self-hosted code hosting
(https://code.aifunny.ltd/gavindiaz/my-NexusTradingForexBot.git).

Includes the live-freshness + scaler-hash fixes for the permanent
STALE dashboard (tick_pipeline now_utc stamps; infer_probabilities
computes model_input_hash on the actual scaled 70D tensor), the
data-fetch default-path fix, the g29 web-auth test fixes, and a
Chinese user manual (使用手册.md) for the web dashboard.

Scratch diagnostic scripts (check*.py, contain a live web-auth token)
and the .kilo/ agent-worktree directory are gitignored, not committed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-23 23:24:54 +08:00

4.0 KiB

title, description, lang
title description lang
System Map Component inventory of the Nexus Scalp Engine — packages, databases, workers, and the dependency shape. en

System Map

Package inventory (src/nexus_scalp/)

nexus_scalp/
├── domain/            frozen Pydantic contracts (TickData, TradeProposal, …)
├── ports/             IMT5Port · IGatewayPort        ← the hexagon seam
├── adapters/          mt5/ (Win32 IPC) · gateway (ZMQ) · paper/ · database/ (AuditRepository, WAL)
├── features/          scalp_features (50D) · schema registry · schema_contract (70D SSoT)
│                      liquidity_engine · regime_classifier · temporal (research)
├── models/            ScalpNet (dual-path TCN + self-attention)
├── training/          walk_forward_trainer · labeling/ (triple-barrier)
├── signals/           policy · rule matrix (~30 SMC rules)
├── strategies/        factory (+ provider_gate for LLM/AI services)
├── risk/              RiskEngine (Kelly sizing, clamps, kill switch)
├── execution/         order_manager (+ protection_ledger · position_state_machine ·
│                      recovery_budget extracted seams)
├── accounting/        core · aggregation · retention
├── application/       live_engine (async orchestrator)
├── experience/        ledger · outcome_recovery · evaluator (autopsy intelligence)
├── intelligence/      behavior detection · lifecycle · store
├── mslie/             market-structure perception (advisory)
├── research/          dataset · discovery · pipeline · backtest · walkforward · oos ·
│                      streaming_replay · forward_test · counterfactual · evidence · observability
├── model_generation/  artifact-first factory (datasets/experiments/models + manifests)
├── model_lifecycle/   candidate staging, champion/challenger
├── governance/        14-gate verify · promotion transaction · rollback preview
├── shadow/            shadow70 runtime (zero order authority)
├── news/              ingest · analysis · bounded gate · database (schema/articles/analysis/queries)
├── incidents/         correlation · lineage · impact · reports · worker
├── forensics/         health engine · deploy gate · experience_gap · trend
├── hygiene/           retention · quarantine · consistency · index health
├── observability/     logging (severity-split) · telegram notifier (read-only)
├── web/               server + domain route modules · debug_snapshot · db_console
├── release/           CLI shim · updater · verifier · packaging
├── settings/          service (settings DB authority) · secret_store
└── configuration/     AppConfig (bootstrap) · RuntimeConfigStore (authoritative snapshots)

Databases (SQLite, WAL)

DB Responsibility
artifacts/audit.db trading ledger, experience outcomes, accounting, research registry, strategy lifecycle, incidents
artifacts/news.db news ingestion, analysis, consensus, impacts

Writes queue through AuditRepository's background worker thread — the tick path never waits on the database (INV-001). Migrations are additive and checksummed (nexus db); hygiene is AUDIT_ONLY by default.

Workers (all off the tick hot path)

  • AuditRepository background writer thread
  • Research worker (dataset → discovery each cycle)
  • Training worker via asyncio.to_thread (auto-train disabled by default)
  • Hygiene worker (light 30m / deep 6h cadence, config-driven)
  • Incident worker (state machine STARTING/RUNNING/DEGRADED/FAILED)
  • Telegram notifier (read-only outbound, INV-010)

Model artifacts

artifacts/models/… + artifacts/model_generation/… — versioned bundles (model, scaler, manifest with schema hash + dataset ID + git commit). The 10-gate load gate validates every bundle before attach; width/hash mismatch blocks loudly. See Model pipeline.