repo hygiene: track the PINK launcher import closure

67 production .py modules that the running PINK service imports but which
were never committed: prod/bingx/ (HTTP client, market/user streams,
journal, config), prod/clean_arch/ adapters/persistence/runtime/dita/dita_v2
production modules and their co-located tests. Rule going forward: every
module imported by launch_dolphin_pink.py / pink_direct.py must appear in
git ls-files. Excludes _backup dirs, __pycache__, and non-code files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-06-12 15:09:32 +02:00
parent c3a18f693a
commit 84e4a50e3f
67 changed files with 15090 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
#!/usr/bin/env python3
"""
Shared eigen-scan normalizer.
BLUE is canonical. This module converts NG7 nested Hazelcast payloads into
the flat shape the production engines expect.
"""
from __future__ import annotations
import math
from typing import Any, Dict
def normalize_ng7_scan(scan: Dict[str, Any]) -> Dict[str, Any]:
"""
Promote an NG7 nested scan to the BLUE-compatible flat dict.
Expected input:
scan["result"]["multi_window_results"]["50"]["tracking_data"]["lambda_max_velocity"]
scan["result"]["pricing_data"]["current_prices"]
"""
if not isinstance(scan, dict):
return {}
result = scan.get("result") or {}
mw = result.get("multi_window_results") or {}
def _velocity(window: int) -> float:
tracking = (mw.get(str(window)) or {}).get("tracking_data", {})
value = tracking.get("lambda_max_velocity")
try:
velocity = float(value)
return velocity if math.isfinite(velocity) else 0.0
except (TypeError, ValueError):
return 0.0
v50 = _velocity(50)
v750 = _velocity(750)
current_prices = (result.get("pricing_data") or {}).get("current_prices") or {}
assets = [asset for asset in current_prices if asset != "BTCUSDT"]
if "BTCUSDT" in current_prices:
assets.append("BTCUSDT")
asset_prices = [float(current_prices[asset]) for asset in assets] if assets else []
instability = float((result.get("regime_prediction") or {}).get("instability_score") or 0.0)
return {
**scan,
"vel_div": v50 - v750,
"w50_velocity": v50,
"w750_velocity": v750,
"assets": assets,
"asset_prices": asset_prices,
"instability_50": instability,
}