Commit Graph
3 Commits
Author SHA1 Message Date
72d6bfdcf4 feat(nodes): add the Resolver ComfyUI node (#21) (#65)
Add nodes/resolver_node.py: ResolverNode, a thin adapter that delegates to
resolve_scene (MASTER_SPEC §20).

- Required inputs scene (SCENE model) and knowledge_base (KNOWLEDGE_BASE, from
  the loader node); optional config (COMPILER_CONFIG) defaulting to Config().
- Outputs (resolved_tags, warnings, errors): RESOLVED_TAGS plus surfaced
  diagnostics. No compiler logic in the node.
- Registered as SceneCompilerResolver ("Resolver").

Tests: metadata/inputs, real resolution over a small in-memory Knowledge Base,
delegation + message surfacing (monkeypatched), default config, registration.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:13:37 +02:00
76d440fbaf feat(resolver): implement the deterministic Illustrious Resolver (#12) (#56)
Add compiler/resolver/illustrious_resolver.py: resolve_scene(scene,
knowledge_base, config, logger=None) -> CompilerResult, per MASTER_SPEC §17. No
LLM; no concept or tag is invented.

- normalize_concept (§17.3): NFKC + lowercase, unifying underscores/spaces so
  natural concepts, snake_case ids, and spaced aliases share one lookup key. The
  resolver builds its own normalized index over the Knowledge Base.
- Per-concept pipeline in scene discovery order (§17.8): normalize -> direct
  alias resolution (no chains; skipped when allow_aliases is false) -> canonical
  lookup -> recursive expansion -> tag generation.
- Expansion (§17.5): own tags first, then depth-first in list order per expand
  target, inserted immediately after; capped by max_expansion_depth; skipped when
  expansion_enabled is false; defensive path-based cycle detection -> SC0003.
- Deduplication after expansion keeps the first occurrence (SC0007).
- Unknown concept -> SC0001 warning (continue); deprecated -> SC0006 (continue);
  invalid category -> SC0008 (stop); circular expansion -> SC0003 (stop).
- Every ResolvedTag keeps its entry's category and full traceability
  (source_concept = originating scene concept, knowledge_base_entry = generating
  entry). Verbose logging of each decision.

Tests (no Ollama): normalization, alias resolution + disable, expansion order,
nested/depth-capped/disabled expansion, traceability, dedup, unknown/deprecated,
circular/invalid-category stops, category preservation, and determinism.

Co-authored-by: kunail0804 <kunail0804@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:58:12 +02:00
72a60aa28b chore: initialize repository structure and tooling (#1) (#45)
Scaffold the Phase 0 foundation per MASTER_SPEC §24:

- Directory layout: nodes/, compiler/{analyzer,validator,resolver,splitter,
  builder,common}/, knowledge_base/, schemas/, prompts/, config/,
  tests/{analyzer,resolver,validator,integration,regression}/, examples/,
  scripts/, docs/.
- pyproject.toml targeting Python 3.11+, jsonschema as the single runtime dep,
  ruff + pytest as dev deps, explicit package list, and ruff/pytest config.
- ruff for linting and formatting; pytest with repo root on pythonpath.
- GitHub Actions CI running install, ruff lint, ruff format check, and pytest
  on Python 3.11 and 3.12 for pushes and pull requests.
- docs/ skeleton and CONTRIBUTING.md referencing the wiki.
- Layout test asserting the §24 structure and package importability.

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