Repository navigation
docs(foundation): second-round pass over the foundation prose (#719) - #1084
Merged
Merged
Conversation
Contributor
|
Coverage: 88.74% (unit tier, Python 3.14,
Per-file detail: the |
Correct docstrings and comments the code contradicts: the reassembly strict flag, the Extractor make_name/record_header/_cleanup contracts, the flow-tracing callback, make_fout and per-ack datagram counts, the opt-in registration comments, and several Warns/Raises lists. Cut the remaining timed context and fix a dangling reST target. Docstrings and comments only; AST identical to main once docstrings are stripped.
JarryShaw
force-pushed
the
docs/719-foundation-round2
branch
from
October 6, 2026 17:07
b74e185 to
b2aab95
Compare
Owner
Author
|
Cross-review verdict on Round 1, on
Round 2, on the four requested fixes:
UNVERIFIED: the Sphinx build was not run by the reviewer; the PR body reports 144→143 warnings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please follow the guide below
make pylint,make mypy,make isort) — N/A, the AST is unchanged (table below)make testpasses, and a test case covers the change — not the whole suite: each of the 26tests/foundationmodules ran in its own process, plustests/projectandtests/test_docstring_contract.py, all passingdocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingchore— anything elseDescription of your pull request and other information
Second-round #719 pass over every file under
pcapkit/foundation/(32 read, 20 changed). It only touches prose the code contradicts, plus leftover timed context:strict. The docs saidstrict=Falsedrops incomplete datagrams. A probe shows it still returns them, as one contiguous payload with the holes zero-filled. For IP, when the total length is unknown, it returns only the prefix up to the first hole.strict=Truereturns the received runs instead.Extractor. Rewrote themake_namesteps, because no output format is ever inferred fromfout. Rewroterecord_header, because tracing never reads the header byteorder. In_cleanup, replaced the dangling_read_framewith the real re-entry path (a probe confirmed it). Completed therunand__init__Warns/Raises lists.Indexwhen a flow is finalised, not a list of datagrams.make_foutraises only whenfoutexists but is not a directory.Index.packetholds one datagram per direction and acknowledgement number.Engineusesengine=, notname=, and a mistyped keyword leaves the class unregistered rather than registered under its own name.TCPmodule class and theregister_pcapng_blocklabel. Fixed thePCAP-NGreST target, and changed the IPv4 timeout citation to RFC 1122. Where timed wording was cut, the rationale is kept in present tense: whyregister_enginechecksEnginerather thanEngineBase, whyTransportProtocol['tcp|udp']misses rather than composing into 3, and why the trace-format guard covers an engine that dissects nothing.Sphinx
-n, fresh output directories, foundation warnings only: main 144, branch 143. No new warnings; the dangling_read_framereference is gone.AST guard (every bare-string
Exprstripped, branch vsorigin/main):pcapkit/foundation/engines/__init__.pypcapkit/foundation/engines/engine.pypcapkit/foundation/engines/pcap.pypcapkit/foundation/engines/pcap_ct.pypcapkit/foundation/engines/pyshark.pypcapkit/foundation/extraction.pypcapkit/foundation/reassembly/data/data.pypcapkit/foundation/reassembly/data/ip.pypcapkit/foundation/reassembly/data/tcp.pypcapkit/foundation/reassembly/ip.pypcapkit/foundation/reassembly/ipv4.pypcapkit/foundation/reassembly/ipv6.pypcapkit/foundation/reassembly/reassembly.pypcapkit/foundation/reassembly/tcp.pypcapkit/foundation/registry/protocols.pypcapkit/foundation/traceflow/__init__.pypcapkit/foundation/traceflow/data/data.pypcapkit/foundation/traceflow/data/tcp.pypcapkit/foundation/traceflow/tcp.pypcapkit/foundation/traceflow/traceflow.py