docs(protocols): state the rulings behind mh, vendor and exceptions in our own words - #991
Conversation
…n our own words Refs #987, #719. - mh.py: four docstring passages quoted the maintainer; restate the ruling on #935 (delete both get overrides rather than widen them) and what it bought. - vendor/__main__.py: restate the #872 snapshot-and-revert ruling and the keep-zero-exited-targets rule instead of quoting them. - utilities/exceptions.py: restate the stdlib-shaped exception ruling carried out by #923. Docstrings only; token streams identical with string literals masked.
|
NEEDS CHANGES at Blocker:
So the lean predates #940 entirely and is what caused it to be opened as a widening attempt — it cannot have been given in review of it. The text also contradicts the sentence before it, which says the first attempt already widened. This pull request already carries the right form 260 lines later at Non-blocking, going in with it: a dangling modifier at Confirmed otherwise. Prose-only in all three files, and checked harder than by counts alone: masked-token sequences are byte-identical and the only six differing string tokens are each a class's or function's first statement, so no Two things the pull request under-claimed and should get credit for: the old prose mislabelled the discard instruction as the ruling's option (b), which was a different cron-workflow option, and it merged two rulings 2h19m apart into one. Also folding in a pre-existing defect in a file this already edits: The verdict carries over from |
The cross-review on #991 found mh.py placing the lean toward widening in a review that did not exist yet. Verified against the API: - the lean is comment 5901325827 on issue #935, 2026-09-29T23:57:26Z, given on the issue itself rather than in any review; - the reversal is comment 5902590532 on the widening attempt, 2026-09-30 T02:00:58Z; - that attempt's earliest comment of any kind is 2026-09-30T01:45:20Z, so the lean predates it by 1h47m48s and is what caused it to be opened. The passage now reads as an earlier lean on the issue, overtaken by a later ruling in review of the attempt, matching the form this file already used 260 lines further down. - The trailing clause at the two sibling sites could attach to either verb, and only the widening was ever preferred; reworded so it cannot invert. - exceptions.py named the #877 re-parenting adjacent to the issue that did not carry it out. #877's phase 2 is the half the ruling was reviewed on. - vendor/__main__.py cross-referenced Vendor._write_atomic with :meth:, which resolves to nothing: git grep finds the method nowhere under pcapkit/vendor/ on this branch or on main, and the same sentence says it was deleted. Now a plain literal. - Re-flowed the five touched paragraphs; remaining short lines are forced by a following role too long to fit. Prose only: masked-token sequences identical in all three files, every differing string token is a docstring, and the AST with docstrings blanked compares equal. Maximum line length unchanged at 190/99/102. Tests: 52 passed / 499 subtests, and 121 passed / 104 subtests.
|
Fixed and pushed as The fix author independently confirmed the provenance table before writing: the lean is comment The mechanical item took two rounds. The first attempt moved the raggedness rather than removing it, leaving Verified by me rather than relayed: masked-token sequences identical in all three files, every differing string token is a docstring, and the AST with docstrings blanked compares equal. Maximum line length unchanged at 190 / 99 / 102. Tests reproduce: 52 passed / 499 subtests, and 121 passed / 104 subtests. One residual imprecision I am accepting rather than papering over, with the reasoning raised on #987: "#877's phase-2 re-parenting" does not uniquely identify where the ruling was reviewed, because phase 2 has two halves — #921 covered 17 of the 24 non-registry enumerations and #930 the remaining seven, and #930's half is cited two files away. Pinning it would mean naming the pull request, which the convention forbids. Label back to |
|
GOOD TO GO at My duration figure was wrong. I said the lean predates #940's earliest comment by 1h47m48s, here and in the commit message. From 2026-09-29T23:57:26Z to 2026-09-30T01:45:20Z is 1:47:54. The conclusion is unaffected — the lean still precedes the pull request it caused — but the number as published was not the number I measured. My "every remaining short line is token-forced" claim was overbroad. True for Independently verified at this head, beyond what I had: all three token counts reproduced exactly (31432 / 1146 / 556), sequences identical, ASTs equal with docstrings blanked, and every differing string token confirmed a docstring by position. The role multiset is unchanged except the intended one-for-one Two residual items, neither blocking and neither in this pull request's file set to fix:
Labelling |
tests/vendor/test_vendor_snapshot_restore_unit.py:14 and :58 carried :meth: roles pointing at Vendor._write_atomic. Nothing defines it: grep finds no `def _write_atomic` anywhere in the tree, and pcapkit/vendor/ default.py has no such method. Line 14 is the odder of the two, since the sentence it sits in says the method no longer exists while using a role that asserts it does. The history is sharper than "removed". `def _write_atomic` appears only in 6fde283 and a0748fb, both intermediate revisions of #873 that the squash dropped, so the method never reached main at all. Under pcapkit/ the only commit touching the name is that squash, 6877210, and what it added was the dangling role in __main__.py rather than the method -- #991 fixes that one. - Both roles become plain inline literals, so the prose still names the method without claiming a resolvable target. tests/ sits outside the Sphinx source tree, which is why neither emitted a build warning. A sweep of all 346 roles across tests/vendor/ found no other unresolved target. Prose only: both sites are inside the module docstring, which spans lines 2-165. Token sequences are identical with strings masked, the AST with docstrings blanked compares equal, and maximum line length stays 99.
Part of #987. Five quotations across two files become statements, and one citation is corrected from authority to provenance. sentinels.py's comment above ABSENT read "per GitHub issue #937" for the fact that ABSENT is private by documentation rather than by underscore. That is a what-changed statement, not a ruling attribution: #937 is the SCREAMING_SNAKE rename, and its own body attributes the ruling to #719, which carries it. Now written with an action verb naming the issue the change belongs to. - Module docstring: the one-shared-module choice on #911 stated rather than quoted, naming what it was chosen over. - NoDefaultType: the dedicated-class ruling and the unsettled-naming remark, both given in review of the work for #857, stated as what they settled. - AbsentType: the rename ruling on #719 stated, including that documenting ABSENT as private replaces the underscore. - tests/corekit: two "I prefer (2) directly" quotations become statements. The pull-request citations stay, since tests/ is exempt from the issue-citation rule per docs/source/contributing/conventions/documentation.rst:203-210, and the wording matches what landed for the same ruling in #991. Three other quoted spans are left alone deliberately: two are documentation section titles and one is a caveat the docstring makes about the code, none of them a maintainer's words. Prose only: token sequences identical with strings masked in both files, the AST with docstrings blanked compares equal, and maximum line length is unchanged at 98 and 121.
Part of #987. Five quotations across two files become statements, and one citation is corrected from authority to provenance. sentinels.py's comment above ABSENT read "per GitHub issue #937" for the fact that ABSENT is private by documentation rather than by underscore. That is a what-changed statement, not a ruling attribution: #937 is the SCREAMING_SNAKE rename, and its own body attributes the ruling to #719, which carries it. Now written with an action verb naming the issue the change belongs to. - Module docstring: the one-shared-module choice on #911 stated rather than quoted, naming what it was chosen over. - NoDefaultType: the dedicated-class ruling and the unsettled-naming remark, both given in review of the work for #857, stated as what they settled. - AbsentType: the rename ruling on #719 stated, including that documenting ABSENT as private replaces the underscore. - tests/corekit: two "I prefer (2) directly" quotations become statements. The pull-request citations stay, since tests/ is exempt from the issue-citation rule per docs/source/contributing/conventions/documentation.rst:203-210, and the wording matches what landed for the same ruling in #991. Three other quoted spans are left alone deliberately: two are documentation section titles and one is a caveat the docstring makes about the code, none of them a maintainer's words. Prose only: token sequences identical with strings masked in both files, the AST with docstrings blanked compares equal, and maximum line length is unchanged at 98 and 121.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
docs— documentation onlyDescription of your pull request and other information
Refs #987, #719. Group C of the quotation-to-statement conversion: nine quoted rulings in three files become statements with the reason and the issue cited, in the locative form (
a ruling given in review of the work for #NNN).pcapkit/protocols/internet/mh.py(4 passages, 6 quotes): fix(mh): two kept get overrides advertise the base default argument and reject it with TypeError #935 — bothgetoverrides deleted rather than widened; what that bought.pcapkit/vendor/__main__.py(1 passage, 2 quotes): python -m pcapkit.vendor exits 0 when a crawler raises, so a no-op regeneration looks like success #872 — snapshot-and-revert, keep zero-exited targets.pcapkit/utilities/exceptions.py(1 passage): stdlib-shaped exceptions, carried out by fix(corekit,utilities): raise pcapkit exceptions from EnumLookup.get, following stdlib Enum's shape #923.Docstrings only: token streams are identical before and after with string literals masked.
tests/protocols/internet/test_mh_unit.py52 passed / 499 subtests;tests/utilities/121 passed.