Commit graph

134 commits

Author SHA1 Message Date
Andrew Pimenov
84c3dffbce detect captive portals up front, flag off-country speedtest servers
New Phase 0 in diagnose(): three generate_204-style probes run before every
other module, using detect-and-tag rather than short-circuit — a portal is
rarely total (DNS/ICMP often pass while only HTTP is intercepted), and an
aborted run would look identical to a dead link. On detection every later
phase still runs, tagged with a crit finding and a banner at the top of the
report.

Caught live before it shipped: detectportal.firefox.com/success.txt (one of
the original three default check URLs) returns 200 "success" on a genuinely
clean connection, which the generate_204-shaped classifier misread as a
portal redirect. Swapped for a second real generate_204 endpoint instead of
teaching the classifier a second success shape.

Also redesigned the speedtest server geo-sanity check after checking the
bundled Ookla CLI's actual JSON output: its server object never carries
lat/lon (documented schema, not a version gap), so speed.server_other_country
compares server_country against the client's own country instead of a
haversine distance that no tier can actually supply.

Part of plans/zesty-zooming-wilkinson.md (gitignored).
2026-08-12 21:36:54 +03:00
Andrew Pimenov
8d4c8bee8b enrich traceroute hops with ASN, AS name, country and PTR fallback
TraceHop.asn/as_name existed in the model since the start but nothing ever
populated them. New probes/hop_asn.py fires one Team Cymru DNS query pair
per unique hop IP (in-run deduped, no rate limit unlike the cached_json()
providers) after the latency/path/TLS fan-out, plus a PTR lookup for hops
whose reverse_dns is still empty because the backend that produced them
doesn't resolve hostnames itself (icmp_win/icmplib/mtr, unlike system
traceroute text).

New path.detour_country finding flags a route that spends two or more
consecutive hops in a country that's neither the client's nor the
destination's. Wires up providers.cymru_asn_zone, which was configured but
referenced nowhere, and adds cymru_origin6_zone for the IPv6 branch Phase 8
will need.

Part of plans/zesty-zooming-wilkinson.md (gitignored).
2026-08-12 21:17:00 +03:00
Andrew Pimenov
76cfd4605c detect CGNAT, NAT64, and first-hop-vs-path issues separately
- net.cgnat: three evidence paths (local IP, gateway, traceroute hop) for
  RFC 6598 100.64.0.0/10, since the local address alone misses the common
  home-router case
- net.nat64: RFC 7050 ipv4only.arpa AAAA probe (new probes/nat64.py) instead
  of checking the client's own address against 64:ff9b::/96, which never
  fires since that prefix is a synthesis target, not something the client's
  egress address falls into
- path.first_hop_loss/slow/unexpected: path_findings() takes an optional
  LocalNet/Thresholds so loss or latency at hop 1 is attributed to the
  user's own router/Wi-Fi instead of blending into the ISP-facing mid-path
  logic

