refactor(tui): drop gum as a TUI backend (ADR-0024)#259
Merged
Conversation
Remove gum entirely as a TUI BACKEND per ADR-0024 (the Rich tier is the fzf two-pane navigator, the Fallback tier is whiptail). gum remains a fully supported INSTALLABLE TOOL via `setup_ubuntu install gum` (module/gum.module.sh, archetype B) — only its dialog-backend role is gone. lib/tui_backend.sh: - delete the gum adapter family (_tui_menu/checklist/msgbox/yesno/input_gum) - delete the pre-launch gum-install resolution (_tui_prelaunch_backend) - drop gum-specific i18n (prompt_install_gum, gum_keys_*, help_gum, the gum press_enter footer) - rewrite tui_backend_detect / tui_backend_init to whiptail-only; collapse _tui_backend_family + tui_help_text to the single whiptail family setup_ubuntu_tui.sh: - --backend accepts fzf|whiptail only; `gum` -> stderr usage + exit 2 with the hint "gum is no longer a TUI backend; install it as a tool via: setup_ubuntu install gum"; update help text + stale comments tests: - tui_backend_spec.bats: drop the gum detection/adapter/help/input tests and the prelaunch section + _make_mock_gum helper; add `--backend gum -> exit 2` - delete smoke_flow_gum.exp / real_install_flow_gum.exp and the gum-backend AC-10/AC-11 cases; scrub gum-backend mentions from helpers/specs - the github-release module-lifecycle specs (gum-the-module) are untouched docs: AGENTS.md (CLAUDE.md symlink), architecture.md, design/tui-*.md, module INDEX note, CHANGELOG [Unreleased] Removed entry. Dockerfile.test-tools keeps the gum binary (comment clarified): the github-release module-lifecycle `verify gum` -> `command -v gum` needs it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s
Recover per-file coverage on lib/tui_backend.sh after the gum backend was
dropped (ADR-0024), which deleted ~69 above-average-covered lines and pulled
the file from 71.94% to 68.76% single-run -- too close to the AC-17 80%
merged gate.
Adds test/unit/tui_backend_branches_spec.bats: focused in-process unit tests
for the genuinely-coverable error / dispatch branches the behavior-focused
tui specs never drive:
- _tui_cli_json ADR-0019 non-JSON validation guard
- tui_cli_install_plan / tui_cli_manage_plan fork-FAILED (rc != 0) paths,
plus tui_cli_manage_plan's "returned no plan" path and a happy parse
- the data-broker single error surface: _tui_broker_fail's msgbox branch
(TUI_BACKEND set + stubbed widget) and the detect-cache accessor error
- _tui_category_entry unknown-category defensive default
No runtime change -- lib/tui_backend.sh is byte-identical. Focused kcov over
all tui specs lifts lib/tui_backend.sh per-file coverage 295/429 (68.76%) ->
305/429 (71.10%); the remaining uncovered lines are jq-program string bodies
and multi-line command-sub continuations that kcov cannot attribute (an
artifact, not a real gap), plus the root-unreachable _tui_has_sudo non-root
arm. Full unit suite stays green (1203 ok, 0 fail).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NX5H2vuMTv4mBmjpPYoS3s
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
Final step before 0.1.0-rc: remove gum as a TUI BACKEND per ADR-0024 (which
mandates remove-now: "gum is dropped entirely... a 0.1.0 blocker"). The TUI now
has exactly two tiers: fzf two-pane navigator (Rich) preferred, whiptail nested
drill-down (Fallback) guaranteed.
gum remains a fully supported INSTALLABLE TOOL:
module/gum.module.shand itsspec are untouched;
setup_ubuntu install gumstill works. Only gum'sdialog-backend role is gone.
Changes
lib/tui_backend.sh: deleted the_tui_{menu,checklist,msgbox,yesno,input}_gumadapter family, the pre-launch gum-install resolver, and gum-specific i18n;
rewrote tier detection to fzf-preferred / whiptail-floor (no gum branch). All
_tui_*_whiptailadapters, the fzf-tier seam, and the backend-agnostictui_render_*dispatchers are preserved.setup_ubuntu_tui.sh:--backendacceptsfzf|whiptailonly;gum(and anyunknown value) exits 2 with a usage hint pointing at
setup_ubuntu install gum._make_mock_gumhelper; deleted the gum expect fixtures (smoke_flow_gum.exp,real_install_flow_gum.exp) and their AC-10/AC-11 cases; scrubbed gum-backend
mentions from the remaining TUI specs/harness. Added a
--backend gum -> exit 2test and whiptail-family contract tests.
test/unit/tui_backend_branches_spec.batscovering the CLI-fork JSONguard, install/manage dry-run plan parsing, and broker error paths (recovers
the genuinely-coverable lines after the gum deletion; the residual uncovered
lines are jq-program-body kcov attribution artifacts).
design docs carry superseded-by-ADR-0024 banners. ADR-0023 already superseded.
Test plan
just -f justfile.ci test-unit(Docker) -- 4061 tests, 0 failuresjust -f justfile.ci test-integration(Docker) -- 21 tests, 0 failures(the
verify gummodule-lifecycle test still passes; gum binary kept inthe test image for that, with a clarifying comment -- it is no longer a
backend)
sharded-merge cannot run in-env, so this is the gate to watch)
Follow-up (not blocking this PR)
rewrite to fzf>whiptail. Tracked separately so this PR stays code-focused.