refactor(corekit): house all four sentinels in one shared module (#911) - #922
Conversation
|
Merge order matters here: this PR conflicts with #919, which is already Measured, not inferred — GitHub reports both as The overlap is narrow. #919 rewrites base line 78 (one stale Resolution is a rebase, not a redesign: merge #919 first, then rebase this branch and take this side for that hunk, since it is a superset. The other two pairs are clean — #919 × #921 and #921 × #922 both merge without conflict. Also flagged by the author and worth recording: once both this PR and #919 land, Cross-review dispatched on Opus (author was Sonnet). Unmerged and unpublished — yours to merge. |
6d7f69b to
26b8309
Compare
|
Cross-review on Opus returned NEEDS CHANGES, and it found a real backward-compatibility break. Fixed — new head The break, measured by me on both trees. Every pickle written by any released version names the old path, and on the branch that attribute was gone: The fix is to re-export Three new tests pin it — Two things I got wrong on the way, both in the test rather than the fix, and worth recording because they would bite anyone writing the same pin. Byte-substituting the module name in a finished payload works at protocols 2-3 but not 4-5, which length-prefix the string — shortening Unchanged by the fix: the same 5 pre-existing isolation failures in Corrections to the reviewer's other two points, neither of which touched this PR's text: the
|
26b8309 to
5d6cf3b
Compare
|
GOOD TO GO at head What changed since That widens the failing-without-the-fix proof from 5 errors to 7: A correction to what I wrote two comments up. I said the failures without the re-export were "all five the On the Everything from the first pass stands: identity 12/12, no cycle from all five cold entry points, Two items remain UNVERIFIED, neither blocking: the Unpublished and unmerged. Merge #919 first — the conflict against it is unchanged. |
|
Resolve conflicts. |
5d6cf3b to
b0759e5
Compare
|
Conflicts resolved — rebased onto One conflicted file, Took this branch's side, because it is a strict superset: it already carries #919's corrected Verified after the rebase: one commit on top of The |
b0759e5 to
16f3a05
Compare
|
CI red run down to root cause: it was my own edit, not the change under review. Fixed — new head One failing leg, The -from pcapkit.corekit.sentinels import (NULL, NullType, # pylint: disable=unused-import
- _get_null)
+from pcapkit.corekit.sentinels import NULL, NullType, _get_null # pylint: disable=unused-importOnly one leg had reached that test; it would have reddened every one of them, so it is a single defect rather than four. Verified locally: all four Being explicit about verdict drift, because it has now accumulated. The Opus confirmation pass was granted at |
|
GOOD TO GO re-confirmed at There were three deltas since the reviewed sha, not two. I described the rebase and the isort fix and omitted the third: Scope, verified by me independently.
#919 lost nothing. The resolved The suppression question is now partly answered rather than UNVERIFIED — I measured this myself. With the project's exact So the comment is necessary rather than noise, it suppresses both names from its new single-line position, and pylint 4.0.8 does flag Pickle tests hold: 11 OK, and reverting only the re-export gives 7 errors across protocols 0-5 plus the direct one, all rooted in the same |
|
The second red leg on this head is infrastructure, not a defect — and unlike the first one, there is nothing to fix.
The GitHub-hosted runner was reclaimed roughly 10% into the suite. Every progress marker before that point is a pass or a skip — no Worth separating from the earlier red on this same PR, because they look identical in the checks UI and are not: the I have not re-run it. Triggering, re-running or cancelling workflow runs is outside what I do here, so it needs your click, or it will clear on the next push. The other 52 CheckRuns on this head are green with 5 still in flight, and the verdict at |
|
Correcting myself: the lost runner does block this merge. Two red marks, one cause, and it is a required context. I said earlier that the verdict here stands independently of CI. That is true of the verdict and misleading about mergeability, so to be plain: #922 cannot merge until that leg is re-run. The second red is derivative, not a new defect.
And it is load-bearing. Ruleset So Two ways to clear it, both yours: re-run the failed jobs on run |
|
3.11 unit tests failed. |
|
No unit test failed. The runner was taken away mid-run. My comment 14 seconds before yours has the detail; the short version and the proof: The It died about 10% into the suite. The 87 KB log holds no The second red mark, It does block the merge, though — |
The `__all__` half of #911 landed as #916; this is the housing half, per the owner's ruling -- "Okay one module for all four it is." - Add pcapkit/corekit/sentinels.py holding NULL/NullType, NoValue/NoValueType, NO_DEFAULT/NoDefaultType and _Absent/_AbsentType, moved from module.py, fields/field.py, enum.py and protocols/protocol.py respectively. - Each original module keeps a re-export so every existing `from <module> import <name>` -- object and type, including the `if TYPE_CHECKING:`-only ones -- keeps working unchanged. - No import cycle: sentinels.py depends only on pcapkit.utilities.compat. - Fix an unrelated, pre-existing staleness found in transit: NoDefaultType's reload example predated #864's non-minting guard and no longer reproduced; replaced with a verified one. - Update conventions.rst's sentinel table and prose to the new module. - Add tests/corekit/test_sentinels_housing_unit.py: cross-module identity and no-cycle checks. Build: isort clean; pylint/mypy unchanged from origin/main on every touched file. tests/corekit/, tests/project/ and tests/protocols/test_construction_keyword_check_unit.py all pass.
16f3a05 to
87ede29
Compare
|
Rebased onto This also gives the branch a fresh CI run, which is what the reclaimed Verified after the rebase:
|
Please follow the guide below
make pylint,make mypy,make isort)What is the purpose of your pull request?
refactor— changes neither behaviour nor performanceDescription of your pull request and other information
The housing half of #911. The owner's ruling, verbatim: "Okay one module for all four it is."
pcapkit/corekit/sentinels.pyholds all four sentinels (NULL/NullType,NoValue/NoValueType,NO_DEFAULT/NoDefaultType,_Absent/_AbsentType), moved frommodule.py,fields/field.py,enum.pyandprotocols/protocol.pyrespectively.TYPE_CHECKING-only ones -- keeps working unchanged. Cross-module identity is pinned intests/corekit/test_sentinels_housing_unit.py, which also checks there is no import cycle.docs/source/contributing/conventions.rst's sentinel table and prose now name the new module.NoDefaultType's docstring -- its reload example predated EnumRegistry.get() mints through its default, contradicting its own "It never mints" contract #864's non-minting guard and no longer reproduced; replaced with a verified one.Not in this PR:
docs/source/pcapkit/corekit/enum.rst(landing on another branch) documentsNoDefaultType/NO_DEFAULTat their old location and will need its targets updated once both merge.