Release v2.0.30: Cold-archive rotation (.tar.gz), 6-Gate public regression suite (hs-public-smoke), VPS-native periodic data production timers, /engineering/ (E0-E5) & /math/ (M0-M5) explication hubs, and LLM pipeline operator manual
This commit is contained in:
1 parent
64825ffd75
commit
54e7f8ff61
55 files changed
+4039
-62
No files matched your search
@@ -678,7 +678,7 @@ def build_financial_quant_harvest(
|
||||
payload: dict[str, Any] = {
|
||||
"$schema": "./schemas/v1/financial-aq-harvest.schema.json",
|
||||
"$id": "urn:io:hyperstitionstud:schema:v1:financial-aq-harvest",
|
||||
"version": "2.0.29",
|
||||
"version": "2.0.30",
|
||||
"target_date_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
|
||||
"harvest_mode": harvest_mode,
|
||||
"synthetic_data_eliminated": True,
|
||||
@@ -744,17 +744,77 @@ def synthesize_quant_dossier_markdown(payload: dict[str, Any]) -> str:
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def update_real_market_history_cache(
|
||||
history_path: str | Path | None = None,
|
||||
new_bars_by_symbol: dict[str, dict[str, dict[str, Any]]] | None = None,
|
||||
allow_live_network: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
"""
|
||||
Merge new real daily exchange bars into `site/quant/real-market-history.json`.
|
||||
Enforces strict Zero-Synthetic-Data honesty: `ANTHR-PVT` always remains `bars_by_date: {}`,
|
||||
`data_available: False`, and closed weekend/holiday dates are never fabricated.
|
||||
"""
|
||||
from hyperstitionstud_io import __version__ as CURRENT_VERSION
|
||||
|
||||
cfg = load_workspace_config()
|
||||
h_path = Path(history_path) if history_path else (cfg.core_dir / "site" / "quant" / "real-market-history.json")
|
||||
if h_path.is_file():
|
||||
doc = json.loads(h_path.read_text(encoding="utf-8"))
|
||||
else:
|
||||
doc = {"version": CURRENT_VERSION, "synthetic_data_eliminated": True, "instruments": {}}
|
||||
|
||||
inst_map = doc.setdefault("instruments", {})
|
||||
appended_count = 0
|
||||
|
||||
for item in CANONICAL_WATCHLIST_24:
|
||||
sym = item["symbol"]
|
||||
if sym == "ANTHR-PVT":
|
||||
inst_map[sym] = {
|
||||
"symbol": sym,
|
||||
"data_available": False,
|
||||
"status": NO_DATA_AVAILABLE,
|
||||
"bars_by_date": {},
|
||||
}
|
||||
continue
|
||||
entry = inst_map.setdefault(sym, {"symbol": sym, "data_available": True, "status": "ok", "bars_by_date": {}})
|
||||
bars_by_dt = entry.setdefault("bars_by_date", {})
|
||||
|
||||
if new_bars_by_symbol and sym in new_bars_by_symbol:
|
||||
for dt_s, b_obj in new_bars_by_symbol[sym].items():
|
||||
if b_obj and b_obj.get("close_usd") is not None:
|
||||
bars_by_dt[dt_s] = b_obj
|
||||
appended_count += 1
|
||||
elif allow_live_network:
|
||||
try:
|
||||
live_b = _fetch_yahoo_chart(sym) or _fetch_stooq_csv(sym)
|
||||
if live_b and live_b.get("observation_date_utc") and live_b.get("close_usd") is not None:
|
||||
dt_s = live_b["observation_date_utc"]
|
||||
bars_by_dt[dt_s] = live_b
|
||||
appended_count += 1
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
doc["version"] = CURRENT_VERSION
|
||||
doc["synthetic_data_eliminated"] = True
|
||||
h_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
h_path.write_text(json.dumps(doc, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
|
||||
return {"history_path": str(h_path), "appended_bars_count": appended_count, "synthetic_data_eliminated": True}
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
ap = argparse.ArgumentParser(prog="hs-quant-harvest", description="Periodic Quantitative Financial Telemetry & Contingent Meaning Collector.")
|
||||
ap.add_argument("--mode", choices=["us-closing-bell", "utc-rollover"], default="us-closing-bell")
|
||||
ap.add_argument("--from-snapshot", default=None, help="Optional offline JSON snapshot file.")
|
||||
ap.add_argument("--live", action="store_true", help="Attempt live keyless HTTP fetch (Yahoo v8 / Stooq CSV / CoinGecko).")
|
||||
ap.add_argument("--append-history", action="store_true", help="Merge newly fetched real exchange bars into site/quant/real-market-history.json.")
|
||||
ap.add_argument("--join-news", default=None, help="Optional path to news-aq-harvest-latest.json.")
|
||||
ap.add_argument("--write-dossier", default=None, help="Optional path to emit Markdown quant report.")
|
||||
ap.add_argument("--out", default=None, help="Output JSON path (default: <archive_dir>/financial-aq-harvest-latest.json).")
|
||||
args = ap.parse_args(argv)
|
||||
|
||||
cfg = load_workspace_config()
|
||||
if args.append_history:
|
||||
update_real_market_history_cache(allow_live_network=args.live)
|
||||
out_path = Path(args.out) if args.out else (cfg.archive_dir / "financial-aq-harvest-latest.json")
|
||||
join_news = args.join_news or str(cfg.archive_dir / "news-aq-harvest-latest.json")
|
||||
|
||||
|
||||
Reference in new issue
Block a user