Skip to content

feat(add): Plan 23 Phase 3 — flip cinematic default + bundled cleanups#64

Merged
LastStep merged 2 commits into
mainfrom
worktree-agent-ad57b8f4
Apr 22, 2026
Merged

feat(add): Plan 23 Phase 3 — flip cinematic default + bundled cleanups#64
LastStep merged 2 commits into
mainfrom
worktree-agent-ad57b8f4

Conversation

@LastStep

Copy link
Copy Markdown
Owner

Summary

Plan 23 Phase 3 — flip cinematic bonsai add to default; delete legacy runAdd body, runAddSpinner, buildNewAgentSteps, buildAddItemsSteps, the BONSAI_ADD_REDESIGN env gate, and the Phase-1-deferred yield variants. Rename cmd/init_redesign.gocmd/init_flow.go. Bundle 7 same-file backlog cleanups from PR #52/#59/#62 reviews (predicate hardening, conflict-slot type-scan, .bak write-error handling, unknown-agent yield variant, harness composition test, applyCinematicConflictPicks direct test, dead post-harness warning removal).

Closes Plan 23 (no GH issue).

Changes

  • cmd/add.go — replaced legacy runAdd body with cinematic flow merged in from cmd/add_redesign.go; applied cleanups feat: add bonsai guide command #3 (closure-capture predicate), feat: add release pipeline — GoReleaser + GitHub Actions + Homebrew Tap #5 (.bak failure drops + collected warning), ci: add pull request CI workflow #6 (type-scan for conflict slot); deleted dead helpers runAddSpinner / buildNewAgentSteps / buildAddItemsSteps / addOutcome / normaliseWorkspace / workspaceUniqueValidator / newDescriber / toItemOptions / toSensorOptions / toRoutineOptions / newAgentWorkspace.
  • cmd/add_redesign.go — deleted (contents merged into cmd/add.go).
  • cmd/add_test.go — new; table tests for applyCinematicConflictPicks (Keep noop, Overwrite no .bak, Backup writes .bak, mixed-action map, empty map → false, backup read-fail + warn, backup write-fail + warn, all-dropped → false, dropped-list smoke).
  • cmd/init.go — deleted userSensorOptions (only legacy add called it); kept asString / asStringSlice / asBool (still used by remove / update / root).
  • cmd/init_redesign.gocmd/init_flow.go (git mv); applied cleanup fix: migrate markerless CLAUDE.md — backup + overwrite with markers #1 (deleted dead post-harness Generate-error warning block — GenerateStage.stateError already prints the in-frame panel).
  • cmd/root.goapplyConflictPicks now drops paths on .bak read OR write failure and emits one collected tui.Warning listing all dropped paths (cleanup feat: add release pipeline — GoReleaser + GitHub Actions + Homebrew Tap #5 same-shape fix).
  • internal/tui/addflow/yield.go — added NewYieldUnknownAgent variant + yieldModeUnknownAgent enum value + renderUnknownAgent() body; deleted NewYieldAddItemsDeferred + yieldModeAddItemsDeferred + renderAddItemsDeferred() (Phase 1 placeholder, unreachable post-Phase 2).
  • internal/tui/addflow/yield_test.go — replaced AddItemsDeferred test with UnknownAgent test asserting bonsai update CTA copy.
  • internal/tui/harness/steps_test.go — added 3 composition tests (cleanup Rename "catalog items" to "abilities" across codebase #2): Conditional+Lazy Chromeless forwarding when active, Chromeless false when skipped, builder fires once per active pass.

Plan

station/Playbook/Plans/Active/23-uiux-phase2-add.md — Phase 3 section

Verification

  • make build — passes
  • go test ./... — passes
  • gofmt -s -l . — empty
  • go vet ./... — clean
  • golangci-lint run — 0 issues
  • All grep checks zero hits (BONSAI_ADD_REDESIGN, buildNewAgentSteps, buildAddItemsSteps, runAddSpinner, addOutcome, NewYieldAddItemsDeferred, yieldModeAddItemsDeferred)
  • cmd/init_redesign.go removed; cmd/init_flow.go present
  • cmd/add_redesign.go removed
  • Binary smoke ./bonsai --help + ./bonsai add --help — works

🤖 Generated with Claude Code

LastStep and others added 2 commits April 22, 2026 16:33
Promote the cinematic `bonsai add` flow to default and delete the legacy
`runAdd` body, `runAddSpinner`, `buildNewAgentSteps`, `buildAddItemsSteps`,
the `BONSAI_ADD_REDESIGN` env gate, and the Phase-1-deferred yield
variants. Rename `cmd/init_redesign.go` → `cmd/init_flow.go`.

Bundle 7 same-file backlog cleanups from PR #52/#59/#62 reviews — every
item touches a file already in scope for the cutover, so opening these
files twice is wasteful churn:

  1. Drop dead post-harness Generate-error warning in init_flow.go
     (GenerateStage.stateError already prints in-frame).
  2. Add harness composition tests for NewConditional(NewLazy(...)):
     Chromeless forwarding + builder-fires-once-per-active-pass.
  3. Replace prev-walk in growSucceeded with closure-captured
     outcome.SpinnerErr + outcome.Ran predicate.
  4. Add NewYieldUnknownAgent variant — replaces the previous
     YieldTechLeadRequired re-use for unknown-agent paths; CTA points
     at `bonsai update`.
  5. Backup-write/-read failure now drops the path from the overwrite
     list and emits one collected tui.Warning naming all dropped paths.
     Same fix shape applied in both applyCinematicConflictPicks
     (cmd/add.go) and applyConflictPicks (cmd/root.go).
  6. Conflicts-stage post-harness slot resolved by type-scanning
     results for map[string]config.ConflictAction, replacing the
     fragile len(results)-2 arithmetic.
  7. Add cmd/add_test.go covering applyCinematicConflictPicks across
     all 7 cases (Keep/Overwrite/Backup happy paths, mixed actions,
     empty map, backup-read-fail drop+warn, backup-write-fail
     drop+warn, all-dropped → false).

Verification:
- make build passes
- go test ./... passes (all packages)
- gofmt -s -l . empty
- go vet ./... clean
- golangci-lint run: 0 issues
- Grep checks zero hits for BONSAI_ADD_REDESIGN, buildNewAgentSteps,
  buildAddItemsSteps, runAddSpinner, addOutcome,
  NewYieldAddItemsDeferred, yieldModeAddItemsDeferred
- Binary smoke ./bonsai --help + ./bonsai add --help works

Plan: station/Playbook/Plans/Active/23-uiux-phase2-add.md (Phase 3)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR #64 review minors:
- cmd/add.go: GrowStage already surfaces SpinnerErr in-frame via
  initflow.GenerateStage.stateError; the post-harness tui.Warning
  fires into a cleared terminal. Symmetric to cleanup #1 already
  applied to cmd/init_flow.go.
- cmd/add_test.go: rename TestApplyCinematicConflictPicks_DroppedListSorted
  → ContainsAll (test asserts membership, not ordering).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@LastStep LastStep marked this pull request as ready for review April 22, 2026 11:13
@LastStep LastStep merged commit 788fa6c into main Apr 22, 2026
6 checks passed
@LastStep LastStep deleted the worktree-agent-ad57b8f4 branch April 22, 2026 11:14
LastStep added a commit that referenced this pull request Apr 22, 2026
…ry + log

Plan 23 complete via PR #64 squash 788fa6c. Move plan to Archive/, mark
Recently Done in Status, HTML-comment 7 absorbed Backlog items + add 2
cosmetic minors from review, refresh memory Work State, append RoutineLog
entry.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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