feat(cli): llmkube foreman slice renders a sliced Workload from a plan#1049
Merged
Conversation
Task 6a of the Sliced Workloads epic (defilantech#1033): the native successor to the experiment's plan_to_workload.py. `llmkube foreman slice --plan FILE` parses a slice plan (the planner's YAML) and renders a Workload whose pipeline is one issue-fix step per disjoint slice, an integrate step (dependsOn every slice) that unions the slice branches, and a reconcile step (dependsOn integrate) that checks the union against the plan's pinned shared identifiers. --dry-run prints the Workload; otherwise it is created. buildSliceWorkload is a pure function (unit-tested for pipeline shape, branch naming foreman/slicer-<issue>/<slice>, dependsOn wiring, and pins in the reconcile payload); validateSlicePlan rejects a non-disjoint plan, a missing issue/repo, or no slices. The planner invocation (fetch issue + repomap + call the model to produce the plan) is Task 6b. Part of defilantech#1033 Signed-off-by: Christopher Maher <chris@mahercode.io>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
What
Task 6a of the Sliced Workloads epic (#1033):
llmkube foreman slice --plan FILE— the native successor to the experiment'splan_to_workload.py.It parses a slice plan (the planner's YAML) and renders a Workload whose pipeline is:
issue-fixstep per disjoint slice (scoped prompt + shared contract, branchforeman/slicer-<issue>/<slice>),integratestep (dependsOnevery slice) carrying the slice branches,reconcilestep (dependsOnintegrate) carrying the pinnedshared_identifiers+ contract + the slices' files.--dry-runprints the rendered Workload; otherwise it is created against the cluster.Why
The slicer's design is "CLI plans + renders, controller executes." This is the render+apply half: it turns a plan artifact into the Workload the controller (and the
integrate/reconciletools) already know how to run, closing the loop from plan to a running sliced Workload.How
buildSliceWorkloadis a pure function so the render is unit-tested directly (pipeline shape, kinds, branch naming,dependsOnwiring, and that the pins ride in the reconcile payload while the branches ride in integrate's).validateSlicePlanrejects a non-disjoint plan (a file owned by two slices), a missing issue/repo, or no slices — the same disjointness invariant the planner andintegrateenforce.Scope
The planner invocation (fetch the issue + build a repomap + call the model to produce the plan) is Task 6b, a follow-up. This PR consumes a plan file.
Testing
go test ./pkg/cli/ -run 'TestBuildSliceWorkload|TestValidateSlicePlan|TestRunSlice'— pipeline-shape, disjoint-validation, and dry-run-render tests pass. Verified end to end via the real CLI (go run ./cmd/cli foreman slice --plan ... --dry-runrenders a valid Workload). Build +golangci-lint(both arches) clean.Checklist
go test/golangci-lint/buildcleanPart of #1033
Assisted-by: Claude Code (Opus 4.8); reviewed and verified by the author.