Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
765a7f1
feat(data-layer): close phase 9 runtime correctness
BobbyAxerol Aug 18, 2026
7302c45
fix(data-layer): preserve data outage across reconnect
BobbyAxerol Aug 18, 2026
51497a2
docs(data-layer): certify phase 9 runtime closure
BobbyAxerol Aug 18, 2026
5e36bdc
docs(data-layer): define phase 9 isolated v2 beta
BobbyAxerol Aug 18, 2026
16979cf
feat(data-layer): certify isolated v2 beta runtime
BobbyAxerol Aug 18, 2026
e956b96
fix(data-layer): make beta certification rootless portable
BobbyAxerol Aug 18, 2026
4955049
fix(data-layer): bridge beta evidence ownership safely
BobbyAxerol Aug 18, 2026
280b692
fix(data-layer): isolate beta runner evidence ownership
BobbyAxerol Aug 18, 2026
5c37170
fix(data-layer): grant evidence helper fowner only
BobbyAxerol Aug 18, 2026
1c88138
fix(data-layer): enable complete beta compose profiles
BobbyAxerol Aug 18, 2026
c10b2b8
fix(data-layer): make beta evidence checksums portable
BobbyAxerol Aug 18, 2026
c89ccb0
docs(data-layer): certify phase 9 isolated v2 beta
BobbyAxerol Aug 18, 2026
a380fbb
docs(data-layer): define phase 9 production prerequisites
BobbyAxerol Aug 18, 2026
30c6cde
feat(data-layer): enforce phase 9 production prerequisites
BobbyAxerol Aug 18, 2026
c7440ac
docs(data-layer): enforce plan journal rules
BobbyAxerol Aug 18, 2026
9d4d4b4
docs(data-layer): define phase 9 rust canary
BobbyAxerol Aug 18, 2026
c78da17
feat(data-layer): gate phase 9 rust canary
BobbyAxerol Aug 18, 2026
33e8bdb
feat(data-layer): fence phase 9 rust publications
BobbyAxerol Aug 18, 2026
2f4cbf7
feat(data-layer): certify isolated rust canary
BobbyAxerol Aug 18, 2026
1826c4b
docs(data-layer): close phase 9.1 rehearsal
BobbyAxerol Aug 18, 2026
83e25f8
docs(data-layer): define phase 9.2 primary handoff
BobbyAxerol Aug 18, 2026
243aaa9
feat(data-layer): enforce phase 9.2 primary handoff
BobbyAxerol Aug 18, 2026
827ed26
feat(data-layer): certify bounded Rust primary recovery
BobbyAxerol Aug 18, 2026
47ab165
docs(data-layer): define phase 9.3 governance
BobbyAxerol Aug 19, 2026
c7e60f2
feat(data-layer): govern primary hold and expansion
BobbyAxerol Aug 19, 2026
3155dd5
test(data-layer): certify phase 9.3 governance
BobbyAxerol Aug 19, 2026
07e2440
fix(data-layer): bind phase 9.3 closure evidence
BobbyAxerol Aug 19, 2026
82bc8f5
fix(ci): require stable PostgreSQL readiness
BobbyAxerol Aug 19, 2026
23b1599
fix(security): upgrade runtime Debian packages
BobbyAxerol Aug 19, 2026
317da4f
docs(data-layer): define Rust V2 Binance OKX closure
BobbyAxerol Aug 19, 2026
fc5e29e
feat(data-layer): freeze multivenue quantity contracts
BobbyAxerol Aug 19, 2026
15b5301
feat(data-layer): certify Rust multivenue realtime core
BobbyAxerol Aug 19, 2026
03115a9
feat(data-layer): freeze stable multivenue edge catalog
BobbyAxerol Aug 19, 2026
fcfd862
feat(data-layer): add stable Kafka projection edge
BobbyAxerol Aug 19, 2026
e90e3aa
feat(data-layer): freeze stable consumer migration contracts
BobbyAxerol Aug 19, 2026
467bbf3
feat(data-layer): package isolated stable multivenue runtime
BobbyAxerol Aug 19, 2026
b8b37d5
fix(data-layer): harden stable runtime certification
BobbyAxerol Aug 19, 2026
aec926d
fix(data-layer): enforce final bar policy in rust core
BobbyAxerol Aug 19, 2026
4a7bcc5
fix(data-layer): expose stable ingress on loopback
BobbyAxerol Aug 19, 2026
5f32238
fix(data-layer): supervise native provider recovery
BobbyAxerol Aug 19, 2026
a0a3f63
fix(data-layer): batch stable projector checkpoints
BobbyAxerol Aug 19, 2026
55e970e
fix(data-layer): supervise transactional core recovery
BobbyAxerol Aug 19, 2026
61e5485
perf(data-layer): pipeline transactional deliveries
BobbyAxerol Aug 19, 2026
3dc58cf
fix(data-layer): align OKX BBO sequence policy
BobbyAxerol Aug 19, 2026
391924f
perf(data-layer): batch stable projector durability path
BobbyAxerol Aug 19, 2026
883b478
perf(data-layer): shard stable rust core workers
BobbyAxerol Aug 19, 2026
c177bb0
perf(data-layer): stage rust core ordering state
BobbyAxerol Aug 19, 2026
f120173
fix(data-layer): query latest durable tail
BobbyAxerol Aug 19, 2026
d08c424
perf(data-layer): bound stable latest reads
BobbyAxerol Aug 19, 2026
066ce0f
fix(data-layer): supervise stable projector recovery
BobbyAxerol Aug 19, 2026
9afc21b
fix(data-layer): backpressure stable projector joins
BobbyAxerol Aug 19, 2026
5c0f3c6
fix(data-layer): make rust replay byte deterministic
BobbyAxerol Aug 19, 2026
c1701c1
fix(data-layer): answer binance websocket pings
BobbyAxerol Aug 19, 2026
0c97e29
fix(data-layer): harden native ingest restarts
BobbyAxerol Aug 19, 2026
3d0ff9c
perf(data-layer): bound stable projector cache
BobbyAxerol Aug 19, 2026
2b38f95
perf(data-layer): carry raw lineage with canonical records
BobbyAxerol Aug 19, 2026
ad4338d
feat(data-layer): bootstrap stable crypto bar history
BobbyAxerol Aug 19, 2026
6a9a19e
fix(data-layer): order native ingestor startup
BobbyAxerol Aug 19, 2026
0a25407
perf(data-layer): coalesce pending latest quotes
BobbyAxerol Aug 19, 2026
0228036
fix(data-layer): close stable multivenue bar gaps
BobbyAxerol Aug 19, 2026
872a572
fix(data-layer): retry provisional okx bar close
BobbyAxerol Aug 19, 2026
2135598
fix(data-layer): validate warmup freshness at watermark
BobbyAxerol Aug 19, 2026
df88de0
fix(data-layer): validate unified stream cursor scope
BobbyAxerol Aug 19, 2026
043f277
docs(data-layer): record stable consumer acceptance
BobbyAxerol Aug 19, 2026
cfc0246
fix(data-layer): close grpc streams in request context
BobbyAxerol Aug 19, 2026
154816d
fix(data-layer): add Kafka recovery headroom
BobbyAxerol Aug 19, 2026
6af2f25
fix(data-layer): fence projection cache generations
BobbyAxerol Aug 19, 2026
e002da6
feat(data-layer): add atomic stable cache rebuild
BobbyAxerol Aug 19, 2026
e55f682
fix(data-layer): bound stable cache recovery lag
BobbyAxerol Aug 19, 2026
2041f18
fix(data-layer): recover unacked closed bars
BobbyAxerol Aug 19, 2026
8851166
fix(data-layer): reconcile semantic bar replays
BobbyAxerol Aug 19, 2026
c61fa39
fix(data-layer): settle canonical bar semantics
BobbyAxerol Aug 19, 2026
7bab231
docs(data-layer): record phase b bar evidence
BobbyAxerol Aug 19, 2026
5054e1e
fix(data-layer): close stable recovery rehearsal
BobbyAxerol Aug 20, 2026
ea84a21
fix(data-layer): certify stable release source
BobbyAxerol Aug 20, 2026
4641bae
fix(data-layer): make stable bar ingestion restart safe
BobbyAxerol Aug 20, 2026
2412572
docs(data-layer): record phase b4 repair certification
BobbyAxerol Aug 20, 2026
f4c86d8
docs(data-layer): close phase b4 certification
BobbyAxerol Aug 20, 2026
583ae82
feat(dnse): harden versioned history acquisition
BobbyAxerol Aug 20, 2026
5d37976
feat(dnse): add durable closed-bar acquisition
BobbyAxerol Aug 20, 2026
e6a2e59
docs(data-layer): record DNSE provider closure
BobbyAxerol Aug 20, 2026
130da39
docs(data-layer): govern V2 production cutover
BobbyAxerol Aug 20, 2026
875edc1
docs(data-layer): record cutover preparation SHA
BobbyAxerol Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# ── DNSE OpenAPI ────────────────────────────────
DNSE_API_KEY=
DNSE_API_SECRET_KEY=
DNSE_API_VERSION=2026-07-23
DNSE_REST_BASE=https://openapi.dnse.com.vn
DNSE_WS_BASE=wss://ws-openapi.dnse.com.vn
# Keep false unless an approved egress proxy is required and monitored.
DNSE_REST_USE_ENV_PROXY=false
DNSE_REST_CONNECT_TIMEOUT_SECONDS=5
DNSE_REST_READ_TIMEOUT_SECONDS=30
DNSE_REST_ATTEMPTS=4
DNSE_REST_MAX_BACKOFF_SECONDS=30

# ── vnstock ─────────────────────────────────────
VNSTOCK_API_KEY=
Expand Down Expand Up @@ -35,6 +44,13 @@ DATA_LAYER_PRELOAD_WATCHDOG_ENABLED=true
BINANCE_WS_MAX_CONNS_PER_SOURCE=0
STREAM_STALE_SECONDS=180
STREAM_STRICT_FEED_HEALTH=false
BINANCE_WS_FIRST_FRAME_TIMEOUT_SECONDS=15
BINANCE_WS_IDLE_TIMEOUT_SECONDS=90
BINANCE_WS_QUEUE_PUT_TIMEOUT_SECONDS=2
BINANCE_KLINE_RECOVERY_ENABLED=true
BINANCE_KLINE_RECOVERY_POLL_SECONDS=2
BINANCE_KLINE_RECOVERY_SETTLE_SECONDS=1
BINANCE_KLINE_RECOVERY_CONCURRENCY=4
BINANCE_SYMBOLS_FILE=/app/data/cache/binance_usdm_symbols.json
BINANCE_SPOT_SYMBOLS_FILE=/app/symbols_spot.json

Expand Down
63 changes: 63 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Data Layer Agent Rules

This tracked file carries the workspace baseline into every clone of this
repository. For Data Layer work, the mandatory main journal is
`DATA_LAYER_UNIFIED_IMPLEMENTATION_PLAN.md`; detailed design is governed by
`upgrade/quant-data-layer-fund-grade-upgrade-architecture.md` and applicable
provider guides. Host-level `/home/bobby/AGENTS.md`, when present, may add
stricter workspace rules but may not weaken this file.

