Skip to content

docs(protocols): tighten the internet-layer prose and cut timed context (#719) - #1035

Merged
JarryShaw merged 1 commit into
mainfrom
docs/719-protocols-internet-a
Oct 5, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/719-protocols-internet-a

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description of your pull request and other information

Internet-layer half A of the #719 prose sweep (mh, esp, ipv6, ip, __init__; the other seven files needed nothing).

  • mh.py: the four RFC-inline enums state the closed-enumeration and no-get-override decisions once, without the issue history. Their claim that an unassigned value degrades the whole IPv6 packet (with a stale ipv6.py line reference) is replaced by what IPv6 does now: substitute IPv6_Ext for the failing MH layer. Registry comments named _read_option_/_read_extension_, which do not exist (_read_opt_/_read_ext_). Issue tags, "used to", "currently" removed from the notes.
  • ipv6.py: __generic_ext_codes__ and the structural next check described as they are; dropped the claim that MANIFEST.in excludes the Shim6 placeholder from the wheel.
  • ip.py: no longer lists AH/ESP (they derive from IPsec); __init__.py: "Deprecated / Base Classes" is "Base Classes".
  • esp.py: issue citations and history dropped; two headings recased.

Checks: Sphinx -n, 29 warnings on these files vs 37 on main, none new. AST with docstrings and bare strings stripped equals main for every file:

file AST equal
internet/__init__.py, esp.py, ip.py, ipv6.py, mh.py True
ipsec.py, ipv6_frag.py, NotImplemented/{ecn,icmp,icmpv6,igmp,shim6}.py True (unchanged)

@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 100fe88d9: NEEDS CHANGES (ran on Opus; authored on Sonnet). One finding, plus a related stale test comment.

esp.py:460-461 — half the new ESPStatus claim is wrong. It says "get and _missing_ come from EnumLookup". EnumLookup defines only get, get_all and _validate_value. I re-checked on the PR head: the MRO is ESPStatus → EnumLookup → IntEnum → … → Enum, _missing_ resolves on stdlib Enum, and ESPStatus(250) raises a builtin ValueError. The pre-PR text was right on this point.

tests/protocols/internet/test_mh_unit.py:1444 still says an unassigned code costs "the whole packet's over IPv6". That contradicts the PR's corrected mh.py prose and the subtest at :1825. Fix it here so the claim is consistent everywhere.

The mh.py behavioural claim is confirmed with real packets. The reviewer built Ethernet + IPv6 (NH 135) + MH + UDP frames: a valid FBack, FBack and LRA with unassigned status 50, and an HI with an unassigned IPv6AddressPrefix option code. In every unassigned case only the MH slot becomes IPv6_Ext (Ethernet:IPv6:IPv6-Ext:UDP:Raw), and the IPv6 header, UDP and payload all survive. The mechanism is ipv6.py:529-535.

Confirmed: the _read_opt_ / _read_ext_ names (71 and 3 readers); the ip.py hierarchy (AH and ESP are IPsec, not IP); no deprecation on IP/IPsec; the dropped MANIFEST.in claim (a built wheel holds all 33 placeholders); all 99 table rows (24 / 71 / 4, no mismatches); member counts 6 and 4.

Nit, worth taking: the 52167e331 ruling now survives only as "a get override was rejected". Name what it was rejected in favour of: deleted, not widened to accept default.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw
JarryShaw force-pushed the docs/719-protocols-internet-a branch from 100fe88 to fdde563 Compare October 5, 2026 17:51
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on fdde56310: NEEDS CHANGES (ran on Opus; authored on Sonnet). One sentence, in a test docstring.

tests/protocols/internet/test_mh_unit.py:1442-1445 gets the two halves the wrong way round. It says an unassigned code "degrades the MH parse to Raw via @beholder … over IPv4 that is the MH message". I re-checked both cases on the PR head with the same FBack MH carrying UDP hello, once valid and once with status 50:

  • IPv4: valid parses as IPv4:MH:UDP:Raw. Status 50 parses as IPv4:Mobility_Header. The layer after IPv4 is a single Raw holding MH, UDP and the payload, so everything above MH is lost, not just the MH message.
  • IPv6: status 50 parses as Ethernet:IPv6:IPv6-Ext:UDP:Raw. Only the MH header is replaced, and UDP and the payload still parse.

So Raw is the IPv4 path only, and IPv4 loses more than IPv6. Suggested: "…so an unassigned code no longer grows the class. Over IPv4 @beholder replaces the MH layer and everything above it with Raw; over IPv6 only the MH header is replaced, by IPv6_Ext, and the layers above it still parse."

Everything else is confirmed:

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
…xt (#719)

Docstrings and comments only, in internet half A (mh, esp, ipv6, ip, __init__).

- mh.py: the four RFC-inline enums lose their issue-by-issue history and
  state the closed-enumeration and no-`get`-override decisions once; the
  stale "AttributeError degrades the whole IPv6 packet" claim (and its
  wrong `ipv6.py` line reference) is replaced by what IPv6 now does, which
  is substitute IPv6_Ext for a Mobility Header that raises. Fix the
  `_read_option_`/`_read_extension_` registry comments to the real
  `_read_opt_`/`_read_ext_` names; drop "currently", issue tags and
  "used to" from the MH/MN-ID/QoS/CGA notes.
- ipv6.py: describe the `__generic_ext_codes__` fallback and the structural
  `next` check as they are; drop the claim that MANIFEST.in excludes the
  Shim6 placeholder from the wheel.
- esp.py, ip.py, __init__.py: drop issue citations and history; IP no longer
  lists AH/ESP (they derive from IPsec); "Deprecated / Base Classes" is
  "Base Classes".

Prose only: AST with docstrings stripped equals origin/main for every file.
@JarryShaw
JarryShaw force-pushed the docs/719-protocols-internet-a branch from fdde563 to a7dda2d Compare October 5, 2026 17:57
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on a7dda2df8: GOOD TO GO (ran on Opus; authored on Sonnet). All round-2 findings are fixed.

  • The test_mh_unit.py comment now matches how the parser behaves. I checked both cases on this head with the same FBack MH carrying UDP hello:
    • Over IPv4, @beholder replaces the MH layer and everything above it with Raw. The packet parses as IPv4:Mobility_Header, and a single Raw holds MH, UDP and the payload.
    • Over IPv6, only the MH header is replaced by IPv6_Ext. The packet parses as Ethernet:IPv6:IPv6-Ext:UDP:Raw.
  • Scope: the commit changes only that docstring (+5/−4). The file's AST still matches main once docstrings are stripped, and test_mh_unit.py passes: 52 passed, 499 subtests.
  • Carried forward and confirmed:
  • Not verified: a full Sphinx -n build, the per-class abc cache claim, and LMAAddressCode at the packet level.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw
JarryShaw merged commit 2d62d9d into main Oct 5, 2026
74 checks passed
@JarryShaw
JarryShaw deleted the docs/719-protocols-internet-a branch October 5, 2026 20:04
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 5, 2026
@JarryShaw JarryShaw added this to the 1.5 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant