Repository navigation
v1.1.0: Declarative Architecture Refactor - #23
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete architectural refactor: tool registry is now 100% declarative. Adding a new tool requires only a TOML edit — zero Python changes.
What Changed
core/tools_factory.toml— declarative schema for all 18 toolscore/generator.py— generic reader/emitter (no hardcoded tool names)if name == ...hardcoded branches +LOAD_ORDERconstant__getattr__compatibility shim (TECH-DEBT-001 resolved)Schema
Each tool declares:
name,type,categoryload_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)source,binary_name,init_command,eval_command,local_path,cache_keyBehavioral Guarantee
Generated
~/.config/ziro/derived/plugins.gen.zshis byte-identical to v1.0.2 output. Zero user-facing change.Tests
Migration
Adding a new tool now requires:
[[tool]]entry tocore/tools_factory.tomldefaults.tomlcategoryNo Python code changes required.
Docs
docs/wiki/sources/spec-006-declarative-registry.md— public docs