All four findings are always-on additions to existing report sections, no
new CLI flags. Part of the larger extension batch tracked in
plans/zesty-zooming-wilkinson.md (gitignored, local planning doc).
2026-08-12 21:06:01 +03:00
Andrew Pimenov
3a0f95c793 document L4-L7 diagnostic modules and the python 3.14 bump 2026-08-10 21:26:46 +03:00
Andrew Pimenov
a21197f83b actually stage the bgp_path.py half of the international-loop fix 2026-08-10 21:18:42 +03:00
Andrew Pimenov
938c715a04 fix international-loop detection: drop dead ip_country parameter 2026-08-10 21:18:28 +03:00
Andrew Pimenov
4ed455700b wire TLS, prefix bench, DPI check, DNS advanced, path diversity into the CLI pipeline 2026-08-10 21:18:19 +03:00
Andrew Pimenov
342d92e709 render TLS, DNS advanced, path diversity, prefix bench, DPI sections in reports 2026-08-09 17:56:07 +03:00
Andrew Pimenov
fc502f1756 add finding rules for TLS, prefix bench, DPI, DNS advanced, path diversity 2026-08-09 17:49:30 +03:00
Andrew Pimenov
1874f3f3c2 add Cloudflare CF-RAY edge/anycast path diversity probe 2026-08-09 17:45:37 +03:00
Andrew Pimenov
63e7597520 add system DNS vs DoH comparison and transparent proxy detection 2026-08-09 17:45:33 +03:00
Andrew Pimenov
a000a12b19 add single-host DPI/TCP-RST self-diagnostic probe 2026-08-09 17:45:27 +03:00
Andrew Pimenov
10fa9f8052 add AS prefix latency benchmark probe 2026-08-09 17:43:10 +03:00
Andrew Pimenov
e34d8f27f4 add TLS handshake RTT / TTFB probe 2026-08-09 17:42:02 +03:00
Andrew Pimenov
c63c179b57 add config sections for TLS, prefix bench, DPI check, DNS advanced, path diversity 2026-08-09 17:37:48 +03:00
Andrew Pimenov
33d7d2d942 add L4-L7 diagnostic models (TLS, DPI, DNS, anycast, prefix bench) 2026-08-09 17:35:37 +03:00
Andrew Pimenov
51d82d997f add jitter matrix (p95/p99/cv) to ping stats 2026-08-09 17:34:06 +03:00
Andrew Pimenov
d1d774a199 bump minimum python to 3.14 2026-08-09 17:31:07 +03:00
Andrew Pimenov
9ef6f2e536 document per-platform setup for optional install extras 2026-08-09 16:46:11 +03:00
Andrew Pimenov
387e58949f add specific unit tests for parse_traceroute 2026-08-09 16:21:23 +03:00
Andrew Pimenov
9a01b2abe2 add test coverage for throughput_from_samples 2026-08-09 16:20:50 +03:00
Andrew Pimenov
f80ebfe217 add tests for parse_server_timing_cfl4 edge cases 2026-08-09 16:20:23 +03:00
Andrew Pimenov
7fb13a87ef add tests for identity_changes 2026-08-09 16:20:11 +03:00
Andrew Pimenov
19c06279fe add test coverage for fetch_internetdb 2026-08-09 16:19:59 +03:00
Andrew Pimenov
058b873445 add tests for decode_dnsbl fallback and mixed responses 2026-08-09 16:18:57 +03:00
Andrew Pimenov
d5b8d27bfd add test coverage for fetch_abuseipdb 2026-08-09 16:18:46 +03:00
Andrew Pimenov
053e42c811 expand classify_ip_type test coverage 2026-08-09 16:17:49 +03:00
Andrew Pimenov
1554af5943 add tests for summarize_dnsbl 2026-08-09 16:17:35 +03:00
Andrew Pimenov
0be881b96a add tests for merge_geo edge cases and improve ip_geo coverage 2026-08-09 16:16:47 +03:00
Andrew Pimenov
bc5b01ae58 add test coverage for refresh_netsets 2026-08-09 16:16:32 +03:00
Andrew Pimenov
15d4d745c4 improve test coverage for latency_changes 2026-08-09 16:15:18 +03:00
Andrew Pimenov
2a72bdb441 cover empty exception message branch in run_speed_cascade 2026-08-09 16:15:08 +03:00
Andrew Pimenov
8e7d5bba5b add tests for tier_cloudflare 2026-08-09 16:14:55 +03:00
Andrew Pimenov
24f08acd79 add test coverage for tier_ookla 2026-08-09 16:14:42 +03:00
Andrew Pimenov
d42a236d3a add test coverage for finding_changes 2026-08-09 16:14:16 +03:00
Andrew Pimenov
b3971375c2 add tests for speed_changes 2026-08-09 16:14:00 +03:00
Andrew Pimenov
be99c19cfd add async tests for query_dnsbl 2026-08-09 16:13:42 +03:00
Andrew Pimenov
2473822b93 add tests for finalize_hop 2026-08-09 16:13:29 +03:00
Andrew Pimenov
8aa806881e add test coverage for tier_fastcom 2026-08-09 16:13:19 +03:00
Andrew Pimenov
768490562c guard tier_fastcom against a falsy target url 2026-08-09 16:13:10 +03:00
Andrew Pimenov
52c0647e77 run refresh_netsets provider fetches concurrently with asyncio.gather 2026-08-09 16:12:15 +03:00
Andrew Pimenov
6810c0f753 optimize first_loss_jump with zip pairwise iteration 2026-08-09 16:11:43 +03:00
Andrew Pimenov
93c6ac526a use zip for pairwise hop iteration in path_findings 2026-08-09 16:11:29 +03:00
Andrew Pimenov
fb3c6ca77f optimize overall_verdict by combining severity iterations 2026-08-09 16:10:45 +03:00
Andrew Pimenov
ab39922bf6 cache dataclass_fields lookup in merge_geo 2026-08-09 16:10:29 +03:00
Andrew Pimenov
329ff15e74 make _resolve async to avoid blocking the event loop 2026-08-09 16:10:17 +03:00
Andrew Pimenov
e4c51546ba use list comprehension for _unix_probes 2026-08-09 16:09:29 +03:00
Andrew Pimenov
85da4aab1f optimize _unix_annotations dedup with dict.fromkeys 2026-08-09 16:09:05 +03:00
Andrew Pimenov
f59f860327 group build_trace_result arguments into TraceConfig dataclass 2026-08-09 16:08:52 +03:00
Andrew Pimenov
4c290ec309 refactor build_reputation to use ReputationContext dataclass 2026-08-09 16:08:29 +03:00