record PyJHora benchmark generation time
This commit is contained in:
@@ -8,6 +8,7 @@ import csv
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
@@ -253,7 +254,7 @@ def compare_one(sample_id, local, pyjhora):
|
||||
return rows
|
||||
|
||||
|
||||
def write_report(samples, rows):
|
||||
def write_report(samples, rows, *, generated_at=None):
|
||||
total = len(rows)
|
||||
counts = {}
|
||||
by_section = {}
|
||||
@@ -272,7 +273,8 @@ def write_report(samples, rows):
|
||||
lines = []
|
||||
lines.append('# Jyotish benchmark 第三轮:PyJHora 对比报告')
|
||||
lines.append('')
|
||||
lines.append('生成时间:2026-06-03')
|
||||
generated_at = generated_at or datetime.now(timezone.utc)
|
||||
lines.append(f'生成时间:{generated_at.isoformat()}')
|
||||
lines.append('')
|
||||
lines.append('## 1. 本轮范围')
|
||||
lines.append('')
|
||||
|
||||
@@ -97,7 +97,8 @@ For large architecture or release work, also read:
|
||||
| ERR-064 | Western cross-system support accepted external JSON but did not calculate a tropical natal chart from standard birth input, inviting agents to treat missing Western data as a completed cross-check. | mitigated 2026-07-14 | `western_chart_engine.py` computes Swiss Ephemeris tropical natal evidence for direct-chart/rectification only. It remains `partial` until separately materialized timing evidence exists; Prashna and external-payload precedence are regression-tested. |
|
||||
| ERR-065 | A newly added release-critical script can be absent from a zip before its first Git commit because the package enumerates tracked files only. | mitigated 2026-07-14 | List `scripts/western_chart_engine.py` in `REQUIRED_CONTRACTS`; the release-package test proves both editions include it before commit. |
|
||||
| ERR-066 | The pre-work fragment sweep invoked a retired `audit-capabilities --mode strict` contract, so governance tests and the mandatory preflight failed before real checks ran. | mitigated 2026-07-14 | Invoke the supported `--mode validate`; `tests/test_preflight_fragment_scan.py` and `pre_work_check.py` must remain green before substantive work. |
|
||||
| ERR-067 | A generic “Western timing” label can imply secondary progressions, solar arcs, and returns that have not been computed. | mitigated 2026-07-14 | Native timing accepts explicit `transit_date` and `solar_return_year` only; packet boundaries and premium prompts name every unsupported technique. |
|
||||
| ERR-067 | A generic “Western timing” label can imply techniques that have not been computed. | mitigated 2026-07-15 | Native timing requires explicit transit, solar-return, secondary-progression, or solar-arc fields; boundaries still name unavailable progressed angles, converse, parans, midpoints, duration, and interpretation. |
|
||||
| ERR-068 | PyJHora comparison reports hard-coded `2026-06-03` as generation time, making fresh external benchmark artifacts appear stale and weakening audit traceability. | mitigated 2026-07-15 | `write_report()` records an injected-or-current UTC ISO timestamp; keep the deterministic timestamp regression. |
|
||||
|
||||
## Fragment Sweep Command Set
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import subprocess
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
from benchmarks.jyotish.scripts.run_pyjhora_compare import write_report
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
RUNNER = ROOT / "benchmarks" / "jyotish" / "scripts" / "run_pyjhora_compare.py"
|
||||
@@ -16,3 +19,14 @@ def test_pyjhora_compare_help_is_non_executing():
|
||||
assert "--build-local" in result.stdout
|
||||
assert "--output-prefix" in result.stdout
|
||||
assert "FileNotFoundError" not in result.stderr
|
||||
|
||||
|
||||
def test_pyjhora_report_uses_supplied_utc_generation_timestamp():
|
||||
report = write_report(
|
||||
[],
|
||||
[],
|
||||
generated_at=datetime(2026, 7, 15, 4, 30, tzinfo=timezone.utc),
|
||||
)
|
||||
|
||||
assert "生成时间:2026-07-15T04:30:00+00:00" in report
|
||||
assert "生成时间:2026-06-03" not in report
|
||||
|
||||
Reference in New Issue
Block a user