Skip to content

docs(protocols): second-round pass over the internet-layer prose (#719) - #1081

Merged
JarryShaw merged 1 commit into
mainfrom
docs/719-r2-internet
Oct 6, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/719-r2-internet

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

  • docs — documentation only

Description of your pull request and other information

Second-round #719 read of all 16 files under pcapkit/protocols/internet/; 7 changed, 9 left as they were. Every change corrects a claim the code contradicts, or past-tense rationale:

  • Registry comments (IPv4, HOPOPT, IPv6-Opts, IPv6-Route, HIP, MH ×3): a non-str value is a (parser, constructor) pair, and a missing named method falls back to the unassigned/none/unknown handler. The old text said the value "should be a method".
  • HOPOPT / IPv6-Opts Raises:: name schema.len, which is what the code checks. Router Alert said tun and Home Address said jumbo. The threshold line now states the != check.
  • HIP: _read_locator returns IPv6Address/LocatorData, not IPv4Address/Locator. PUZZLE and SOLUTION raise when the length is wrong under HIPv1. The docs said they raise on any non-v1 version.
  • IPv6-Opts make takes Destination Options, not Hop-by-Hop. "Header Extensive Length" now reads "Header Extension Length". A :class: role that was split across two lines is joined again, which removes one Sphinx -n warning. The IPv6 walk comment is shorter, and its "check above" now reads "this check". That comment still names Shim6 as the code with no dedicated parser that resolves to IPv6_Ext. MH's interval is documented as unused when option is given.

Tests: each tests/protocols/internet/test_*.py was run in its own process, plus tests/test_docstring_contract.py and tests/project. All pass. Sphinx -n, fresh builds, this slice only: 35 warnings on the branch against 36 on main, none new.

File AST identical to origin/main (docstrings stripped)
hip.py True
hopopt.py True
ipv4.py True
ipv6.py True
ipv6_opts.py True
ipv6_route.py True
mh.py True

@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 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Coverage: 88.74% (unit tier, Python 3.14, 3f7ba4636, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1035 2342 846 90.23%
pcapkit/corekit 1874 91 578 22 94.33%
pcapkit/dumpkit 136 0 40 0 100.00%
pcapkit/foundation 2422 143 842 34 92.62%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15653 187 3942 162 98.19%
pcapkit/toolkit 487 71 144 3 84.15%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

Per-file detail: the coverage-html artifact of this run.

- registry attribute comments (IPv4, HOPOPT, IPv6-Opts, IPv6-Route, HIP,
  MH x3): a non-string value is a (parser, constructor) pair, and a
  missing named method falls back to the unassigned/none handler
- HOPOPT/IPv6-Opts Raises: name the field the code checks (schema.len),
  fix the copy-pasted tun/jumbo names, and say what the length check is
- HIP: _read_locator returns IPv6Address/LocatorData; PUZZLE and SOLUTION
  raise on a HIPv1 length mismatch, not on any non-v1 version
- IPv6-Opts make documents Destination, not Hop-by-Hop, options
- "Header Extensive Length" -> "Header Extension Length"; split
  :class: role rejoined; shorter IPv6 walk comment; past-tense rationale
  restated in the present (IPv6-Route, IPv6-Opts, MH)

Docstrings and comments only; AST-identical to origin/main.
@JarryShaw
JarryShaw force-pushed the docs/719-r2-internet branch from 4938f5c to 3f7ba46 Compare October 6, 2026 17:09
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 3f7ba4636: GOOD TO GO (ran on Sonnet; author Opus, two rounds)

Round 1 (4938f5c6b) was GOOD TO GO with three nits. All three are fixed in this head:

  • Shim6: ipv6_ext.py:657 registers it directly to IPv6_Ext, and no dedicated parser exists. Probed: 140 resolves to IPv6_Ext, while 253 and 254 resolve to Raw.
  • _make_opt_mesg_id interval: it is read only when neither option nor timestamp is given. option.ntp_timestamp is non-Optional, and its only constructor, at mh.py:3249, always sets it.
  • _read_ip_hextet Returns: this now matches the 4-octet (_vers, _tcls, _flow) read.

AST guard: all 7 files are identical to origin/main once bare strings are stripped. test_ipv6_unit, test_mh_unit and test_docstring_contract pass.

UNVERIFIED: the Sphinx -n counts were not rebuilt.

@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 6, 2026
@JarryShaw
JarryShaw merged commit b1e1a07 into main Oct 6, 2026
40 checks passed
@JarryShaw
JarryShaw deleted the docs/719-r2-internet branch October 6, 2026 17:34
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label 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