Skip to content

fix(hip)!: read REG_FAILED's Failure Type and Reg Types as RFC 8003 lays them out (#2309) - #2336

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2309-hip-reg-failed-model
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2309-hip-reg-failed-model

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style
  • make test passes, and a test case covers the change
  • Changelog entry: 1.5.0.rst (breaking change)

What is the purpose of your pull request?

  • fix — bug fix

Description

Closes #2309, per the ruling (take the recommendation). Breaking: lifetime is renamed with no alias.

  • Fix: RFC 8003 §4.5 lays out REG_FAILED as a Failure Type octet followed by Reg Type octets, with no lifetime. pcapkit read the first octet as a lifetime timedelta and decoded the Reg Types through the RegistrationFailure registry.
    • The schema, data model and maker now carry failure_type (a RegistrationFailure) in place of lifetime.
    • reg_type and reg_failed decode through the Registration registry.
    • The wire octets are unchanged.
  • Tests: test_hip_roundtrip_unit pins the parsed types, parse→rebuild over Failure Types 0–255 with several Reg Types, and make→parse octets.
  • Fail-without-fix: on origin/main, 7 failed, e.g. '03a8000300030100' != '03a8000302030100'. On the head, 44 passed.

@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw JarryShaw added breaking Breaks public-facing behaviour or API (apply alongside the type label) bug Issues reporting a defect (set by the bug report template; a default, not an assessment) 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 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at c75c8f120 (Sonnet).

  • RFC 8003 §4.5, checked against the RFC text: REG_FAILED is a Failure Type octet followed by Reg Types, with no lifetime. failure_type uses RegistrationFailure, and reg_failed uses Registration, like REG_INFO, REG_REQUEST and REG_RESPONSE.
  • Byte-exact: parse→rebuild over Failure Types 0, 1, 2, 3, 9, 201 and 255, plus make→parse. No lifetime attribute or keyword remains, and no leftover reference was found repo-wide.
  • Changelog: a breaking-change bullet is in 1.5.0.rst and CHANGELOG.md. The PR body's changelog box now says so.
  • Fail-without-fix: on origin/main, 7 failed across both test files (4 from the round-trip file alone). On the head, 51 passed.

@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 26, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 26, 2026
…ays them out (#2309)

RFC 8003 section 4.5 gives REG_FAILED a Failure Type octet followed by Reg
Type octets, and no lifetime. pcapkit read the first octet as a `lifetime`
timedelta and decoded the Reg Types with the RegistrationFailure registry.

Replace `lifetime` with `failure_type` (a RegistrationFailure) in the schema,
the data model and the maker, with no alias, and decode `reg_type` /
`reg_failed` with the Registration registry. The octets are unchanged.

Tests: test_hip_roundtrip_unit pins the parsed types, parse->rebuild over
Failure Types 0-255 with several Reg Types, and make->parse octets.
@JarryShaw
JarryShaw force-pushed the fix/2309-hip-reg-failed-model branch from c75c8f1 to 4ec3e1d Compare October 26, 2026 22:32
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased c75c8f120 → 4ec3e1d17 onto main bfe184bd6. The patch-id is identical, so the GOOD TO GO verdict carries over to the new head.

The old head's Project tests failed on test_no_test_calls_unparse_outside_a_version_gate. That was not this PR. It came from main's #2306 scan test, which called ast.unparse outside a version gate; bfe184bd6 fixes it on main, and CI is re-running on the new head.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, 4ec3e1d17, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 3023 23 1044 25 98.82%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17438 218 4586 185 98.15%
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 9dd46d8 into main Oct 26, 2026
61 checks passed
@JarryShaw
JarryShaw deleted the fix/2309-hip-reg-failed-model branch October 26, 2026 23:44
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased 4ec3e1d17 → fa1dd3c83 onto main b7b02c0fa. The patch-id is identical to the old head, so the rebase applied every hunk — including the CHANGELOG.md/1.5.0.rst additions — with no textual conflict against #2312's entry.

The old head's CI was green (Required checks passed SUCCESS, 0 failures, KTLO clean, protocols ordering leg 1946 tests / 0 failures). On the new head: test_hip_roundtrip_unit.py, test_hip_unit.py, tests/test_docstring_contract.py and tests/test_tier_guard.py give 187 passed, and util/changelog_md.py --check passes.

The patch is unchanged and the old head was already green, so the owner can bypass checks and merge once the new head's CI completes.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Correction to my own comment above: you had already merged this (as 9dd46d8d4) while I was rebasing it, so the "rebase" and the force-push after it landed on an orphan branch ref and changed nothing merged. Sorry for the noise — no action needed here.

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) bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(hip): REG_FAILED reads Failure Type as a lifetime and its Reg Types as failure types

1 participant