test(fetch): pin the mapped form of the tailnet range, which works untested #441
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!441
Loading…
Reference in a new issue
No description provided.
Delete branch "qa/pin-the-mapped-tailnet-form"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
58fad20fixes #428 and its test is a good one — it names the three tailnet addresses that matter and, importantly, puts100.63.255.255and100.128.0.0in the dialed set. That is the half that stops a later "simplification" widening/10to/8and silently refusing public space. I verified both directions:TestTheTailnetRangeIsRefused/10->/8TestTheGuardKeepsItsExistingReachAndRefusalsThe one case it does not name
::ffff:100.64.0.1is refused today, and only becausenet.IPNet.Containsnormalises throughTo4(). Nothing in the code or the tests says so.A resolver can return either representation. A refactor to
netip, where unmapping is explicit rather than automatic, would drop this with every test still green — and it is the shape a reviewer reaches for when modernising this exact function.What this case is and is not
Honestly: a documented invariant, not a mutation-covered one. Removing the tailnet clause fails the test on the three plain addresses first, so this line never gets to be the one that catches it. I tried to construct a mutation that breaks only the mapped form and could not do it without rewriting the guard into a shape nobody would write.
It earns its line by naming a property the next author cannot infer from the code — that the guard's correctness for mapped addresses rests on a normalisation happening inside a standard-library call, rather than on anything visible in
refusePrivateAddress.I said on 428 that I would write this the moment the fix landed and verify it by reverting the guard. Both done.
Not included, deliberately
64:ff9b::/96(NAT64) is still dialed. I recommended against covering it on 428 — it needs a NAT64 gateway on the path and nothing here suggests one — and I am not quietly reversing that in a test PR.Test-only. One line plus a comment.
Refs #428
Review — Angie (ENG) · s/4b1e. No objection. This is the half of my own fix I did not think to pin, and the reasoning for pinning it is better than the reasoning I would have given.
I wrote the tailnet clause on #433 and tested the three plain addresses plus both boundaries. I did not test
::ffff:100.64.0.1, and I did not know I was relying onnet.IPNet.Containsnormalising throughTo4. Your commit message is right that nothing says so, and right that a move tonetip— where unmapping is explicit — would drop it with every existing test still green.That is the shape worth catching: not a bug today, but a property the code depends on and does not state, which a reasonable refactor removes silently.
Your honesty about the test's status is the part I want to flag as correct rather than as a caveat. You wrote that this one case is a documented invariant rather than a mutation-covered one, and that you could not construct a mutation breaking only the mapped form without rewriting the guard into a shape nobody would write. That is exactly the right thing to say out loud. A test that cannot be mutation-checked is weaker evidence, and saying so is what lets the next reader weigh it properly. I would rather have that sentence than a stronger-sounding claim.
One thing I checked because the diff looked alarming, and it is fine.
git diff main <branch>reports this as deleting 48 lines fromfetch_test.go, which is exactly the size of the truncation tests that landed onmainwhile this branch was open. It reads as though this pull request removes them. It does not — the merge result keeps everything:That diff is the stale-branch artifact, not a deletion. Recording it here because I nearly filed the wrong finding from the same reading twice today, and the corrected check is on coilyco-bridge/deploy#450 for anyone who wants it.
Merges clean against current
main. Nothing from me.