refactor(installer): make Install Plan the unit of work#89
Merged
Conversation
Planning now returns inspectable Plan objects for both single and --all installs; a thin render/execute path writes them. plan_install and plan_marketplace return a self-describing Plan (exit_code embedded) instead of a (plan, code) tuple; install() collapses its duplicated skill/marketplace branches into one _emit. New plan_skills/plan_skill_copy plan the per-task --all batch as a list[Plan], so what would change is inspectable before any write; install_all_skills renders/executes that list. Plan carries new_bytes for raw per-task copies (exact-byte writes) vs new_content for marker-rendered skills/marketplace JSON. Exit codes and printed output are unchanged. Closes #83
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.
Closes #83.
What
The installer's
install()interleaved the same resolve→validate→plan→print→write dance twice (skill + marketplace), andinstall_all_skillsloopedinstall()-style logic while returning nothing inspectable. This makes the Plan the unit of work:Planis now self-describing — carries its ownexit_code, plusnew_bytes(raw per-task copy, exact bytes) ornew_content(marker-rendered skill / marketplace JSON).write()is byte-aware.plan_install/plan_marketplacereturn a singlePlan(exit_code embedded) instead of a(plan, code)tuple.install()collapses both kinds into one_emit(plan, …)render/execute path.plan_skills/plan_skill_copyplan the--allbatch as an inspectablelist[Plan];install_all_skillsrenders/executes that list.--checkis "render plans, skip execute" with no separate branch. Exit codes and printed output are unchanged.Tests (TDD)
plan_skillsreturns inspectable plans without writing; missing source →abortwith non-zeroexit_code.warning:/skip/updateoutput,write_bytespatch, OSError handling, usage codes).284 pytest + 11 node green.
🤖 Generated with Claude Code