Port the traversal engine to the Ruby dnstraverse model so behaviour and
output match dns.squish.net:
- dns: single RD=0 query path (RD=1 only for upstream root discovery),
per-run packet cache, EDNS0 512-fallback with warnings, UDP->TCP on
truncation; fix --retries 0 and --root-server IP-literal handling;
drop all hardcoded 127.0.0.1:53 resolvers
- traverse: hierarchical per-branch InfoCache, 7-step response
classification with the full 10-status vocabulary, bailiwick
partitioning, strictly-deeper lame-referral rule, refid grammar with
.0 resolve subtrees and childset digits, per-IP branching at 1/n
weight, cache-based glue resolution with noglue/loop dead ends, CNAME
restarts from the deepest cached zone, fast-mode memoization,
probability aggregation with Ruby-identical stats keys (sums to 1.0)
- output: byte-for-byte reference text format pinned by a golden test,
reference CLI defaults, working --quiet/--show-X=false, TTY-aware
colour, deduplicated deterministic JSON
- web: adapt API/SPA to the new engine, SSE events carry refid/status,
fix subscribe/snapshot duplicate-event race and a statusCls TDZ bug,
align SPA type list with the backend
- delete the old engine and dead code (net -4,350 lines)
Verified against live runs of the reference Ruby engine across five
domains (answers, NXDOMAIN, null MX, CNAME restart, glueless resolve)
with no divergences beyond the documented typo fixes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three bugs fixed:
1. processReferral was calling ResolveNS with ref.Name (the query domain,
e.g. '800adventures.com.au.') instead of ref.Bailiwick (the NS hostname,
e.g. 'ns-a.hansenits.com.'). This caused the sub-traversal to look up the
wrong name and always fail to find the nameserver's IP address.
2. In ResolveNS (and Referral.Resolve), child referrals whose name matched the
visited set were unconditionally skipped. When the .com TLD returns glue A
records for the target NS alongside its delegation, the child referral has
addresses and should be queried directly rather than skipped.
3. FormatRecord was prepending the DNS header fields and then appending
rr.String() which already includes those same fields, producing doubled
output like 'example.com. 300 IN A example.com. 300 IN A 1.2.3.4'.
Now simply returns rr.String().
Additional improvements:
- Results section deduplicates terminal results: same NS failure or same
(NS, answer) pair is merged with summed probability, avoiding the same
nameserver appearing 15 times with 6.7% each.
- Result lines now include the NS hostname (from Bailiwick) and use the
compact rdata format, e.g. '33% ns-a.hansenits.com answered with 13.54.63.231'.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>
Add text and JSON formatters with real-time progress via traverser hooks,
summary statistics, and CLI integration for --show-* and --json flags.
Co-authored-by: multica-agent <github@multica.ai>