Skip to content

docs(protocols): second-round pass over the data-model prose (#719) - #1080

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

JarryShaw merged 1 commit into
mainfrom
docs/719-r2-protocols-data

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Round-two re-read of every file under pcapkit/protocols/data/ for #719 (38 files read, 14 changed). Comments and docstrings only.

  • preserved keyword → reserved keyword (IPv4 ToSField/TROption, IPv6).
  • HIP SolutionParameter.reserved: replaced the "used to be read as a Lifetime" history with the standing reason (only PUZZLE has a Lifetime; 0x00 would not re-serialise, per _make_puzzle_lifetime).
  • NoPayload comment: Info generates __init__(self, dict_=None, **kwargs) for an annotation-less class (probed), rather than "skipping" it.
  • IPv6_Ext.protocol: None also when alias is not given (read only resolves a non-None alias).
  • Added doc comments for undocumented IPv4.options (set only when hdr_len > 20) and TROption.originator; fixed #:Flags. / # :Flags. on IPDFFOption.flags (the latter was not a doc comment at all).
  • VLAN index comments name both 802.1Q and 802.1ad, matching vlan.py.
  • Typos: crytographic, moddel, modelf, compability, Publick, Sendder, ZigBEE.

Sphinx -n, fresh dirs: 46 warnings mention this slice on both main and branch, none new. Tests (one module per process) and tests/project pass.

AST guard (every bare-string Expr stripped), origin/main vs branch:

File Identical
pcapkit/protocols/data/__init__.py True
pcapkit/protocols/data/application/httpv2.py True
pcapkit/protocols/data/application/ospf.py True
pcapkit/protocols/data/internet/hip.py True
pcapkit/protocols/data/internet/hopopt.py True
pcapkit/protocols/data/internet/ipv4.py True
pcapkit/protocols/data/internet/ipv6.py True
pcapkit/protocols/data/internet/ipv6_ext.py True
pcapkit/protocols/data/internet/ipv6_opts.py True
pcapkit/protocols/data/internet/mh.py True
pcapkit/protocols/data/link/__init__.py True
pcapkit/protocols/data/misc/null.py True
pcapkit/protocols/data/misc/pcapng.py True
pcapkit/protocols/data/transport/tcp.py True

- Fix "preserved keyword" to "reserved keyword" in the IPv4/IPv6
  from_dict notes and comments.
- Drop timed context from SOLUTION's reserved-octet note; keep why it
  is not a Lifetime.
- Correct NoPayload's comment on what Info generates for a class with
  no annotations, and IPv6_Ext.protocol's None condition.
- Document IPv4 options and TR originator, and repair IPDFFOption's
  flags doc comment in HOPOPT and IPv6-Opts.
- Name both VLAN tag types in the package-index comments.
- Fix typos (crytographic, moddel, modelf, compability, Publick,
  Sendder, ZigBEE).

Comments and docstrings only; AST guard identical for all 14 files.
@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, c420eaa58, 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.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on c420eaa58: GOOD TO GO (ran on Sonnet; author Opus)

  • No code changed. All 14 files are AST-identical to origin/main once bare strings are stripped.
  • IPv4.options exists only when hdr_len > 20. Probed with a 20-byte and a 24-byte header.
  • HIP SolutionParameter.reserved is carried verbatim, and only PUZZLE uses _make_puzzle_lifetime. The :issue: link and RFC citations are kept.
  • Info subclasses with no annotations get __init__(self, dict_=None, **kwargs). Probed.
  • ipv6_ext protocol is None both when alias is absent and when the lookup misses.
  • The #: fixes now register. ModuleAnalyzer.find_attr_docs() returns IPDFFOption.flags from both hopopt and ipv6_opts, plus TROption.originator and IPv4.options.
  • "Reserved keyword" is correct everywhere. The typo fixes touch no identifiers.
  • Tests: test_docstring_contract and 8 touched unit modules pass.
  • Non-blocking: #: Return hop count. in TROption is still orphaned, as it is on main.

@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 e574a0c into main Oct 6, 2026
41 checks passed
@JarryShaw
JarryShaw deleted the docs/719-r2-protocols-data 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