Skip to content

CLI and TUI copy the zone summary fields and pre-scan notices by hand #474

Done

Description

@TMHSDigital

Summary

The CLI and the TUI fill the same seven zone fields of TargetSummary (AXFR and NSEC) by hand, line for line. The TUI also retypes several of the CLI's pre-scan notices as string literals.

Where

  • internal/cli/summary.go:35-42 and internal/tui/model.go:741-748 (zone fields; the TUI comment says "The same zone fields as the CLI's report")
  • Notices: the "Skipped %d invalid wordlist entries ..." line at internal/cli/session.go:754 and internal/tui/model.go:332; simulation notes at internal/tui/model.go:336, :340, :356 vs internal/cli/cli.go:514, internal/cli/session.go:427-435; the bundled-list note at internal/tui/model.go:377 retypes bundledWordlistName (internal/cli/wordlist.go:14).

Impact

Every new zone field (the NSEC fields were the last, #437) and every wording or limit change must be made in two places. Only the per-front-end tests catch a miss. The sources and permutation parts were already shared (report.Sources, report.Permutation, passive.AddedLine), so the pattern exists but was not applied here.

Suggested fix

  1. Add a test that runs one lab zone through the CLI's targetSummary and the TUI's summary and compares the AXFR, NSEC and ZoneDenial fields.
  2. Add report.Zone(t *output.TargetSummary, r axfr.Result, foundBy map[string]int) in internal/report and switch the TUI, then the CLI.
  3. Move the shared notices into small functions next to their data (for example wordlist.SkippedLine(n), wordlist.BundledNote, a simulation-note helper), called from both front ends.

Getting started

  • Relevant files: internal/cli/summary.go, internal/tui/model.go, internal/report/
  • How to run tests: go test ./internal/cli ./internal/tui ./internal/report

Filed by repo-audit/full-audit at a45b999. Severity: medium. Effort: S. audit-key: tech-debt|internal/cli/summary.go|targetSummary

Activity

  1. added
    good first issue
    tech-debt
    severity: medium
    on Nov 29, 2026
  2. TMHSDigital commented on Nov 29, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 933ad25: new report.Zone fills the AXFR/NSEC/ZoneDenial fields and zone queries for both the CLI (via a targetAXFR.result() conversion) and the TUI. report.SimulationNote, wordlist.SkippedLine and wordlist.BundledName replace the retyped notices in both front ends; the printed text is the same. New TestZone and TestSimulationNote pin the shared output, and the existing CLI and TUI tests pass unchanged. Gate (gofmt, vet, golangci-lint v2.15.0, full suite) passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueseverity: mediumtech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions