Skip to content

docs(corekit): add the sentinels API page so conventions.rst references resolve (#934) - #936

Merged
JarryShaw merged 1 commit into
mainfrom
docs/934-sentinels-api-page
Sep 30, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/934-sentinels-api-page

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner
  • Searched for similar pull requests
  • Followed the coding style (make pylint, make mypy, make isort)
  • make test passes, and a test case covers the change
  • Added a changelog entry under docs/source/changelog/ and regenerated CHANGELOG.md, if the change is user-visible

N/A -- changelog centralised in #657

What is the purpose of your pull request?

  • fix
  • feat
  • perf
  • refactor
  • test
  • docs
  • ci
  • chore

Description of your pull request and other information

Part of #934: pcapkit.corekit.sentinels had no API page, so all five :mod: references
to it in conventions.rst (lines 165, 168, 171, 174, 261) rendered as plain text instead
of links. Adds docs/source/pcapkit/corekit/sentinels.rst, matching the sibling
module.rst/enum.rst/field.rst pages' style, and wires it into corekit/index.rst's
toctree so it isn't an orphan. _Absent/_AbsentType stay off the page — private, not in
__all__, and never documented at their pre-#911 home in protocol.rst either. (#911
moved all four sentinel definitions into this module, not three; the page's prose says so.)

Verified with a nitpicky sphinx-build: all five references now render real <a href>
anchors (were bare <code>); four more pre-existing pcapkit.corekit.sentinels misses
elsewhere resolve too. Unclaimed bonus, caught in cross-review: three
:class:~pcapkit.corekit.sentinels.NullType`` references (conventions.rst:216,265,282)
used to silently resolve to the wrong page (`module.html`, the re-export) with no warning
at all — nitpicky mode only catches a miss, not a wrong hit. They now land on this page.

Total warnings move 1275 → 1287 — confirmed noise only: duplicate object description
(7) and more than one target found (36) counts are unchanged between builds, and neither
fires for any sentinel name. All 21 extra warnings are pre-existing broken internal
docstring refs inside NullType/NoDefaultType (unqualified __new__, etc.) now firing
twice, once per page documenting the class. Not introduced or fixed here; sentinels.py
itself is out of scope for this PR.

Added tests/project/test_sentinels_doc_page_934_unit.py (isort/mypy/pylint clean),
proven to fail on main (2 failures, 1 error), pinning the page's existence, its module
directive (module::/automodule::, either resolves the same way), and its toctree
registration. Ran that file plus test_sentinel_exports_unit.py and
test_documentation_claims.py (24 tests, all green) rather than the full make test,
which OOMs at 29 GB in this environment.

@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: pending No verdict for the current head - never reviewed, or the head moved since the last one test Pull requests that add or correct tests (test: subject prefix) labels Sep 29, 2026
@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 29, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

NEEDS CHANGES at a8b2cd388 — Opus cross-review (author was Sonnet). One factual error, which I re-derived before relaying.

docs/source/pcapkit/corekit/sentinels.rst:14-15 says "until GitHub issue #911 moved the three definitions here". #911 moved four. Three sources in the tree contradict it: pcapkit/corekit/sentinels.py quotes the ruling verbatim — "Okay one module for all four it is." — conventions.rst:180 says "moved the four definitions", and the module defines four (NullType/NULL :55/:193, NoValueType/NoValue :208/:227, NoDefaultType/NO_DEFAULT :231/:426, _AbsentType/_Absent :430/:469).

It matters because conventions.rst:165-177 is a four-row table whose _Absent row now links here, so a reader following it lands on a page asserting three. "Each of the three below" at :11 is correct and stays — the page documents three deliberately, and leaving _Absent off was independently confirmed defensible.

Everything else confirmed, two of them better than claimed:

  • All five references resolve. Base: 5 warnings, 5 unlinked xref py py-mod spans, 0 linked. Head: 0 warnings, 5 linked to sentinels.html#module-pcapkit.corekit.sentinels.
  • The +12 is noise, not ambiguity. more than one target found is 36 in both builds, duplicate object description 7 in both, and zero of either for any sentinel name — the two objects carry distinct FQNs. All 21 extra warnings are pre-existing sentinels.py docstring defects firing twice; none attributed to the new page.
  • An unclaimed fix worth more than the stated one. On main the three :class:~pcapkit.corekit.sentinels.NullType`` references at conventions.rst:216, `:265`, `:282` silently resolved to the wrong page — `module.html`, the re-export — with no warning. This PR corrects all three.
  • The new test fails 3/3 on main and passes 3/3 on head; page matches the sibling module/enum/field pattern; toctree clean, no orphan warning; no contention with refactor(const,protocols): reparent the last seven non-registry enums onto EnumLookup #932.

Not widening it to the three shim autoclass directives: they are the only thing keeping pcapkit.corekit.module.NullType resolvable, and module.rst:22 has a live :type: depending on it. The +12's root cause is sentinels.py's own broken docstring references, tracked on #934.

…es resolve (#934)

- Added docs/source/pcapkit/corekit/sentinels.rst for pcapkit.corekit.sentinels,
  which had no page, so the five :mod:`pcapkit.corekit.sentinels` references in
  conventions.rst (lines 165, 168, 171, 174, 261) rendered as plain text.
  Documents NullType/NULL, NoValueType/NoValue and NoDefaultType/NO_DEFAULT,
  matching module.rst/enum.rst/field.rst's style for the same three sentinels
  at their old re-export locations. _Absent/_AbsentType stay off the page:
  private, absent from __all__, never documented at their pre-#911 home in
  protocol.rst either. #911 moved all four definitions here, not three -- the
  page's own prose now says so.
- Wired the page into corekit/index.rst's toctree, alphabetically between
  protochain and version, so it is not an orphan page.
- Added tests/project/test_sentinels_doc_page_934_unit.py, pinning the page's
  existence, its module directive (module:: or automodule::) and its toctree
  registration; proven to fail (2 failures, 1 error) on main.

Verified against a nitpicky sphinx-build: all five conventions.rst references
now render real hrefs (were bare <code>); four more pre-existing
pcapkit.corekit.sentinels :mod: misses resolve too. Unclaimed bonus: three
:class:`~pcapkit.corekit.sentinels.NullType` references (lines 216, 265, 282)
used to silently resolve to the wrong page (module.html) with no warning; now
correct. Total warnings move 1275 -> 1287 -- pure noise, confirmed: ~21
pre-existing broken internal refs inside NullType/NoDefaultType's own
docstrings now fire twice (duplicate-object-description and ambiguous-target
counts unchanged, 7 and 36, in both builds). sentinels.py itself stays out of
scope.
@JarryShaw
JarryShaw force-pushed the docs/934-sentinels-api-page branch 2 times, most recently from a8b2cd3 to 99fbfb2 Compare September 29, 2026 22:40
@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Sep 29, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 99fbfb237.

The three/four error is fixed, and I verified the delta from the reviewed head a8b2cd388 myself rather than re-reviewing from scratch — two hunks, nothing else touched:

  • docs/source/pcapkit/corekit/sentinels.rst:14 now reads "until GitHub issue fix(corekit): export only the sentinel objects, not their types #911 moved all four definitions here, the private _AbsentType/_Absent included". Those two names are plain literals, not :class: roles, so the correction adds no new unresolved reference — confirmed by the rebuild staying at 1287 warnings, unchanged by this fix.
  • tests/project/test_sentinels_doc_page_934_unit.py swaps a literal .. module:: match for assertRegex(text, r'\.\.\s+(?:auto)?module::\s+pcapkit\.corekit\.sentinels\b'). That generalises the directive without weakening the assertion — it still requires the directive and the exact module name.

Line :11 ("Each of the three below") is untouched and correct: the page documents three deliberately, and leaving _Absent off was independently confirmed defensible — it is private, absent from __all__, and was never documented at its pre-#911 home either.

Everything substantive was confirmed at a8b2cd388 and is unchanged by this amendment: all five conventions.rst references resolve (5 warnings and 5 unlinked spans on base → 0 warnings, 5 linked on head), the page is in the toctree with no orphan warning, the new test fails 3/3 on main and passes 3/3 here, the page matches the sibling module/enum/field pattern, and there is no contention with #932.

The +12 warning rise stands as measured noise, not ambiguity: more than one target found is 36 in both builds, duplicate object description 7 in both, and zero of either for any sentinel name. All 21 extra warnings are pre-existing sentinels.py docstring defects firing a second time, tracked on #934.

Still the most valuable thing in this PR and now stated in its body: on main the three :class:~pcapkit.corekit.sentinels.NullType`` references at conventions.rst:216, `:265`, `:282` silently resolved to the wrong page — `module.html`, the re-export — with no warning at all. This corrects all three.

One commit, author Jarry Shaw <jarryshaw@icloud.com>, MERGEABLE. Unpublished and awaiting you.

@JarryShaw
JarryShaw merged commit ba83c4b into main Sep 30, 2026
67 of 124 checks passed
@JarryShaw
JarryShaw deleted the docs/934-sentinels-api-page branch September 30, 2026 00:13
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Sep 30, 2026
JarryShaw added a commit that referenced this pull request Sep 30, 2026
…#934)

Part B of #934: the remaining nitpicky sphinx-build misses in conventions.rst
that are neither the sentinels module refs part A (#936) fixed nor the six
aenum roles part C already ruled on (plain literals, since aenum's
objects.inv carries zero py: objects and conf.py excludes it deliberately).

* Qualified the three unqualified sentinel refs -- :class:`AbsentType`,
  :class:`NoValueType` and :data:`ABSENT` -- to their real dotted path under
  pcapkit.corekit.sentinels, so they resolve against the page #936 added.
  Rewrapped the two lines that grew past this file's ~88-column convention;
  no wording changed.
* Added an autoclass entry for FEATCode to
  docs/source/pcapkit/const/ftp.rst, and widened the FTP Command section's
  intro clause to name both classes it now documents -- FEATCode is a
  companion of Command's, not a peer listed in the page's own overview
  table, so it stays folded into that section rather than getting its own
  heading; every other section in this file pairs one heading with one
  autoclass, and inventing a repeated `.. module::` for a second heading on
  the same submodule would be a novel shape this file has nowhere else.
* Demoted Method.get and part C's six aenum roles to plain double-backtick
  literals: Method.get carries `:meta private:` deliberately (same pattern as
  Command.get, OptionType's and AppType's private get overrides), and aenum
  cannot be cross-referenced at all, so no target can exist for either.
* Rebasing onto #940 (merged after this branch started) surfaced a seventh
  broken reference: #940 deleted FastBindingAcknowledgmentStatus.get outright
  rather than just widening it, so the :meth: role citing it in the #923
  retrospective joined the unresolved set. Demoted to a plain literal too,
  matching the two sibling examples already written that way in the same
  sentence (TransportProtocol.get, Criticality.get).
* Added test_ftp_featcode_doc_page_934_unit.py, pinning the new autoclass
  entry the way test_sentinels_doc_page_934_unit.py pins part A's page;
  proven to fail against the pre-fix (83c7552) page.
* Added AenumRoleExclusionTests to test_conventions_doc_claims.py: pins that
  no :mod:/:class:/etc. role names aenum on this page (the plain-literal
  demotion is settled policy per conf.py, and nothing else enforced it), and
  that the four qualified sentinel targets stay qualified. Both assertions
  proven to fail against the pre-fix (83c7552) page.

Nitpicky sphinx-build: conventions.rst had 14 unresolved references against
83c7552, 15 against b337cdb (this branch's rebased base) once #940's
deletion is counted; all resolve here. Three more resolve as a side effect of
documenting FEATCode: stale FEATCode references inside
Command._unregistered_member's and Method._unregistered_member's own
docstrings, plus one in a rendered `feat: Optional[FEATCode]` parameter
annotation with no clear file attribution. Two pre-existing bugs inside
FEATCode's own docstring are newly exposed rather than introduced -- a
line-wrapped :meth: role and a reference to the vendor Command.process,
deliberately excluded from vendor/ftp.rst's own :members: allowlist.
FEATCode's :show-inheritance: does genuinely introduce one new warning of its
own (an aenum._enum.StrEnum base that cannot resolve), joining five identical
ones already present for Command/Method/etc. Recording rather than fixing
any of these: out of scope for this file.

mypy 321 errors/38 files, pylint 8.67/10 exit 30, isort clean -- all matching
the b337cdb baseline (R0401 cyclic-import churn aside, which is
non-deterministic on an unmodified tree). Targeted tests: 40 passed, 1
skipped across test_conventions_doc_claims (incl. the two new
AenumRoleExclusionTests methods), test_sentinel_exports_unit,
test_sentinels_doc_page_934_unit and the FEATCode page test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix) test Pull requests that add or correct tests (test: subject prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant