feat(windows): PS 5.1 ASCII picker, Resolve-FinalToolset, TUI tests [Slice 3] (#495) - #506
Open
primetimetank21 wants to merge 3 commits into
Open
feat(windows): PS 5.1 ASCII picker, Resolve-FinalToolset, TUI tests [Slice 3] (#495)#506primetimetank21 wants to merge 3 commits into
primetimetank21 wants to merge 3 commits into
Conversation
…495) - Add scripts/windows/lib/tui.ps1 with Resolve-FinalToolset (canonical ordered resolver), Resolve-ToolSelection (checked-array to CSV), and Show-ToolMenu ([Console]::ReadKey loop, ASCII-only, no Write-Host). - Refactor scripts/windows/setup.ps1: extract inline FinalToolset building into Resolve-FinalToolset calls; wire menu/selection-file dispatch under Test-ShouldShowMenu; add _PS_TUI_TEST_MENU env seam to Test-ShouldShowMenu for headless integration tests. - Add tests/test_tui_pwsh.ps1: 14 tests covering resolver defaults/only/skip, selection resolver defaults/subset/opt-in/empty, selection-file E2E, cancel/empty guards (seam-driven), drift gate, ASCII purity, help hiding, PS 5.1 parse check. - Update .github/workflows/validate.yml: PSSA for tui.ps1 in lint-powershell; tui.ps1 syntax check + PSSA + test_tui_pwsh.ps1 in validate-ps51; test_tui_pwsh.ps1 in validate-powershell (pwsh). Part of #495 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- validate.yml: restore validate-ps51 job key (was merged into validate-powershell body, breaking YAML structure and dropping the dedicated PS 5.1 CI job entirely) - tui.ps1: remove Resolve-ToolSelection (dead function; Show-ToolMenu internal result feeds Resolve-FinalToolset directly, no CSV mapping needed at that layer) - tui.ps1: remove _PS_TUI_MOCK seam (fake bypass returning final result, not driving state machine); cancel/empty live behavior under manual gate - tui.ps1: fix ReadKey catch warning to say 'Interactive menu failed; installation is being cancelled.' -- no longer misleads caller about proceeding non-interactively; return null drives 'Install cancelled.' - tui.ps1: document null-vs-empty return contract (cancel = return null, non-null = return comma-prefixed array; distinguishable at caller, verified under PS 5.1 and pwsh) - test_tui_pwsh.ps1: remove 4 Resolve-ToolSelection unit tests (dead function removed), remove T_menu_cancel_aborts_ps (tested _PS_TUI_MOCK bypass only, not production flow); 14 -> 9 tests remain - test_tui_pwsh.ps1: update manual gate list (cancel explicitly named, ReadKey failure warning wording updated) Authored by Rex (CT-7567), independent revision author for rejected PR #506. Hardcase strictly locked out per reviewer protocol. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update exports list to match actual exported functions, removing Resolve-ToolSelection. - Keep Resolve-FinalToolset and Show-ToolMenu exports listed. Authored by Tech, third independent revision author for rejected PR #506. Hardcase and Rex strictly locked out per reviewer protocol. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Author
Manual Verification: Group A TUI BehaviorsDate: 2026-08-07 All Group A interactive menu behaviors verified passing:
All manual gates cleared. Ready for review. |
primetimetank21
marked this pull request as ready for review
August 7, 2026 08:53
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.
Slice 3: PS 5.1 ASCII Picker + Resolve-FinalToolset Refactor
Part of #495
Scope
This PR implements Slice 3 only of the #495 TUI picker plan.
New file
scripts/windows/lib/tui.ps1:Resolve-FinalToolset: canonical ordered tool resolver (pure function, no exit, no I/O). Replaces the inline FinalTools build block in setup.ps1. Handles default/only/skip paths with order preservation and alphabetic opt-in appending.Show-ToolMenu:[Console]::ReadKey($True)loop, pure ASCII display ([x]/[ ], no Write-Host, no Unicode). Keys: Up/Down, Space, A toggle-all, Enter, Esc/Q. Defaults pre-checked; opt-ins unchecked + labeled(opt-in). Cancel returns$null; nothing-selected returns[string[]]@(); confirmed returns[string[]]. ReadKey failure catches to one stderr warning ("Interactive menu failed; installation is being cancelled.") + returns$null(Install cancelled.).Refactored
scripts/windows/setup.ps1:lib/tui.ps1(after logging.ps1 + path.ps1).///block; all paths now callResolve-FinalToolset.Test-ShouldShowMenuresult to menu dispatch: interactive path handles SelectionFile seam orShow-ToolMenu; non-interactive path validates and resolves via flags._PS_TUI_TEST_MENUenv seam toTest-ShouldShowMenu(hidden; enables headless integration tests).Write-Output(PSSA-clean).New file
tests/test_tui_pwsh.ps1(9 tests):T_resolve_toolset_defaults/only/skip_psT_menu_selection_file_e2e_ps,T_menu_noop_empty_ps,T_noarg_noninteractive_compat_ps[DRIFT]T_ascii_purity_ps,T_help_no_seam_ps,T_parse_tui_ps51Updated
.github/workflows/validate.yml:lint-powershell: PSSA forscripts/windows/lib/tui.ps1validate-ps51: (restored job key) syntax check + PSSA for tui.ps1; runtest_tui_pwsh.ps1under PowerShell 5.1validate-powershell: runtest_tui_pwsh.ps1under pwsh (modern)Excluded
--helpexposure of-SelectionFile(hidden seam)Resolve-ToolSelectionremoved (dead function -- Show-ToolMenu result feeds Resolve-FinalToolset directly)_PS_TUI_MOCKfake seam removed (tested bypass, not production control flow)Rejection Findings Fixed (Rex corrective revision, Hardcase locked out)
validate-ps51job key was missing (YAML merged the job body intovalidate-powershell, silently dropping the PS 5.1 CI job)Resolve-ToolSelectionwas dead production code and its 4 tests removed_PS_TUI_MOCKfake seam removed;T_menu_cancel_aborts_psremoved; cancel/ReadKey failure remain manual gates$null-> "Install cancelled."$nullvs@()return semantics verified under PS 5.1 and pwsh: cancel (return $null) and empty (return ,$selected) are distinguishable at callerCI Gates
All existing CI checks preserved. New gates added:
Manual TTY Verification Required (Kix Protocol)
These cannot be tested headlessly:
(opt-in)[Console]::ReadKeyexception path: warning to stderr ("Interactive menu failed; installation is being cancelled."), exit 0, nothing installedRelationship to Other PRs