Skip to content

refactor(4.10b): split plan_scaffold.py into runtime/plan/ package#41

Merged
Li-Sanze merged 1 commit into
mainfrom
refactor/4.10b-plan-scaffold-split
May 26, 2026
Merged

refactor(4.10b): split plan_scaffold.py into runtime/plan/ package#41
Li-Sanze merged 1 commit into
mainfrom
refactor/4.10b-plan-scaffold-split

Conversation

@Li-Sanze
Copy link
Copy Markdown
Collaborator

What

Extract plan_scaffold.py (466 LOC) into single-responsibility modules under runtime/plan/:

Module Responsibility
scaffold.py Plan package creation + rendering (~200 LOC)
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 (relocated, unchanged)

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 → verify no auto-upsert
  • Mock patch paths updated for new module locations
  • Add _scaffold_with_registry() helper for registry-dependent tests
  • Migrate intent tests to dedicated test_runtime_plan_intent.py
  • New contract tests: test_runtime_plan_lookup (5 cases), test_runtime_plan_intent (4 cases)

Verification

  • 626 passed, 49 subtests passed
  • Structural: scaffold has no find/load/intent; lookup has no scaffold; intent has no runtime deps
  • Import direction: scaffold→identity, lookup→identity, no reverse deps
  • __init__.py is docstring-only (no re-export facade)

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
@Li-Sanze Li-Sanze merged commit 9d3a862 into main May 26, 2026
2 of 4 checks passed
@Li-Sanze Li-Sanze deleted the refactor/4.10b-plan-scaffold-split branch May 26, 2026 06:38
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