refactor(cdsl_engine): executor registry + per-family executor package
Phase 3 of the decoupling refactor (behavior-preserving): - registry.py: atomic_executor decorator, ALL_ATOMIC_IDS with fail-fast registration validation, execute_node dispatcher - executors/: one module per family (extrude, revolve, surfaces, loft_sweep, bodies, context, primitives, parametric, holes, dressup, patterns) + shared helpers in executors/common - executors/__init__: explicit aggregation + completeness check (registry must cover every declared atomic id at import time) - runtime.py: slimmed to entry points (analyze_cdsl/rebuild_cdsl) plus full historical re-exports incl. test-referenced privates Adding an atomic operation now touches only one executor module and its schema contract; the shared registry never changes. Verified against baseline: zero new failures.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"""Executor modules for the session runtime.
|
||||
|
||||
Importing this package registers every atomic executor into
|
||||
``cdsl_engine.registry.EXECUTORS`` exactly once, then verifies that the
|
||||
registry covers the complete declared atomic-id set. Executor modules must
|
||||
not import each other; shared helpers live in ``common``.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ..registry import ALL_ATOMIC_IDS, EXECUTORS
|
||||
from . import ( # noqa: F401 (importing the modules performs registration)
|
||||
bodies,
|
||||
context,
|
||||
dressup,
|
||||
extrude,
|
||||
holes,
|
||||
loft_sweep,
|
||||
parametric,
|
||||
patterns,
|
||||
primitives,
|
||||
revolve,
|
||||
surfaces,
|
||||
)
|
||||
|
||||
_missing = sorted(ALL_ATOMIC_IDS - set(EXECUTORS))
|
||||
if _missing:
|
||||
raise RuntimeError(f"atomic ids without a registered executor: {_missing}")
|
||||
Reference in New Issue
Block a user