docs(const,vendor): fix RFC anchor typos and missing section- prefixes - #943
Conversation
|
NEEDS CHANGES at
The one change needed is a reversal of my own instruction. I told the author to leave any other malformed fragment alone, so it recorded the second one in a
So: fix both Keeping the best part of this as-is: the module docstring establishes from |
eeb4e62 to
36c50c2
Compare
|
Round 2 verified at
Two process notes worth recording rather than leaving implicit. This widening was my correction of my own brief, not a defect in the author's work — round 1 did exactly what I asked and I asked for the wrong thing. And the label swap needed three attempts: |
|
NEEDS CHANGES at The regex blesses 10 provably dead anchors — the exact defect class the test exists to prevent. The review recommended grandfathering these because fixing them "would require an IANA regeneration". It does not, which is why I am fixing instead. Traced: Two docstring claims are also wrong, both confirmed. "nitpicky mode only checks Round 3 is with the author: fix both generators, fix the 10 const lines, drop the bare alternative outright, and re-prove the census at 0 under the stricter regex. One correction to the review, and one to a framing of mine. It reported the 9 sites as being in I am widening this past what #942 literally names. I think that is right — the test found the defect, the fix is mechanical, and grandfathering 10 dead links inside the invariant meant to catch them repeats the |
36c50c2 to
ca41c6b
Compare
|
Round 3 verified at
The author also volunteered its reasoning on the scope question rather than just complying, and I agree with it: the 10 dead anchors were surfaced by the very test #942 asked for, and grandfathering them would have repeated the What the cross-review is specifically hunting, because it is the one thing neither of us can settle by reading the diff: both generators interpolate |
|
NEEDS CHANGES at My error first. I wrote above that the new test could not catch a generator emitting a bad fragment, since it reads only the generated tree. Wrong. The review enumerated what 1. 2. The invariant is shape-only, and the body reads as though it were anchor coverage. The review proved the gap with a live case: Filed as #944 rather than fixed here, because the fix is an editorial choice about what to cite instead — 3. The title is narrower than the change — still names only Everything else came back confirmed, independently: the 645/0 census, both corrected docstring claims against the real Sphinx source, and the loosened Two notes needing no action, recorded so nobody re-finds them: |
ca41c6b to
50c35bb
Compare
50c35bb to
480fdd1
Compare
|
GOOD TO GO at
One place I disagree with the cross-review, in the author's favour. It framed the sibling Three cross-reviews across four rounds, each on a model other than the Sonnet author: Fable found the |
FEATCode's class docstring cited :rfc:`5797#secion-3` -- "secion", missing
the "t" -- in pcapkit/vendor/ftp/command.py:68 (the LINE f-string template,
source of truth) and its generated copy pcapkit/const/ftp/command.py:28.
Sphinx's :rfc: role (sphinx.roles.RFC.build_uri) appends whatever follows
"#" verbatim with no validation, so this rendered a live link to a
non-existent anchor and no build warned.
- Fix both sites to :rfc:`5797#section-3` (RFC 5797 §3, Initial Contents
of Registry). Fix the same defect at a second site, Command's `feat`
attribute docstring, vendor:269/const:257, secion-2.2 -> section-2.2
(§2.2 Registry Format, verified against the RFC text as the section
that actually defines the "FEAT Code" column). get()'s correct
:rfc:`5797#section-2` is untouched.
- Add tests/project/test_rfc_anchor_fragments.py: walks every :rfc: role
with a `#` fragment across pcapkit/ and asserts each matches one of
Sphinx's own three known anchor prefixes -- section-N, appendix-X,
page-N (sphinx.roles._format_rfc_target) -- so the next typo fails a
test. Deliberately excludes the untitled/numberless shapes (bare
"introduction", bare "section") that same function also does not
error on: neither appears under pcapkit/ today, and accepting them
would trade shape validation for an open-ended anchor vocabulary.
Also pins both exact citations by site.
- The sweep's own first draft accepted a third shape, bare N[.N...], to
match 10 already-dead anchors in const/tcp/mp_tcp_option.py (RFC 8684)
and const/reg/apptype/tcp.py (RFC 8765) -- confirmed dead against the
real RFC 8684 HTML, which anchors sections as "section-3.1", never
"3.1". Traced to vendor/tcp/mp_tcp_option.py:59 and
vendor/reg/apptype/apptype.py:1146, both discarding the literal word
"Section" from IANA's "RFC8684, Section 3.1" via the same regex. Fixed
both generators to emit `#section-{sec}` and all 10 generated lines to
match; dropped the bare-N shape from the test's accepted set entirely.
- The invariant is shape-only: it does not check that an anchor actually
exists on the RFC's own page. :rfc:`959#section-4.1` is shaped
correctly and cited at 6 sites (4 in the two ftp/command.py files
here), but RFC 959 only has section-1 through section-8 -- a dead
link this test passes. Filed separately as #944; not fixed here.
isort clean; pylint identical to 9ea0d6a for every touched pair
(ftp/command.py 8.56/10, tcp/mp_tcp_option.py 9.85/10,
reg/apptype/{apptype,tcp}.py 9.98/10, zero message diff -- unchanged
between 1bd576e and 9ea0d6a for all six files). tests/project 198
passed, 1 skipped. Census: 645 total :rfc: fragments, 0 malformed.
480fdd1 to
daf6cb2
Compare
|
Carrying the GOOD TO GO forward to
The rebase is content-preserving, checked rather than assumed: every file in the merge-base delta is byte-identical by md5 between CI is re-running on the new head. I will confirm it lands clean before calling this ready to merge; it remains unpublished and yours. |
…tions (#944) RFC 959's rendered HTML carries only ``section-1`` through ``section-8``, so ``#section-4.1`` named an anchor that does not exist and rendered a live link to nothing. Per the maintainer's ruling on #944, all six sites now cite ``:rfc:`959#section-4```. - Retarget three template/generated pairs: ``pcapkit/{const,vendor}/ftp/ command.py`` (two sites each) and ``pcapkit/{const,vendor}/http/method.py`` (one each). Each string is a literal in the ``vendor/`` template, so both halves are hand-edited and the cited lines stay byte-identical; no crawl or regeneration is involved. - Add a ``KNOWN_DEAD_ANCHORS`` denylist and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead one, so this is a second, narrower check for the same defect class. It is offline by design: CI has no network, and the test's docstring states that a denylist proves nothing about a fragment it has never heard of. tests/project: 207 passed, 1 skipped, 562 subtests. The new test fails without the fix with ``DeadAnchorFinding(path='pcapkit/vendor/ftp/command.py', rfc=959, fragment='section-4.1')``.
RFC 959's rendered HTML carries anchors only for its eight top-level sections, ``section-1`` through ``section-8``, so **every** sub-numbered ``959`` fragment is a live link to nothing. Per the ruling on #944, they now cite the enclosing top-level section. - ``#section-4.1`` -> ``#section-4`` at eleven sites: the six in ``pcapkit/{const,vendor}/{ftp/command,http/method}.py`` #944 reported, plus four rendered roles in ``docs/source/contributing/conventions/registry-protocol.rst`` and one in ``tests/const/test_const_enum_no_mint.py``. The five extra sites predate this branch -- ``git log -S`` puts them at #913 (``1f4337e12``) -- and were found by the cross-review, not by #944's ``pcapkit/``-only grep. - ``#section-5.3`` -> ``#section-5`` at two more, in ``tests/protocols/application/test_ftp_unit.py`` and ``docs/source/changelog/1.5.0.rst``, cited for the case-insensitivity rule §5.3 does correctly name in prose. ``CHANGELOG.md`` regenerated with ``util/changelog_md.py`` for the second of those, one line. - The three ``pcapkit/`` template/generated pairs stay byte-identical on the cited lines; each string is a literal in the ``vendor/`` template, verified to contain no interpolation, so a regeneration reproduces the edit. No crawl was run. - Add ``KNOWN_DEAD_ANCHORS`` (both ``959`` fragments) and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead anchor, so this is a narrower second check for the same class. It scans ``pcapkit/``, ``docs/source`` and ``tests/`` rather than ``pcapkit/`` alone -- looking at one directory is what let five sites sit unnoticed -- and matches roles only, via a lookbehind, so a ``literal`` naming the defect stays writable. Offline by design: CI has no network. Prose left standing where it is still true: ``ftp/command.py``'s citations carry the command-*kind* claim, which §4 does support. ``http/method.py``'s carry a case-insensitivity claim that §4 does not; that is #947's question, deliberately not widened into here. tests/project: 207 passed, 1 skipped, 562 subtests. tests/protocols/application/test_ftp_unit.py + tests/const/test_const_enum_no_mint.py: 79 passed, 602 subtests. Each new assertion was shown to fail without its fix, including from a ``docs/`` site the pre-widening scan could not see.
RFC 959's rendered HTML carries anchors only for its eight top-level sections, ``section-1`` through ``section-8``, so **every** sub-numbered ``959`` fragment is a live link to nothing. Per the rulings on #944 and #947, they now cite the section that supports the claim they carry. - ``#section-4.1`` -> ``#section-4`` at eleven sites: the six in ``pcapkit/{const,vendor}/{ftp/command,http/method}.py`` #944 reported, plus four rendered roles in ``docs/source/contributing/conventions/registry-protocol.rst`` and one in ``tests/const/test_const_enum_no_mint.py``. The five extra sites predate this branch -- ``git log -S`` puts them at #913 (``1f4337e12``) -- and were found by cross-review, not by #944's ``pcapkit/``-only grep. - ``#section-5.3`` -> ``#section-5`` at two more, in ``tests/protocols/application/test_ftp_unit.py`` and ``docs/source/changelog/1.5.0.rst``. ``CHANGELOG.md`` regenerated with ``util/changelog_md.py`` for the second, one line. - The three ``pcapkit/`` template/generated pairs stay byte-identical on the cited lines; each string is a literal in the ``vendor/`` template, carrying no interpolation, so a regeneration reproduces the edit. No crawl was run. - Add ``KNOWN_DEAD_ANCHORS`` (both ``959`` fragments) and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead anchor, so this is a narrower second check for the same class. It scans ``pcapkit/``, ``docs/source`` and ``tests/`` rather than ``pcapkit/`` alone -- looking at one directory is what let five sites sit unnoticed. Offline by design: CI has no network. - Classify role-versus-literal by **masking inline literal spans** before matching, rather than by a one-character lookbehind. The lookbehind was wrong in both directions, measured: a role written straight after a closing literal or a title reference was silently skipped, and an inert literal padded with spaces was wrongly flagged. Masking fixes all three. Two residual gaps are documented rather than claimed away -- a ``::`` literal block, and a triple-backtick wrapper around a padded literal -- both of which fail in the safe direction, since a false positive fails loudly where a false negative is a dead link nobody sees. Prose left standing where it is still true: ``ftp/command.py``'s citations carry the command-*kind* claim, which §4 does support. ``http/method.py``'s carry a case-insensitivity claim stated in §5.3, tracked in #947. Dead sub-anchors in *other* RFCs -- ten sites across RFC 1122 and RFC 719, both of which render no sub-section anchors either -- are out of #944's scope and are filed as #950. tests/project: 207 passed, 1 skipped, 562 subtests. tests/protocols/application/test_ftp_unit.py + tests/const/test_const_enum_no_mint.py: 79 passed, 602 subtests. Each new assertion was shown to fail without its fix, including from a ``docs/`` site the pre-widening scan could not see.
RFC 959's rendered HTML carries anchors only for its eight top-level sections, ``section-1`` through ``section-8``, so **every** sub-numbered ``959`` fragment is a live link to nothing. Per the rulings on #944 and #947, they now cite the section that supports the claim they carry. - ``#section-4.1`` -> ``#section-4`` at eleven sites: the six in ``pcapkit/{const,vendor}/{ftp/command,http/method}.py`` #944 reported, plus four rendered roles in ``docs/source/contributing/conventions/registry-protocol.rst`` and one in ``tests/const/test_const_enum_no_mint.py``. The five extra sites predate this branch -- ``git log -S`` puts them at #913 (``1f4337e12``) -- and were found by cross-review, not by #944's ``pcapkit/``-only grep. - ``#section-5.3`` -> ``#section-5`` at two more, in ``tests/protocols/application/test_ftp_unit.py`` and ``docs/source/changelog/1.5.0.rst``. ``CHANGELOG.md`` regenerated with ``util/changelog_md.py`` for the second, one line. - The three ``pcapkit/`` template/generated pairs stay byte-identical on the cited lines; each string is a literal in the ``vendor/`` template, carrying no interpolation, so a regeneration reproduces the edit. No crawl was run. - Add ``KNOWN_DEAD_ANCHORS`` (both ``959`` fragments) and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead anchor, so this is a narrower second check for the same class. It scans ``pcapkit/``, ``docs/source`` and ``tests/`` rather than ``pcapkit/`` alone -- looking at one directory is what let five sites sit unnoticed. Offline by design: CI has no network. - Classify role-versus-literal by **masking inline literal spans** before matching, rather than by a one-character lookbehind. The lookbehind was wrong in both directions, measured: a role written straight after a closing literal or a title reference was silently skipped, and an inert literal padded with spaces was wrongly flagged. Masking fixes all three. Two residual gaps are documented rather than claimed away -- a ``::`` literal block, and a triple-backtick wrapper around a padded literal -- both of which fail in the safe direction, since a false positive fails loudly where a false negative is a dead link nobody sees. Prose left standing where it is still true: ``ftp/command.py``'s citations carry the command-*kind* claim, which §4 does support. ``http/method.py``'s carry a case-insensitivity claim stated in §5.3, tracked in #947. Dead sub-anchors in *other* RFCs -- ten sites across RFC 1122 and RFC 719, both of which render no sub-section anchors either -- are out of #944's scope and are filed as #950. tests/project: 207 passed, 1 skipped, 562 subtests. tests/protocols/application/test_ftp_unit.py + tests/const/test_const_enum_no_mint.py: 79 passed, 602 subtests. Each new assertion was shown to fail without its fix, including from a ``docs/`` site the pre-widening scan could not see.
RFC 959's rendered HTML carries anchors only for its eight top-level sections, ``section-1`` through ``section-8``, so **every** sub-numbered ``959`` fragment is a live link to nothing. Per the rulings on #944 and #947, they now cite the section that supports the claim they carry. - ``#section-4.1`` -> ``#section-4`` at eleven sites: the six in ``pcapkit/{const,vendor}/{ftp/command,http/method}.py`` #944 reported, plus four rendered roles in ``docs/source/contributing/conventions/registry-protocol.rst`` and one in ``tests/const/test_const_enum_no_mint.py``. The five extra sites predate this branch -- ``git log -S`` puts them at #913 (``1f4337e12``) -- and were found by cross-review, not by #944's ``pcapkit/``-only grep. - ``#section-5.3`` -> ``#section-5`` at two more, in ``tests/protocols/application/test_ftp_unit.py`` and ``docs/source/changelog/1.5.0.rst``. ``CHANGELOG.md`` regenerated with ``util/changelog_md.py`` for the second, one line. - The three ``pcapkit/`` template/generated pairs stay byte-identical on the cited lines; each string is a literal in the ``vendor/`` template, carrying no interpolation, so a regeneration reproduces the edit. No crawl was run. - Add ``KNOWN_DEAD_ANCHORS`` (both ``959`` fragments) and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead anchor, so this is a narrower second check for the same class. It scans ``pcapkit/``, ``docs/source`` and ``tests/`` rather than ``pcapkit/`` alone -- looking at one directory is what let five sites sit unnoticed. Offline by design: CI has no network. - Classify role-versus-literal by **masking inline literal spans** before matching, rather than by a one-character lookbehind. The lookbehind was wrong in both directions, measured: a role written straight after a closing literal or a title reference was silently skipped, and an inert literal padded with spaces was wrongly flagged. Masking fixes all three. Two residual gaps are documented rather than claimed away -- a ``::`` literal block, and a triple-backtick wrapper around a padded literal -- both of which fail in the safe direction, since a false positive fails loudly where a false negative is a dead link nobody sees. Prose left standing where it is still true: ``ftp/command.py``'s citations carry the command-*kind* claim, which §4 does support. ``http/method.py``'s carry a case-insensitivity claim stated in §5.3, tracked in #947. Dead sub-anchors in *other* RFCs -- ten sites across RFC 1122 and RFC 719, both of which render no sub-section anchors either -- are out of #944's scope and are filed as #950. tests/project: 207 passed, 1 skipped, 562 subtests. tests/protocols/application/test_ftp_unit.py + tests/const/test_const_enum_no_mint.py: 79 passed, 602 subtests. Each new assertion was shown to fail without its fix, including from a ``docs/`` site the pre-widening scan could not see.
RFC 959's rendered HTML carries anchors only for its eight top-level sections, ``section-1`` through ``section-8``, so **every** sub-numbered ``959`` fragment is a live link to nothing. Per the rulings on #944 and #947, they now cite the section that supports the claim they carry. - ``#section-4.1`` -> ``#section-4`` at eleven sites: the six in ``pcapkit/{const,vendor}/{ftp/command,http/method}.py`` #944 reported, plus four rendered roles in ``docs/source/contributing/conventions/registry-protocol.rst`` and one in ``tests/const/test_const_enum_no_mint.py``. The five extra sites predate this branch -- ``git log -S`` puts them at #913 (``1f4337e12``) -- and were found by cross-review, not by #944's ``pcapkit/``-only grep. - ``#section-5.3`` -> ``#section-5`` at two more, in ``tests/protocols/application/test_ftp_unit.py`` and ``docs/source/changelog/1.5.0.rst``. ``CHANGELOG.md`` regenerated with ``util/changelog_md.py`` for the second, one line. - The three ``pcapkit/`` template/generated pairs stay byte-identical on the cited lines; each string is a literal in the ``vendor/`` template, carrying no interpolation, so a regeneration reproduces the edit. No crawl was run. - Add ``KNOWN_DEAD_ANCHORS`` (both ``959`` fragments) and ``test_no_known_dead_anchor_citations`` to ``tests/project/test_rfc_anchor_fragments.py``. #943's shape invariant accepts ``section-4.1`` as well-formed and by construction cannot see a dead anchor, so this is a narrower second check for the same class. It scans ``pcapkit/``, ``docs/source`` and ``tests/`` rather than ``pcapkit/`` alone -- looking at one directory is what let five sites sit unnoticed. Offline by design: CI has no network. - Classify role-versus-literal by **masking inline literal spans** before matching, rather than by a one-character lookbehind. The lookbehind was wrong in both directions, measured: a role written straight after a closing literal or a title reference was silently skipped, and an inert literal padded with spaces was wrongly flagged. Masking fixes all three. Two residual gaps are documented rather than claimed away -- a ``::`` literal block, and a triple-backtick wrapper around a padded literal -- both of which fail in the safe direction, since a false positive fails loudly where a false negative is a dead link nobody sees. Prose left standing where it is still true: ``ftp/command.py``'s citations carry the command-*kind* claim, which §4 does support. ``http/method.py``'s carry a case-insensitivity claim stated in §5.3, tracked in #947. Dead sub-anchors in *other* RFCs -- ten sites across RFC 1122 and RFC 719, both of which render no sub-section anchors either -- are out of #944's scope and are filed as #950. tests/project: 207 passed, 1 skipped, 562 subtests. tests/protocols/application/test_ftp_unit.py + tests/const/test_const_enum_no_mint.py: 79 passed, 602 subtests. Each new assertion was shown to fail without its fix, including from a ``docs/`` site the pre-widening scan could not see.
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingchore— anything elseDescription of your pull request and other information
Fixes #942, plus two defect classes the invariant it required then found:
(1) the same
secion/section-2.2typo at a second FTP site, and (2) tengenerated fragments missing
section-entirely (RFC 8684/8765), traced totwo generators discarding IANA's literal "Section" word; fixed both plus all
10 generated lines.
ACCEPTED_FRAGMENTnow accepts exactly Sphinx's own three anchor prefixes(
section-N/appendix-X/page-N, fromsphinx.roles._format_rfc_target),adding
page-N(confirmed real: RFC 793id="page-5") to matchtest_changelog_md.py. Deliberately still rejects bareintroduction/section-- neither is in Sphinx's known set, and both would trade shapevalidation for an open-ended vocabulary; recorded in the test's docstring.
The invariant is shape-only, not anchor existence:
:rfc:959#section-4.1``passes it but the anchor doesn't exist on RFC 959's real page (filed as
#944, not fixed here). Census: 645 total, 0 malformed. isort/pylint
unchanged against
9ea0d6a5a.