Files
Jyotisha/scripts/market_astrology_refresh_planner.py
T
ClaudeandClaude Opus 5.5 6a57faacdb feat(consult): run the astrologer's upstream skill in full (BUG-1696, BUG-1697, BUG-1698)
- root SKILL.md is her upstream file (body byte-identical to the 5fb8379c mirror; description quoted so YAML parses and Mastra can load the skill)
- chat binds the whole SKILL.md plus references/product_runtime_contract.md (safety-only) instead of a ~477-character excerpt
- every turn carries her full strict-workflow-router (synced to upstream) and the domain's event-judgment file; product lists follow as an extra layer
- import her 10 sub-skills, family router, interpretation status contract, technique ontology and the 54 files her method names
- tests/test_upstream_skill_parity.py (in the quick gate) fails whenever her skill and ours drift
- 18 frontend guards that locked the excerpt design updated with 原值/新值/原因 notes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-07 14:02:26 +08:00

44 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Build a refresh plan from the market source manifest."""
from __future__ import annotations
import argparse
import json
from pathlib import Path
from typing import Any
def _load(path: Path) -> dict[str, Any]:
payload = json.loads(path.read_text(encoding="utf-8"))
return payload if isinstance(payload, dict) else {}
def build_refresh_plan(path: Path) -> dict[str, Any]:
manifest = _load(path)
providers = manifest.get("providers") if isinstance(manifest.get("providers"), list) else []
assets = manifest.get("asset_universe") if isinstance(manifest.get("asset_universe"), list) else []
cadence = str(manifest.get("refresh_cadence") or "unspecified")
return {
"schema": "jyotish.market_refresh_plan.v1",
"status": "ready" if providers and assets else "blocked",
"refresh_cadence": cadence,
"provider_count": len(providers),
"asset_count": len(assets),
"assets": assets,
"providers": providers,
"boundary": str(manifest.get("boundary") or ""),
}
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("manifest", type=Path)
args = parser.parse_args()
print(json.dumps(build_refresh_plan(args.manifest), ensure_ascii=False, indent=2, sort_keys=True))
return 0
if __name__ == "__main__":
raise SystemExit(main())