Skip to content

fix(const)!: name LLACode codes 0 and 2 as RFC 5568 does (#1848) - #1872

Merged
JarryShaw merged 1 commit into
mainfrom
fix/1848-llacode-wildcard
Oct 17, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/1848-llacode-wildcard

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

  • Rename LLACode.Wilcard to Wildcard and LLACode.MH to MN, in the
    hand-written vendor table and the generated module alike. No alias keeps
    either old name: this is a breaking rename.
  • Give the LLACode crawler its own template, so the generated class
    docstring carries a versionchanged:: 1.5.0 note on both renames; the
    const docs page carries the same note.
  • Point the MH-LLA option reader and builder, and their unit tests, at
    LLACode.MN.
  • Pin the new names, the absence of the old ones, and that the crawler
    renders the committed module byte for byte.

Closes #1848

Breaking: LLACode.Wilcard and LLACode.MH are gone with no alias, following the ruling on #1848 and the precedent of #1090 and #1715. LLACode now carries its own copy of the generator template, so that the class docstring can hold the rename note. That is the same pattern used for tcp/flags, http/status_code and ipv6/extension_header.

@JarryShaw JarryShaw added fix Pull requests that fix a defect (fix: subject prefix) breaking Breaks public-facing behaviour or API (apply alongside the type label) const Regenerated IANA or vendor constant tables; members keep their numeric values review: running A cross-review is in flight against the current head - no verdict yet labels Oct 16, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 660669d15. A Sonnet cross-review (author: Opus) confirmed:

  • No LLACode.Wilcard, LLACode.MH or Enum_LLACode.MH survives in pcapkit, tests, docs, examples, util or the changelogs.
  • The copied LINE differs from vendor.default.LINE only by the rename note, which is the same pattern as ftp/command, http/status_code and tcp/flags.
  • Running the real Vendor.__init__ offline renders a module byte-identical to the committed const/mh/lla_code.py.
  • RFC 5568 §6.4.3 names code 0 Wildcard… and code 2 Link-Layer Address of the MN.
  • The new tests fail on main's files.

Non-blocking:

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

Copy link
Copy Markdown
Owner Author

for vendor/const templates, no need to mention the version directives. they're meant to be updated automatically by the scripts so no version changed/added are necessary.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Understood. The scripts regenerate the vendor templates and the pcapkit/const/** files, so those get no version directives. I'll remove the versionchanged this PR adds to pcapkit/vendor/mh/lla_code.py and to the generated pcapkit/const/mh/lla_code.py. The note on the hand-written docs/source/pcapkit/const/mh.rst page stays, unless you'd rather drop that too.

Templates on main already carry such directives: ftp/command, http/method, ipv6/extension_header, pcapng/option_type, pcapng/tls_key_label, reg/apptype and tcp/flags, each mirrored in its const file. I'll file a follow-up to remove those as well. The #: notes on MAX_RETRY and PCAPKIT_CI_MODE in vendor/default.py document the crawler framework's own settings, not a template, so they stay.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 17, 2026
- Rename LLACode.Wilcard to Wildcard and LLACode.MH to MN, in the
  hand-written vendor table and the generated module alike. No alias keeps
  either old name: this is a breaking rename.
- Note both renames with versionchanged:: 1.5.0 on the const docs page. The
  generated module carries no version directive, as the crawler
  regenerates it.
- Point the MH-LLA option reader and builder, and their unit tests, at
  LLACode.MN.
- Pin the new names, the absence of the old ones and of any version
  directive in the generated docstring, and that the crawler renders the
  committed module byte for byte.

Closes #1848
@JarryShaw
JarryShaw force-pushed the fix/1848-llacode-wildcard branch from 660669d to 5003607 Compare October 17, 2026 02:35
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 17, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 5003607bc. A Sonnet cross-review checked the version-directive removal made per your ruling.

  • The deleted LINE template and context override matched vendor/default.py's, except for the directive. Run offline, the crawler renders the committed const/mh/lla_code.py byte for byte, now through the shared default.
  • Against main, the vendor and const files differ only by the renames to Wildcard = 0 and MN = 2. The MH reader and builder use LLACode.MN.
  • No version directive remains under pcapkit/vendor/** or pcapkit/const/**. The note on the hand-written docs/source/pcapkit/const/mh.rst page matches RFC 5568 section 6.4.3.
  • The tests that now pin the directive's absence fail if one is added back. The rename tests fail on the base.
  • test_mh_unit.py gave 52 passed; test_tier_guard.py and test_const_enum_no_mint.py also pass.

@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 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 90.05% (unit tier, Python 3.15, 5003607bc, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 2 20 2 96.77%
pcapkit/const 19595 881 2618 867 92.11%
pcapkit/corekit 2462 69 780 35 96.55%
pcapkit/dumpkit 276 3 100 3 98.40%
pcapkit/foundation 2914 164 1016 34 93.59%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17406 224 4580 189 98.10%
pcapkit/toolkit 872 177 298 8 77.18%
pcapkit/utilities 512 2 158 4 99.10%
pcapkit/vendor 4407 2342 1010 157 43.27%

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

@JarryShaw
JarryShaw merged commit bac1cf6 into main Oct 17, 2026
57 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 17, 2026
@JarryShaw
JarryShaw deleted the fix/1848-llacode-wildcard branch October 17, 2026 13:20
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaks public-facing behaviour or API (apply alongside the type label) const Regenerated IANA or vendor constant tables; members keep their numeric values fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(const): LLACode.Wilcard misspells RFC 5568's code 0, and LLACode.MH names code 2 differently from the RFC

1 participant