Skip to content

feat(cli): plan an issue into slices in llmkube foreman slice#1050

Merged
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:feat/slicer-cli-planner
Jul 10, 2026
Merged

feat(cli): plan an issue into slices in llmkube foreman slice#1050
Defilan merged 1 commit into
defilantech:mainfrom
Defilan:feat/slicer-cli-planner

Conversation

@Defilan

@Defilan Defilan commented Jul 10, 2026

Copy link
Copy Markdown
Member

What

Task 6b of the Sliced Workloads epic (#1033): make llmkube foreman slice hands-off.

Given an ISSUE argument plus --repo and --planner-url, it:

  1. fetches the issue (title + body),
  2. builds the pinning planner prompt (embedded) with an optional --repomap,
  3. calls the OpenAI-compatible planner model,
  4. parses the SlicePlan (strips a code fence, surfaces UNSLICEABLE, unmarshals YAML),
  5. feeds it to the existing render (feat(cli): llmkube foreman slice renders a sliced Workload from a plan #1049).

--plan FILE still short-circuits planning (Task 6a). The CLI overrides the plan's issue/repo header fields, which the planner routinely slips (seen repeatedly in the experiment).

Why

Completes the "CLI plans + renders" design: llmkube foreman slice 700 --repo ... --planner-url ... now goes from an issue number to an applied sliced Workload in one command, no hand-authored plan.

How

The planner transport is injected (PlannerCaller), so parsing + HTTP are unit-tested without a live model. A one-shot POST /v1/chat/completions (not the streaming oai.Client, which is built for the agent loop) matches the experiment's curl.

Testing

go test ./pkg/cli/parseSlicePlan (bare / fenced / UNSLICEABLE / no-slices), httpPlannerCall via httptest, and resolveSlicePlan input-mode validation, plus the 6a render tests. Build + golangci-lint clean.

Scope / follow-ups

  • Auto-generating the repomap (today it's an optional --repomap file, as in the experiment).
  • Resolving the planner endpoint from a planner Agent's InferenceService instead of --planner-url.

Stacked PR

Stacked on #1049 (Task 6a render). Until it merges, this PR's diff includes 6a's commit; the new commit here is c8c57c9.

Checklist

  • Parsing + HTTP unit-tested (injected transport, httptest)
  • go test / golangci-lint / build clean
  • DCO sign-off

Part of #1033


Assisted-by: Claude Code (Opus 4.8); reviewed and verified by the author.

Task 6b of the Sliced Workloads epic (defilantech#1033): make llmkube foreman slice
hands-off. Given an ISSUE arg plus --repo and --planner-url, it fetches the
issue, builds the pinning planner prompt (embedded) with an optional --repomap,
calls the OpenAI-compatible planner model, parses the SlicePlan (fence-strip,
UNSLICEABLE detection, YAML), and feeds it to the existing render. --plan FILE
still short-circuits planning. The CLI overrides the plan's issue/repo header
fields, which the planner routinely slips.

The planner transport is injected (PlannerCaller) so parsing + HTTP are unit-
tested without a live model: parseSlicePlan (bare/fenced/UNSLICEABLE/no-slices),
httpPlannerCall via httptest, and resolveSlicePlan's input-mode validation.

Part of defilantech#1033

Signed-off-by: Christopher Maher <chris@mahercode.io>
@Defilan Defilan force-pushed the feat/slicer-cli-planner branch from c8c57c9 to ca05f9a Compare July 10, 2026 06:47
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.15094% with 38 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/cli/slice_planner.go 50.70% 29 Missing and 6 partials ⚠️
pkg/cli/slice.go 91.42% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Defilan Defilan merged commit c4a967c into defilantech:main Jul 10, 2026
23 checks passed
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.

1 participant