Skip to content

Commit cfbe5dc

Browse files
authored
docs: #1103 round 8 -- finish the Protocol/ProtocolBase cross-reference sweep, fix other prose drift (#2428)
Round 8 of the whole-repo prose sweep (#1103). Fanned out 8 shard agents by directory; most of the repo was clean. Changes: * pcapkit/protocols/internet/ipv6_ext.py + its .rst: finish the carry-over miss from round 7 -- the `_lookup_next_layer` plain pointer still targeted `ProtocolBase`, flipped to `Protocol` per #2420's ruling. * Same miss in corekit/sentinels.py (`__keywords__`), docs/source/ext.rst (three sites, including a verbatim twin of a paragraph #2420 already fixed in protocol.py), schema/schema.py and schema/link/ethernet.py. * internet.py, link.py, transport.py, sctp.py, protocol.py: `register()`'s Arguments: and a couple of Returns:/versionchanged clauses said `Protocol` subclass/instance while the signature types `ProtocolBase` and the adjacent Raises: clause already said so -- internal contradiction, fixed to `ProtocolBase` to match. * docs/source/contributing/conventions/protocol-layer-placement.rst: the Link-Application-ProtocolBase set difference is `__proto_key__`, not empty as claimed (#2343 added it after this page was written). * docs/source/contributing/conventions/registry-protocol.rst: "every registry overrides `_validate_value`" contradicted its own next paragraph, where the AppType transports inherit rather than override. * pcapkit/vendor/ipx/packet.py, vendor/reg/linktype.py: a self-contradicting claim and a stale counted-number, both in vendor docstrings. * docs/source/engines.rst, docs/source/conf.py, util/changelog_md.py, CONTRIBUTING.md: a stale scapy version, a wrong file path, a false "matches the Sphinx we build with" claim, and a missing caveat about actionlint making Lint non-advisory. No executable code changed -- every edit is inside a docstring, comment, or .rst file; confirmed by diff review and `import pcapkit` from this worktree. Four behavioral defects found but deliberately left unfixed (reported separately): 16 of 24 pcapkit/vendor crawlers' `process(self, data)` reads the module-global `DATA` instead of its own `data` argument (latent, harmless only because `request()` returns that same global); an empty `FilterType` registry behind a live TODO; three open "handle this programmatically" TODOs in pcapkit/vendor/mh; and dead `multiprocessing.Pool` scaffolding in vendor/__main__.py.
1 parent 98f6000 commit cfbe5dc

15 files changed

Lines changed: 46 additions & 33 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,15 @@ header records which of them are clean and what each of the others would need be
163163
`continue-on-error` line could be deleted. Read the job's run summary, where each step writes
164164
its verdict, and try not to add to the numbers.
165165

166-
`isort` is the exception: no `Lint` step runs it. It appears in `cron-vendor.yml` as a formatter
167-
that rewrites the regenerated constants, and `tests/project/test_isort_clean.py`, which the `test`
168-
extra's `isort` lets run, fails on a file whose imports `make isort` would reorder.
166+
**The job is not entirely advisory, though.** It carries one more step, `actionlint`, which lints
167+
the workflow YAML rather than `pcapkit/`, and that one has no `continue-on-error` and no
168+
`Makefile` target — so a change under `.github/` can turn `Lint` red even though none of the
169+
linters above can. The header records that split, and asks for a promoted step to be moved below
170+
the advisory ones, since a failed step skips every step after it.
171+
172+
`isort` is absent from the job altogether: no `Lint` step runs it. It appears in `cron-vendor.yml`
173+
as a formatter that rewrites the regenerated constants, and `tests/project/test_isort_clean.py`,
174+
which the `test` extra's `isort` lets run, fails on a file whose imports `make isort` would reorder.
169175

170176
One trap: `make vermin` redirects its report into `temp/vermin.txt` rather than to your terminal,
171177
so when vermin finds code that misses `vermin.ini`'s `targets = 3.8` and exits 1,

‎docs/source/conf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
# Those packages are therefore linked to their project pages instead, through
184184
# :data:`rst_epilog` below (#1936).
185185

186-
#: The label on the note in :file:`pcapkit/foundation/engines/3rdparty.rst` that
186+
#: The label on the note in :file:`docs/source/pcapkit/foundation/engines/3rdparty.rst` that
187187
#: says which distribution installs the ``pcap`` module, which ``|pcap|_`` links
188188
#: to (:issue:`1948`).
189189
PCAP_MODULE_LABEL = 'pcap-module'

‎docs/source/contributing/conventions/protocol-layer-placement.rst‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,26 @@ Counting the names in each class's own namespace, whether new or overriding
191191
:class:`~pcapkit.protocols.protocol.ProtocolBase`'s, and including those
192192
:meth:`ProtocolBase.__init_subclass__ <pcapkit.protocols.protocol.ProtocolBase.__init_subclass__>`
193193
sets there, :class:`~pcapkit.protocols.link.link.Link` has ``__data__``, ``__layer__``,
194-
``__post_init__``, ``__proto__``, ``__schema__``, ``_read_protos``, ``_shipped_proto``,
195-
``from_data``, ``register`` and ``layer``, and
194+
``__post_init__``, ``__proto__``, ``__proto_key__``, ``__schema__``, ``_read_protos``,
195+
``_shipped_proto``, ``from_data``, ``register`` and ``layer``, and
196196
:class:`~pcapkit.protocols.application.application.Application` has what they share
197197
(``__data__``, ``__layer__``, ``__post_init__``, ``__schema__``, ``from_data``, ``layer``)
198198
plus ``__index__``, ``_decode_next_layer`` and ``_import_next_layer``.
199199
:class:`~pcapkit.protocols.link.link.Link` overrides names that
200200
:class:`~pcapkit.protocols.application.application.Application` does not -- ``__proto__``,
201201
``register``, ``_read_protos`` and ``_shipped_proto``, the last set because
202-
:class:`~pcapkit.protocols.link.link.Link` defines its own ``__proto__`` -- but each also
203-
exists on :class:`~pcapkit.protocols.protocol.ProtocolBase`, so the strict difference
202+
:class:`~pcapkit.protocols.link.link.Link` defines its own ``__proto__`` -- and each of
203+
those also exists on :class:`~pcapkit.protocols.protocol.ProtocolBase`, so each still
204+
resolves on :class:`~pcapkit.protocols.application.ospf.OSPF`. The strict difference
204205
:class:`~pcapkit.protocols.link.link.Link` minus
205206
:class:`~pcapkit.protocols.application.application.Application` minus
206-
:class:`~pcapkit.protocols.protocol.ProtocolBase` is **empty** and every one of them still
207-
resolves on :class:`~pcapkit.protocols.application.ospf.OSPF`. What changes is which
207+
:class:`~pcapkit.protocols.protocol.ProtocolBase` is ``__proto_key__`` alone
208+
(:issue:`2343`), which :class:`~pcapkit.protocols.link.link.Link` declares and neither of
209+
the others does, so it does **not** resolve on
210+
:class:`~pcapkit.protocols.application.ospf.OSPF`. Nothing turns on that:
211+
:func:`~pcapkit.foundation.registry.protocols.register_protocol_code` reads the pairing
212+
out of the registry owner's own namespace rather than off the class, and reads its
213+
absence as *declares no pairing* rather than as an error. What changes is which
208214
registry it resolves *to*: ``OSPF.__proto__`` is
209215
:attr:`ProtocolBase.__proto__ <pcapkit.protocols.protocol.ProtocolBase.__proto__>` rather
210216
than :attr:`Link.__proto__ <pcapkit.protocols.link.link.Link.__proto__>`, so OSPF does not

‎docs/source/contributing/conventions/registry-protocol.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ generated registries spell by hand in ``_missing_``:
7474
if not (isinstance(value, int) and 0 <= value <= 0xFF):
7575
raise EnumValueError(f'{value!r} is not a valid {cls.__name__}')
7676
77-
**Every registry overrides it**, so that ``register`` refuses what ``get`` refuses
77+
**Every registry has it overridden**, so that ``register`` refuses what ``get`` refuses
7878
(:issue:`1816`). Each vendor generator emits the override from the check it already
7979
writes at the top of ``_missing_``, with the same message. That is the ``FLAG`` of most
8080
crawlers, but a bespoke template's own range where its ``_missing_`` checks something

‎docs/source/engines.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ preflight described at the top of this page.
188188

189189
Only the engines above carry extra constraints. :mod:`pcapkit` itself and
190190
its ``default``, ``dpkt`` and ``scapy`` engines need nothing beyond their
191-
``pip install`` -- |dpkt|_ 1.9.8 and ``scapy`` 2.7.0 were both measured
191+
``pip install`` -- |dpkt|_ 1.9.8 and ``scapy`` 2.8.0 were both measured
192192
reading a capture on Python 3.14. The ``scapy`` engine needs **scapy 2.6.0 or
193193
newer**, which the ``Scapy`` extra requires: 2.5.0 can drop a PCAP-NG
194194
interface's timestamp resolution, reading nanoseconds as microseconds

‎docs/source/pcapkit/protocols/internet/ipv6_ext.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ This class is reached in these ways:
126126
1. **An unrecognised protocol number.**
127127
:attr:`~pcapkit.const.ipv6.extension_header.ExtensionHeader.Shim6` is a real
128128
IANA extension header (:rfc:`5533`) with no dedicated parser, so
129-
:meth:`Internet._lookup_next_layer <pcapkit.protocols.protocol.ProtocolBase._lookup_next_layer>`
129+
:meth:`Internet._lookup_next_layer <pcapkit.protocols.protocol.Protocol._lookup_next_layer>`
130130
would default it to plain :class:`~pcapkit.protocols.misc.raw.Raw`. That
131131
has no ``next`` field, so the walk in
132132
:meth:`IPv6._decode_next_layer <pcapkit.protocols.internet.ipv6.IPv6._decode_next_layer>` would

‎pcapkit/protocols/internet/internet.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def register(cls, code: 'Enum_TransType', protocol: 'ModuleDescriptor[ProtocolBa
182182
Arguments:
183183
code: protocol code as in :class:`~pcapkit.const.reg.transtype.TransType`
184184
protocol: module descriptor or a
185-
:class:`~pcapkit.protocols.protocol.Protocol` subclass
185+
:class:`~pcapkit.protocols.protocol.ProtocolBase` subclass
186186
187187
Raises:
188188
pcapkit.utilities.exceptions.RegistryError: If ``protocol`` is not a

‎pcapkit/protocols/internet/ipv6_ext.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
9494
1. **An unrecognised protocol number.** :class:`~pcapkit.const.ipv6.extension_header.ExtensionHeader.Shim6`
9595
is a real IANA extension header (:rfc:`5533`) with no dedicated parser, so
96-
:meth:`Internet._lookup_next_layer <pcapkit.protocols.protocol.ProtocolBase._lookup_next_layer>`
96+
:meth:`Internet._lookup_next_layer <pcapkit.protocols.protocol.Protocol._lookup_next_layer>`
9797
would default it to plain :class:`~pcapkit.protocols.misc.raw.Raw`. That
9898
has no ``next`` field, so the walk in
9999
:meth:`IPv6._decode_next_layer <pcapkit.protocols.internet.ipv6.IPv6._decode_next_layer>`

‎pcapkit/protocols/link/link.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def register(cls, code: 'Enum_EtherType', protocol: 'ModuleDescriptor[ProtocolBa
138138
Arguments:
139139
code: protocol code as in :class:`~pcapkit.const.reg.ethertype.EtherType`
140140
protocol: module descriptor or a
141-
:class:`~pcapkit.protocols.protocol.Protocol` subclass
141+
:class:`~pcapkit.protocols.protocol.ProtocolBase` subclass
142142
143143
Raises:
144144
pcapkit.utilities.exceptions.RegistryError: If ``protocol`` is not a
@@ -158,7 +158,7 @@ def register(cls, code: 'Enum_EtherType', protocol: 'ModuleDescriptor[ProtocolBa
158158
159159
Takes the protocol as one ``protocol`` argument, a
160160
:class:`~pcapkit.corekit.module.ModuleDescriptor` or a
161-
:class:`~pcapkit.protocols.protocol.Protocol` subclass, in place of
161+
:class:`~pcapkit.protocols.protocol.ProtocolBase` subclass, in place of
162162
the ``module`` and ``class_`` names.
163163
164164
"""

‎pcapkit/protocols/protocol.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ def analyze(cls, proto: 'int', payload: 'bytes', **kwargs: 'Any') -> 'ProtocolBa
10111011
**kwargs: Arbitrary keyword arguments.
10121012
10131013
Returns:
1014-
Parsed payload as a :class:`~pcapkit.protocols.protocol.Protocol`
1014+
Parsed payload as a :class:`~pcapkit.protocols.protocol.ProtocolBase`
10151015
instance.
10161016
10171017
"""
@@ -1044,7 +1044,7 @@ def register(cls, code: 'int', protocol: 'ModuleDescriptor | Type[ProtocolBase]'
10441044
Arguments:
10451045
code: protocol code
10461046
protocol: module descriptor or a
1047-
:class:`~pcapkit.protocols.protocol.Protocol` subclass
1047+
:class:`~pcapkit.protocols.protocol.ProtocolBase` subclass
10481048
10491049
Raises:
10501050
pcapkit.utilities.exceptions.RegistryError: If ``protocol`` is not a

0 commit comments

Comments
 (0)