feat(report): give the writer a static interpretation guide

The report writer had no interpretation methodology at all: a local agent
calling the jyotish skill can read the reference library, the report model
could read nothing. It could only restate the bundle.

- frontend/src/lib/report-interpretation-packs/ holds one general pack and
  one pack per report theme, distilled from the in-repo reference guides.
  They constrain wording and reasoning discipline (term modernisation,
  how to talk about relative strength and SAV scores, the reasoning errors
  to avoid, the banned phrasings) and never assert a chart fact.
- The general pack rides INSIDE the cached system message so the cached
  prefix stays byte-identical across sections; the chapter pack follows it
  and summary calls get the general pack only.
- Skill jyotish-personal-report goes to 1.1.0 (1.0.0 deprecated): the
  contract now names interpretiveFacts and themeNarrativeSeeds as a
  bounded fact layer and states that the knowledge pack is not a fact
  source and cannot raise certainty.
- Telemetry records interpretiveFactCount and knowledgePackCharacters as
  numbers only; the counter never throws so telemetry cannot break a run.

Tests lock every theme resolving a pack, the 3,000 character budget, a
forbidden-substring scan (paths, module names, vendor names, artefact
names), the byte-stable cache prefix, and that no evidence id or date
appears in the static content.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016P5RoqzmUQEbeC2qjAkeGr
This commit is contained in:
Jesse_Chen
2026-09-01 18:54:52 +00:00
parent 90bad10d6f
commit ef1bd6dfa9
14 changed files with 567 additions and 29 deletions
@@ -7,7 +7,10 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
PACKAGE_ROOT = ROOT / "skills/jyotish-personal-report"
VERSION_ROOT = PACKAGE_ROOT / "versions/1.0.0"
# was versions/1.0.0; bumped 2026-09-01 when the skill contract gained the
# interpretive fact layer and the static interpretation packs.
ACTIVE_VERSION = "1.1.0"
VERSION_ROOT = PACKAGE_ROOT / f"versions/{ACTIVE_VERSION}"
REGISTRY = ROOT / "skills/skill-package-registry.json"
HASH_DOMAIN = b"jyotisha-skill-package-v1\0"
@@ -45,10 +48,10 @@ def test_personal_report_skill_is_versioned_and_registry_hash_matches_package_by
]
assert matches == [{
"name": "jyotish-personal-report",
"version": "1.0.0",
"version": ACTIVE_VERSION,
"sha256": _package_sha256(VERSION_ROOT),
"sourceCommit": None,
"packagePath": "skills/jyotish-personal-report/versions/1.0.0",
"packagePath": f"skills/jyotish-personal-report/versions/{ACTIVE_VERSION}",
"status": "active",
}]
assert (PACKAGE_ROOT / "SKILL.md").read_bytes() == (VERSION_ROOT / "SKILL.md").read_bytes()
@@ -87,3 +90,8 @@ def test_personal_report_skill_encodes_evidence_only_two_stage_and_safety_bounda
assert "恰好" in skill
assert "不得从宫位、星座、度数、分盘或 Dasha 自行推导含义" in skill
assert "research` 不代表可以联网或补证" in skill
# v1.1.0: the interpretive layer and the static packs are fact-bounded.
assert "interpretiveFacts" in skill
assert "themeNarrativeSeeds" in skill
assert "不得据此产生该 Claim Card 之外的新占星断言" in skill
assert "它**不是事实来源**" in skill