feat(add): Plan 23 Phase 3 — flip cinematic default + bundled cleanups#64
Merged
Conversation
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>
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.
Summary
Plan 23 Phase 3 — flip cinematic
bonsai addto default; delete legacyrunAddbody,runAddSpinner,buildNewAgentSteps,buildAddItemsSteps, theBONSAI_ADD_REDESIGNenv gate, and the Phase-1-deferred yield variants. Renamecmd/init_redesign.go→cmd/init_flow.go. Bundle 7 same-file backlog cleanups from PR #52/#59/#62 reviews (predicate hardening, conflict-slot type-scan,.bakwrite-error handling, unknown-agent yield variant, harness composition test,applyCinematicConflictPicksdirect test, dead post-harness warning removal).Closes Plan 23 (no GH issue).
Changes
cmd/add.go— replaced legacyrunAddbody with cinematic flow merged in fromcmd/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 helpersrunAddSpinner/buildNewAgentSteps/buildAddItemsSteps/addOutcome/normaliseWorkspace/workspaceUniqueValidator/newDescriber/toItemOptions/toSensorOptions/toRoutineOptions/newAgentWorkspace.cmd/add_redesign.go— deleted (contents merged intocmd/add.go).cmd/add_test.go— new; table tests forapplyCinematicConflictPicks(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— deleteduserSensorOptions(only legacy add called it); keptasString/asStringSlice/asBool(still used by remove / update / root).cmd/init_redesign.go→cmd/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.stateErroralready prints the in-frame panel).cmd/root.go—applyConflictPicksnow drops paths on.bakread OR write failure and emits one collectedtui.Warninglisting all dropped paths (cleanup feat: add release pipeline — GoReleaser + GitHub Actions + Homebrew Tap #5 same-shape fix).internal/tui/addflow/yield.go— addedNewYieldUnknownAgentvariant +yieldModeUnknownAgentenum value +renderUnknownAgent()body; deletedNewYieldAddItemsDeferred+yieldModeAddItemsDeferred+renderAddItemsDeferred()(Phase 1 placeholder, unreachable post-Phase 2).internal/tui/addflow/yield_test.go— replacedAddItemsDeferredtest withUnknownAgenttest assertingbonsai updateCTA 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— passesgo test ./...— passesgofmt -s -l .— emptygo vet ./...— cleangolangci-lint run— 0 issuesBONSAI_ADD_REDESIGN,buildNewAgentSteps,buildAddItemsSteps,runAddSpinner,addOutcome,NewYieldAddItemsDeferred,yieldModeAddItemsDeferred)cmd/init_redesign.goremoved;cmd/init_flow.gopresentcmd/add_redesign.goremoved./bonsai --help+./bonsai add --help— works🤖 Generated with Claude Code