Skip to content

v1.1.0: Declarative Architecture Refactor - #23

Merged
Pakrohk merged 3 commits into
mainfrom
feat/declarative-refactor-v1.1.0
Oct 15, 2026
Merged

Pakrohk merged 3 commits into
mainfrom
feat/declarative-refactor-v1.1.0

Conversation

@Pakrohk

@Pakrohk Pakrohk commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Summary

Complete architectural refactor: tool registry is now 100% declarative. Adding a new tool requires only a TOML edit — zero Python changes.

What Changed

  • New: core/tools_factory.toml — declarative schema for all 18 tools
  • Rewritten: core/generator.py — generic reader/emitter (no hardcoded tool names)
  • Removed: All if name == ... hardcoded branches + LOAD_ORDER constant
  • Removed: __getattr__ compatibility shim (TECH-DEBT-001 resolved)

Schema

Each tool declares:

  • name, type, category
  • load_method (binary-eval, clone-source, clone-eval, local-source, builtin-load, bootstrap-source)
  • load_timing (eager, defer, eval)
  • load_order (integer)
  • guard (none, binary-check)
  • conditional fields: source, binary_name, init_command, eval_command, local_path, cache_key

Behavioral Guarantee

Generated ~/.config/ziro/derived/plugins.gen.zsh is byte-identical to v1.0.2 output. Zero user-facing change.

Tests

  • Total: 263/263 pass (was 238)
  • New: 25 tests across 3 files (schema validation, emission, declarative acceptance)
  • CRITICAL test: "add a new tool via TOML only — no Python change" passes

Migration

Adding a new tool now requires:

  1. Add [[tool]] entry to core/tools_factory.toml
  2. (Optional) Add to defaults.toml category
  3. Regenerate — done

No Python code changes required.

Docs

  • docs/wiki/sources/spec-006-declarative-registry.md — public docs

- Define declarative schema for tool registry
- Migrate all spec-006 tools to new declarative format
- Fields: name, type, category, load_method, load_timing, load_order, guard
- Bootstrap: znap, ziro-defer
- Default active: 10 tools
- Alternatives: 6 tools (powerlevel10k, pure, zsh-autosuggestions,
  zsh-syntax-highlighting, wd, z)
- NO new tools added — behavior-preserving migration only
- NO generator changes yet (subphase 2)
- 238/238 tests pass
…hase 2/5)

- Add load_tools_registry() — reads core/tools_factory.toml dynamically
- Add emit_pattern() — generates shell lines from declarative metadata
- Remove ALL hardcoded if/elif on tool names
- Remove LOAD_ORDER constant — load_order derived from TOML field
- Remove all tool-name strings from generator code
- Behavior-preserving: regenerated plugins.gen.zsh is byte-identical
- __getattr__ compatibility shim for legacy tests (debt logged)
- 238/238 tests pass
- Add tests/test_tools_factory_schema.py (10 tests — schema validation)
- Add tests/test_generator_emission.py (12 tests — per load_method emission)
- Add tests/test_declarative_acceptance.py (3 tests — CRITICAL: add tool via TOML only)
- Resolve TECH-DEBT-001: remove __getattr__ shim from generator
- Remove obsolete LOAD_ORDER reference in tests/test_generator_load_order.py
- Behavior-preserving: plugins.gen.zsh remains byte-identical
- CHANGELOG: add v1.1.0 entry (Declarative Architecture)
- Add docs/wiki/sources/spec-006-declarative-registry.md
- Total tests: 263/263 pass
@Pakrohk
Pakrohk merged commit d9d659d into main Oct 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant