Skip to content

refactor(corekit)!: move utilities.decorators into corekit, and state the corekit/utilities rule (#1712, option A) #1735

Closed

Description

@JarryShaw

Describe the bug
Under the placement rule chosen on #1712 (option A), utilities holds cross-cutting services that import nothing from pcapkit outside utilities, and corekit holds the types the packet model is built from. pcapkit/utilities/decorators.py breaks that rule:

  • seekset, beholder and prepare act on Protocol._file and _seekset;
  • beholder lazily imports protocols.misc.null and protocols.misc.raw (decorators.py:130-132).

Expected behavior

  • The move: decorators.py moves to pcapkit/corekit/decorators.py, with no re-export left behind (the ruling on refactor(corekit)!: move the byte-order field helpers into corekit (#1711) #1715). Every importer updates its path: protocols/protocol.py, internet/internet.py, internet/ipv6.py, schema/schema.py, plus the tests and docs.
  • What breaks: pcapkit.utilities.{seekset,beholder,prepare} and the logger name pcapkit.utilities.decorators. Subject refactor(corekit)!:, labelled breaking.
  • No new import cycle: the module's top-level imports are only utilities.exceptions and utilities.logging. Do not re-export it from utilities/__init__.
  • Write the rule down: docs/source/contributing/conventions/ gains the rule, with a project test enforcing it: no module under pcapkit/utilities/ imports from pcapkit outside utilities, whether at top level, inside a function or under TYPE_CHECKING.

Blocked until #1730 merges. It also edits protocol.py's import lines.

Activity

  1. added
    breakingBreaks public-facing behaviour or API (apply alongside the type label)
    refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    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 14, 2026
  2. JarryShaw commented on Oct 14, 2026

    @JarryShaw
    OwnerAuthor

    #1730 has merged, so this is unblocked. A worker is on it.

  3. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 14, 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

    breakingBreaks public-facing behaviour or API (apply alongside the type label)refactorRestructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions