2 Commits
Author SHA1 Message Date
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
f4f7722517 Implement typed data models (#3) (#47)
* feat(schemas): add immutable typed data models (#3)

Implement the frozen-dataclass data models for every inter-stage document
(MASTER_SPEC §9): Concept, Character, Interaction, Metadata, ResolvedTag,
CategoryMap, PromptOutput, and Scene, plus SceneObject.

- Immutable once produced: frozen dataclasses, concept arrays stored as tuples,
  free-form mappings (Concept.metadata, CategoryMap) wrapped read-only.
- from_json / to_json on every model; model round-trip is lossless for all
  documented fields, and each to_json() validates against its schema (#2).
- Concept loads from a bare string or an object; confidence is carried in
  metadata and never affects logic (§9.3, §12.7).
- SceneObject aliases Concept: in V1 objects serialize as concepts per the
  grammar (§10.4) and scene schema; §9.5 owner/attributes are not required in V1.

Tests: construction, serialization, round-trip, schema conformance, and
immutability (frozen assignment + read-only nested mapping).

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

* fix(schemas): use default_factory for read-only mapping fields (Python 3.11)

Python 3.11 rejects a mappingproxy as a dataclass field default (treated as a
mutable default); 3.12+ allows it. Wrap the shared empty read-only mapping in a
default_factory so the models build on the minimum supported version.

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

* test(schemas): use pytest.approx for float confidence assertion

Avoid exact float equality in the Concept confidence test (SonarCloud
reliability rule). No behaviour change.

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-07 19:02:43 +02:00