Skip to content

refactor(mqlaunch): de-layer fzf pickers into a lib (Step 11a)#42

Merged
MCamner merged 1 commit into
mainfrom
feat/monolith-delayer-fzf
Jul 5, 2026
Merged

refactor(mqlaunch): de-layer fzf pickers into a lib (Step 11a)#42
MCamner merged 1 commit into
mainfrom
feat/monolith-delayer-fzf

Conversation

@MCamner

@MCamner MCamner commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What

Second slice of Step 11a (monolith de-layering, audit P4). Pull the six fzf interactive pickers out of terminal/launchers/mqlaunch.sh into mqlaunch/lib/fzf-pickers.sh:

fzf_git_log, fzf_git_branch, fzf_kill_process, fzf_kill_port, fzf_run_snippet, fzf_recent_files.

  • Verbatim move, sourced back into the launcher's scope — still uses the ambient UI helpers and $BASE_DIR. No behavior change.
  • Every caller resolves: main dispatch (mqlaunch.sh) and command-mode's declare -f fzf_… || "$BASE_DIR/bin/mqlaunch" … fallback both run after the lib is sourced.
  • Pure bash (no zsh builtins), so the lib gets a #!/usr/bin/env bash shebang and full shellcheck coverage.
  • Launcher: 1882 → 1771 lines (−111). Combined with the network slice, the monolith is down ~310 lines from where 11a started.

Guard generalised

tests/network-lib-delayer-smoke.shtests/monolith-delayer-smoke.sh: one table-driven check over every extracted concern (network + fzf, 23 functions). For each it asserts the lib defines the functions, the launcher sources the lib, and the launcher redefines none — and picks zsh -n vs bash -n per lib shebang. Each future concern adds one CONCERNS row.

Verification

  • Full selftest suite green (143 shell files lint clean); shellcheck clean on the new lib and smoke.
  • Function-resolution smoke confirms all 6 resolve after sourcing.
  • markdownlint clean.

Docs

docs/AUTHORITY_MAP.md lists the new LIVE support lib; CHANGELOG.md updated.

Part of the v2.0.0 runtime-authority track; 11a unblocks Step 12 (v1 removal).

Note for a later, separate PR (not this one)

The launcher redefines print_header after sourcing mq-ui.sh, shadowing the library's version — the two render different headers (launcher: dashboard-v7.1 script; mq-ui: bordered ASCII-face). That's a UI-authority reconciliation with a real behavior decision, out of scope for a verbatim de-layer. Flagging it rather than folding a behavior change into a refactor.

🤖 Generated with Claude Code

Second Step 11a slice. Pull the six fzf interactive pickers (git log/branch,
kill process/port, run snippet, recent files) out of the mqlaunch.sh monolith
into mqlaunch/lib/fzf-pickers.sh, sourced back into the launcher's scope.

Verbatim move: the pickers still rely on the launcher's ambient UI helpers and
$BASE_DIR, and every caller (main dispatch + command-mode's `declare -f … ||
fallback`) resolves because the lib sources before dispatch. No behavior change.
The lib is pure bash (no zsh builtins), so it carries a bash shebang and is
covered by shellcheck. Launcher: 1882 → 1771 lines.

Generalise the de-layer guard: tests/network-lib-delayer-smoke.sh becomes
tests/monolith-delayer-smoke.sh, a table-driven check over every extracted
concern (network + fzf, 23 functions). It fails if any function is redefined in
the monolith or a lib source is dropped, and picks the right syntax check
(zsh -n vs bash -n) per lib shebang. Add a CONCERNS row per future extraction.

AUTHORITY_MAP lists the new LIVE support lib; CHANGELOG updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@MCamner MCamner merged commit 8942680 into main Jul 5, 2026
3 checks passed
@MCamner MCamner deleted the feat/monolith-delayer-fzf branch July 5, 2026 16:26
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