Skip to content

docs(protocols): tighten the schema prose and cut timed context (#719) - #1040

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

JarryShaw merged 1 commit into
mainfrom
docs/719-protocols-schema

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

Slice of #719 covering pcapkit/protocols/schema/: 13 files, docstrings and comments only (+422 / -658). Cuts "used to" / "until #NNN" / measured-before-the-fix prose, keeps the rationale behind each guard, fixes a HEADERS flags docstring that named DATA frames, and a improt typo.

Not touched (nothing to cut found): link/*, application/{ftp,httpv1,ngap,ospf,__init__}, internet/{ah,esp,ipx,ipv6,ipv6_ext,ipv6_frag,__init__}, misc/{__init__,null,raw}, misc/pcap/{header,__init__}, transport/__init__. mh.py, hip.py, pcapng.py were only partly rewritten (timed context and issue citations); their remaining RFC prose is unchanged.

Checks: sphinx-build -b dummy -n fresh dirs, branch vs main, schema-file warnings 51 vs 51, none new. tests/project, tests/test_docstring_contract.py, the three tests/protocols/schema/ modules and test_option_roundtrip_unit.py pass, one module per process.

AST guard (docstrings stripped, vs origin/main): all 13 files True.

file identical AST
schema.py True
transport/{tcp,udp,sctp}.py True
internet/{ipv4,ipv6_route,ipv6_opts,hopopt,hip,mh}.py True
misc/pcapng.py, misc/pcap/frame.py True
application/httpv2.py True

- schema.py: drop issue/PR history from the registrar, finaliser and
  packing notes; keep the rationale for each guard. State that
  EnumSchema.registry answers on an instance and EnumMeta.registry on
  the class.
- transport/tcp.py: rewrite the DSS Data ACK/DSN selector notes around
  the SwitchField-versus-ConditionalField reason that still holds; cut
  the PortEnumField, MPTCP FastClose and MP_CAPABLE change narratives.
- internet/{ipv4,ipv6_route,ipv6_opts,hopopt,hip,mh}.py and
  misc/{pcapng,pcap/frame}.py: cut "used to"/"until #NNN" prose and
  measured-before-the-fix figures; HIP padding, Quick-Start lengths and
  MPTCP widths re-checked against the declared fields.
- application/httpv2.py: fix the HEADERS Flags docstring, which named
  DATA frames.
- misc/pcapng.py: fix the "improt" typo in the Option example.

Docstrings and comments only; AST identical to main once docstrings are
stripped. Sphinx -n warnings for these files 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 c8e3cd875: GOOD TO GO (ran on Opus; authored on Sonnet). Docstrings and comments only, 13 of the 37 schema/ files. The PR body states that the coverage is partial.

EnumSchema.register note is correct. Same schema object: no warning. Different object: one warning. There is no write-back path here like ProtocolBase's, because __enum__ entries are classes, not ModuleDescriptors, so the note needs no state qualifier. The removed cross-reference to register_protocol was accurate but redundant: the note now states the condition directly.

registry properties are correct. Both exist (EnumMeta and EnumSchema). The class lookup resolves through the metaclass, an instance resolves to the same _EnumRegistry, and EngineMeta.registry describes the same split. The if code is not None opt-in is untouched.

IPv4 Stream ID cut is correct, and my own earlier note was stale. SIDOption.sid is UInt16Field on main (ipv4.py:520); 04b9c3747 (#534, #537) narrowed it. The removed "6-octet UInt32Field" narrative was history, not a live defect.

Arithmetic matches the declared fields: MPTCP Fastclose 12 octets; MP_CAPABLE 12 and 20; HIP encrypted_data_len and parameter_total_len; the locator-set byte count. HTTP/2 has six Flags(0) sites and five flags=None sites, and HeadersFrame.Flags now reads HEADERS. All listed rationale survives.

Found along the way, filed as #1042: a pre-existing defect where three of the five RFC 8684 MP_CAPABLE lengths fail to parse. It is outside this PR's scope.

@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 ea2e7bf into main Oct 5, 2026
72 of 74 checks passed
@JarryShaw
JarryShaw deleted the docs/719-protocols-schema branch October 5, 2026 20:05
@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