متن انگلیسی نمایش داده می‌شود — ترجمه این صفحه هنوز تکمیل نشده است — انگلیسی
در این صفحه

Architecture Dependency Map — Nexus Scalp Engine (NSE)

Maintained per the MASTER MULTI-AGENT CONTRACT §9 (see agents/multi-agent-git-contract.md).

Describes actual subsystem relationships (verified against executable code; see agents/skill.md for the full inventory).

Every edge documents: contract, direction, expected data, safety guarantees.

Canonical high-level flow

text
MT5
  │  (tick/order/position/account events)
  ▼
MT5 Adapter / Providers            [ports: IMT5Port; adapters: mt5/, paper/, remote]
  │  (normalized events)
  ▼
LiveEngine (async event loop)      [src/nexus_scalp/application/live_engine.py]
  ├─ Feature Engine                [features/scalp_features.py → FEATURE_VECTOR_50D]
  ├─ Model Runtime                 [models/scalp_net.py → MODEL_MANIFEST; Champion/Challenger]
  ├─ News Context                  [news/ → NEWS_CONTEXT]
  ├─ Experience Gate               [experience/ → TRADE_OUTCOME / EXIT_CLASSIFICATION]
  ├─ RiskEngine                    [risk/risk_engine.py → risk boundaries, INV-003]
  └─ OrderManager                  [execution/order_manager.py → TRADE_EXECUTION_CONTEXT, INV-004]
        │
        ▼
   Execution Outcome               [broker fills; parent-child lineage, INV-005/006]
        │
        ▼
Ledger Experience + Accounting     [artifacts/audit.db; accounting/ → ACCOUNTING_SNAPSHOT]
        │
        ▼
Research / Backtest                [research/ + strategies/ → STRATEGY_CANDIDATE / RESEARCH_RESULT]
        │
        ▼
Dashboard / Telegram               [web/ + Web/ → UI_STATE; telegram read-only, INV-010]

Edge contracts

EdgeContractDirectionExpected dataSafety guarantees
MT5 → AdaptersMT5_BROKER_SNAPSHOTbroker → engineticks, rates, positions, orders, accountbroker truth precedence (INV-011)
Adapters → LiveEnginenormalized eventsadapter → appnormalized ticks/barsno sync DB on tick path (INV-001)
LiveEngine → FeaturesFEATURE_VECTOR_50Dapp → features50 floats, finite, [-3,3]schema-controlled ordering (INV-009)
LiveEngine → ModelMODEL_MANIFESTapp → models(Batch,50) → 4 logitsChampion never overwritten
News → LiveEngineNEWS_CONTEXTnews → appcontext bundlecache-only on hot path
LiveEngine → RiskEngineproposal → riskapp → riskTradeProposalauthoritative risk boundaries (INV-003)
RiskEngine → OrderManagersized proposalrisk → executionlot, SL/TP, margin-safeHARD_MAX_LOTS / MAX_TOTAL_EXPOSURE
OrderManager → BrokerTRADE_EXECUTION_CONTEXTexecution → MT5orders/fillsparent-child lineage (INV-005)
Execution → Ledger/AccountingTRADE_OUTCOME / EXIT_CLASSIFICATIONexecution → audit.dboutcomes, classificationsUNKNOWN stays UNKNOWN (INV-012)
Ledger → ResearchRESEARCH_RESULTaudit.db → researchexperiences/outcomeshistorical experience immutable (INV-007)
Ledger → Dashboard/TelegramACCOUNTING_SNAPSHOT / UI_STATEaudit.db → websnapshots, reportstelegram read-only (INV-010)

Ownership (contract §3)

LiveEngine → Hermes-Runtime · OrderManager/Execution → Hermes-Execution · RiskEngine → Hermes-Risk · MT5 Adapter/Providers → Hermes-MT5 · Experience/Learning → Hermes-Learning · Research/Backtesting → Hermes-Research · News → Hermes-News · Accounting → Hermes-Accounting · Model → Hermes-Model · Web/Dashboard → Hermes-UI · Release → Hermes-Release. Cross-owner changes MUST be tagged CROSS-OWNER CHANGE with justification.