Skip to content

refactor(const,vendor): apply the mint/unmint criterion ruling to 82 registries (#775) - #861

Merged
JarryShaw merged 1 commit into
mainfrom
refactor/775-mint-criterion
Sep 27, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
refactor/775-mint-criterion

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style (isort clean; pylint 10.00/10 on the two most complex changed files; no new mypy errors attributable to this diff)
  • make test passes, and a test case covers the change — ran unittest discover on tests/const (170), tests/vendor (86) and tests/test_tier_guard.py (107), all green; did not run the full suite (documented OOM risk on this tree)
  • Added a changelog entry — N/A, changelog centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657

What is the purpose of your pull request?

  • refactor — changes neither behaviour nor performance... except where the owner's ruling says it must

Description

Applies the owner's mint/unmint criterion (settled on #847, confirmed on #775: "a final concrete assigned name -> mint; a notation for the readers -> unmint") to every one of the 89 _missing_ bodies still calling extend_enum on this tree.

Classification. 82 registries convert wholly (172 branches): every one mints a bare status word — Unassigned, Reserved [...], Reserved for Private/Experimental Use, Unspecified in the IANA registry, Deprecated and similar — which is a notation for the reader, not an assignment. Two registries are mixed:

  • EtherType: DEC Unassigned (3 branches) and the historical list's own "Old Xerox Experimental values. Invalid as an Ethertype since 1983." (1 branch) convert; every attributed vendor-company block (Xyplex, Motorola, Walker Richer & Quinn, ~45 more) keeps minting, because a proprietary protocol has no public name, so the company name is the best name that will ever exist for that code.
  • Socket (ipx): Experimental, Dynamically Assigned Socket Numbers, Statically Assigned Socket Numbers and Dynamically Assigned convert — each names an allocation policy for the pool, not a specific assignment; Registered by Xerox keeps minting — a real ownership fact, not a status placeholder.

7 of the 89 are untouched: CGAType's Tag_<hex> mint is not an IANA-style range at all (CGA extension type tags are collision-avoidance random 128-bit values), so the ruling never applied; the other 6 files sit on 9 classes that do not inherit EnumRegistry yet (AppType, StatusCode, ftp.return_code, ftp.command, Method, OptionType) and so have no _unregistered_member to convert to until #860 lands (blocked on #859) — left alone here.

Implementation. Each conversion touches both the vendor crawler under pcapkit/vendor/ and the generated file under pcapkit/const/, per #838's/#858's precedent, so a regeneration is a no-op. Proved on a 5-file sample spanning both crawler shapes (a per-row loop and a hardcoded single-line template) and both mixed registries: ipv4/tos_del.py, ipx/socket.py, reg/ethertype.py, mh/access_type.py, mh/status_code.py — all regenerate byte-identical (md5sum match before/after).

Tests. tests/const/test_const_enum_no_mint.py gains the ruling-derived registry lists (RULING_CONVERTED_REGISTRIES, RULING_CONVERTED_WITH_REACHABLE_GAP) and both behavioural and source-level coverage for all 82+2, citing #775/#847; its docstring's stale "~92 registries still mint" is corrected to the measured 89. Fixed collateral breakage this conversion caused in three sibling test files that had pinned the pre-ruling mint behaviour for ProtectionAuthority, TransType and four of Socket's ranges.

Open question for the maintainer

docs/source/conventions.rst (landed on main after this branch was cut) lists ipx.socket's Registered by Xerox range under "Unmint" in its worked examples. This PR keeps it minting, per the ruling as relayed to me for this batch ("keep the company one [Registered by Xerox]"). Flagging the apparent conflict rather than resolving it either way — the doc prose may need a follow-up once this is confirmed.

@JarryShaw JarryShaw added refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix) const Regenerated IANA or vendor constant tables; members keep their numeric values breaking Breaks public-facing behaviour or API (apply alongside the type label) review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Sep 27, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

NEEDS CHANGES on 4343004d3 — CI, not the cross-review. Three tests fail on every Compat Python 3.10–3.14 leg (and so Required checks passed); all five legs and the aggregate are one defect, not six.

