Skip to content

fix(const): AppType.register accepts a port outside 0–65535 #1792

Closed

Description

@JarryShaw

Describe the bug
TCP.register(70000, 'x') mints <TCP.x70000: 70000 [tcp]>, and -1 mints too. Afterwards AppType.get(70000, proto=tcp) returns that member, although get is documented (versionchanged:: 1.5.0, #758) to raise ValueError for an out-of-range port, and does so before the registration.

EnumRegistry.register validates through _validate_value (pcapkit/corekit/enum.py:530), but AppType.register (pcapkit/const/reg/apptype/apptype.py:2782, template pcapkit/vendor/reg/apptype/apptype.py:737) neither calls it nor overrides it.

Expected behavior
register rejects a port outside 0–65535, as get does, so a registration cannot make get accept a port it rejects.

Additional context
Found by the #1103 second pass (corekit slice) and confirmed by a Sonnet review.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 15, 2026
  2. JarryShaw commented on Oct 15, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until the #1103 second-pass corekit PR merges; it edits apptype.py in both const and vendor, which this fix also changes.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 15, 2026
  4. JarryShaw commented on Oct 15, 2026

    @JarryShaw
    OwnerAuthor

    The corekit second-pass PR is #1808. This issue stays blocked until #1808 merges.

  5. JarryShaw commented on Oct 15, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1808 has merged. A worker is on it.

  6. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 15, 2026
  7. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions