fix: restore ayanamsa state and keep tests hermetic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
@@ -9,7 +10,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
OUTPUT = ROOT / "references/oracle/full_technique_invocation_matrix_2026_07_22.json"
|
||||
OUTPUT_NAME = "full_technique_invocation_matrix_2026_07_22.json"
|
||||
|
||||
SCAN_ROOTS = {
|
||||
"skill": ["SKILL.md", "skills"],
|
||||
@@ -339,13 +340,18 @@ def _claim_boundary(tech: Technique, claim_status: str) -> str:
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--output-dir", type=Path, default=ROOT / "references/oracle")
|
||||
args = parser.parse_args()
|
||||
packet = build_matrix()
|
||||
without_hash = dict(packet)
|
||||
without_hash["content_hash"] = ""
|
||||
digest = hashlib.sha256(json.dumps(without_hash, ensure_ascii=False, sort_keys=True).encode("utf-8")).hexdigest()
|
||||
packet["content_hash"] = digest
|
||||
OUTPUT.write_text(json.dumps(packet, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
||||
print(json.dumps({"path": str(OUTPUT.relative_to(ROOT)), "sha256": digest, "summary": packet["summary"]}, ensure_ascii=False, indent=2))
|
||||
args.output_dir.mkdir(parents=True, exist_ok=True)
|
||||
output = args.output_dir / OUTPUT_NAME
|
||||
output.write_text(json.dumps(packet, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
||||
print(json.dumps({"path": str(output), "sha256": digest, "summary": packet["summary"]}, ensure_ascii=False, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user