53566b9d82
Move several hot Python analysis paths to Rust-backed helpers. This adds Rust implementations for backtest strategy signal generation and the core portfolio loop, options and futures payoff aggregation, Greeks aggregation, ratio calculation, trade extraction, chunked close-only indicator runs, and forward-fill helpers. Wire the Python analysis and data modules to prefer these paths, and add coverage for the new batch fast path. Expand the WASM package to export WMA, ADX, and MFI from ferro_ta_core, refresh the Node examples, benchmarks, and README, and add a Node-vs-Python conformance test so the browser and node surface stays aligned with the main Python package. Introduce a generated cross-surface API manifest in docs/, along with scripts to rebuild and verify it from source exports. Enforce manifest freshness in the Python and WASM CI workflows so release candidates catch surface drift before push.
54 lines
1.4 KiB
Python
54 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Check that docs/api_manifest.json is up-to-date.
|
|
|
|
This script regenerates the deterministic manifest in-memory and compares it to
|
|
the committed file. It exits non-zero if drift is detected.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main() -> int:
|
|
root = Path(__file__).resolve().parents[1]
|
|
python_root = str(root / "python")
|
|
if python_root not in sys.path:
|
|
sys.path.insert(0, python_root)
|
|
scripts_root = str(root / "scripts")
|
|
if scripts_root not in sys.path:
|
|
sys.path.insert(0, scripts_root)
|
|
|
|
from build_api_manifest import build_manifest
|
|
|
|
manifest_path = root / "docs" / "api_manifest.json"
|
|
|
|
if not manifest_path.exists():
|
|
print(
|
|
"docs/api_manifest.json is missing. Run:\n"
|
|
" python scripts/build_api_manifest.py --output docs/api_manifest.json"
|
|
)
|
|
return 1
|
|
|
|
expected = build_manifest(root, include_runtime_metadata=False)
|
|
actual = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
|
|
if actual != expected:
|
|
print(
|
|
"docs/api_manifest.json is out of date.\n"
|
|
"Run:\n"
|
|
" python scripts/build_api_manifest.py --output docs/api_manifest.json\n"
|
|
"and commit the updated file."
|
|
)
|
|
return 1
|
|
|
|
print("docs/api_manifest.json is up to date.")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|