Files
5e146d5a55 feat!: v1.1 — Resolver emits a flat prompt, drop categories (#85)
* feat!: collapse pipeline — Resolver emits a flat prompt, drop categories (v1.1)

BREAKING CHANGE: the Category Splitter and Prompt Builder stages and nodes are
removed. The Resolver is now the translator from Scene JSON to prompt: it resolves
concepts to Knowledge Base tags and joins them into one flat comma-separated
prompt string, in resolution order (which naturally leads with character concepts).

Resolver node outputs are now (prompt, warnings, errors, json) — the json being
the traceable resolved tags so a translation problem is inspectable. Node count
drops from 8 to 6. The CategoryMap/PromptOutput models and their schemas are
removed; the `category` field remains on entries and resolved tags for
traceability only. Debug Viewer simplified to scene/warnings/errors.

Goldens, example scenes/workflow, integration/performance/repo-layout/release
tests, benchmark script, and the docs (README + wiki) are updated to the flat
prompt. Version bumped to 1.1.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* build: drop removed splitter/builder packages from pyproject

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 00:00:48 +02:00

41 lines
1.1 KiB
Python

"""Deliberately regenerate the golden prompt outputs (issue #28).
Run this only when a change is *intended* to alter compiler output (e.g. a
Knowledge Base or formatting change). It compiles every reference scene against
the shipped Knowledge Base and overwrites the golden files under
``tests/regression/golden/``.
Usage:
python scripts/regenerate_goldens.py
"""
from __future__ import annotations
import json
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from tests.regression.golden_scenes import ( # noqa: E402
GOLDEN_DIR,
SCENES,
compile_prompt,
load_reference_knowledge_base,
)
def main() -> int:
GOLDEN_DIR.mkdir(parents=True, exist_ok=True)
knowledge_base = load_reference_knowledge_base()
for name, scene in SCENES.items():
prompt = compile_prompt(scene, knowledge_base)
path = GOLDEN_DIR / f"{name}.json"
path.write_text(json.dumps(prompt, indent=2) + "\n", encoding="utf-8")
sys.stdout.write(f"wrote {path.relative_to(GOLDEN_DIR.parent.parent.parent)}\n")
return 0
if __name__ == "__main__":
raise SystemExit(main())