Skip to content

fix: preserve distinct identifier types throughout CLI traversal - #3449

Merged
soxoj merged 4 commits into
soxoj:mainfrom
hakarrr:fix-typed-target-identity
Nov 26, 2026
Merged

soxoj merged 4 commits into
soxoj:mainfrom
hakarrr:fix-typed-target-identity

Conversation

@hakarrr

@hakarrr hakarrr commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve the identifier type when queuing and deduplicating CLI targets. A username and a VK ID can contain the same text without naming the same target.

  • Keep equal values of different types from batch files and recursive extraction instead of overwriting or skipping one.
  • Keep the public extract_ids_from_results mapping API unchanged. The CLI uses a private iterator to retain typed pairs across sites and links.
  • Select startup site availability from the requested target types, including typed-only filtered batches.
  • Keep ordinary per-target report filenames. If two targets would write the same stem, suffix the later one with its ID type, then a number if needed. Compare stems case-insensitively to avoid overwrites on those filesystems.

Reproduction

An input file containing username:12345 and vk_id:12345 currently runs only the latter search. A recursive search starting from username 12345 also skips an extracted VK ID 12345 as already checked. Local synthetic fixtures reproduce both without contacting any external profile service.

The fix searches both site sets and retains both results in the general report tuple list. Within-type case-insensitive deduplication and input order remain unchanged.

Validation

Base: a6d585479f7a47b9e1400481d12b73eb477f6475.

  • New offline regression file on base: 16 failed, 5 passed. Candidate: all 21 passed.
  • Focused CLI, extraction, input and utils tests: 89 passed, 6 slow tests deselected.
  • make test: base 725 passed, 5 skipped, 82% coverage; candidate 746 passed, 5 skipped, 84% coverage.
  • Actual loopback HTTP with real CLI/checker/CSV/TXT/JSON writers: base makes two requests and writes six files, dropping one supported target. Candidate makes all three expected requests and writes nine distinct files with correct parsed identifiers and site sets. Synthetic server stopped after the check.
  • make format run; unrelated baseline formatting drift restored. New test file is Black clean. git diff --check passes.
  • make lint remains baseline-red: 139 mypy errors in 21 files on both base and candidate, with identical normalized file/message diagnostics. Hard flake8 errors: zero.

Boundaries

This prevents same-run filename collisions, not normal overwrite-on-rerun behavior. The first target keeps its existing stem; later collisions receive typed suffixes.

Public mapping APIs keep their existing behavior. The CLI cannot recover types already collapsed inside one upstream mapping; it now preserves every typed pair received across batch entries, result mappings and links.

For slash-containing identifiers, filenames and per-target writer labels keep their existing sanitization. Raw typed target identity remains intact for traversal and the general result list.

hakarrr and others added 2 commits November 19, 2026 09:43
Keep identifier types in pending and completed target identity, preserve the public extraction mapping API, and disambiguate same-run report filename collisions without changing ordinary writer labels.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Add offline regressions for batch, recursive and link-derived target identity; ordinary and colliding report paths; legacy slash-containing writer labels; and public extraction mapping compatibility.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
@soxoj

soxoj commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks, keying the queue and the dedup set on (value, type) is the right fix. The report filename collision logic adds a lot for the rare same value, different type case, though. Could you drop it, along with the unrelated blank-line changes, and keep the PR to the typed queue, dedup and recursive extraction?

hakarrr and others added 2 commits November 26, 2026 09:03
Drop the report filename collision handling and the unrelated blank-line changes, as asked in review. The typed queue, dedup and recursive extraction are unchanged.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Remove the tests for the dropped report filename collision handling, and the one assertion in the slash-label test that needed distinct filenames.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
@soxoj
soxoj merged commit d2e48c2 into soxoj:main Nov 26, 2026
9 checks passed
@soxoj

soxoj commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks for trimming it down! Keying the queue on value and type is a clean fix, and the PR reads much easier now.

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.

2 participants