From 1878e452a9e1cb7c4ed354a3987004ed1accb543 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Thu, 29 Oct 2026 13:52:27 -0400 Subject: [PATCH] docs: #1103 round 10 -- close the whole-repo prose sweep Round 10, the closing-condition test: a full re-grep across the entire repo found exactly 3 items, all outside the carve-outs round 9 already settled. * pcapkit/protocols/protocol.py + foundation/registry/protocols.py: RegistryError said "protocol must be a Protocol subclass" while the adjacent issubclass() check and the Raises: docstring both say ProtocolBase -- fixed the message text to match, with the three test assertions that locked the old string. * tests/foundation/reassembly/test_deferred_pickle_2423_unit.py: a docstring said "this pull request's earlier commit", stale now that #2424 landed as one squashed commit on main -- reworded to cite the issue instead of the PR's own history. * tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py: a cross-reference cited the nonexistent module pcapkit.corekit.fields.enums.EnumField; the real path is pcapkit.corekit.fields.numbers.EnumField. No executable logic changed: an AST structural diff (ignoring string constants) against origin/main is identical for every touched file, and the RegistryError fix only changes the text of a raised message, not what triggers it. Re-verified and rejected two relayed findings that didn't survive a direct check: a transport.py:188-189 and a registry/protocols.py:370 cross-reference claim both already read correctly on this base. Re-swept vendor/process() for siblings of #2429/#2430 -- none found. docs/source and the rest of tests/ came back clean. Build: tests/protocols/test_register_class_guard_unit.py, tests/foundation/registry/test_protocols.py, tests/foundation/reassembly/test_deferred_pickle_2423_unit.py, tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py and tests/project/test_docs_issue_pr_roles_1103_unit.py pass. Closes #1103. --- pcapkit/foundation/registry/protocols.py | 2 +- pcapkit/protocols/protocol.py | 2 +- .../foundation/reassembly/test_deferred_pickle_2423_unit.py | 6 +++--- tests/foundation/registry/test_protocols.py | 2 +- tests/protocols/test_register_class_guard_unit.py | 4 ++-- .../transport/test_tcp_mptcp_option_attr_2293_unit.py | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pcapkit/foundation/registry/protocols.py b/pcapkit/foundation/registry/protocols.py index 459e2d03e5..2c92d7f3f2 100644 --- a/pcapkit/foundation/registry/protocols.py +++ b/pcapkit/foundation/registry/protocols.py @@ -221,7 +221,7 @@ class rather than supplied by a caller, and this function is the funnel if not isinstance(protocol, type): raise RegistryError(f'protocol must be a class, not {protocol!r}') if not issubclass(protocol, ProtocolBase): - raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}') + raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}') name = protocol.__name__.upper() incumbent = protocol_registry.get(name) diff --git a/pcapkit/protocols/protocol.py b/pcapkit/protocols/protocol.py index 75b04a49f4..a96df0ec20 100644 --- a/pcapkit/protocols/protocol.py +++ b/pcapkit/protocols/protocol.py @@ -1139,7 +1139,7 @@ def _next_layer_entry(cls, code: 'Any', protocol: 'ModuleDescriptor[ProtocolBase if not isinstance(protocol, type): raise RegistryError(f'protocol must be a class, not {protocol!r}') if not issubclass(protocol, ProtocolBase): - raise RegistryError(f'protocol must be a Protocol subclass, not {protocol!r}') + raise RegistryError(f'protocol must be a ProtocolBase subclass, not {protocol!r}') return protocol @classmethod diff --git a/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py b/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py index 98e9dce102..7ab929a545 100644 --- a/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py +++ b/tests/foundation/reassembly/test_deferred_pickle_2423_unit.py @@ -244,9 +244,9 @@ def test_setstate_accepts_the_native_default_shape(self) -> None: def test_setstate_still_accepts_the_first_revisions_flat_shape(self) -> None: """The flat ``{slot: value}`` shape the very first fix returned. - Never released, but already pushed to this pull request's earlier - commit -- accepting it costs nothing and protects anyone who - pickled against that commit. + Never released, but already pushed in an earlier revision of + :issue:`2424`'s fix -- accepting it costs nothing and protects anyone + who pickled against that revision. """ from pcapkit.foundation.reassembly.data.data import Deferred diff --git a/tests/foundation/registry/test_protocols.py b/tests/foundation/registry/test_protocols.py index c9132109ac..830a7db3c3 100644 --- a/tests/foundation/registry/test_protocols.py +++ b/tests/foundation/registry/test_protocols.py @@ -438,7 +438,7 @@ def test_register_protocol_rejects_a_non_class_with_registry_error(self) -> None ('none', None, 'must be a class'), ('descriptor argument (not unwrapped here)', ModuleDescriptor('pcapkit.protocols.misc.raw', 'Raw'), 'must be a class'), - ('wrong class', object, 'Protocol subclass'), + ('wrong class', object, 'ProtocolBase subclass'), ): with self.subTest(value=label): with self.assertRaises(RegistryError) as caught: diff --git a/tests/protocols/test_register_class_guard_unit.py b/tests/protocols/test_register_class_guard_unit.py index 334fb469fd..853476a387 100644 --- a/tests/protocols/test_register_class_guard_unit.py +++ b/tests/protocols/test_register_class_guard_unit.py @@ -82,7 +82,7 @@ def test_wrong_class_still_raises_registry_error(self) -> None: with mock.patch.dict(klass.__proto__): with self.assertRaises(RegistryError) as caught: klass.register(code, dict) # type: ignore[arg-type] - self.assertIn('Protocol subclass', str(caught.exception)) + self.assertIn('ProtocolBase subclass', str(caught.exception)) def test_descriptor_naming_a_non_class_raises_registry_error(self) -> None: from pcapkit.corekit.module import ModuleDescriptor @@ -107,7 +107,7 @@ def test_descriptor_naming_a_wrong_class_still_raises_registry_error(self) -> No with mock.patch.dict(klass.__proto__): with self.assertRaises(RegistryError) as caught: klass.register(code, descriptor) # type: ignore[arg-type] - self.assertIn('Protocol subclass', str(caught.exception)) + self.assertIn('ProtocolBase subclass', str(caught.exception)) def test_valid_class_and_descriptor_still_register(self) -> None: from pcapkit.corekit.module import ModuleDescriptor diff --git a/tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py b/tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py index cff1f0d952..20aad669b6 100644 --- a/tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py +++ b/tests/protocols/transport/test_tcp_mptcp_option_attr_2293_unit.py @@ -15,7 +15,7 @@ exactly ``kind`` and ``length`` (#541) and every concrete subtype adds its own on top; none of them declares ``option``, under :data:`~typing.TYPE_CHECKING` or otherwise. So the assignment created an attribute out of nothing at unpack time, and nothing in ``pcapkit`` read it back: -``kind``, a real :class:`~pcapkit.corekit.fields.enums.EnumField`, already carries +``kind``, a real :class:`~pcapkit.corekit.fields.numbers.EnumField`, already carries :attr:`~pcapkit.const.tcp.option.Option.Multipath_TCP`, and it is ``kind`` that the schema packs.