refactor: restructure modules into decision/ and enforcement/ planes#12
Merged
refactor: restructure modules into decision/ and enforcement/ planes#12
Conversation
…ward-compat shims Files moved into new three-plane structure: - adr_kit/decision/workflows/ (from workflows/) - adr_kit/decision/guidance/ (from workflows/decision_guidance.py) - adr_kit/decision/gate/ (from gate/) - adr_kit/enforcement/adapters/ (from enforce/eslint.py, ruff.py) - adr_kit/enforcement/validation/ (from enforce/validator.py, stages.py) - adr_kit/enforcement/generation/ (from enforce/script_generator.py, ci.py, hooks.py) - adr_kit/enforcement/config/ (from guardrail/) - adr_kit/enforcement/detection/ (from guard/) - adr_kit/enforcement/reporter.py (from enforce/reporter.py) Backward-compat shims created at old locations so all 309 tests pass.
Update mcp/server.py and cli.py to import directly from new plane locations instead of going through backward-compat shims.
Deleted adr_kit/gate/, adr_kit/enforce/, adr_kit/guardrail/, adr_kit/guard/. Updated workflows/__init__.py to final form (only PlanningWorkflow stays here).
RST (module restructure by plane) is fully executed — all 309 tests pass, lint is clean, and the three-plane architecture is in place. The plan file is no longer needed and its presence would be misleading.
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.
Why
The codebase had grown with modules organized by technical role (gate/, enforce/, guardrail/, guard/) rather than by architectural plane. The three-plane architecture (Decision / Context / Enforcement) was already the conceptual model, but the directory layout didn't reflect it — making it harder to reason about where logic belongs and where to add new features.
Approach
Modules were moved into two new top-level planes inside
adr_kit/:decision/— workflows, guidance, and gate logicenforcement/— adapters, validation, generation, config, detection, and reporterThe migration was done in stages: first creating the new structure with backward-compat shims at the old paths so all 309 tests continued to pass, then updating all import sites (mcp/server.py, cli.py, tests) to use the new paths directly, and finally deleting the old directories and shims. This avoids a big-bang cutover that's hard to review.
adr_kit/workflows/was preserved as-is forPlanningWorkflow, which belongs to the Context plane and is addressed separately.What Was Tested
Risks
This is a pure structural refactor — no logic was changed, only file locations and import paths. The main risk is an import that was missed, but the test suite and mypy provide strong coverage of the import graph. No public API surface changed.