|
| 1 | +.. _const-vendor-pairing: |
| 2 | + |
| 3 | +Const-Vendor Pairing |
| 4 | +--------------------- |
| 5 | + |
| 6 | +**Every module under** :mod:`pcapkit.const` **is generated by a matching crawler |
| 7 | +under** :mod:`pcapkit.vendor`. A registry copied from an IANA, IETF or similar |
| 8 | +web-published table is never hand-maintained -- the crawler re-scrapes the source and |
| 9 | +regenerates the module, so a hand edit to the generated file is silently discarded on |
| 10 | +the next run. :issue:`2441`, raised in cross-review and knowingly deferred rather than |
| 11 | +fixed. |
| 12 | + |
| 13 | +The Exception |
| 14 | +~~~~~~~~~~~~~ |
| 15 | + |
| 16 | +**A source that is not a web-crawlable table is the one legitimate reason to hand-write |
| 17 | +a const module.** :class:`~pcapkit.const.linux.arphrd.ARPHRD`'s source is the Linux |
| 18 | +kernel header ``<linux/if_arp.h>``, not an IANA page, and its docstring says so plainly |
| 19 | +-- *"Only the values that pcapkit names are listed"* -- rather than claiming full |
| 20 | +coverage from a registry :mod:`pcapkit.vendor` could crawl. The ``EnumRegistry`` shape |
| 21 | +it was moved to on :pr:`2443` is a structural decision for API uniformity with every |
| 22 | +other registry, not a claim that a crawler produces the file. |
| 23 | + |
| 24 | +Known Violation |
| 25 | +~~~~~~~~~~~~~~~ |
| 26 | + |
| 27 | +:class:`~pcapkit.const.tls.content_type.ContentType` and |
| 28 | +:class:`~pcapkit.const.tls.handshake_type.HandshakeType` (:pr:`2441`) both cite a live |
| 29 | +IANA registry and claim to name every value IANA assigns, with no |
| 30 | +:mod:`pcapkit.vendor` crawler behind either one -- no ``pcapkit/vendor/tls/`` |
| 31 | +directory exists, and neither class appears in :data:`pcapkit.vendor.__all__`. This |
| 32 | +was flagged in that PR's own review and merged anyway on the stated reasoning that the |
| 33 | +crawler would follow later. Tracked as :issue:`2495`. |
0 commit comments