Skip to content

TUI copies the CLI's source-merge, permutation and report logic #347

Closed

Description

@TMHSDigital

Summary

internal/tui/passes.go (#274) holds a compact copy of the CLI's passive-source merge, permutation-candidate and report code instead of sharing it, so a fix in one front end can miss the other. Separately, internal/cli/axfr.go keeps a "no name servers found" branch that cannot run.

Where

  • internal/tui/passes.go
  • internal/cli/ct.go, internal/cli/permute.go, internal/cli/summary.go
  • internal/cli/axfr.go (the len(servers) == 0 branch)

Details

Several of today's fixes (#273 sources, #298 permutation report, #321 allocation) had to be made twice, once per front end. The axfr branch is unreachable because LookupNS returns an error for a NOERROR answer with no NS records (#303's test asserts the error text instead).

Suggested fix

Move the candidate bookkeeping (candidates, permutation candidates, the pass's report entry) into a shared internal package used by both front ends; drop the unreachable branch or map the not-found error to its wording.

Acceptance criteria

  • One implementation of source merging and permutation candidates
  • No unreachable branch in axfr.go

Getting started

  • How to run tests: make test (or go test ./...). Tests must stay hermetic: use -simulate, -simulate-zone or the local DNS test server, never a live domain.
  • Related docs: docs/DEVELOPER_GUIDE.md, docs/ARCHITECTURE.md

Filed by repo-audit/fix-issues at 637a950. Severity: low. Effort: M. audit-key: tech-debt|internal/tui/passes.go|duplication

Activity

  1. added
    help wanted
    tech-debt
    severity: low
    on Nov 15, 2026
  2. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    The axfr part is done in a5373d6: the unreachable len(servers) == 0 wording is now used for a not-found NS lookup (no NS records, or NXDOMAIN), and other errors keep "name server lookup failed". Verified: TestE2EZoneTransferNSLookupFails expects the new wording for the no-NS case and has a new NXDOMAIN case; go test ./internal/cli ./pkg/... and golangci-lint v2.15.0 pass.

    Still open: one shared implementation of source merging, permutation candidates and the pass's report entry for the CLI and the TUI (internal/tui/passes.go vs internal/cli/ct.go, permute.go, summary.go).

  3. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    The shared-code part is done in 32bde28: the new internal/candidates package (candidate set, source labels, RelativeSeeds, Permutations) and report.Permutation (the pass's report entry and verdict) are used by both the CLI and the TUI, and both copies are gone. The TUI copy had drifted: its permutation step still built a wordlist-sized skip map, which this removes. Verified: the moved unit tests (TestSet, TestNoWordlistSizedMap, TestPermutationsRespectNameLength) and the CLI and TUI suites pass; go test -race ./... and golangci-lint v2.15.0 pass. Both acceptance criteria are now met.

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

    help wantedseverity: lowtech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions