Skip to content

Preflight modal dialogs: make TUI prompts work (12.2.0, closes #106) - #109

Merged
Nerds489 merged 1 commit into
mainfrom
feat/preflight-modals-106
Sep 29, 2026
Merged

Nerds489 merged 1 commit into
mainfrom
feat/preflight-modals-106

Conversation

@Nerds489

Copy link
Copy Markdown
Owner

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) import ConfirmModal / InputModal / InterfaceSelectModal / PreflightModal from netreaper.tui.modals.preflight_modal — a module that never existed. Every prompt caught the ImportError and 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.py implemented: four ModalScreen dialogs, 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__.py re-exports them and drops the stale "does not exist" note.
  • test_preflight_modals.py drives each dialog through the Textual test harness (run_test + push_screen callback) and pins its dismiss value.
  • Dropped preflight_modal from KNOWN_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 (the run_with_preflight/PreflightModal path) is still unwritten and still KNOWN_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

…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
Nerds489 merged commit 0053fd3 into main Sep 29, 2026
2 checks passed
@Nerds489
Nerds489 deleted the feat/preflight-modals-106 branch September 29, 2026 23:50
Nerds489 added a commit that referenced this pull request Oct 1, 2026
Preflight modal dialogs: make TUI prompts work (12.2.0, closes #106)
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.

Medium: chain retry/fallback ignored, session lost-update, mislabelled safety primitive, TUI-only preflight

1 participant