# BACKLOG - dnsname
Seeded 2026-07-14 (main-thread audit; Gemini swarm was quota-blocked). Rows: `file:line | category | severity | problem | acceptance criteria`.
DONE 2026-07-14 | src/lib.rs:44 | silent-fallback | medium | `normalize` ASCII-lowercases but does NOT reject non-ASCII (U-label) input; a Unicode host (`bücher.de`) is passed as raw UTF-8 bytes to `psl::domain`, which expects A-labels (`xn--…`). The result is a silently wrong registrable domain, not an error. Doc says "pass an A-label" but nothing enforces it. | detect non-ASCII bytes in the normalized host and return `None` (fail-closed) or expose a loud `Result`; add a test asserting a U-label host does not silently mis-resolve. | FIXED: `normalize` now rejects non-ASCII input (U-labels) and returns `None`; callers must supply punycode A-labels. Added `tests::unicode_u_label_is_rejected` and `tests::punycode_alabel_is_accepted` in `src/lib.rs`.
DONE 2026-07-14 | src/lib.rs:118 | correctness | low | `is_subdomain_of` is pure label-string matching with no PSL awareness, so `is_subdomain_of("a.co.uk", "co.uk")` returns `true` even though `co.uk` is a public suffix, not a registrable domain. Whether that is desired is undocumented relative to the crate's PSL thesis. | document that `is_subdomain_of` is deliberately DNS-label-based (not PSL-based) and add tests pinning the public-suffix-parent behavior so it can't drift. | FIXED: updated `is_subdomain_of` doc comment to state it is a pure DNS-label check (not PSL-aware) and added `tests::is_subdomain_of_is_label_based_not_psl_based` pinning the behavior including bare public-suffix self-match and negative substring cases. `cargo +1.92.0 test -p dnsname --lib` green (CARGO_EXIT=0).
DONE 2026-07-14 src/lib.rs:60 | data-staleness | low | The Public Suffix List is baked in at compile time via the `psl` crate version; there is no runtime-updatable Tier-B data path, so the PSL snapshot silently ages with the pinned dependency. | pin and document the `psl` crate version (PSL snapshot date) in the crate docs; add a CI reminder/test tied to the pinned version, or migrate to a loadable PSL data file. | DONE 2026-07-14: pinned `psl` to `=2.1.218` in `Cargo.toml`; added a `# Public Suffix List snapshot` section to `lib.rs` documenting the pinned version and the no-runtime-data limitation; added `tests::psl_dependency_is_pinned` which reads `Cargo.toml` at compile time and asserts the `psl` line contains the exact pinned version. `cargo +1.92.0 test` in `libs/scanner/dnsname` passed (15 passed).
DONE 2026-07-14 | src/lib.rs:118 | test-gap | low | No tests for: non-ASCII/U-label input, `is_subdomain_of` with a public-suffix parent, `public_suffix` on a bare suffix, or a proptest over random label structures. | add negative/adversarial tests (U-labels, trailing-dot edge cases, single-label hosts) and a proptest asserting `registrable_domain ⊆ public_suffix` label invariants. | FIXED: added `tests::public_suffix_on_bare_suffix_returns_itself`, `tests::registrable_domain_is_subset_of_public_suffix`, and a `proptest` `registrable_domain_is_subset_of_public_suffix_prop` (with `random_ascii_host` strategy) that asserts any host with a registrable domain has a public suffix, the registrable domain ends with that suffix, and the registrable domain resolves to the same public suffix. `cargo +1.92.0 test -p dnsname --lib` green (CARGO_EXIT=0).
DONE 2026-07-14 | src/lib.rs:71 | api | low | `etld_plus_one` and `apex_domain` are exact aliases of `registrable_domain` (identical bodies) — three public names for one operation invites drift and confuses the minimal-surface contract. | keep one canonical function; make the aliases `#[doc(alias)]`/deprecated re-exports or document explicitly why three names exist. | FIXED: replaced the duplicate `fn` bodies with `pub use self::registrable_domain as etld_plus_one;` and `pub use self::registrable_domain as apex_domain;`, so there is one canonical implementation. Added `tests::aliases_match_registrable_domain` to ensure the re-exports remain identical. `cargo +1.92.0 test -p dnsname --lib` green (CARGO_EXIT=0).
src/lib.rs:48 | dnsname | performance | medium | REPOPULATE 2026-07-16: host normalization unconditionally allocates a lowercase String before validating if the input is ASCII, substituting a needless heap allocation on non-ASCII or invalid inputs, resulting in wasted allocation overhead before rejection. | avoid allocating a String when the input contains non-ASCII characters by checking is_ascii beforehand + a proving test asserting the rejection of non-ASCII input without heap allocation | FIXED (Law-7): `normalize` now returns `Cow<'_, str>` and (a) rejects non-ASCII BEFORE any allocation (`!h.is_ascii()` check moved ahead of lowercasing — ASCII-lowercasing never changes ASCII-ness, so the old lowercase-then-check wasted a String on every non-ASCII/invalid input), and (b) borrows the input zero-copy when it is already trimmed lowercase ASCII, only allocating the single lowercased String when an ASCII-uppercase byte is actually present. Proving test tests::normalize_borrows_already_normalized_host_and_owns_only_when_changed asserts Cow::Borrowed for `a.example.com` and the trimmed ` a.example.com. `, Cow::Owned only for `A.Example.COM`, and None (no alloc) for U-label/empty/whitespace. Gate: cargo test (crate dir) 17 passed, EXIT=0. | status=done
src/lib.rs:98 | dnsname | performance | medium | REPOPULATE 2026-07-16: checking subdomain relationships via is_subdomain_of calls normalize on both inputs which allocates two Strings, substituting needless heap allocations for a boolean check, resulting in performance overhead in hot query paths. | perform subdomain label checking without heap allocations when child and parent are already lowercase ASCII + a proving test asserting the boolean result for standard subdomain queries without heap allocation | FIXED (Law-7): follows from the `Cow`-returning `normalize` above — when `child` and `parent` are already lowercase ASCII (the hot query path), both `normalize` calls now return `Cow::Borrowed` and `is_subdomain_of` performs the `c == p` / `strip_suffix` label check with ZERO heap allocation (was two Strings per call). Existing `subdomain_label_boundary` + `is_subdomain_of_is_label_based_not_psl_based` pin the boolean results; the new normalize test proves the borrow (no-alloc) path. Gate: cargo test (crate dir) 17 passed, EXIT=0. | status=done
src/lib.rs:65 | dnsname | performance | low | REPOPULATE 2026-07-16: extracting the registrable domain allocates a new String via from_utf8_lossy even though the result is a suffix of the already-allocated normalized String, substituting a needless second heap allocation, resulting in double-allocation overhead on every lookup. | reuse the normalized String's allocation by draining the prefix instead of allocating a new String + a proving test asserting the returned registrable domain string matches the expected value while using only one string allocation | FIXED (Law-7): the double-allocation is eliminated a better way than prefix-draining — with the `Cow`-returning `normalize`, the common (already-normalized) path no longer allocates a normalized String at all, so registrable_domain now performs exactly ONE allocation total (the owned result). Replaced `String::from_utf8_lossy(..).into_owned()` with the shared ONE-PLACE `owned_ascii()` helper: the psl-returned bytes are a label-boundary subslice of the ASCII-validated host, so it parses via `core::str::from_utf8` (no lossy U+FFFD replacement scan) and fails loud on the impossible invariant break instead of silently emitting mangled hostnames (Law 10). Proving test tests::resolved_names_are_ascii_without_lossy_replacement asserts exact value, is_ascii, and no U+FFFD. Gate: cargo test (crate dir) 17 passed, EXIT=0. | status=done
src/lib.rs:83 | dnsname | performance | low | REPOPULATE 2026-07-16: extracting the public suffix allocates a new String via from_utf8_lossy even though the result is a suffix of the already-allocated normalized String, substituting a needless second heap allocation, resulting in double-allocation overhead on every lookup. | reuse the normalized String's allocation by draining the prefix instead of allocating a new String + a proving test asserting the returned public suffix string matches the expected value while using only one string allocation | FIXED (Law-7): same fix as lib.rs:65 applied to public_suffix — `owned_ascii()` (shared ONE-PLACE helper) replaces `from_utf8_lossy(..).into_owned()`, and the `Cow` normalize means the common path allocates only the single owned result String. Proving test tests::resolved_names_are_ascii_without_lossy_replacement covers public_suffix("Shop.Example.CO.UK") == "co.uk", is_ascii, no U+FFFD. Gate: cargo test (crate dir) 17 passed, EXIT=0. | status=done