You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
utils: follow-ups from the #1561 review (two missing IPv6 ranges, wire-level tests, NAT64 and malformed policy) #1572
Follow-ups from the independent review of #1561 (the policy classifier for non-public hosts, #1560). The PR is accepted; these are not blocking.
Acceptance Criteria
isSpecialUseIpv6 includes 100:0:0:1::/64 (RFC 9780 dummy prefix) and 5f00::/16 (SRv6): a 200,000-literal differential against the IANA special-purpose registry shows no other private or special-use IPv6 form returns public.
Wire-level tests with a special-use start URL exist for audit.ts (run registration, publish and credit-clamp gate), report --publish and the MCP billed audit; each fails when its call site is switched back to the narrow classifier.
The policy for a NAT64 or 6to4 address with a PUBLIC embedded IPv4 (64:ff9b::808:808, 2002:808:808::1) is decided once and documented: today the policy functions judge it non-public (delivery rules skipped, cloud handoff and publish withheld, schemeless default scheme http) while the egress guard treats it as a public destination.
The malformed-IPv6 behaviour of the exported policy function is decided and pinned (today any string with a colon that is not a valid IPv6 returns public; callers pass only URL-parsed hosts, so it is unreachable through them).
Optional: the anycast and AS112 exceptions inside 2001::/23 (2001:3::, 2001:4:112::, 2001:1::1) and 192.0.0.9 and 192.0.0.10 are not rejected as special-use.
The docs say Teredo is 2001::/23 as the code has it (they say 2001::/32).
Acceptance check against v0.0.162 (7c31d5b, release). Fix commits: 452a3de and 08aca7d. Tests run on the tag: packages/utils/tests/special-use-ip.test.ts 117 pass, special-use-ipv6-registry.test.ts 5 pass, apps/cli/tests/commands/audit-non-public-host-wiring.test.ts 20 pass, report-publish-non-public-host.test.ts 29 pass, apps/cli/tests/mcp/audit-website-billing.test.ts 29 pass.
#
Criterion
Result
Evidence
1
100:0:0:1::/64 and 5f00::/16, 200,000-literal differential
PASS
special-use-ip.tsisSpecialUseIpv6; special-use-ipv6-registry.test.ts "200,000 random literals inside non-reachable registry blocks never come back public" (seeded) and "the two ranges added by #1572 are covered at their edges"
2
Wire-level tests for audit.ts, report --publish, MCP billed audit, each failing on the narrow classifier
PASS
the three CLI test files above carry special-use start URLs (NAT64, 6to4, documentation, site-local, benchmarking), including the credit-clamp gate with a public-host control. I switched each call site to the narrow privateNetworkHostLabel in a scratch worktree: audit-non-public-host-wiring 14 fail, report-publish-non-public-host 7 fail, audit-website-billing 6 fail; restored afterwards
3
NAT64 and 6to4 with a public embedded IPv4 decided and documented
PASS
decision: non-public for policy, by prefix; the egress guard judges the embedded address on purpose. Documented in non-public-host.ts and special-use-ip.ts, docs/guides/local-audits-cli.mdx and the CHANGELOG; pinned by "translation prefixes with a public embedded IPv4" in special-use-ip.test.ts
4
Malformed IPv6 decided and pinned
PASS
non-public (fail closed), non-public-host.ts; test "a malformed IPv6 is non-public for policy" (the narrow classifier is unchanged)
5
Optional: anycast and AS112 exceptions in 2001::/23, 192.0.0.9 and 192.0.0.10
PASS
isGloballyReachableIetf and the 192.0.0.x carve-out; registry test "the globally reachable carve-outs inside 2001::/23" and "192.0.0.9 and 192.0.0.10 are not special-use"
6
Docs say Teredo is 2001::/23
PASS
docs/guides/local-audits-cli.mdx; no 2001::/32 left in the tree
Activity
fix(utils): add the RFC 9780 and SRv6 IPv6 ranges, keep the reachable…
fix(utils): pin NAT64 and 6to4 prefix policy, malformed IPv6 is non-p…
nc9 commentedon Nov 4, 2026
Acceptance check against v0.0.162 (7c31d5b, release). Fix commits: 452a3de and 08aca7d. Tests run on the tag:
packages/utils/tests/special-use-ip.test.ts117 pass,special-use-ipv6-registry.test.ts5 pass,apps/cli/tests/commands/audit-non-public-host-wiring.test.ts20 pass,report-publish-non-public-host.test.ts29 pass,apps/cli/tests/mcp/audit-website-billing.test.ts29 pass.100:0:0:1::/64and5f00::/16, 200,000-literal differentialspecial-use-ip.tsisSpecialUseIpv6;special-use-ipv6-registry.test.ts"200,000 random literals inside non-reachable registry blocks never come back public" (seeded) and "the two ranges added by #1572 are covered at their edges"audit.ts,report --publish, MCP billed audit, each failing on the narrow classifierprivateNetworkHostLabelin a scratch worktree:audit-non-public-host-wiring14 fail,report-publish-non-public-host7 fail,audit-website-billing6 fail; restored afterwardsnon-public-host.tsandspecial-use-ip.ts,docs/guides/local-audits-cli.mdxand the CHANGELOG; pinned by "translation prefixes with a public embedded IPv4" inspecial-use-ip.test.tsnon-public-host.ts; test "a malformed IPv6 is non-public for policy" (the narrow classifier is unchanged)2001::/23,192.0.0.9and192.0.0.10isGloballyReachableIetfand the192.0.0.xcarve-out; registry test "the globally reachable carve-outs inside 2001::/23" and "192.0.0.9 and 192.0.0.10 are not special-use"2001::/23docs/guides/local-audits-cli.mdx; no2001::/32left in the treeAll six boxes are ticked. Closing.
nik