Skip to content

fix(cli): reject lab zones before starting the TUI - #382

Merged
TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/356-reject-tui-lab-mode
Nov 16, 2026
Merged

TMHSDigital merged 1 commit into
TMHSDigital:mainfrom
laozhej:fix/356-reject-tui-lab-mode

Conversation

@laozhej

@laozhej laozhej commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Description

-tui with an active lab zone now exits with usage error 2 before opening the interface. Previously the TUI discarded -simulate-zone, leaving the form configured for a live scan. The diagnostic names whether the zone came from a flag, SUBENUM_SIMULATE_ZONE, or the config file and tells the user to run the lab without -tui.

The README and lab guide describe the restriction. Six regression cases cover flags, interspersed arguments, no domain, environment/config defaults, and JSON diagnostics.

Related Issue

Fixes #356.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvements
  • Test updates

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the code style of this project
  • I have added/updated appropriate comments to the code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)

Ethical Considerations

  • This change maintains or improves the security controls in the tool
  • This change follows the educational/legitimate security testing focus of the project
  • I have considered potential misuse cases and taken appropriate steps to prevent them

Additional Information

Validated on macOS arm64 with the pinned Go 1.26.11 toolchain and golangci-lint 2.15.0:

  • All six regression cases fail before the fix and pass afterward.
  • go test -race -shuffle=on ./... passes the full suite (21 packages with tests).
  • make lint reports 0 issues; make build and git diff --check pass.
  • The built command returns exit 2 with no scan output for flag, environment, and config/JSON lab requests.

Tests use simulations and the repository's local DNS fixtures; no public resolver or live target was used. Prepared with OpenAI Codex assistance.

@TMHSDigital
TMHSDigital merged commit 1d49463 into TMHSDigital:main Nov 16, 2026
17 checks passed
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.

-tui -simulate-zone opens a live-scan form; the only warning is hidden

2 participants