Skip to content

Commit 09126cd

Browse files
committed
docs(contributing): record the const-vendor pairing ruling
1 parent b915586 commit 09126cd

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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`.

‎docs/source/contributing/conventions/index.rst‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ House Conventions
2727
:mod:`pcapkit.corekit` a support module belongs in;
2828
* :ref:`reassembly-integration` -- :mod:`pcapkit.foundation.reassembly` and what a
2929
new engine there needs from :mod:`pcapkit.toolkit` and
30-
:mod:`pcapkit.foundation.analysis`.
30+
:mod:`pcapkit.foundation.analysis`;
31+
* :ref:`const-vendor-pairing` -- :mod:`pcapkit.const` and the
32+
:mod:`pcapkit.vendor` crawler each module needs.
3133

3234
**A ruling that stays in its thread is a ruling that gets rediscovered.** So
3335
when a question is answered in a way the code cannot express on its own -- a
@@ -52,3 +54,4 @@ House Conventions
5254
test-coverage
5355
utilities-or-corekit
5456
reassembly-integration
57+
const-vendor-pairing

‎tests/project/test_conventions_doc_claims.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
'test-coverage',
122122
'utilities-or-corekit',
123123
'reassembly-integration',
124+
'const-vendor-pairing',
124125
)
125126

126127
#: Each anchor's own file, one-to-one -- there is no shared page to slice between

0 commit comments

Comments
 (0)