Skip to content

Label Follow Records results as records in the TUI and count records_found - #1

Closed
Beehtrix wants to merge 1 commit into
mainfrom
fix/tui-follow-records-sources-494
Closed

Beehtrix wants to merge 1 commit into
mainfrom
fix/tui-follow-records-sources-494

Conversation

@Beehtrix

@Beehtrix Beehtrix commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Description

The TUI dropped Event.Followed, so a name found through a found name's records was saved with sources: ["wordlist"] (or the permutation or PTR pass's source), and the report had no records_found. Now record takes the followed flag and labels such a result records before the stage and candidate-set cases (as emitFrom in internal/cli/session.go does), formValues.attributed counts Follow Records so the results file has sources with that toggle alone, and summary sets RecordsFound from foundBy[candidates.Records].

Before (wordlist app, Record Types A,CNAME, Follow Records and Permute on, jsonl output):

{"subdomain":"lb-7.int.example.com",...,"sources":["wordlist"]}
summary: no records_found

After:

{"subdomain":"lb-7.int.example.com",...,"sources":["records"]}
summary: "records_found":1

Related Issue

Fixes TMHSDigital#494

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

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

New tests in internal/tui/follow_test.go fail without the fix and pass with it: an end-to-end TUI run (Follow Records alone, and with Permute) and a check that a followed result in the permutation or PTR stage keeps source records. go test ./... passes.


Summary by cubic

Fixes the TUI dropping Event.Followed so a name named by a found name's records was saved with the wrong source and the report had no records_found. Now such results are labeled records before the stage and candidate-set cases, formValues.attributed includes Follow Records so the results file sources show records, and the summary sets records_found from foundBy[candidates.Records].

Written for commit 8d0e09d. Summary will update on new commits.

View guided diff Turn on auto-fix

@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Sorry @Beehtrix, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T23:52:11.586816Z 8d0e09d PR opened
🔒 Security Review ✅ Completed 2026-12-03T23:53:05.179727Z 8d0e09d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Scan results followed from previously discovered records are now attributed consistently in reports, including during later scan stages. Permutation attribution is limited to results found during permutation scans, while eligible results found elsewhere can still seed permutations. The run summary now reports the number of records found, and enabling record following is reflected in the scan’s attribution options.

The TUI now attributes followed results to records, adjusts permutation handling for those results, and reports the number of records found. New tests check source attribution with Permute enabled and disabled, and during later scan stages.

Changes: Followed-Record Attribution

Layer / File(s) Summary
Followed-result attribution and reporting
internal/tui/form.go, internal/tui/model.go, internal/tui/follow_test.go
The TUI passes follow status into result recording and attributes followed results to records. It updates permutation handling and sets RecordsFound from the records count. Tests check attribution across Permute settings and later scan stages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: tmhsdigital, laozhej

Merge Risk: Minimal · up to 8d0e0

This change fixes how results found through Follow Records are labeled and counted in the TUI. It touches only display and accounting in the TUI. No concrete risk was identified, and the new tests cover the changed behavior.

Security architecture risk: Minimal · up to 8d0e0

Follow Records now reports where results came from without widening the scan. CSV consumers that require the old column count may need to accept the optional sources column.

Security review details

Security Blast Radius

  • inferred — The changed exposure is to consumers of TUI results and reports. The full comparison and unchanged seed eligibility provide no evidence of a new scan entrypoint or an increase in DNS query reach.

Trust Boundaries and Controls

  • observed — DNS responses can influence which results the runner marks as followed, but the TUI maps that flag to a predefined records label rather than copying DNS text into the source field. The flag does not grant scan or file-write authority.

Data and control flow

  • observed — Permutation seed eligibility is unchanged. The base's attribution condition was already true whenever Permute was enabled, so followed main-pass results already entered the list. The new followed branch keeps that gate and excludes PTR- and permutation-pass results, as the base did.

Resilience and Maintainability Implications

  • observed — The new count is run-local and counts result events handled by the TUI, not a guarantee that every corresponding row was persisted. The existing completion path, including an abort that drains results, still finalizes output; an early stop before candidate testing still discards the temporary results file. The stats file remains a separate write with separate error reporting.

Rollout and rollback

  • inferred — No permission or stop-control migration is introduced. Operators using fixed-width CSV importers for TUI runs with Follow Records alone should accept the optional sources column when adopting the change and its absence when rolling back.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Follow Records results are now labeled as records in the TUI, and records_found is counted. The title matches the changeset, which passes the followed flag into record…
Description check Passed The description explains the bug (followed results saved with wordlist, permutation, or PTR sources and no records_found), the fix (followed flag passed to record, attribution of Follow Records, Recor…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Follow Records results are now labeled as records in the TUI, and records_found is counted. The title matches the changeset, which passes the followed flag into record, adds Follow Records to attribution, and sets RecordsFound from the records count.

Full details: Description check

Explanation

The description explains the bug (followed results saved with wordlist, permutation, or PTR sources and no records_found), the fix (followed flag passed to record, attribution of Follow Records, RecordsFound set from the records count), a before and after example, the linked issue, and the new tests. It relates directly to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 3
  • Waived: $0.75 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

A rabbit checks each hostname’s trail,
And marks the records in the tale.
Through Permute and PTR’s flight,
The source counts now match just right.
One found record joins the stack,
Then hops along the JSON track.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 20254148-8c33-4c3a-a38c-2adb2cd4d1d0
Commits

Reviewing files that changed from the base of the PR and between b8afd4d and 8d0e09d.

Files selected for processing: 3

  • internal/tui/follow_test.go
  • internal/tui/form.go
  • internal/tui/model.go

Limit details: You’ve used all 10 included reviews currently available.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional comments: 3

internal/tui/form.go: 1

760-760: LGTM!

internal/tui/model.go: 1

560-560: LGTM!

Also applies to: 570-578, 949-949

internal/tui/follow_test.go: 1

1-98: LGTM!

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@gitar-bot

gitar-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

Beehtrix commented Dec 4, 2026

Copy link
Copy Markdown
Owner Author

Opened upstream: TMHSDigital#497. Closing this fork PR.

@Beehtrix Beehtrix closed this Dec 4, 2026
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 labels Follow Records results as wordlist names and omits records_found

1 participant