Skip to content

refactor(installer): make Install Plan the unit of work#89

Merged
derek-palmer merged 1 commit into
mainfrom
feat/install-plan-unit-of-work
May 30, 2026
Merged

refactor(installer): make Install Plan the unit of work#89
derek-palmer merged 1 commit into
mainfrom
feat/install-plan-unit-of-work

Conversation

@derek-palmer
Copy link
Copy Markdown
Owner

Closes #83.

What

The installer's install() interleaved the same resolve→validate→plan→print→write dance twice (skill + marketplace), and install_all_skills looped install()-style logic while returning nothing inspectable. This makes the Plan the unit of work:

  • Plan is now self-describing — carries its own exit_code, plus new_bytes (raw per-task copy, exact bytes) or new_content (marker-rendered skill / marketplace JSON). write() is byte-aware.
  • plan_install / plan_marketplace return a single Plan (exit_code embedded) instead of a (plan, code) tuple.
  • install() collapses both kinds into one _emit(plan, …) render/execute path.
  • New plan_skills / plan_skill_copy plan the --all batch as an inspectable list[Plan]; install_all_skills renders/executes that list.

--check is "render plans, skip execute" with no separate branch. Exit codes and printed output are unchanged.

Tests (TDD)

  • New: plan_skills returns inspectable plans without writing; missing source → abort with non-zero exit_code.
  • All existing installer behavior tests pass unchanged (byte-exact per-task writes, warning:/skip/update output, write_bytes patch, OSError handling, usage codes).

284 pytest + 11 node green.

🤖 Generated with Claude Code

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
@derek-palmer derek-palmer merged commit f06b264 into main May 30, 2026
12 checks passed
@derek-palmer derek-palmer deleted the feat/install-plan-unit-of-work branch May 30, 2026 14:23
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.

Deepen installer around an Install Plan as the unit of work

1 participant