Two test files still assert the minting this PR removes, and neither is in the diff:

  • tests/corekit/test_fields_numbers_unassigned_enum.py:199 — expects BlockType(0x0bad0bad).name == 'Reserved_0bad0bad', gets 'Reserved'. Correct per the ruling (Reserved is a procedure word), so the assertion and its docstring rationale are what need updating — and the value pin (int(member) == 0x0bad0bad) should be added, since the name no longer carries it.
  • tests/protocols/misc/test_pcapng_unit.py:2049 (2 methods) — AttributeError: Unassigned_0, from FilterType.Unassigned_0 by attribute name. That member only ever existed because of the import-time mint at pcapkit/protocols/misc/pcapng.py:4593, which this PR removes on purpose; FilterType.__members__ is now genuinely empty.

No pcapkit/ failure surfaced — both are collateral test updates, not a library break.

Also: the base is behind main (now 6b333d7e4), so rebase before the next push. The stale Registered by bullet in conventions.rst the review flagged is fixed on main as 6b333d7e4 — the code here was right and the doc was wrong.

Cross-review (opus) was otherwise GOOD TO GO: 172/82 re-derived exactly, 781 non-EnumRegistry branches untouched with per-class parity, all 5 vendor crawlers regenerate byte-identically, zero mis-converted labels in either direction, and the FilterType import-mutation claim confirmed sharper than stated. Its two follow-ups are now #862 and the doc fix above.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Sep 27, 2026
@JarryShaw
JarryShaw force-pushed the refactor/775-mint-criterion branch from 4343004 to fa228c4 Compare September 27, 2026 21:40
@JarryShaw

Copy link
Copy Markdown
Owner Author

Fixed and rebased — new head fa228c421, still one commit, now 171 files on top of 6b333d7e4.

The three CI failures were both collateral test pins, as diagnosed. Verified by me in my own worktree with the tree assertion printed (pcapkit.__file__ inside the scratch tree, editable finder evicted):

  • tests/corekit/test_fields_numbers_unassigned_enum.py — BlockType(0x0bad0bad) measured as <BlockType.Reserved: 195890093>, name Reserved, int() 0xbad0bad, not in __members__ or _value2member_map_, and the registry snapshot is identical before and after the lookup. Assertion changed to 'Reserved' plus a new int(resolved) == 0x0bad0bad, so the value stays pinned now that the name no longer carries it.
  • tests/protocols/misc/test_pcapng_unit.py — 4 × FilterType.Unassigned_0 → FilterType(0), which resolves to <FilterType.Unassigned: 0> and leaves __members__ empty.

One finding worth recording, because it nearly produced a silent non-fix: the substitution alone fixed the AttributeError but pinned nothing — no surrounding assertion inspects the resolved member, only downstream fields (.expression, the duplicate-option guard). So assertEqual(FilterType(0).name, 'Unassigned') was added to each of the two methods, and with filter_type.py reverted to main both now fail 'Unassigned_0' != 'Unassigned'. Without that, the two tests would have passed on either tree.

Counts, plain unittest (no pytest-subtests undercount): 104 tests across the two fixed files, 0 failures, 1 skipped; tests/const/ 179 and tests/vendor/ 86 unchanged. Each fixed test proven to fail with its const file reverted.

Label back to review: pending — the earlier GOOD TO GO was pinned to 4343004d3. Re-review dispatched on the same head.

@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Sep 27, 2026
…registries (#775)

- classify every one of the 89 `_missing_` bodies still calling `extend_enum`
  against the owner's ruling on #775/#847: a final concrete assigned name
  mints, a notation for the reader (Unassigned/Reserved/Deprecated/etc.)
  unmints
- convert 82 registries wholly and two more (`EtherType`, `Socket`) partially,
  172 branches total, from `extend_enum` to `_unregistered_member`, in both
  the vendor crawler and the generated const file, following #838's/#858's
  precedent; proved a 5-file sample (Form-A and Form-B crawlers, both mixed
  registries) regenerates byte-identically
- leave 89-82=7 untouched: `CGAType`'s mint is not an IANA-style range at all,
  and 6 files sit on classes without `EnumRegistry` yet (`AppType` and
  friends), tracked separately by #860 pending #859
- extend `tests/const/test_const_enum_no_mint.py` with the ruling-derived
  registry lists and behavioural/source coverage for all 82+2, correct its
  stale "~92 still mint" docstring to the measured 89, and fix collateral
  breakage in three sibling test files and `tests/vendor/test_ipx_socket_
  unit.py` that pinned the pre-ruling mint behaviour

- fix the last two collateral pins the ruling invalidates, in files the first
  pass missed and CI caught: `tests/corekit/test_fields_numbers_unassigned_
  enum.py` expected `BlockType(0x0bad0bad).name == 'Reserved_0bad0bad'`, now
  `Reserved` with the value asserted explicitly since the name no longer
  carries it; and `tests/protocols/misc/test_pcapng_unit.py` read
  `FilterType.Unassigned_0` by attribute, a member that existed only because
  of the import-time mint at `pcapkit/protocols/misc/pcapng.py:4593` which
  this change removes

Build: plain `unittest` on tests/const (179), tests/vendor (86),
tests/corekit/test_fields_numbers_unassigned_enum.py (11) and
tests/protocols/misc/test_pcapng_unit.py (92 + 1 skipped) all green; both
newly-fixed files fail with their const file reverted to main.
@JarryShaw
JarryShaw force-pushed the refactor/775-mint-criterion branch from fa228c4 to 1285d06 Compare September 27, 2026 21:51
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO — round-2 cross-review (opus, author sonnet) on fa228c421, plus the one-word amend it asked for. New head 1285d06d7, one commit, 171 files; git merge-base --is-ancestor origin/main HEAD true.

The claim I flagged as unreproduced is now confirmed, by a four-cell experiment. With pcapkit/const/pcapng/filter_type.py the only file moved:

cell state result
A head as-is Ran 2 tests … OK
B filter_type.py reverted to main FAILED (failures=2)
C reverted and the two added assertEqual lines deleted Ran 2 tests … OK
D test file restored, still reverted FAILED (failures=2)

Cell C is the measurement: the FilterType.Unassigned_0 → FilterType(0) substitution on its own passes on either tree and pins nothing. The two added assertEqual(FilterType(0).name, 'Unassigned') lines are the entire pin, failing 'Unassigned_0' != 'Unassigned' at :787 and :1910. Cell D rules out residue. Sharper framing from the review: the old attribute access was itself an accidental assertion that importing pcapkit had minted that member — it pinned the very side effect the ruling removes.

Also independently re-derived at this head: BlockType(0x0bad0bad) → <BlockType.Reserved: 195890093>, all six properties, _value2member_map_ checked separately from __members__, registry unmutated (third agreement); pcapng.py:4593's default argument read back via inspect.signature still resolves, so the library was never broken; all 5 crawlers still regenerate byte-identically after the rebase; the AST walk gives round-1's numbers unchanged (120 _missing_ classes, EnumRegistry extend=54 unreg=221, non-EnumRegistry extend=781 unreg=0, KEEP set intact). Seven touched test files, plain unittest: 234 tests, OK, 1 pre-existing environment skip.

Nothing narrowed in either fixed file — the old single assertion carried two facts in its name suffix, and the new pair splits them into name and value.

The amend is the review's one non-blocking nit: tests/corekit/test_fields_numbers_unassigned_enum.py:185 still said _missing_ "extends" one sentence before saying the range no longer mints — the exact verb for the behaviour this PR removes. Changed to "covers"; 11 tests still pass. That is the only delta from fa228c421, so the verdict carries.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Sep 27, 2026
@JarryShaw
JarryShaw merged commit 70fa920 into main Sep 27, 2026
63 checks passed
@JarryShaw
JarryShaw deleted the refactor/775-mint-criterion branch September 27, 2026 22:06
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Sep 27, 2026
JarryShaw added a commit that referenced this pull request Sep 27, 2026
…ing _missing_ (#866)

- `pcapkit/vendor/pcapng/{record_type,secrets_type}.py` rendered a two-line
  `_missing_` body whose first line called `_unregistered_member` without
  returning it and whose second was `return cls(value)`. That was harmless
  while the first line was `extend_enum`, which registers the member so the
  following lookup found it; #861 replaced it with `_unregistered_member`,
  which deliberately does not register, so the lookup missed again and
  re-entered `_missing_` until `RecursionError`
- collapse both to the single returning line the other 101 registries already
  use, and regenerate `pcapkit/const/pcapng/{record_type,secrets_type}.py`
  from the fixed crawlers
- add `tests/vendor/test_vendor_missing_body_unit.py`, a crawler-layer guard:
  every constant line a crawler emits into `miss` must `return`, none may be
  `return cls(value)`, and the sweep size is pinned at 35 so a crawler joining
  or leaving is deliberate. #861 fixed the generated files and not the
  generators, so the defect was latent until `e58618bdf` regenerated

Build: 6 new tests pass; all 6 fail with the four files reverted, as does
`tests/const/test_const_enum_lookup.py`, which is what caught this on main.
JarryShaw added a commit that referenced this pull request Sep 27, 2026
…ing _missing_ (#866)

- `pcapkit/vendor/pcapng/{record_type,secrets_type}.py` rendered a two-line
  `_missing_` body whose first line called `_unregistered_member` without
  returning it and whose second was `return cls(value)`. That was harmless
  while the first line was `extend_enum`, which registers the member so the
  following lookup found it; #861 replaced it with `_unregistered_member`,
  which deliberately does not register, so the lookup missed again and
  re-entered `_missing_` until `RecursionError`
- collapse both to the single returning line the other 101 registries already
  use, and regenerate `pcapkit/const/pcapng/{record_type,secrets_type}.py`
  from the fixed crawlers
- add `tests/vendor/test_vendor_missing_body_unit.py`, a crawler-layer guard:
  every constant line a crawler emits into `miss` must `return`, none may be
  `return cls(value)`, and the sweep size is pinned at 35 so a crawler joining
  or leaving is deliberate. #861 fixed the generated files and not the
  generators, so the defect was latent until `e58618bdf` regenerated

Build: 6 new tests pass. With the four source files reverted, 4 of the 6 fail
(counted as methods, not subTest records): the self-recursive-lookup guard, the
named-pair guard, and both behavioural lookups. `test_the_sweep_size_is_pinned`
and `test_the_hard_coded_body_ends_in_a_return` pass either way -- the latter by
design, since #866's body ended on `return cls(value)`, which returns.
`tests/const/test_const_enum_lookup.py` also fails on the reverted tree, which
is what caught this on main. tests/vendor 92 and tests/project 156 green.
JarryShaw added a commit that referenced this pull request Sep 28, 2026
JarryShaw added a commit that referenced this pull request Sep 28, 2026
util/changelog_md.py regenerated from 1.5.0.rst; --check exit 0.
JarryShaw added a commit that referenced this pull request Sep 28, 2026
JarryShaw added a commit that referenced this pull request Sep 28, 2026
util/changelog_md.py regenerated from 1.5.0.rst; --check exit 0.
JarryShaw added a commit that referenced this pull request Sep 28, 2026
JarryShaw added a commit that referenced this pull request Sep 28, 2026
util/changelog_md.py regenerated from 1.5.0.rst; --check exit 0.
JarryShaw added a commit that referenced this pull request Oct 2, 2026
#719

Swept tests/ for owner-ruling quotes attributed to the wrong GitHub
thread, the same defect class #719 fixed under pcapkit/. Confirmed each
by grepping the quote's distinctive text against the cited thread's
body/comments; a hit elsewhere is a re-quote or a different thread's
own words, not the source.

- test_sentinel_exports_unit.py: the already-reported #937->#719 fix
  for AbsentType's privacy ruling.
- test_enum_lookup_reparent_930_unit.py (4 sites) and test_mh_unit.py:
  "I prefer (2) directly" and the question that drew it are in pull
  request #940's thread, not issue #935 -- #935 only carries the first
  ruling ("I lean on 1").
- test_vendor_snapshot_restore_unit.py: the contextlib/atomic-write
  ruling is in pull request #873's thread; issue #872 has zero
  comments.
- test_vendor_reg_apptype_generator_unit.py (2 sites): the "undefined
  direct uses 0" ruling is in pull request #874's thread, not issue
  #860 or #770.
- test_const_enum_no_mint.py (2 sites): the mint/unmint criterion was
  settled on pull request #847 and confirmed on #775 -- the reverse of
  what the text said, per #861's own description of the same ruling;
  and "Q1 - bare it is." is pull request #838's thread, not #775's.

One occurrence left unresolved rather than guessed at: the "Preserve
each branch's existing name argument..." quote (4 sites in
test_const_enum_no_mint.py, attributed to "#775's final round") does
not appear verbatim in #775, #847, or #878 (the implementing PR) by
body, comments, review comments, or commit message -- only a
paraphrase in #878's own PR description/commit message, which is the
author's prose rather than a quoted ruling. Flagged for the owner
rather than fixed.

tests/corekit/, tests/vendor/, tests/const/ pass (400/16, 118, 299
respectively, pcapkit.__file__ confirmed inside this worktree);
tests/protocols/internet/test_mh_unit.py passes standalone (52/0) --
the full directory has 5 unrelated pre-existing failures from
ungenerated examples/captures/ fixtures, untouched by this change.

Refs #719
JarryShaw added a commit that referenced this pull request Oct 2, 2026
…719)

Per #719's citation ruling (de-quote, never reproduce a verbatim quote that
may have come from outside GitHub):

