Skip to content

docs(protocols): fifth whole-repo pass over application, misc and the protocol base (#1103) - #2154

Merged
JarryShaw merged 1 commit into
mainfrom
docs/1103-r5-appmisc
Oct 25, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/1103-r5-appmisc

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

This is part of #1103, round 5: the application, misc and protocol-base slice, on main at 4c3d30163. It is prose only; the docstring-stripped AST is identical on all 5 changed .py files.

  • meth argument: HTTP.register_frame and the PCAPNG.register_block/option/record/secrets methods said meth was a "method name or callable". The code indexes a non-string entry [0]/[1], so it is a (parser, constructor) pair. This matches docs(protocols): fifth whole-repo pass over link and transport protocols (#1103) #2152's TCP/SCTP fix.
  • Stale claims:
    • keep_short_read: __short_read__ is a metadata key in Data.__included__ since fix(protocols): Info field order follows PyPy's attribute layout, not the declared fields #2003.
    • SectionHeaderBlock.pre_pack: the magic number is not palindromic.
    • NameResolutionBlock.length is the Block Total Length.
    • Frame.__post_init__: _ghdr holds the data model.
    • _make_block_cb: corrected the padding idiom it quotes.
    • HTTP/2 __length_hint__: corrected its description.
    • ngap.rst: pycrate decodes "values", not "IEs".
  • Doc entries: added for five helpers that rendered text already names: _cut_last_line, _malformed_line_message, Schema._cut_short_read, keep_short_read and replay_short_read.
  • Tests: tests/project/test_docs_*, the conventions and documentation-claims tests, and tests/protocols/{misc,application} plus the base tests all pass (220 + 278 + 251 + 40).

@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 25, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 25, 2026
… protocol base (#1103)

- keep_short_read: the key is listed in Data.__included__, not an ordinary one (#2003)
- register_frame/register_block/_option/_record/_secrets: meth is a method name or a
  (parser, constructor) pair, not a single callable
- SHB pre_pack: the magic is not palindromic; NRB length is the Block Total Length
- Frame._ghdr holds the data model; the CB padding comment names the right idiom;
  HTTP/2 __length_hint__ is a hint, not a total length
- ngap.rst: unnamed values, not IEs; misc/index.rst grammar
- document the helpers rendered text names: Schema._cut_short_read,
  keep_short_read, replay_short_read, _cut_last_line, _malformed_line_message

Prose only; AST unchanged. tests/project docs tests and nearby protocol tests pass.
@JarryShaw
JarryShaw force-pushed the docs/1103-r5-appmisc branch from c171f9b to e0db51b Compare October 25, 2026 04:49
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at e0db51b97.

The Sonnet review of c171f9bfc confirmed 11 of 12 claims; the remaining one (pycrate "values") is unverified.

  • meth: HTTP and PCAP-NG index non-string entries [0]/[1], and every see :attr: target exists.
  • __short_read__: it is in Data.__included__, from fix(protocols): Info field order follows PyPy's attribute layout, not the declared fields #2003.
  • SHB magic: the value is not palindromic.
  • Lengths: the NRB length is the Block Total Length.
  • _ghdr: it is the Data_Header model.
  • Padding: the file uses math.ceil(n / 4) * 4.
  • New doc entries: all five targets import, and they fit the rule that a private helper named in public prose gets an entry.
  • Checks: the AST guard is OK, and the docs tests pass (94).

e0db51b97 folds in the reviewer's one nit, a false claim that predates this PR. SectionHeaderBlock.pre_pack said the magic is "not carried by any field", but magic is a field. The sentence now says what the code does, and I checked it against the code. shb_byteorder_callback reads packet['match']['byteorder']. A constructed block has no match, so pre_pack seeds it, and keeps a match that is already present. The record-level NRB length comments were already right. The AST guard passes on all 5 files.

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

Copy link
Copy Markdown
Contributor

Coverage: 91.55% (unit tier, Python 3.15, e0db51b97, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 880 2618 866 92.12%
pcapkit/corekit 2589 75 816 37 96.48%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2971 23 1036 25 98.80%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17418 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at e0db51b97.

  • Review: Sonnet GOOD TO GO on c171f9bfc. The amend fixed the reviewer's one nit, and I checked that change against pre_pack and shb_byteorder_callback.
  • CI: 58 CheckRuns passed, 0 failed, 0 running. Required checks passed is SUCCESS. The KTLO legs show no warnings.
  • Ordering: tests/project plus the root modules, run on this PR merged into main under the plain unittest ordering leg: 2288 tests, 0 failures, 0 errors.
  • Merge conflicts: none with the other round-5 PRs. docs(docs): fifth whole-repo pass over the non-API docs, with issue/PR roles (#1103) #2161 also edits protocols/schema/misc/pcapng.py, but on different lines, and a test merge applied cleanly.

@JarryShaw
JarryShaw merged commit 7c944ad into main Oct 25, 2026
62 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 25, 2026
@JarryShaw
JarryShaw deleted the docs/1103-r5-appmisc branch October 25, 2026 14:09
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 25, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 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