Planned Change Execution
Homeboy’s planned-change vocabulary is the shared core language for work that starts as a plan and may eventually mutate files or publish external state.
The lifecycle is:
plan -> execute -> artifact -> approve -> apply -> publishCore Contract
The contract types live in src/core/execution.rs and are intentionally usable
without changing existing command JSON output shapes.
ExecutionRequestcaptures the subject, selectedExecutionMode, optionalHomeboyPlan, approval scope, inputs, and policy.ExecutionRuncaptures the run status, step results, produced artifacts, warnings, and metadata.ExecutionStepResultrecords one executed step without forcing each command to expose a new public output envelope.ChangeArtifactrecords a proposed or captured change with provenance, files, diff/path data, approval scope, and metadata.ApplyRequestandApplyResultdescribe local worktree mutation.PublishRequestandPublishResultdescribe durable externalization such as commits, pushes, pull requests, releases, and deploys.
Mode Mapping
Existing command flags keep their command-specific behavior and output. Internally
they can map to ExecutionMode when a caller needs shared planned-change
semantics:
| Existing CLI vocabulary | ExecutionMode | Meaning |
|---|---|---|
--plan, preview | plan | Describe intended work without running executable steps. |
--dry-run, dry-run | dry_run | Run far enough to preview effects without durable writes. |
--capture-patch, capture-patch | capture_patch | Execute and preserve proposed file changes as artifacts. |
--write, --apply, write, apply | apply | Materialize an approved or command-permitted change locally. |
--execute, run, execute | execute | Execute the requested workflow directly. |
Use ExecutionMode::from_cli_value() for value-style inputs. Boolean flag
handlers should map their selected command behavior to the same mode values at
the call site when they adopt the contract.
Existing Workflow Mapping
- Release planning remains represented by
HomeboyPlan; release run results can project intoExecutionRunandChangeArtifactwithout changing release CLI JSON. - Runner/Lab patch capture can project captured patches or deltas into
ChangeArtifact; local mutation belongs inApplyResult. - Refactor write paths can treat
--writeasExecutionMode::Applywhile preserving their existing command outputs. - WP Codebox-style adapters should split local file mutation from publish steps: apply verifies and writes files, while publish commits, pushes, opens pull requests, releases, or deploys.
Extension Guidance
Extensions do not need to adopt every type at once. A useful first slice is:
- Accept or emit
ExecutionModewhen a command supports plan, dry-run, capture, apply, or execute behavior. - Emit
ChangeArtifactfor proposed file changes with enough provenance to identify the source run, step, command, and captured snapshot. - Return
ApplyResultwhen an approved artifact mutates a local worktree. - Return
PublishResultonly for post-apply externalization.
This keeps the core vocabulary consistent for fleet cooking while allowing each command and extension to preserve current public JSON contracts during migration.