Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
fad8073
feat(stream): add demand-aware recovery and health
BobbyAxerol Aug 12, 2026
cf8bfc2
chore(logging): make data layer rotation configurable
BobbyAxerol Aug 12, 2026
5e7d175
merge: urgent demand reliability hardening
BobbyAxerol Aug 12, 2026
b0cbdc5
fix(stream): include active USD-M delivery contracts
BobbyAxerol Aug 12, 2026
44da6c8
fix(ci): isolate compose networks on clean runners
BobbyAxerol Aug 12, 2026
d316cf4
docs(architecture): plan fund-grade data layer upgrade
BobbyAxerol Aug 12, 2026
80a47e2
docs(okx): map v5 market data guide to upgrade phases
BobbyAxerol Aug 13, 2026
58f8686
docs(architecture): stage durability before broker promotion
BobbyAxerol Aug 13, 2026
e55b1e3
feat(runtime): add validated market source ownership flags
BobbyAxerol Aug 13, 2026
965275e
fix(health): preserve source identity for kline demand
BobbyAxerol Aug 13, 2026
7f0eadd
test(phase0): freeze contracts and baseline runtime
BobbyAxerol Aug 13, 2026
5a3799e
feat(contracts): establish canonical market data v2
BobbyAxerol Aug 13, 2026
f44d657
feat(control): add canonical instrument registry foundation
BobbyAxerol Aug 13, 2026
62b6622
refactor(runtime): define dark role ownership boundaries
BobbyAxerol Aug 13, 2026
40ac6e7
docs(phase1): close canonical foundation with evidence
BobbyAxerol Aug 13, 2026
47645d6
fix(control): enforce atomic instrument metadata revisions
BobbyAxerol Aug 13, 2026
8f10792
docs(phase1): record final metadata regression evidence
BobbyAxerol Aug 13, 2026
1c235e9
test(phase1): certify isolated Redis integration
BobbyAxerol Aug 13, 2026
0ea4f52
feat(transport): add bounded durable replay bridge
BobbyAxerol Aug 13, 2026
33b7674
feat(pipeline): add restartable canonical shadow flow
BobbyAxerol Aug 13, 2026
bc2757a
feat(rust): add deterministic data-plane foundation
BobbyAxerol Aug 13, 2026
e2eab2f
feat(projection): rebuild Redis state from durable replay
BobbyAxerol Aug 13, 2026
4108330
perf(transport): batch durable commits and certify shadow slice
BobbyAxerol Aug 13, 2026
134a9f3
fix(transport): harden Phase 2 durability bounds
BobbyAxerol Aug 13, 2026
a344e84
ci(phase2): enforce recovery and security gates
BobbyAxerol Aug 13, 2026
dd8df84
docs(phase2): certify dark durability foundation
BobbyAxerol Aug 13, 2026
f2ac229
feat(data-plane): add demand fencing and queue controls
BobbyAxerol Aug 13, 2026
14c7499
feat(binance): add demand-scoped canonical shadow adapter
BobbyAxerol Aug 13, 2026
47fb7b6
feat(okx): add V5 shadow ingestion and book continuity
BobbyAxerol Aug 13, 2026
58a299a
feat(projection): add fenced compatibility data plane
BobbyAxerol Aug 13, 2026
ddb06cb
feat(rust): add real Binance shadow ingestion path
BobbyAxerol Aug 13, 2026
1933099
fix(ingestion): make websocket supervisors stop-safe
BobbyAxerol Aug 13, 2026
50e2cbb
test(phase3): certify sustained load and authority rollback
BobbyAxerol Aug 13, 2026
db774aa
docs(phase3): freeze scalable shadow ingestion
BobbyAxerol Aug 13, 2026
89747bf
docs(phase3): record isolated cleanup evidence
BobbyAxerol Aug 13, 2026
b251b3e
feat(quality): add canonical gap and authority state
BobbyAxerol Aug 13, 2026
632386f
feat(history): add atomic revision-aware shadow catalog
BobbyAxerol Aug 13, 2026
9f559dd
feat(replay): add signed gap-free snapshot handoff
BobbyAxerol Aug 13, 2026
a2a7943
feat(okx): add exact historical coverage adapter
BobbyAxerol Aug 13, 2026
38612f8
feat(quality): govern calendars and historical storage
BobbyAxerol Aug 13, 2026
46669f4
fix(quality): preserve generated protobuf namespace
BobbyAxerol Aug 13, 2026
9a45b2a
docs(phase4): freeze quality history and replay
BobbyAxerol Aug 13, 2026
1d65a9b
feat(query): harden v2 readiness contracts
BobbyAxerol Aug 13, 2026
7a4f431
test(query): certify v2 readiness failures
BobbyAxerol Aug 13, 2026
0472abc
test(stream): add bounded websocket provider probe
BobbyAxerol Aug 13, 2026
6ada6eb
docs(query): freeze pre-phase5 readiness
BobbyAxerol Aug 13, 2026
78302e8
feat(api): add provider-neutral v2 query contracts
BobbyAxerol Aug 13, 2026
9668e2e
feat(sdk): add resumable v2 stream client
BobbyAxerol Aug 13, 2026
9553377
test(migration): certify v2 shadow consumers
BobbyAxerol Aug 13, 2026
f234006
feat(migration): harden v2 consumer boundary
BobbyAxerol Aug 13, 2026
bdd1730
docs(phase5): freeze v2 consumer migration
BobbyAxerol Aug 13, 2026
ffd05be
feat(phase6): add bounded operations and security controls
BobbyAxerol Aug 13, 2026
1fd111e
test(phase6): certify recovery and venue capability boundaries
BobbyAxerol Aug 13, 2026
5125efd
build(phase6): enforce release certification gates
BobbyAxerol Aug 13, 2026
c5ababa
docs(phase6): freeze production certification decision
BobbyAxerol Aug 13, 2026
5b7edc3
fix(phase6): prepare nonroot runtime mounts
BobbyAxerol Aug 13, 2026
605b747
docs(plan): define v2 beta and rust core promotion
BobbyAxerol Aug 14, 2026
b9a2b57
docs(plan): make rust realtime core multi-venue
BobbyAxerol Aug 14, 2026
86dd138
feat(v2): harden phase 7 data-plane contracts
BobbyAxerol Aug 14, 2026
618214d
docs(v2): freeze phase 7 contract evidence
BobbyAxerol Aug 14, 2026
5e013be
feat(v2): add isolated fenced beta runtime
BobbyAxerol Aug 14, 2026
fa8cbb2
docs(v2): certify phase 7.1 isolated beta runtime
BobbyAxerol Aug 14, 2026
b4c3900
feat(v2): activate phase 7.2 consumer canary
BobbyAxerol Aug 14, 2026
49bd8b1
docs(v2): certify phase 7.2 consumer canary
BobbyAxerol Aug 14, 2026
ed31dc8
feat(v2): add phase 7.3 beta certification
BobbyAxerol Aug 15, 2026
bf23f97
fix(v2): correct phase 7.3 storage probe
BobbyAxerol Aug 15, 2026
19f3e77
fix(v2): accept typed malformed request status
BobbyAxerol Aug 15, 2026
0e609d4
fix(v2): wait for beta lease recovery
BobbyAxerol Aug 15, 2026
49c5764
fix(v2): persist beta fencing epochs
BobbyAxerol Aug 15, 2026
29c1ae5
docs(v2): certify phase 7 read-only beta
BobbyAxerol Aug 15, 2026
654a103
feat(phase8): certify replicated shadow substrate
BobbyAxerol Aug 15, 2026
f7eb055
feat(phase8): add raw envelope and venue-neutral Rust core
BobbyAxerol Aug 15, 2026
7212eba
feat(phase8): certify exact-frame cross-venue shadow
BobbyAxerol Aug 15, 2026
16108a6
feat(phase8): add fenced authority candidate runtime
BobbyAxerol Aug 15, 2026
90cdc2c
fix(phase8): separate authority state and audit history
BobbyAxerol Aug 15, 2026
053ec76
build(phase8): pin immutable runtime base
BobbyAxerol Aug 15, 2026
2795107
test(phase8): enforce authorized evidence consumers
BobbyAxerol Aug 15, 2026
535053d
test(phase8): certify release-profile parity capacity
BobbyAxerol Aug 15, 2026
0538cf8
build(phase8): support offline artifact freeze evidence
BobbyAxerol Aug 15, 2026
691a54f
docs(phase8): freeze certified Rust shadow candidate
BobbyAxerol Aug 15, 2026
73b6f58
fix(ci): handle initial contracts and nonroot build context
BobbyAxerol Aug 15, 2026
a14f6b7
fix(ci): provide rust linker deps and audit cache
BobbyAxerol Aug 15, 2026
6eaa9bc
fix(ci): make clean rust and phase6 gates deterministic
BobbyAxerol Aug 15, 2026
64f42d2
fix(ci): pin rust workspace and writable replay state
BobbyAxerol Aug 15, 2026
326fa50
fix(ci): run release rehearsal in pinned python
BobbyAxerol Aug 15, 2026
c58196a
fix(ci): harden disposable postgres startup
BobbyAxerol Aug 15, 2026
996b027
Merge pull request #3 from BobbyAxerol/feat/fund-grade-data-layer-v2
BobbyAxerol Aug 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ __pycache__
.venv
venv
data
logs
target
*.parquet
*.csv
*.gz
*.gz
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ PRELOAD_STRICT_FRESHNESS=false
# ── Binance WS ──────────────────────────────────
BINANCE_WS_BATCH_SIZE=100
BINANCE_WS_QUEUE_MAXSIZE=10000
DATA_LAYER_BINANCE_SOURCES=binance_futures_trade,binance_futures_kline
DATA_LAYER_DNSE_STREAM_ENABLED=true
DATA_LAYER_VNSTOCK_POLLER_ENABLED=true
DATA_LAYER_PRELOAD_WATCHDOG_ENABLED=true
BINANCE_WS_MAX_CONNS_PER_SOURCE=0
STREAM_STALE_SECONDS=180
STREAM_STRICT_FEED_HEALTH=false
Expand All @@ -45,3 +49,6 @@ OKX_FALLBACK_PRIORITY_SYMBOLS=BTCUSDT,ETHUSDT
# ── FastAPI ─────────────────────────────────────
API_HOST=0.0.0.0
API_PORT=8100
LOG_LEVEL=INFO
LOG_FILE_MAX_BYTES=10000000
LOG_FILE_BACKUP_COUNT=5
208 changes: 204 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,217 @@ on:
branches: ["dev"]

jobs:
contract-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Checkout pull-request base contracts
if: github.event_name == 'pull_request'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ github.base_ref }}
path: base-contracts

- name: Set up Buf
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
with:
version: "1.50.0"

- name: Check schema format and compatibility
working-directory: contracts
run: |
buf format --diff --exit-code
buf lint
buf breaking --against baseline/qdl-v2-phase1.binpb
buf breaking --against baseline/qdl-v2-phase7-beta.binpb

- name: Check schema against pull-request base
if: github.event_name == 'pull_request'
working-directory: contracts
run: |
if [[ -d ../base-contracts/contracts ]]; then
buf breaking --against ../base-contracts/contracts
else
echo "Base branch has no contract module; frozen Phase 1/7 baselines remain authoritative."
fi

- name: Verify generated contracts are current
working-directory: contracts
run: |
buf generate
git diff --exit-code -- ../generated

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"

- name: Test Python generated contracts
run: |
python -m pip install --disable-pip-version-check protobuf==6.33.6
python -m unittest tests.test_phase1_contracts

- name: Test Rust generated contracts
run: |
docker run --rm -v "$PWD:/workspace" -w /workspace rust:1.82-slim \
sh -c 'apt-get update -qq && apt-get install -y --no-install-recommends clang cmake libclang-dev libcurl4-openssl-dev libssl-dev libzstd-dev make pkg-config zlib1g-dev >/dev/null && cargo fmt --all -- --check && cargo clippy --workspace --all-targets --locked -- -D warnings && cargo test --workspace --locked'

- name: Check Rust dependency, license and advisory policy
env:
CARGO_DENY_VERSION: "0.20.2"
CARGO_DENY_SHA256: "9f12ed4c49936e09b48bf862b595cde2fe64fcbd9d74dfacac6131ca824c8d5f"
run: |
archive="cargo-deny-${CARGO_DENY_VERSION}.tar.gz"
directory="cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl"
curl --fail --location --silent --show-error \
"https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/${directory}.tar.gz" \
--output "${archive}"
echo "${CARGO_DENY_SHA256} ${archive}" | sha256sum --check --strict
tar --no-same-owner -xzf "${archive}"
"./${directory}/cargo-deny" check

unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.12"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3

- name: Prepare non-root runtime bind mounts
run: sudo scripts/prepare_nonroot_runtime.sh

- name: Build data_layer image
run: docker compose build data_layer
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml build data_layer

- name: Audit final runtime dependencies
run: |
docker run --rm data-layer:v0.1.0 sh -c '
test ! -e /opt/venv/bin/poetry
python -c "from importlib.metadata import version; from packaging.version import Version; assert Version(version(\"msgpack\")) >= Version(\"1.2.1\"); assert Version(version(\"setuptools\")) >= Version(\"78.1.1\")"
python -m pip freeze --local > /tmp/qdl-runtime-requirements.txt
python -m pip install --disable-pip-version-check --no-cache-dir "pip-audit>=2.9,<3"
pip-audit --cache-dir /tmp/qdl-pip-audit-cache -r /tmp/qdl-runtime-requirements.txt --progress-spinner=off
'

- name: Run unit tests
run: docker compose run --rm test_runner python -m unittest discover -s tests
run: >-
docker compose -f docker-compose.yml -f docker-compose.ci.yml
run --rm test_runner python -m unittest discover -s tests

- name: Run V2 contract, SDK and shadow-consumer gates
run: >-
docker compose -f docker-compose.yml -f docker-compose.ci.yml
run --rm test_runner python -m unittest -v
tests.test_fund_phase5_api tests.test_fund_phase5_contracts
tests.test_fund_phase5_consumer tests.test_fund_phase5_stream_sdk
tests.test_fund_phase5_e2e tests.test_fund_phase5_load
tests.test_fund_phase5_real_provider

- name: Run Phase 6 operations, recovery and release gates
run: >-
docker compose -f docker-compose.yml -f docker-compose.ci.yml
run --rm test_runner python -m unittest -v
tests.test_fund_phase6_operations tests.test_fund_phase6_resilience
tests.test_fund_phase6_release

- name: Run Phase 7 typed-contract and data-plane identity gates
run: >-
docker compose -f docker-compose.yml -f docker-compose.ci.yml
run --rm test_runner python -m unittest -v
tests.test_fund_phase7_contract_security
tests.test_fund_phase71_beta_runtime
tests.test_fund_phase72_consumer_canary
tests.test_fund_phase73_beta_decision
tests.test_phase0_contract_golden tests.test_fund_phase5_contracts

- name: Run isolated Phase 7.1 beta topology and rollback gate
env:
QDL_BETA_CURSOR_KEYS_JSON: '{"beta-k1":"phase71-ci-cursor-key-material-32-bytes"}'
QDL_BETA_JWT_KEYS_JSON: '{"phase7-test":"phase7-test-secret-material-32bytes"}'
run: |
docker image inspect redis:7.2-alpine >/dev/null 2>&1 || docker pull redis:7.2-alpine
export QDL_BETA_IMAGE="$(docker image inspect data-layer:v0.1.0 --format '{{.Id}}')"
export QDL_BETA_REDIS_IMAGE="$(docker image inspect redis:7.2-alpine --format '{{.Id}}')"
export QDL_BETA_INIT_IMAGE="${QDL_BETA_REDIS_IMAGE}"
scripts/phase71_beta_topology_smoke.sh

- name: Run additive PostgreSQL migration gate
run: bash scripts/phase5_migration_smoke.sh

- name: Run bounded V2 API replica load gate
run: >-
docker run --rm -v "$PWD:/app" -w /app data-layer:v0.1.0
python scripts/phase5_api_replica_load.py --replicas 8 --requests 2000
--concurrency 100 --min-rps 250 --max-p99-ms 500

- name: Test isolated Redis restart and replay rebuild
run: QDL_TEST_IMAGE=data-layer:v0.1.0 scripts/phase2_redis_rebuild_smoke.sh

- name: Build immutable Rust replay tool
run: >-
docker build --provenance=false -f Dockerfile.qdl-core
-t qdl-core:${{ github.sha }} .

- name: Verify Rust artifact against provider fixtures
run: |
docker run --rm -v "$PWD/tests/fixtures/phase2:/fixtures:ro" \
qdl-core:${{ github.sha }} /fixtures/binance_usdm_trade.json | grep -q '"status":"PASS"'
docker run --rm -v "$PWD/tests/fixtures/phase2:/fixtures:ro" \
qdl-core:${{ github.sha }} /fixtures/okx_trade.json | grep -q '"status":"PASS"'

- name: Run bounded durability performance regression
run: >-
docker run --rm -v "$PWD:/app" -w /app data-layer:v0.1.0
python scripts/phase2_benchmark.py --events 2000 --partitions 10
--payload-bytes 512 --batch-size 100 --consumer-groups 8
--min-throughput 300 --max-p99-ms 300 --max-disk-amplification 12

- name: Scan final runtime image for critical and high vulnerabilities
uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0
with:
image-ref: data-layer:v0.1.0
format: table
exit-code: "1"
ignore-unfixed: true
severity: CRITICAL,HIGH

- name: Scan repository for leaked secrets and critical misconfiguration
uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0
with:
scan-type: fs
scan-ref: .
scanners: secret,misconfig
format: table
exit-code: "1"
severity: CRITICAL,HIGH

- name: Rehearse immutable SBOM and signed release manifest
run: |
evidence_dir="$(mktemp -d)"
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 \
-out "${evidence_dir}/private.pem" >/dev/null 2>&1
openssl pkey -in "${evidence_dir}/private.pem" -pubout \
-out "${evidence_dir}/public.pem"
image_id="$(docker image inspect data-layer:v0.1.0 --format '{{.Id}}')"
python -m scripts.phase6_release_bundle \
--repo . --output-dir "${evidence_dir}/bundle" \
--release "qdl-ci-${GITHUB_SHA}" --git-sha "${GITHUB_SHA}" \
--image-ref "local/data-layer@${image_id}" \
--signing-key "${evidence_dir}/private.pem" \
--verification-key "${evidence_dir}/public.pem"
rm -rf "${evidence_dir}"

- name: Clean CI Compose resources
if: always()
run: >-
docker compose -f docker-compose.yml -f docker-compose.ci.yml
down --volumes --remove-orphans
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/
*.egg-info/
dist/
build/
/target/
.eggs/
.venv/
venv/
Expand Down
5 changes: 5 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Trivy 0.72 can prefer stale BuildKit Python SBOM metadata over the final
# virtualenv. CI independently asserts the final runtime has msgpack >=1.2.1
# and setuptools >=78.1.1 before this narrowly scoped false-positive waiver.
GHSA-6v7p-g79w-8964
CVE-2025-47273
Loading
Loading