Skip to content

docs(corekit): say which generated registries bound their width (#2178) - #2192

Merged
JarryShaw merged 1 commit into
mainfrom
docs/2178-enumfield-notes
Oct 25, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/2178-enumfield-notes

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • docs — documentation only

Description

Closes #2178.

  • Defect: EnumField.post_process's Notes said only the bit-flag registries bound their width, and that none backs a plain EnumField. In fact most generated _missing_ guards range-check the value. Plain registries such as ipv4.option_number.OptionNumber back plain EnumFields in the IPv4 schema.
  • Fix: the Notes say which registries bound their width, and that it is harmless: the out-of-width rejection is the bare ValueError the method already falls back on. The same false claim in test_an_in_library_rejection_is_not_absorbed's docstring is corrected to match.
  • Scope: docstring-only; with docstrings stripped, both files have the same AST as main. OptionNumber(300) raises a plain ValueError, and a two-byte EnumField over it resolves 300 to the unassigned pseudo-member.
  • Tests run: the docstring contract and EnumField tests pass (30).

The Notes of EnumField.post_process, and a docstring in
tests/corekit/test_fields_numbers_unassigned_enum.py, said only the
bit-flag registries bound themselves to a width and that none of those
backs a plain EnumField. Most generated _missing_ guards range-check the
value, plain registries such as ipv4 OptionNumber included, and those are
plain EnumField namespaces.

Say so, and that it is harmless because the out-of-width rejection is the
bare ValueError the method falls back on.

Docstrings only: the docstring-stripped AST of both files is unchanged.
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 25, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at 6d273b2ce (Sonnet): every claim in the new Notes checks out against the generated _missing_ bodies and post_process, OptionNumber backs a plain EnumField in the IPv4 schema, and with docstrings stripped both files have the same AST as main.

@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 25, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 25, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at 6d273b2ce. Merging closes #2178.

  • Review: Sonnet GOOD TO GO.
  • CI: Required checks passed SUCCESS, 0 failed. Only the board's Sync Status and the non-gating Python graalpy-25.4 (experimental) leg is still open.
  • KTLO: 12 legs, no warnings.
  • Ordering: corekit leg merged into main: 912 tests, 0 failures.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.55% (unit tier, Python 3.15, 6d273b2ce, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 880 2618 866 92.12%
pcapkit/corekit 2589 75 816 37 96.48%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2971 23 1036 25 98.80%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17418 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

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

@JarryShaw
JarryShaw merged commit 67018fa into main Oct 25, 2026
67 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 25, 2026
@JarryShaw
JarryShaw deleted the docs/2178-enumfield-notes branch October 25, 2026 14:57
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 25, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

docs(corekit): EnumField.post_process Notes misstate which registries bound themselves to a width

1 participant