Skip to content

fix(protocols): revert #2432's RegistryError message to name Protocol - #2434

Merged
JarryShaw merged 1 commit into
mainfrom
fix/revert-protocolbase-message-2432
Oct 29, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/revert-protocolbase-message-2432

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort)
  • make test passes, and a test case covers the change
  • Changelog entry: N/A -- reverts an unreleased, undocumented docs: #1103 round 10 -- close the whole-repo prose sweep #2432 change back to the prior, already-ratified behavior; net effect on 1.5.0 is zero

What is the purpose of your pull request?

  • fix -- corrects a defect

Description

#2432 (round 10 of #1103) mistakenly changed register's RegistryError message
from "...must be a Protocol subclass" to "...must be a ProtocolBase subclass"
in pcapkit/protocols/protocol.py and foundation/registry/protocols.py, and
updated the three locked assertions in tests/protocols/test_register_class_guard_unit.py
(two) and tests/foundation/registry/test_protocols.py (one) to match.

Naming Protocol (not ProtocolBase) in that message is a deliberate, ratified
decision, not stale prose: #1016 ruled the message's reader is third-party code
that should be told to subclass Protocol, since ProtocolBase's own docstring
says it is "for internal use only". #2316 re-confirmed this is out of scope to
change. #2420's merge commit records the split directly: "The Raises: clause
of each register keeps naming ProtocolBase, unchanged... the raised message
names Protocol." git log -S on both wordings shows #2432 is the only commit
that ever flipped the message; #2420 only touched the Raises: docstring
clause, never the message. This PR reverts both raise sites and the three
locked test assertions back to Protocol subclass.

Also fixes a citation #2432 left behind: tests/foundation/reassembly/ test_deferred_pickle_2423_unit.py cited :issue:2424 (the merged PR, not an issue) where the sentence means the underlying fix, tracked as #2423 -- now `:issue:`2423, matching the file's own existing citation style and the
changelog's (:issue:2423, :issue:2425, :pr:2424).

#2432's other two fixes (a stale PR-history docstring, a cross-reference to a
moved EnumField) were correct and are untouched.

Refs #1016, #2316, #2420, #1103

#2432 (round 10 of #1103) changed register's RegistryError message from
"...must be a Protocol subclass" to "...must be a ProtocolBase subclass"
in pcapkit/protocols/protocol.py and foundation/registry/protocols.py, and
updated the locked assertions in tests/protocols/test_register_class_guard_unit.py
and tests/foundation/registry/test_protocols.py to match. This was a mistake.

* The wording naming Protocol (not ProtocolBase) is a deliberate, ratified
  decision: #1016 ruled the message's reader is third-party code, who should
  be told to subclass Protocol -- ProtocolBase's own docstring says it is
  "for internal use only". The owner approved that reasoning, #2316
  re-confirmed it as out of scope to change, and #2420's commit explicitly
  records "the error message names Protocol" as the kept half of the split
  between the Raises: clause (ProtocolBase) and the raised message
  (Protocol). #2420 also notes it already caught and corrected one prior
  accidental flip of this exact wording.
* Reverted both raise sites and the four locked test assertions back to
  "Protocol subclass".
* Also fixed a citation left by #2432: tests/foundation/reassembly/
  test_deferred_pickle_2423_unit.py cited :issue:`2424` (the merged PR, not
  an issue) where it meant the underlying fix, tracked as #2423 -- matches
  the file's existing :issue:`2423` citation style and the changelog's own
  "(:issue:`2423`, :issue:`2425`, :pr:`2424`)" citation.

#2432's other two fixes (a stale docstring, a cross-reference to a moved
EnumField) are correct and untouched.

Refs #1016, #2316, #2420
Refs #1103

Build: tests/protocols/test_register_class_guard_unit.py,
tests/foundation/registry/test_protocols.py,
tests/foundation/reassembly/test_deferred_pickle_2423_unit.py pass; full
tests/project/ run shows no new failures (13 pre-existing failures, all in
unrelated subprocess/network-dependent tests, none touching these files).
@github-actions github-actions Bot added this to the PyPCAPKit v1.5 milestone Oct 29, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 29, 2026
@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 29, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at dfda0f0a2 (Opus, different model from the author). The code is a correct, complete, byte-exact revert of #2432's mistake, verified independently — but the review found the PR description carried three factual errors, now corrected in the body above (this becomes the squash commit message, same as #2432):

Independently confirmed: the ruling itself (#1016/#2316, with the caveat that it's one shared login throughout), the diff has no scope creep (5 files, 6 lines each way, byte-exact against pre-#2432), the citation fix is correct, the raised message text is restored (register_protocol(object) → "must be a Protocol subclass"), and re-breaking the message confirms the tests actually catch the regression (17 failures). Full suite / lint / type checks not run (budget) — reported as unverified rather than assumed clean.

@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 29, 2026
@JarryShaw
JarryShaw merged commit ce757cd into main Oct 29, 2026
65 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 29, 2026
@JarryShaw
JarryShaw deleted the fix/revert-protocolbase-message-2432 branch October 29, 2026 19:17
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant