Skip to content

feat(tui): add Upgrade Tools menu with parallel upgrade engine#73

Draft
davidarce wants to merge 3 commits intomainfrom
feat/sdd-upgrade-tools
Draft

feat(tui): add Upgrade Tools menu with parallel upgrade engine#73
davidarce wants to merge 3 commits intomainfrom
feat/sdd-upgrade-tools

Conversation

@davidarce
Copy link
Copy Markdown
Owner

New Feature

Description

Adds a new Upgrade Tools entry to the DevRune TUI menu that lets users update declared external tools (e.g. crit, engram) in parallel using the upgrade commands defined in devrune.yaml.

Motivation

DevRune's manifest already declares external tools that integrate with the workflow (Crit for plan review, Engram for memory). Until now, users had to upgrade them manually outside DevRune. Centralizing tool upgrades in the TUI removes friction, surfaces what's installed at a glance, and keeps users on stable versions without leaving the app.

Implementation

  • Manifest schema — adds tools: to devrune.yaml with name + command per tool. Validated in internal/model/manifest.go.
  • Embedded catalogtools/*.yaml files compiled in via //go:embed (same pattern as agents). Defaults: crit = brew install crit, engram = brew install gentleman-programming/tap/engram.
  • Wizard wiringExistingConfig.Tools propagates through internal/cli/init.go and internal/cli/menu.go; persisted at the confirm step alongside agents.
  • Parallel upgrade engineinternal/tui/steps/tool_upgrade.go runs all upgradable tools concurrently, preserves a stable order by index, and returns a structured {name, status, error} summary. Individual failures don't abort the run.
  • Injectable executorfunc(command string) error parameter (defaults to sh -c <command>) keeps tests deterministic.
  • Empty / non-upgradable handling — tools without an effective command render with a (no upgradable) badge and are excluded from execution. If no tools are declared at all, an empty-state screen routes back to the main menu.

Testing

  • Added unit tests — manifest_test.go (5 cases), tool_catalog_test.go (loader smoke), app_test.go (5 table-driven cases), tool_upgrade_test.go (10 engine tests with injected executor)
  • Added integration tests — round-trip parse/serialize for tools: section in internal/parse/manifest_test.go
  • Tested edge cases — empty catalog, partial failures, non-upgradable tools, concurrent ordering

Documentation

  • Updated relevant documentation — manifest fixture in testdata/manifests/valid-full.yaml reflects the new section
  • Added usage examples — N/A (interactive TUI, behavior is self-documenting via menu)

Breaking Changes

None. The tools: field is additive and optional; existing manifests continue to work unchanged.

Out of Scope

Downgrades, rollback, version pinning, auto-upgrade on launch, and external (non-embedded) catalogs — all deliberate non-goals tracked in the SDD PRD.

SDD Trail

Built via the full SDD workflow (explore → plan → implement → review). Review verdict: ok with 5 non-blocking minors documented in .sdd/sdd-upgrade-tools/review.md (workdir is gitignored).

davidarce added 2 commits May 10, 2026 18:02
- Add ToolRef schema (name + command) to UserManifest with validation
- Embed built-in tool catalog (tools/engram.yaml, tools/crit.yaml)
- Add internal/tui/tool_catalog.go loader for embedded catalog
- Persist manifest.Tools after wizard confirm, preserving user overrides
- Add internal/tui/steps/tool_upgrade.go with parallel upgrade engine
  using injected executor for deterministic tests
- Render '(no upgradable)' badge for tools with no effective command
- Show empty-state and confirm gate before executing upgrades
- Wire 'Upgrade Tools' option into main TUI menu
Three follow-up fixes on top of the initial Upgrade Tools feature
based on real-usage feedback:

- Catalog wins over manifest. Resolution was 'manifest command first,
  catalog fallback'. A stale 'command:' override in the user's
  devrune.yaml (e.g. 'brew install tomasz-tomczyk/tap/crit') would
  silently shadow the catalog's correct command and fail. Invert the
  order: catalog always wins for known tools; manifest 'command:' only
  serves unknown tools as an extensibility hatch.

- Drop the redundant preview screen. The flow showed a Note listing
  upgradable tools (advances on any key, contradicting the 'enter
  submit' hint) immediately before a Confirm screen that already
  listed the same tools with their commands. Land directly on the
  Confirm screen.

- Add the standard '◆ DevRune' header to every Upgrade Tools screen
  (preview/confirm/summary/empty/all-non-upgradable) via BannerNote(),
  matching the convention used by 'devrune upgrade'.

Tests updated: 'manifest wins' assertion inverted; new cases cover
'catalog wins even when manifest differs' and 'manifest used when
catalog entry is empty' (fallback path for unknown tools).

Refs davidarce/devrune-starter-catalog#71 (corrects the upstream
crit command so users picking up the new catalog get the fix
automatically).
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