feat(migration): Add Resumable Staged Migration Planning#3
Draft
bigH wants to merge 69 commits into
Draft
Conversation
Why: Removes duplicated bypass log formatting across modules and protects the scope-expansion artifact contract with focused coverage. Validation: uv run pytest
Why: Removes regex-heavy duplicate grammar handling in a boundary parser while preserving behavior with tighter edge-case tests. Validation: uv run pytest
Why: Removes repeated load-bearing parsing logic in planning.py while preserving phase discovery behavior and locking section-over-legacy precedence with tests. Validation: uv run pytest
Why: This makes a load-bearing retry state machine smaller and easier to change while preserving rollback and validation semantics under direct test. Validation: uv run pytest
Why: Preserves a real safety invariant by fixing a test helper that could miss branching calls in direct run_command imports and still pass. Validation: uv run pytest
Why: This locks down migration-facing effort semantics and removes duplicated result-building logic that could drift. Validation: uv run pytest
Why: removes repeated manifest discovery logic in a load-bearing module while preserving human-review and effort-budget scheduling semantics Validation: uv run pytest
Why: Removes duplicated boundary checks in init, making repo-relative path rules easier to maintain while preserving the tested contract for both flags. Validation: uv run pytest
Why: This preserves the real scope-candidate contract while deleting test-coupled internals that made small cleanups harder than necessary. Validation: uv run pytest
Why: Removes repeated summary/rationale fallback branches and locks the boundary-text contract behind one helper plus direct tests. Validation: uv run pytest
Why: Preserves the current kind-based selection contract while preventing silent misrouting if future refactors produce duplicate candidate kinds. Validation: uv run pytest
Why: Removes a duplicated load-bearing package string while adding a higher-value test for the actual --version CLI boundary Validation: uv run pytest
Why: Preserves the same upgrade behavior with a smaller, truer test file that is easier to extend without copy-paste drift. Validation: uv run pytest
Why: Removes duplicated attempt/transition field plumbing in failure reporting while preserving the tested commit-vs-failure boundary. Validation: uv run pytest
Why: Centralizing RouteResult and DecisionRecord assembly removes duplicate error-mapping logic in a hot orchestration path and makes future cleanup safer Validation: uv run pytest
Why: Preserves behavior while deleting private test scaffolding that duplicated shared fixture logic, reducing drift risk in a sensitive test path. Validation: uv run pytest
Why: Preserves caller-visible status parsing and retry defaults while making the module smaller, more direct, and better protected by boundary-level tests. Validation: uv run pytest
Why: Preserves CLI guard behavior while reducing test-only drift against the canonical run-loop argument shape. Validation: uv run pytest
Why: Preserves a small but real safety net by making taste CLI tests fail truthfully and share one arg-construction path, which reduces maintenance drift in the taste test cluster. Validation: uv run pytest
Why: Removes pointless count-based indirection in git state checks while adding direct coverage for dirty-state helpers and empty-commit rejection. Validation: uv run pytest
Why: Removes duplicated test setup and replaces it with one shared fail-fast helper, making the run-loop tests smaller and easier to change without touching behavior. Validation: uv run pytest
Why: Preserves the effort-override contract while removing effort-domain logic from loop.py, improving locality and reducing orchestration noise. Validation: uv run pytest
Why: Preserves a small but real cleanup that makes the run-once test cluster simpler and less drift-prone without changing behavior. Validation: uv run pytest
Why: Reduces duplicated fixture mechanics in the CLI taste-warning tests, making the protected warning behavior easier to read and safer to extend. Validation: uv run pytest
Why: This makes `targeting` easier to read and change by replacing exception-shaped local validation with direct validity checks, with behavior pinned by tests. Validation: uv run pytest
Why: preserves behavior while removing repeated failure-event construction that could drift across classifier error paths Validation: uv run pytest
…429T020915/revise Why: planning.revise accepted; next step: review-2
Why: Cuts misleading test dependencies/noise in a single module cluster without changing behavior, making tests easier to read and maintain. Validation: uv run pytest
Why: Improves test-code truthfulness and reduces maintenance ambiguity with zero user-facing or runtime behavior change. Validation: uv run pytest
Why: Reduces repeated regex compilation in a hot matching path while preserving behavior with an explicit boundary guard test. Validation: uv run pytest
…260507T130532 Why: planning.approaches accepted; next step: pick-best
…g-20260507T130532/pick-best Why: planning.pick-best accepted; next step: expand
…g-20260507T130532/expand Why: planning.expand accepted; next step: review
…g-20260507T130532/review Why: planning.review accepted; next step: revise
…g-20260507T130532/revise Why: planning.revise accepted; next step: review-2
Why: Reduces parser brittleness/duplication while preserving behavior, with direct tests locking the intended parsing contract. Validation: uv run pytest
Why: Deletes dead abstraction layers, keeps behavior identical, and makes the persistence path shorter and easier to audit. Validation: uv run pytest
Why: Removes duplicated load-bearing gate logic and adds a planning-path regression test, reducing drift risk while preserving behavior. Validation: uv run pytest
…260507T140152 Why: planning.approaches accepted; next step: pick-best
…n-20260507T140152/pick-best Why: planning.pick-best accepted; next step: expand
…n-20260507T140152/expand Why: planning.expand accepted; next step: review
…n-20260507T140152/review Why: planning.review accepted; next step: revise
…n-20260507T140152/revise Why: planning.revise accepted; next step: review-2
…n-20260507T140152/review-2 Why: planning.review-2 accepted; next step: final-review
…n-20260507T140152/final-review Why: Deterministic, low-risk refactor plan with correct effort tiers and no human decision gates.
…on-20260507T140152/phase-1-characterize-current-contracts.md Why: Locks current migration_consistency contracts before internal refactoring, reducing behavior-regression risk in later extraction phases. Validation: uv run pytest
…on-20260507T140152/phase-2-extract-rule-groups-behind-stable-api.md Why: Improves readability and maintainability of consistency execution-gate logic without changing public contracts or caller behavior. Validation: uv run pytest
…on-20260507T140152/phase-3-normalize-shared-internal-policy-predicates.md Why: Reduces duplicated gating logic and branch redundancy in migration consistency policy checks while preserving execution semantics and keeping full test suite green. Validation: uv run pytest
…on-20260507T140152/phase-4-integration-verification-sweep.md Why: No code changes were necessary; this phase verified integration contracts and preserved behavior across callers. Validation: uv run pytest
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
.planning/state.json, accepted stage stdout, resumable one-step planning, and refinement feedback.migration list|doctor|review|refinecommands with safer visible-migration and slug/path resolution.Components Touched
Why
Migration planning needed a durable, resumable path instead of relying on transient agent output. This makes planning auditable, lets review and refinement publish through the same staged transaction boundary, and keeps automation from executing invalid or human-gated migrations.
Related PRs
None. This PR carries the staged migration planning stack.
Validation
uv run pytest->880 passedin73.56sReviewer Notes
🤖 Generated with OpenAI Codex
🧠 Steered & Validated by Hiren Hiranandani