Add a method/version fallback ladder to the DoH canary probe (D-0056) #136

Merged
hannah-vernon merged 1 commit from feature/doh-probe-fallback-ladder into dev 2026-09-24 17:00:49 -05:00
Owner

What does this PR do?

Raises the DoH canary-probe confirmation rate with a small per-address fallback ladder (D-0056).

A live probe cycle over the full 1976-address set confirmed only 6.0% (118). Because the probe connects by IP, most compliant resolvers reject the default POST-over-HTTP/2 request:

probe outcome addresses pct
Refused 1339 67.8%
RespondedNonCompliant 357 18.1%
Timeout 162 8.2%
Confirmed 118 6.0%

Of the 1339 Refused, 934 returned no HTTP response and the rest returned 404/400/505/etc. - path/method/HTTP-version mismatches, not "this is not a DoH server".

DohCanaryProbe.ProbeAsync now walks, per address: POST then GET (RFC 8484 ?dns= base64url of the same wire query), each over HTTP/2 then HTTP/1.1. It returns Confirmed as soon as any variant returns HTTP 200 + application/dns-message + the canary token; otherwise it reports the most informative non-confirming outcome (RespondedNonCompliant > HTTP-error Refused > Timeout > transport Refused). The ladder short-circuits once an address returns no HTTP response twice in a row, capping an unreachable host at two attempts instead of four.

  • No new settings. This is an algorithm change, so there is no Admin UI or API surface change.
  • Confirmed definition unchanged (strict application/dns-message + token).
  • Inclusion unchanged: the curated feeds remain the sole authority; a non-confirming probe still never removes an address. This only improves the per-entry comment annotation.
  • Cost: confirmed hosts still take a single request; only non-confirming addresses issue extra requests, on the 6-hour probe interval and under the existing concurrency limit.

How was this tested?

  • dotnet build - 0 errors, 0 warnings (full solution)
  • dotnet test - Application suite 586 pass, incl. 5 new ProbeAsync tests (first-attempt confirm, HTTP/1.1 retry on 505, GET fallback on 405, short-circuit after two unanswered attempts, non-compliant reporting)
  • Live effect (higher Confirmed rate) can only be measured on the next probe cycle after deploy

Checklist

  • I have read the Contributing Guide
  • Changes are focused - one logical change per PR
  • Documentation updated (DECISIONS.md D-0056, AGENT-README.md, ARCHITECTURE.md)
  • New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (none added)
  • No secrets, credentials, or real infrastructure identifiers in the diff
  • No commented-out code or debug leftovers
## What does this PR do? Raises the DoH canary-probe confirmation rate with a small per-address fallback ladder (D-0056). A live probe cycle over the full 1976-address set confirmed only **6.0%** (118). Because the probe connects **by IP**, most compliant resolvers reject the default POST-over-HTTP/2 request: probe outcome | addresses | pct --- | --- | --- Refused | 1339 | 67.8% RespondedNonCompliant | 357 | 18.1% Timeout | 162 | 8.2% Confirmed | 118 | 6.0% Of the 1339 Refused, 934 returned **no HTTP response** and the rest returned 404/400/505/etc. - path/method/HTTP-version mismatches, not "this is not a DoH server". `DohCanaryProbe.ProbeAsync` now walks, per address: **POST then GET** (RFC 8484 `?dns=` base64url of the same wire query), each over **HTTP/2 then HTTP/1.1**. It returns `Confirmed` as soon as any variant returns HTTP 200 + `application/dns-message` + the canary token; otherwise it reports the most informative non-confirming outcome (RespondedNonCompliant > HTTP-error Refused > Timeout > transport Refused). The ladder **short-circuits** once an address returns no HTTP response twice in a row, capping an unreachable host at two attempts instead of four. - **No new settings.** This is an algorithm change, so there is no Admin UI or API surface change. - **Confirmed definition unchanged** (strict `application/dns-message` + token). - **Inclusion unchanged**: the curated feeds remain the sole authority; a non-confirming probe still never removes an address. This only improves the per-entry comment annotation. - **Cost**: confirmed hosts still take a single request; only non-confirming addresses issue extra requests, on the 6-hour probe interval and under the existing concurrency limit. ## How was this tested? - [x] `dotnet build` - 0 errors, 0 warnings (full solution) - [x] `dotnet test` - Application suite 586 pass, incl. 5 new `ProbeAsync` tests (first-attempt confirm, HTTP/1.1 retry on 505, GET fallback on 405, short-circuit after two unanswered attempts, non-compliant reporting) - [ ] Live effect (higher Confirmed rate) can only be measured on the next probe cycle after deploy ## Checklist - [x] I have read the Contributing Guide - [x] Changes are focused - one logical change per PR - [x] Documentation updated (DECISIONS.md D-0056, AGENT-README.md, ARCHITECTURE.md) - [x] New dependencies are MIT/Apache-2.0/BSD, security-vetted, and recorded in THIRD-PARTY-NOTICES.md (none added) - [x] No secrets, credentials, or real infrastructure identifiers in the diff - [x] No commented-out code or debug leftovers
A live probe cycle over the full 1976-address set confirmed only 6% (118).
Most candidates reject the default POST-over-HTTP/2 request even though they
are compliant DoH servers because we connect by IP: 67.8% Refused (934 with no
HTTP response, the rest 404/400/505/etc.), 18.1% RespondedNonCompliant, 8.2%
Timeout.

DohCanaryProbe.ProbeAsync now walks a small per-address ladder - POST then GET
(RFC 8484 ?dns= base64url of the same wire query), each over HTTP/2 then
HTTP/1.1 - and returns Confirmed as soon as any variant returns HTTP 200 with
application/dns-message and the canary token.  When none confirm it reports the
most informative non-confirming outcome (RespondedNonCompliant > HTTP-error
Refused > Timeout > transport Refused).  The ladder short-circuits once an
address returns no HTTP response twice in a row, capping an unreachable host at
two attempts instead of four.  Confirmed hosts still take a single request, so
the extra cost falls only on non-confirming addresses on the 6-hour interval.

No new configuration value: this is an algorithm change, so there is no Admin UI
or API surface change.  The Confirmed definition is unchanged (strict
application/dns-message + token), and inclusion is unchanged (curated feeds
remain the sole authority; a non-confirming probe never removes an address).

Adds five ProbeAsync tests (first-attempt confirm, HTTP/1.1 retry on 505, GET
fallback on 405, short-circuit after two unanswered attempts, non-compliant
reporting).  Docs updated (DECISIONS.md D-0056, AGENT-README.md, ARCHITECTURE.md).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannah-vernon/viegard-sentinel!136
No description provided.