Skip to content

Passive-source merge is duplicated between the CLI and pkg/subenum #265

Closed

Description

@TMHSDigital

Summary

The CLI and the library merge passive-source names into the candidate list with separate copies of the same logic. The CLI helpers still have CT-only names from before #193.

Where

  • main_ct.go:26-54, :84-117 (withCTEntries, withCTSeeds)
  • pkg/subenum/sources.go:21-63 (withSourceNames, its own User-Agent constant at :21)
  • internal/passive/passive.go:67-69 (passive.New registry, which pkg bypasses by building ct.Client and passive.Wayback directly)

Why it hurts now

A third source has to be wired in two places. Dedupe and ordering rules can diverge between the CLI and the library, and resume positions depend on that order.

Plan

  1. Test first: a table test for the merge (dedupe, order, normalization) run against both current implementations.
  2. Move the merge into passive.Merge(entries, names, domain) ([]string, int) and call it from both.
  3. Rename withCTEntries and withCTSeeds to source-neutral names.
  4. Have the pkg constructors call passive.New and share the User-Agent constant.

Getting started

  • Relevant files: listed above
  • How to run tests: go test ./...
  • Related docs: docs/library.md

Related: #193


Filed by repo-audit/full-audit at 3f671b2. Severity: low. Effort: S. audit-key: tech-debt|main_ct.go|withCTEntries

Activity

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

    @TMHSDigital
    OwnerAuthor

    Fixed in 49d245a: the merge now lives in passive.Merge and is called by both the CLI's candidates.add and pkg's withSourceNames; pkg's CertificateTransparency/WaybackMachine go through passive.New. (withCTEntries/withCTSeeds had already been renamed.) Verified with the new TestMerge, the full test suite and golangci-lint v2.15.0.

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: lowtech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions