Skip to content

feat: vk create --engine agent|pipeline for 0.5.0#3

Merged
voidkey merged 13 commits into
mainfrom
feature/engine-selection
May 14, 2026
Merged

feat: vk create --engine agent|pipeline for 0.5.0#3
voidkey merged 13 commits into
mainfrom
feature/engine-selection

Conversation

@voidkey
Copy link
Copy Markdown
Collaborator

@voidkey voidkey commented May 14, 2026

Summary

Unlocks the v=2 agent engine on vk create (the v=3 pipeline engine has been the CLI's only option until now). Both engines are actively maintained on go-figlens and the web frontend exposes engine selection as a user toggle.

  • vk create --engine pipeline (default) — current behavior, byte-identical wire body to 0.4.2
  • vk create --engine agent — routes to /v1/agent2forVideo/stream with v=2 on init
  • New node.progress SSE event surfaces v=2's empty-step_id messages as [agent] <message> in text mode (previously silently filtered)
  • --engine agent --mode replica rejected at CLI boundary with exit 2 (replica is v=3-only; verified against go-figlens source)
  • Snapshot JSON gains an engine field, remapped DB-enum "suite" → user-vocabulary "pipeline"

Spec: docs/superpowers/specs/2026-05-14-engine-selection-design.md
Plan: docs/superpowers/plans/2026-05-14-engine-selection.md

What's in the diff

13 commits, all green:

  • client/figlens/engine.go (new): Engine enum with Wire() / StreamPath() methods + RemapEngineForDisplay(). Zero value = EnginePipeline (preserves 0.4.2 defaults)
  • client/figlens/{task,stream,work}.go: thread Engine through InitTask (sets wire v), StreamChat (picks endpoint path), and decode Work.Engine from backend
  • client/figlens/stream.go: emit new node.progress event for empty step_id (v=2 shape) — load-bearing for visibility on agent engine
  • cmd/create.go: --engine flag, resolveEngine + validateEngineModeCombo helpers, node.progress rendering with [agent] prefix
  • cmd/video/list.go: engine field in JSON output for parity with snapshot
  • internal/video/snapshot/snapshot.go: Engine in Snapshot struct, populated via remap helper
  • internal/i18n/strings.go: 3 new keys en+zh
  • tests/integration/create_engine_test.go (new): end-to-end with the actual binary against a mock figlens — asserts v=2 on init body, hits /agent2forVideo/stream (NOT agent3), [agent] prefix in stderr
  • CHANGELOG / AGENTS.md / README{,.zh}.md / package.json / SKILL.md: docs + version bump 0.4.2 → 0.5.0

Test plan

  • go test ./... passes (incl. integration test for --engine agent)
  • go build ./... clean
  • vk create --help shows --engine alongside --mode/--aspect/--bgm
  • vk version reflects 0.5.0 (via package.json + SKILL.md; the make-build ldflags use git-describe)
  • Default invocation (no --engine) wire body unchanged (covered by TestInitTask_OmitsEmptyFields + Engine zero-value = pipeline)
  • --engine agent --mode replica exits 2 with clear error
  • --engine bogus exits 2 listing allowed values
  • Cross-package: pre-existing v=3 tests (TestStreamChat_ProcessEvents, TestStreamChat_*) still pass — empty step_id branch added BEFORE the existing IsKnownNode filter
  • Manual smoke against beta cluster — verified vk create --engine agent end-to-end + --mode script preflight rejection + vk video {list,status} --output json engine field on real beta backend

voidkey added 13 commits May 14, 2026 16:39
Apply findings from /simplify review:

- client/figlens/engine.go: replace if-chains in Wire() and
  StreamPath() with switches (clearer when a third engine is added);
  remove the no-op `case "agent"` identity arm in
  RemapEngineForDisplay — the default arm produces identical output.
- cmd/video/list.go: emit `engine` field in `--output json` for each
  work, remapped via RemapEngineForDisplay. Closes a gap where agents
  using `vk video list --output json` got no engine info even though
  the backend returns it.
- cmd/create.go: trim two over-narrated comments (validateEngineModeCombo
  doc + node.progress inline rationale) — keep WHY, drop WHAT.
- internal/video/snapshot/snapshot.go: move Engine field above Title
  in the struct/JSON ordering so provenance/identity fields cluster
  before display content.
- tests/integration/create_engine_test.go: replace the vacuous
  "skip strict format check" comment block with a pointer to the
  unit-level engine remap coverage in snapshot_test.go (RenderText
  intentionally omits engine from human output, so the integration
  test's text-mode path can't usefully assert on it).

No behavior changes for end users; JSON shapes for `vk video list`
gain an additive `engine` field (omitempty), and the snapshot
field-order is purely cosmetic.
@voidkey voidkey merged commit 5484967 into main May 14, 2026
3 checks passed
@voidkey voidkey deleted the feature/engine-selection branch May 14, 2026 10:12
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