Repository navigation
Preflight modal dialogs: make TUI prompts work (12.2.0, closes #106) - #109
Merged
Merged
Conversation
…106) The M1 finding on #106: the tool-requirements preflight was reachable only in the TUI, and even there its interactive prompts were dead. PreflightRunner's ensure_* methods import ConfirmModal/InputModal/InterfaceSelectModal/PreflightModal from netreaper.tui.modals.preflight_modal, a module that never existed, so every prompt (pick interface, confirm monitor mode, enter target/API key, approve a download/install) degraded to a 'name it explicitly' notice. - Implement tui/modals/preflight_modal.py with the four ModalScreen dialogs, each dismissing the value the runner expects (bool / str|None / interface name). - Re-export them from tui/modals/__init__ and drop the stale 'does not exist' note. - test_preflight_modals.py pins each dialog via the Textual test harness. - Dropped preflight_modal from the KNOWN_DANGLING (test_reachability) and the static-analysis dangling set now that it exists. Chosen over adding a separate headless preflight to the chain/CLI path: the real safety gates fire at the execution seam regardless of entry point. Bump 12.2.0.
Nerds489
added a commit
that referenced
this pull request
Oct 1, 2026
Preflight modal dialogs: make TUI prompts work (12.2.0, closes #106)
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.
Closes the last open finding on #106 (M1) by fixing the TUI preflight permanently, and bumps 12.2.0.
The problem
M1 was that the tool-requirements preflight was reachable only in the TUI. Investigating it showed the TUI preflight itself was half-dead:
PreflightRunner's interactive prompts (ensure_interface,ensure_monitor_mode,ensure_root,ensure_target,ensure_api_key,ensure_wordlist, tool install) importConfirmModal/InputModal/InterfaceSelectModal/PreflightModalfromnetreaper.tui.modals.preflight_modal— a module that never existed. Every prompt caught theImportErrorand degraded to a "there is no picker yet, name it explicitly" notice, so the interactive path did nothing.The fix (fix the TUI, not a headless bypass)
tui/modals/preflight_modal.pyimplemented: fourModalScreendialogs, each dismissing exactly what the runner expects —ConfirmModal→ bool,InputModal→ str|None,InterfaceSelectModal→ the chosen interface name|None,PreflightModal→ bool. Styled to match the existing modal (first_run.py), stable widget ids.tui/modals/__init__.pyre-exports them and drops the stale "does not exist" note.test_preflight_modals.pydrives each dialog through the Textual test harness (run_test+push_screencallback) and pins its dismiss value.preflight_modalfromKNOWN_DANGLING(test_reachability) and from the static-analysis dangling set, now that it exists.The alternative (a separate headless preflight for the chain/CLI path) was rejected: the real safety gates (scope, tier, destructive, root) fire at the execution seam regardless of entry point, so the preflight is a TUI convenience and belongs in the TUI.
Not in scope:
netreaper.automation.preflight.PreflightChecker(therun_with_preflight/PreflightModalpath) is still unwritten and stillKNOWN_DANGLING; it has no callers and is a separate part of #31.Verification
88 tests green across the modal, reachability, static-analysis and tui-app suites; ruff and mypy clean on the new module.
Closes #106