- test_const_enum_no_mint.py (4 sites): a quotation attributed to "the
  owner's ruling, verbatim" never appears in #775, #847, #861 or #878 (or
  anywhere in the repo's comment corpus). Replaced with a paraphrase
  attributed to PR #878's own body, which carries the real design note in
  different words.
- test_sentinel_exports_unit.py / test_const_registry_protocol.py: a quote
  attributed to #911 silently dropped half of what the owner wrote on #719
  and swapped `__all__` for "users". Replaced with a paraphrase naming #719
  as where it was settled and #911 as the issue that carried it out.
- test_const_enum_no_mint.py / test_const_enum_builtin_parity.py (4 sites):
  a "verbatim" quote of #860 silently corrected the owner's typo ("entires"
  -> "entries"). Paraphrased, which drops the question of reproducing or
  flagging the typo.
- test_enum_lookup_reparent_930_unit.py: "the owner's final ruling there"
  had #935 as its nearest antecedent instead of #940; named #940 explicitly
  and paraphrased the adjacent quote.

Verified: ast.parse and reST markup pairing clean on every touched file;
tests/const (299 tests) and the targeted pytest sweep of all touched files
(261 passed, 2013 subtests) are green. tests/corekit's full discover run
shows 5 pre-existing failures in test_sentinel_exports_unit.py, confirmed
identical on the unedited originals -- a cross-file test-order dependency
unrelated to this change.
JarryShaw added a commit that referenced this pull request Oct 2, 2026
…quest (#719) (#982)

* docs(pcapkit,ci): cite the issue a defect belongs to, not the pull request (#719)

Per the owner's ruling on #719, replace every reference to a pull-request
number in pcapkit/** and .github/workflows/** comments and docstrings with
the issue it closed, or a description where no issue covers it.

- 92 real PR citations in pcapkit/ (93 was the estimate; the gap is RFC
  packet-diagram and hex-format-spec false positives, plus one cross-repo
  issue citation that only coincidentally matched a PyPCAPKit PR number).
- 13 PR citations in .github/workflows/, matching the estimate exactly.
- Several citations named two or three numbers for one claim where a PR
  closed several issues, or several PRs closed the same issue;
  deduplicated rather than left reading "#425 and #425".

Four review rounds caught the same category error recurring: several sites
had relocated a verbatim quote or a specific finding into the issue number
rather than describing where the ruling was actually given, so the quote
no longer existed where the sentence pointed. Fixed each by naming the
issue while locating the ruling honestly -- "a ruling given in review of
the work for #N" -- the same shape already used on this repo's conventions
docs. Two sites needed the inverse correction instead: the #923 quote in
enum.py/exceptions.py genuinely is recorded on #923's own thread, just
attributed there to the pull request that implemented it, so those read
"a ruling recorded on GitHub issue #923" rather than pointing elsewhere.
Also fixed a lost conjunction and an ordinal/number mismatch in
corekit/enum.py, a self-contradicting below/above pointer repeated across
three internet/ files, and a number collision in http.py where one issue
ended up naming both a defect and the change that closed it.

Final sweep: grepped the whole tree for the word "verbatim" -- the marker
that makes a quote-attribution claim falsifiable -- across all 30 files
under pcapkit/ that carry it, and checked every quote this way names
against the actual issue thread. Caught two more of the same defect:
vendor/__main__.py's #872 citation (the quote is in the implementing pull
request's review, not #872 itself) and four sites across mh.py
attributing to #935 a ruling that only exists in the review of the pull
request that implemented it -- #935's own thread holds just the
superseded widen-not-delete proposal. Both fixed the same way. Every
other quote-bearing claim the sweep found -- #911, #937, three distinct
#877 quotes, both #842 quotes, and the #860/#808/#806/#886/#917 rewrites
from earlier in this pass -- resolves to the thread it names.

Verified: targeted pytest across every touched module passes, including
the test that pins the vendor/const apptype.py get() region as
byte-identical, reconfirmed after each amendment. Both edited workflow
YAML files parse before and after with unchanged key counts.

* docs(corekit): cite #719, not #937, for the AbsentType ruling

AbsentType's docstring attributed the owner's "document it as private
type/class... not for public use is enough" quote to #937. #937 itself
quotes that ruling verbatim under "The owner's ruling, verbatim (from
#719)" -- it re-attributes rather than originates it. Per the house
rule to cite the issue a ruling was settled on
(docs/source/contributing/conventions/documentation.rst:196-200), point
the attribution at #719 and re-wrap the paragraph to the file's
existing ~78-column width. The neighbouring, unrelated #937 citation
describing what #937 did to sentinel naming is untouched.

tests/corekit/ passes (400 passed, 16 skipped) against this worktree's
own pcapkit (confirmed via pcapkit.__file__); pylint on the file is
9.77/10, unchanged by this edit -- the one finding is a pre-existing,
unrelated too-few-public-methods warning on NoValueType.

* docs(tests): re-point six ruling citations at their actual threads, per #719

Swept tests/ for owner-ruling quotes attributed to the wrong GitHub
thread, the same defect class #719 fixed under pcapkit/. Confirmed each
by grepping the quote's distinctive text against the cited thread's
body/comments; a hit elsewhere is a re-quote or a different thread's
own words, not the source.

- test_sentinel_exports_unit.py: the already-reported #937->#719 fix
  for AbsentType's privacy ruling.
- test_enum_lookup_reparent_930_unit.py (4 sites) and test_mh_unit.py:
  "I prefer (2) directly" and the question that drew it are in pull
  request #940's thread, not issue #935 -- #935 only carries the first
  ruling ("I lean on 1").
- test_vendor_snapshot_restore_unit.py: the contextlib/atomic-write
  ruling is in pull request #873's thread; issue #872 has zero
  comments.
- test_vendor_reg_apptype_generator_unit.py (2 sites): the "undefined
  direct uses 0" ruling is in pull request #874's thread, not issue
  #860 or #770.
- test_const_enum_no_mint.py (2 sites): the mint/unmint criterion was
  settled on pull request #847 and confirmed on #775 -- the reverse of
  what the text said, per #861's own description of the same ruling;
  and "Q1 - bare it is." is pull request #838's thread, not #775's.

One occurrence left unresolved rather than guessed at: the "Preserve
each branch's existing name argument..." quote (4 sites in
test_const_enum_no_mint.py, attributed to "#775's final round") does
not appear verbatim in #775, #847, or #878 (the implementing PR) by
body, comments, review comments, or commit message -- only a
paraphrase in #878's own PR description/commit message, which is the
author's prose rather than a quoted ruling. Flagged for the owner
rather than fixed.

tests/corekit/, tests/vendor/, tests/const/ pass (400/16, 118, 299
respectively, pcapkit.__file__ confirmed inside this worktree);
tests/protocols/internet/test_mh_unit.py passes standalone (52/0) --
the full directory has 5 unrelated pre-existing failures from
ungenerated examples/captures/ fixtures, untouched by this change.

Refs #719

* docs(tests): paraphrase four fabricated or altered owner quotations (#719)

Per #719's citation ruling (de-quote, never reproduce a verbatim quote that
may have come from outside GitHub):

- test_const_enum_no_mint.py (4 sites): a quotation attributed to "the
  owner's ruling, verbatim" never appears in #775, #847, #861 or #878 (or
  anywhere in the repo's comment corpus). Replaced with a paraphrase
  attributed to PR #878's own body, which carries the real design note in
  different words.
- test_sentinel_exports_unit.py / test_const_registry_protocol.py: a quote
  attributed to #911 silently dropped half of what the owner wrote on #719
  and swapped `__all__` for "users". Replaced with a paraphrase naming #719
  as where it was settled and #911 as the issue that carried it out.
- test_const_enum_no_mint.py / test_const_enum_builtin_parity.py (4 sites):
  a "verbatim" quote of #860 silently corrected the owner's typo ("entires"
  -> "entries"). Paraphrased, which drops the question of reproducing or
  flagging the typo.
- test_enum_lookup_reparent_930_unit.py: "the owner's final ruling there"
  had #935 as its nearest antecedent instead of #940; named #940 explicitly
  and paraphrased the adjacent quote.

Verified: ast.parse and reST markup pairing clean on every touched file;
tests/const (299 tests) and the targeted pytest sweep of all touched files
(261 passed, 2013 subtests) are green. tests/corekit's full discover run
shows 5 pre-existing failures in test_sentinel_exports_unit.py, confirmed
identical on the unedited originals -- a cross-file test-order dependency
unrelated to this change.

* test(vendor,corekit): fix a surviving fabricated ruling and a wrong citation (#719)

- tests/vendor/test_ipx_socket_unit.py: the "owner's ruling" attribution for
  keeping the hex-suffixed Xerox name survived in this file after the prior
  commit removed the same false attribution from four sites in
  test_const_enum_no_mint.py. Reworded to credit PR #878's own design note,
  matching the wording already used at the repaired sites.
- tests/corekit/test_sentinel_exports_unit.py: the docstring cited the #719
  export ruling ("only export objects, not types") as grounds for keeping
  ABSENT out of __all__, but ABSENT is an object, so that ruling argues for
  including it, not excluding it. Re-grounded the sentence on the privacy
  ruling already quoted ~15 lines below instead, without re-quoting it.

Both changes are prose-only: tokenizing each file before and after with
comments and docstrings stripped produces identical token sequences.
tests/vendor passes 118/118 except one pre-existing, test-order-dependent
flake in test_vendor_snapshot_restore_unit.py (reproduces identically on the
pre-edit tree); tests/project/test_conventions_doc_claims.py passes 38/38.

* test(corekit,const): narrow the blanket paraphrase, restoring quotations that cite correctly (#719)

The last two commits paraphrased every disputed owner quotation away.
That was right for one case and wrong for two: a quotation that exists
nowhere has to be paraphrased, but a quotation that is real and was
only cited to the wrong thread lost its audit trail for nothing, since
the defect was the pointer, not the words. Per the owner's ruling,
narrow the fix to match.

Restored as quotations, correctly cited:

- tests/corekit/test_sentinel_exports_unit.py (~L4-7) and
  tests/const/test_const_registry_protocol.py (~L1363): the sentinel
  export rule, split back into its two real sources instead of one
  spliced sentence -- #719's "we should ONLY export the objects ...
  and leave the types ... out", and #911's own "we only expose the
  final objects to users", with #911 noted as both executor and
  source.

- tests/const/test_const_enum_no_mint.py (~L88, ~L1876, ~L2363) and
  tests/const/test_const_enum_builtin_parity.py (~L655): the #860
  minting ruling, including its load-bearing first sentence ("I think
  we should not mint on get still actually") and the owner's own
  "entires" typo, marked [sic] rather than silently corrected.

Left alone: the four #878 fabricated-quote sites in
test_const_enum_no_mint.py, which cite no real thread and stay
paraphrased, and the ABSENT privacy sentence, which is a correct
paraphrase of a different ruling.

Verified: ast.parse and reST markup clean on all four files; code
token sequences (docstrings/comments stripped) identical before and
after; each restored quotation substring-matches its source comment
after whitespace/markup normalisation. tests/const: 299 OK. tests/
project/test_conventions_doc_claims: 38 OK, 1 skipped.

* test(corekit,const): convert restored quotations to statements with context, per #719

The previous commit restored eight verbatim quotations to fix a narrowing
that had dropped their context. The owner has since ruled that neither
form is right: a narrowed paraphrase without context does not help a
reader who was not in the thread, but a verbatim quotation makes the
docstring read as a discussion rather than documentation.

- Sentinel export rule (corekit/test_sentinel_exports_unit.py,
  const/test_const_registry_protocol.py): state that a module's `__all__`
  lists a sentinel's object but deliberately leaves its type out, and why
  (the type is not part of the public surface), citing #719 as where it
  was settled and #911 as where the implementing work belongs.
- #860 minting rule, four sites (const/test_const_enum_no_mint.py x3,
  const/test_const_enum_builtin_parity.py): state that `get()` must not
  mint and only `register()` creates a new entry, and why (only
  IANA-registered values are legitimate and `get()` lacks the information
  to construct one), citing #860. Each site is fitted to its own
  surrounding prose rather than one paragraph pasted four times. Drops
  the `[sic]` each quotation carried, since there is nothing left to
  reproduce.
- Fixed two sentences left orphaned by the quotations' removal: an
  antecedent ("the three") that depended on the deleted quote's wording,
  and a sentence whose "get() as well as _missing_" had the emphasis
  backwards relative to the rule's own subject.

The four PR #878 paraphrase sites in test_const_enum_no_mint.py were
already in this third form and are unchanged.

Verified: ast.parse on all four files; tokenize with comments and
docstrings stripped shows an identical token sequence before/after
(prose-only); tests/const (299) and tests/project/test_conventions_doc_claims.py
(38, 1 skip) pass; tests/corekit (400, 5 failures, 16 skipped) matches the
documented pre-existing sentinel-identity failures.

* test(corekit,const): state the remaining owner rulings in our own words, per #719

The four files still carried owner-attributed quotations beside the eight
converted earlier, so each read half as documentation and half as a thread.

- Replace each quoted ruling with a statement of the rule, the reason a
  reader needs, and the issue where it was given (#842, #864, #775, #860,
  #911, #719, #647, #808, #759, #857).
- Rename the dangling "privacy ruling quoted below" reference to point at
  the statement that replaced the quotation.
- Leave RFC text, code literals and ordinary prose untouched.

Prose only: tokens with comments and docstrings stripped are identical
before and after; tests/const 299 OK, tests/corekit unchanged (5 known).

* test(const): restore ruling citations to the pull requests that carry them, per #719

tests/ is exempt from the issue-citation rule (documentation.rst, ruled on
#719): the fact cited lives in the pull request, not the issue.

- PR #836 restored for the TransportProtocol-extension refusal, the
  |-composite decoding retirement, and the stale-comment deletion; the
  rulings are not on #808 at all.
- PR #783 for the f-string convention; PR #847 for the mint criterion.
- The de-quotation stands: wording stays as statements, no quotation marks.
@JarryShaw JarryShaw added this to the 1.5 milestone Oct 6, 2026
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) const Regenerated IANA or vendor constant tables; members keep their numeric values refactor Restructuring for its own sake — neither a fix nor a new capability (refactor: prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant