Snapshot PINK DITAv2 system + Sprint 0 flaw-fix verification

First commit of the previously-untracked PINK-on-DITAv2 migration system
(execution moves to the Rust kernel; policy stays on legacy DITA, so Alpha
Engine algorithmic integrity is preserved). BLUE is untouched.

Sprint 0 (safety snapshot + flaw-fix verification, MARKET single-leg scope):
- Verified Rust FSM fixes (flaws 2,4,10,11,13) by source read of lib.rs.
- Hardened 5 vacuous/guarded assertions in test_flaws.py so each flaw test
  genuinely exercises its fix. Most important: Flaw 5 now asserts capital
  moves by EXACTLY realized PnL (was entering/exiting at the same price).
- Offline suites: 533 passed, 0 failed (35 flaws + 402 kernel/accounting/
  bridge + 96 runtime/persistence/multi-exit/restart/seams).
- GATE PASS: MARKET-path-critical flaws 1,2,5 confirmed fixed + green.
- Added SPRINT0_FLAW_VERIFICATION.md report and _rust_kernel/.gitignore
  (excludes Rust target/ build artifacts).

LIMIT/partial-fill remain explicitly out of scope (MARKET-only bring-up).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-05-30 18:26:43 +02:00
parent 34d01fe6a4
commit 3d7b00e28d
89 changed files with 32782 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
from __future__ import annotations
from pathlib import Path
import unittest
class TestDITAv2Ops(unittest.TestCase):
def test_operator_playbook_mentions_supervisor_program(self) -> None:
text = Path("/mnt/dolphinng5_predict/prod/docs/DITA_V2_OPERATOR_PLAYBOOK.md").read_text()
self.assertIn("dolphin:dita_v2", text)
self.assertIn("launch_dita_v2.py", text)
self.assertIn("dita_v2_ctl.py", text)
def test_supervisor_config_contains_dita_v2_program(self) -> None:
conf = Path("/mnt/dolphinng5_predict/prod/supervisor/dolphin-supervisord.conf").read_text()
self.assertIn("[program:dita_v2]", conf)
self.assertIn("launch_dita_v2.py", conf)
def test_supervisor_migration_doc_mentions_dita_v2_recovery(self) -> None:
text = Path("/mnt/dolphinng5_predict/prod/AGENT_READ_Supervisor_migration.md").read_text()
self.assertIn("dolphin:dita_v2", text)
self.assertIn("dita_v2_ctl.py", text)
self.assertIn("Do not use `systemctl` for `dolphin:dita_v2`", text)
def test_supervisor_wrapper_mentions_dita_v2(self) -> None:
text = Path("/mnt/dolphinng5_predict/prod/supervisor/supervisorctl.sh").read_text()
self.assertIn("dita_v2", text)
self.assertIn("dita_v2_ctl.py", text)
def test_supervisor_config_has_dita_v2_comment(self) -> None:
conf = Path("/mnt/dolphinng5_predict/prod/supervisor/dolphin-supervisord.conf").read_text()
self.assertIn("DITAv2 — supervised kernel", conf)
def test_operational_status_mentions_dita_v2(self) -> None:
text = Path("/mnt/dolphinng5_predict/prod/docs/OPERATIONAL_STATUS.md").read_text()
self.assertIn("DITAv2 Kernel", text)
self.assertIn("dolphin:dita_v2", text)
def test_live_smoke_wrapper_is_documented_and_wired(self) -> None:
script = Path("/mnt/dolphinng5_predict/prod/ops/dita_v2_live_bingx_smoke.py").read_text()
self.assertIn("BINGX_SMOKE_LIVE", script)
self.assertIn("BINGX_SMOKE_ALLOW_TRADE", script)
self.assertIn("DITA_V2_LIVE_BINGX", script)
self.assertIn("test_dita_v2_live_bingx_testnet_e2e.py", script)
self.assertIn("--dry-run", script)
playbook = Path("/mnt/dolphinng5_predict/prod/docs/DITA_V2_OPERATOR_PLAYBOOK.md").read_text()
self.assertIn("dita_v2_live_bingx_smoke.py", playbook)
self.assertIn("--dry-run", playbook)
self.assertIn("TRXUSDT", playbook)
if __name__ == "__main__":
unittest.main()