Skip to content

Run-quality report leaves out the -permute pass's queries and verdict #298

Closed

Description

@TMHSDigital

Summary

queries_sent, achieved_qps and the target and run verdict in the -stats report are built from the main pass only; the permutation pass's traffic and its verdict are left out, although the GitHub Action gates on that verdict.

Where

  • main_summary.go:35-51
  • internal/report/report.go:78-106
  • internal/report/report.go:115-135
  • main_session.go:675-691

Details

targetSummary builds the target from the main pass only: t := report.Target(domain, status, res.err, res.done, res.final, scan.FlagName) (main_summary.go:36), where res.final is the main pass's EventDone. The permutation pass's final event (res.permutation.pass.final, set at main_session.go:681) contributes only Seeds, Candidates, Found and its own Verdict (main_summary.go:45-49); its Stats.QueriesSent is never added. report.Finish sums t.QueriesSent into Summary.QueriesSent and derives AchievedQPS from it, and takes the overall verdict from the targets' main-pass verdicts (report.go:115-135). README.md:575 says queries_sent "counts DNS messages actually dialed, including retries".

Impact

With -permute (or -seeds) the -stats file, the jsonl summary line and the Action's step summary under-report the DNS traffic sent, often by an order of magnitude, and achieved_qps is wrong by the same factor. A degraded permutation pass (timeouts, a spent budget) does not lower the target's or the run's verdict, which the GitHub Action uses to gate the job and to decide whether to save the baseline (action.yml:210-218).

Steps to reproduce

Lab mode, no traffic leaves the machine: subenum -simulate-zone examples/labs/lab1-first-scan.zone -w examples/labs/words.txt -stats a.json -silent lab.example gives queries_sent 72. The same command with -permute -stats b.json runs "Permutation pass for lab.example: 465 candidates from 5 seed names", and b.json still says queries_sent 72 (run and target), processed 30.

Suggested fix

In targetSummary, add p.pass.final.Stats.QueriesSent to t.QueriesSent when the pass ran (and consider a queries_sent/processed pair inside PermutationSummary), and fold the pass's verdict into the target's: the worse of the two by scan.VerdictRank, with the reason saying it is the permutation pass.

Acceptance criteria

  • queries_sent for a target includes the permutation pass's queries
  • A degraded permutation pass lowers the target's and the run's verdict, with a reason that names the pass
  • A lab-mode test compares the report with and without -permute

Getting started

  • Relevant files: main_summary.go, internal/report/report.go, main_session.go
  • 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/full-audit at d0c56f0. Severity: medium. Effort: S. audit-key: bug|main_summary.go|targetSummary

Activity

  1. added
    bug
    area: output
    severity: medium
    on Nov 15, 2026
  2. TMHSDigital commented on Nov 15, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 878009b.

    The run-quality report now includes the -permute pass: its queries are added to the target's queries_sent (so the run total and achieved_qps follow), and its verdict becomes the target's when it is worse, with the reason prefixed permutation pass:. The permutation entry gains processed and queries_sent. The target's top-level processed and outcomes still describe the main pass.

    One addition beyond the issue: a permutation pass that had candidates but never finished (for example a failed preflight) lowers a complete target to degraded, with its error as the reason.

    Verified with TestE2EPermuteReportCountsThePass (lab 1, with and without -permute) and TestTargetSummaryPermutationVerdict (six cases), both failing without the change. go test ./... and golangci-lint run pass.

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

    area: outputbugseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions