refactor(4.10b): split plan_scaffold.py into runtime/plan/ package#41
Merged
Conversation
Extract plan_scaffold.py (466 LOC) into single-responsibility modules under runtime/plan/: - scaffold.py: plan package creation + rendering only - lookup.py: plan discovery (find_plan_by_*, load_plan_artifact) - intent.py: new-plan intent detection (regex heuristics) - identity.py: shared derive_topic_key + _slugify - registry.py: plan governance (unchanged, relocated) Contract change: create_plan_scaffold() no longer calls upsert_plan_entry(). Registry write lifted to _planning.py caller with same try/except PlanRegistryError fallback semantics. Test updates: - Rewrite scaffold-auto-registry test to verify no auto-upsert - Mock patch path updated for new module locations - Add _scaffold_with_registry() helper for registry-dependent tests - Migrate intent tests to dedicated test_runtime_plan_intent - New contract tests: test_runtime_plan_lookup (5 cases), test_runtime_plan_intent (4 cases) 626 passed, 49 subtests passed. Release-Sync: yes Release-Version: 2026-05-26.092824 Release-Date: 2026-05-26
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.
What
Extract
plan_scaffold.py(466 LOC) into single-responsibility modules underruntime/plan/:scaffold.pylookup.pyfind_plan_by_*,load_plan_artifact)intent.pyidentity.pyderive_topic_key+_slugifyregistry.pyContract Change
create_plan_scaffold()no longer callsupsert_plan_entry(). Registry write lifted to_planning.pycaller with sametry/except PlanRegistryErrorfallback semantics.Test Updates
_scaffold_with_registry()helper for registry-dependent teststest_runtime_plan_intent.pytest_runtime_plan_lookup(5 cases),test_runtime_plan_intent(4 cases)Verification
__init__.pyis docstring-only (no re-export facade)