المصدر الإنجليزي — الترجمة قيد الانتظار — الإنجليزية
في هذه الصفحة

Database Architecture

Canonical stores

DBContentsNotes
artifacts/audit.dbtrading ledger, experience outcomes, accounting, research registry, strategy lifecycle, incidents, hygieneone canonical ledger; SQLite WAL
artifacts/news.dbnews ingestion, analysis, consensus, impactslazy schema on first save
candle_intel.dbcandle intelligenceversioned schema
settings DBsecrets + user intent (Telegram creds via settings_service)never in YAML (INV-010)

Write path

AuditRepository queues writes to a background worker thread — the tick hot path never performs synchronous DB work (INV-001). Historical experience/outcome/ledger rows are immutable (INV-007); corrections go through evidence → reconstruction → derived records with provenance, never row rewrites.

Migrations

src/nexus_scalp/database/ migration engine (TASK-10): per-domain schema versions, checksummed registry, baseline detection, WAL-safe backups, OS-lock concurrency control, drift detection, downgrade block, startup gate, nexus db CLI. Migrations are append-only — financial truth, provenance and research evidence are never deleted.

Hygiene engine

Observe → classify → plan → validate → clean → verify. Non-destructive by default (AUDIT_ONLY); quarantine is MOVE-MARK-REPORT with restore/resolve and full provenance. Consistency rules validate TRADE/LEDGER/DATASET/NEWS (read-only); index health is advisory. CLI: nexus db hygiene status|plan|run (+ --dry-run --deep).

Model artifacts (filesystem, not DB)

The Model Factory stores versioned datasets/experiments/models with manifests under artifacts/model_generation/ and artifacts/models/ — inference needs no database.

Docker persistence

Named volumes nexus-artifacts + nexus-data; the container runs the migration gate at boot. See docs/docker.md.