## Scope And Sources Of Truth

1. Before acting, read the nearest `AGENTS.md`, the project's main implementation plan, the approved detailed guide, and the relevant code/config. Do not rely on chat memory alone.
2. When the user asks to discuss, evaluate, explain, or plan only, do not edit files, restart services, mutate data, or run destructive commands.
3. Implement only the approved scope. Report newly discovered out-of-scope bugs and proposed fixes before changing them unless the user explicitly authorized fixing all discovered issues.
4. Preserve the declared domain source of truth. For alpha migrations, backtest/approved research logic and parameters are authoritative unless the user says otherwise. Do not silently simplify business logic.

## Mandatory Plan Journal

5. Every project change must be recorded in that project's main plan markdown. The plan update is part of the implementation transaction, not optional documentation after the fact.
6. Before code changes, record or confirm the phase/task status, goal, guide links, approved scope, invariants, test gates, rollback, and decision boundary in the main plan.
7. During implementation, update the plan incrementally after each coherent tested slice with exact work completed, commands/tests actually run, results, cleanup evidence, decisions, and remaining debt.
8. Never claim a task or phase is complete until the main plan and any governing detailed guide agree with the code and evidence. A final response must state the recorded status and link/path.
9. Technical debt means a real external, cost, infrastructure, licensing, business-semantics, or approval gate. Fix in-scope defects before closure; do not relabel unfinished work or failed tests as debt.
10. If a project has no identified main plan, identify or create one before substantial implementation. Do not scatter progress across ad hoc markdown files without linking them from the main plan.

## Runtime And Data Safety

11. Protect running production/V1 consumers by default. Use isolated names, ports, networks, schemas, Redis prefixes, volumes, topics, consumer groups, credentials, and evidence paths for development and tests.
12. Do not restart, recreate, cut over, prune, flush, truncate, force-close, delete volumes/data, or change authority unless the user explicitly approves the exact blast radius and rollback.
13. Production/shadow market data must come from approved real providers or replay of durably captured provider bytes. Synthetic/generated data is test-only and must carry test provenance.
14. Never commit secrets, raw credentials, private keys, unbounded logs, caches, runtime state, or generated data. Evidence stores identifiers, hashes, bounded metrics, and provenance only.
15. Clean disposable test resources and scoped smoke rows after verification. Never clean shared state broadly when an exact alpha/account/test namespace is available.

## Verification And Evidence

16. Test correctness before performance: identity, units, decimals, timestamps/timezones, ordering, bar closure, sequence, source authority, state transitions, risk/order semantics, and business-domain parity.
17. Use applicable unit, contract/golden, parity/oracle, migration-idempotency, integration, failure/reconnect, recovery/rollback, compatibility, security, resource/capacity, and bounded real-provider tests.
18. A health endpoint or process-up state alone is not acceptance. Report exact cases, pass/fail/skip counts, untested boundaries, production mutations, and cleanup results.
19. Never present local/same-host rehearsal as production, HA, independent failure-domain, broker-authoritative, sandbox/live, or real-provider evidence. Missing evidence fails closed and is documented honestly.
20. Read large logs and databases intelligently: filter relevant time ranges and warning/error/event IDs first, then query exact related rows. Avoid unbounded output and token-heavy tool use.

## Git And Change Discipline

21. Inspect branch/worktree before editing. Preserve user/unrelated changes and never revert them without explicit instruction.
22. Use feature branches from `dev` when the repository workflow requires it. Feature branches merge to `dev`; `main` is release-only. Never merge or push unless explicitly requested.
23. Commit each coherent, tested implementation slice with a clear message. Do not create excessive tiny commits or one giant untraceable commit.
24. Commits must use the user's configured identity (`BobbyAxerol <vugioan11022002@gmail.com>`), never a system/root identity. Verify identity before commit.
25. Before commit: run `git diff --check`, inspect staged scope, confirm tests/evidence and plan updates, and exclude unrelated files. After commit: report commit SHA, branch, worktree state, and whether anything was pushed/merged.

## Engineering And Operations

26. Prefer existing shared runtime, SDK, contracts, wrappers, parsers, and domain abstractions. Copy unchanged code mechanically when appropriate; avoid duplicated strategy-specific infrastructure.
27. Keep public V1/stable endpoints and schemas backward-compatible unless an approved versioned migration says otherwise. Internal implementation language and transport must stay behind contracts.
28. Design provider-neutral, venue-capability-driven, scalable boundaries. Do not hardcode one venue/mode where the domain needs extension to Binance, OKX, DNSE/VN, Deribit, or future brokers.
29. Optimize only after correctness. Measure CPU, memory, disk, queue/lag, I/O and latency; require no unexplained loss, duplicate, gap, or state mismatch before promotion.
30. Keep logs structured, host-visible where required, bounded and aligned to strategy/feed intervals. Avoid tick-level INFO spam unless actively diagnosing a new feed.
31. Use the smallest useful set of tools and agents. Prefer `rg`, targeted reads, scoped tests, reusable commands, and compact evidence over broad scans or repeated full-output calls.
32. Use `apply_patch` for manual edits when available. If the sandbox helper is broken, use an exact-match scripted replacement and immediately verify the diff.

## Reporting

33. Working updates explain what is being checked or changed and why. Final reports state: implemented scope, domain behavior, tests/evidence, runtime impact, cleanup, remaining decision gates, commit/branch, and the next permitted step.
34. Do not hide blockers or overstate readiness. Distinguish `implemented`, `tested locally`, `shadow-certified`, `production-ready`, and `production-authoritative` explicitly.
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"rust/qdl-core",
"rust/qdl-kafka",
"rust/qdl-provider-envelope",
"rust/qdl-realtime-core",
"rust/qdl-venue-core",
]
resolver = "2"
Expand All @@ -27,6 +28,6 @@ rustls = { version = "=0.23.43", default-features = false, features = ["ring", "
serde = { version = "=1.0.228", features = ["derive"] }
serde_json = "=1.0.145"
sha2 = "0.10.9"
tokio = { version = "=1.48.0", features = ["fs", "io-util", "macros", "rt-multi-thread", "sync", "time"] }
tokio = { version = "=1.48.0", features = ["fs", "io-util", "macros", "rt-multi-thread", "signal", "sync", "time"] }
tokio-tungstenite = { version = "=0.24.0", features = ["rustls-tls-webpki-roots"] }
zeroize = "=1.8.1"
Loading
Loading