Skip to content

refactor(foundation): replace the registry's ad-hoc _MISSING with a MISSING sentinel - #2610

Merged
JarryShaw merged 1 commit into
mainfrom
refactor/2555-registry-missing
Nov 2, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
refactor/2555-registry-missing

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • refactor — changes neither behaviour nor performance

Description of your pull request and other information

pcapkit.foundation.registry's ad-hoc _MISSING = object() becomes a MissingType/MISSING sentinel in pcapkit.corekit.sentinels that follows sentinel-convention.rst, with __bool__, __repr__, pickling and a singleton. sentinel-convention.rst and corekit/sentinels.rst list it. No registrar changes behaviour: tests/foundation/registry and the registry tests in tests/protocols pass unchanged.

Settled on the worker's recommendations:

Closes #2555

…rekit.sentinels (#2555)

pcapkit.foundation.registry.protocols kept its own `_MISSING = object()`.

- pcapkit/corekit/sentinels.py: add MissingType and its MISSING instance,
  private and falsy like ABSENT; __all__ is unchanged.
- pcapkit/foundation/registry/protocols.py: import MISSING and drop
  _MISSING; the lease code compares against it as before.
- docs: list MISSING in sentinel-convention.rst's table and its __bool__
  and __repr__ entries, and on the sentinels API page as private.
- tests: add MISSING to the sentinel population, consumer, singleton and
  _py_abc tables; pin a new name's lease displacing MISSING; guard against
  any import-time bare object() under pcapkit/.
@JarryShaw JarryShaw added refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Nov 1, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at aae9a5377 (Sonnet review). The sentinel follows sentinel-convention.rst, and no registrar changes behaviour. The docs edits outside the brief are justified. The new test fails on main. The one foundation-leg error, in test_pcapng_unique_block_names_unit, predates this change and is unrelated.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Coverage: 94.03% (unit tier, Python 3.15, aae9a5377, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 20093 144 2712 125 98.78%
pcapkit/corekit 2612 74 818 37 96.53%
pcapkit/dumpkit 281 3 100 3 98.43%
pcapkit/foundation 3359 27 1186 32 98.70%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 20346 220 5370 204 98.34%
pcapkit/toolkit 961 28 342 10 96.32%
pcapkit/utilities 506 7 144 5 98.15%
pcapkit/vendor 5009 2222 1148 182 52.31%

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

@github-actions github-actions Bot added this to the PyPCAPKit v1.6 milestone Nov 2, 2026
@JarryShaw
JarryShaw merged commit 253827c into main Nov 2, 2026
65 checks passed
@JarryShaw
JarryShaw deleted the refactor/2555-registry-missing branch November 2, 2026 02:31
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Nov 2, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Nov 2, 2026
JarryShaw added a commit that referenced this pull request Nov 2, 2026
…s latest wave into 1.6.0 (#2449)

- Added: every whole HTTP/2 frame in a TCP segment is a further HTTPv2
  layer, the previous frame's payload, as with TLS (#2609).
- Folded into unreleased entries: SSLv3 lives in
  pcapkit.protocols.application.sslv3 (#2602), and a reassembled DTLS
  Datagram's packet holds the deferred handshake decode (#2605).
  tls.SSLv3 is in no release tag, so the entry records no move.
- Changed: the remaining xdist jobs at -n logical (#2606) join the CI
  entry, and the member-order entry cites the last reorder (#2613).
- No entry for the test-only #2611 and #2612, or for #2610's private
  registry sentinel, which changes no behaviour.
- CHANGELOG.md regenerated; util/changelog_md.py --check passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

refactor(foundation): foundation.registry's _MISSING = object() bypasses the sentinel convention

1 participant