fix(const,vendor): bring the AppType family onto EnumRegistry, stop it minting (#860) - #874
Conversation
|
NEEDS CHANGES on 1. A test this PR invalidates was not updated, and it is the test for the generator this PR edits. Reproduced by me in the branch tree: The file is not among the PR's 7 files ( 2. One sentence missing from the description. The body says A composed Verified and not disputed, all re-derived rather than taken from the report: 766 + 1 mint sites converted with zero Left UNVERIFIED and not claimed as passing: Nit, not blocking: |
|
Addendum, narrowing my own verdict: the two suites I reported as UNVERIFIED are green on this head. So The verdict itself does not change. |
fc45d90 to
2715d15
Compare
|
NEEDS CHANGES on
1. Two false statements in production comments — 2. Disclose the single-int changes in the PR body, not just the composed ones. 3. Confirmed: 87 / 251 / 152 / 55 methods reproduce exactly (the 7 transport errors are the missing generated |
2715d15 to
01ae462
Compare
|
NEEDS CHANGES on 1. "only Unwrapping 2. Same paragraph: "#770's own four **3. The Two errors in the body were mine and I have fixed them. "Fixed 6 existing tests" was understated: comparing each test method's AST body against Optional, and I agree with your reasoning for leaving Byte-identity across a live crawl remains unreproduced by either of us, and the body says so. |
01ae462 to
7397976
Compare
|
NEEDS CHANGES on 1. "since #860" on So the 4 → 3 story has the mechanism right and the provenance wrong: #836 caused the 4 → 2 drop; #860's only contribution is adding 2. Cosmetic, worth folding in: #836 is a PR, not an issue ( Confirmed, and not to be redone: the mypy numbers are exact — |
7397976 to
4d8cd64
Compare
|
Recorded, verbatim:
So the GOOD TO GO on Identical numbering, identical dispatch, and mypy stays clean — because Everything else in the |
934f26f to
e51a0c6
Compare
|
NEEDS CHANGES on Round 6 read So: "once retired" has no subject; the Flag quote is now attributed to #808 rather than to #836's ruling, contradicting the settled account that #808 is the issue and #836 the PR that implemented it; and the back-reference at The Confirmed clean and not to be re-derived: numbering One caveat worth recording: |
…t minting (#860) Step 2 of #860 (PR 2 of 2, following AppType's 8 non-AppType siblings in #869). - Mix pcapkit.const.reg.apptype.apptype.AppType into EnumRegistry, alongside its four transport subclasses (TCP/UDP/SCTP/DCCP). AppType keeps its own get/get_all/register_alias, which already dispatch by transport protocol, and gains a working register (previously absent -- the base's generic one would have built a member with svc='<null>') and an _unregistered_member override reconstructing svc/port/proto. - Convert AppType._missing_'s 766 range-bounded extend_enum calls, plus the one more inside get()'s own second mint site, to _unregistered_member -- owner ruling: "only IANA registered ones are legit values ... get will not have sufficient information to create new ones." All 766+1 branches convert uniformly, including the 8 that named a real (if span-assigned rather than individually declared) service, since none of them mints at import time -- unlike FEATCode's earlier fix, there is no self-mutation defect here to address by declaring members statically. - Move TransportProtocol from power-of-two values to sequential ones, per PR #836's ruling retiring `|`-composite decoding and the owner's further #860 ruling that the spacing itself then had nothing left to protect; delete the stale comment claiming the values must stay power-of-two. undefined is declared as an explicit cast('TransportProtocol', 0) and tcp/udp/sctp/dccp continue from it via plain auto(), per the owner's own final ruling on the declaration shape ("undefined direct uses 0. then other real transport use auto. so we don't have to define a _start_ and the undefined declaration is explicit") -- an earlier revision of this same change used an explicit _start_ = 0 with every member on auto(), which the owner's ruling superseded. AppType._dispatch treats a composed or bare int identically as a whole either way, so the renumbering changes what specific integers mean, not only what hand-composed ones do -- e.g. a bare, uncomposed 4 (previously sctp's value) now silently resolves as dccp's, with no exception, since a real member sits at 4 under either numbering. No test pins any of this, per the owner's explicit instruction; the class comment states it instead, and every docstring that used to claim a hand-built composite is refused unconditionally (_dispatch's and get's own) is corrected to say it is looked up as a whole and resolves or is refused depending on whether some real member happens to equal it. - Update corekit/enum.py's own docstring, which described AppType's EnumRegistry mixin as future work ("stays as it is until tier two lands"), and its get() docstring's str-valued-registry census (119 -> 124). - Update tests/vendor/test_vendor_reg_apptype_generator_unit.py's #770 pin: undefined is once again the one bare-literal-under-cast member among four auto()-valued siblings, exactly as #770 first shaped it, so its wrapper is load-bearing against a mypy error again -- measured directly, stripping it alone (leaving auto() elsewhere) now reproduces 3 [assignment] + 762 [arg-type] errors (765 total), while stripping tcp's wrapper instead stays clean. The two separate changes behind the 3-not-4 count: PR #836 widened get()/get_all()'s own proto annotations to tolerate a bare int default before this issue touched anything, and this issue's own new _unregistered_member site is what brought the count back up from 2 to 3. - Fix four tests in the existing suite that pinned the old minting/power-of- two behaviour directly (test_const_apptype_split_unit.py, test_const_enum_builtin_parity.py), and add 17 new tests plus prose/count updates in test_const_enum_no_mint.py and test_const_registry_protocol.py. All 5 crawlers regenerate byte-identically on a second run; git status is clean relative to this commit. mypy/pylint deltas are the same classes of finding this codebase already tolerates elsewhere (aenum stub gaps, import-outside-toplevel/protected-access/no-member in test internals), suppressed with # type: ignore[override]/pylint: disable=arguments-differ, arguments-renamed where the codebase's own convention already does so. 216 test methods pass across test_const_apptype_split_unit.py, test_const_enum_no_mint.py, test_const_enum_builtin_parity.py, test_const_registry_protocol.py and test_vendor_reg_apptype_generator_unit.py, plus 87 across tests/vendor/ (excluding the live-network crawler- reachability test) and 55 across the TransportProtocol-consuming suites outside those directories (tests/corekit/test_fields_numbers_port_option_ no_mint_unit.py, tests/dumpkit/test_nameless_enum_rendering_unit.py, tests/dumpkit/test_common_unit.py, tests/foundation/registry/ test_protocols.py, tests/utilities/test_compat.py).
e51a0c6 to
f58fb75
Compare
|
GOOD TO GO on
All three consequences are discharged. Still one commit on The author also named the files behind its "55 methods" figure, which the previous review could not verify: |
#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
…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.
…ting them The last tranche of #987, plus #995. These files are generated, so every change is made twice: in the vendor template and identically in the const file it renders. The template holds the prose verbatim with {NAME}/{DOCS} placeholders, so the next crawler run reproduces it. No crawler was run. Scope: 22 italic-quoted spans across 7 files, of which 16 are rulings and converted. Six are not and stay -- all of them RFC 5797 and RFC 2389 text on FEAT-code case sensitivity. The italic pattern also missed 14 straight-quoted spans in the apptype pair, 7 per side, most wrapping a backticked vertical bar; those are converted too. - #877 was revised twice and the prose stated the middle revision. The final ruling is RFC-directed: an enum treats its values as case-insensitive where the RFC states they are, and as case-sensitive otherwise. The earlier form, which also allowed a fold where it logically made sense, is out. - #860's ruling is narrowed to what it says. The prose called it the ruling for the whole family, but the comment reads "for all three" and names FEATCode, Command and Method. AppType is never named in it, and the AppType work is #874 under #860, so the prose now says the family follows a ruling given for those three rather than that it was given for the family. - #860's FEAT-value question was answered conditionally, on whether it matched the approach already in use; that conditional is restored. - The #921 exception ruling had lost its second clause -- that the exception comes from pcapkit.utilities.exceptions rather than being a builtin. - #995: vendor/ipx/socket.py credited a ruling with "a real ownership fact", which is in no maintainer comment. The real reason, #847 at 13:15:36Z, is that a proprietary protocol may expose no name of its own. That comment is module documentation for UNASSIGNED_RANGE_NAMES and is not emitted into the const file, so only the template changed. - Re-flowing wrapped one inline literal that the base had whole, and left five orphan tails. All six are closed. Prose only, and proven against the one risk that matters in a generated file. Importing both trees gives a byte-identical sha256 over every name and value for the seven enums the three touched const files define -- 127 members, 126 iterable -- and the generated rST table rows are identical at 603 distinct of 707. Token sequences match per file with comments and NL dropped, masking FSTRING_MIDDLE as well as STRING since the templates are f-strings and their prose tokenises as the former. The over-95 line set is unchanged in every file. Closes #995.
…ting them The last tranche of #987, plus #995. These files are generated, so every change is made twice: in the vendor template and identically in the const file it renders. The template holds the prose verbatim with {NAME}/{DOCS} placeholders, so the next crawler run reproduces it. No crawler was run. Scope: 22 italic-quoted spans across 7 files, of which 16 are rulings and converted. Six are not and stay -- all of them RFC 5797 and RFC 2389 text on FEAT-code case sensitivity. The italic pattern also missed 14 straight-quoted spans in the apptype pair, 7 per side, most wrapping a backticked vertical bar; those are converted too. - #877 was revised twice and the prose stated the middle revision. The final ruling is RFC-directed: an enum treats its values as case-insensitive where the RFC states they are, and as case-sensitive otherwise. The earlier form, which also allowed a fold where it logically made sense, is out. - #860's ruling is narrowed to what it says. The prose called it the ruling for the whole family, but the comment reads "for all three" and names FEATCode, Command and Method. AppType is never named in it, and the AppType work is #874 under #860, so the prose now says the family follows a ruling given for those three rather than that it was given for the family. - #860's FEAT-value question was answered conditionally, on whether it matched the approach already in use; that conditional is restored. - The #921 exception ruling had lost its second clause -- that the exception comes from pcapkit.utilities.exceptions rather than being a builtin. - #995: vendor/ipx/socket.py credited a ruling with "a real ownership fact", which is in no maintainer comment. The real reason, #847 at 13:15:36Z, is that a proprietary protocol may expose no name of its own. That comment is module documentation for UNASSIGNED_RANGE_NAMES and is not emitted into the const file, so only the template changed. - The exception ruling was credited to issue #923, which carries no maintainer comment at all -- its own body attributes the ruling to the review of #877's implementation. So the prose now credits the ruling to that review and #923 with the implementation, keeping the citation in issue form as docs/source/contributing/conventions/documentation.rst requires. - Re-flowing wrapped one inline literal that the base had whole, and left five orphan tails. All six are closed. Prose only, and proven against the one risk that matters in a generated file. Importing both trees gives a byte-identical sha256 over every name and value for the seven enums the three touched const files define -- 127 members, 126 iterable -- and the generated rST table rows are identical at 603 distinct of 707. Token sequences match per file with comments and NL dropped, masking FSTRING_MIDDLE as well as STRING since the templates are f-strings and their prose tokenises as the former. The over-95 line set is unchanged in every file. Closes #995.
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible -- N/A, changelog centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Step 2 of #860 (PR 2 of 2; the 8 non-
AppTyperegistries were #869). BringsAppTypeand its four transport subclasses ontoEnumRegistryand stops both of its mint sites:_missing_'s 766 range branches, andget()'s own second, independent mint (PORT_{port}_{transport}->'unknown'). Both now build via a new_unregistered_memberoverride reconstructingsvc/port/proto(attributes the base's generic helper does not know about), per the owner's ruling: "only IANA registered ones are legit values ... get will not have sufficient information to create new ones."All 766+1 branches convert uniformly, including the 8 branches that name a real (if IANA-assigned to a whole port span rather than declared individually) service, 7 distinct names with
x11appearing twice —x11,active-net,satvid-datalnk,vrml-multi-use,ircu,swx,flex-lm. UnlikeFEATCode's earlier fix, there is no import-time self-mutation defect here to address by declaring members statically, so these are deliberately left as unregistered lookups too. The{TABLE}/{MISS}/{FLAG}data the generator derives from IANA's live CSV was not re-verified against a fresh crawl for this description; what I confirmed directly is that the class body the generator emits is byte-identical to what is committed (the earlier "557-line" figure was not reconstructible from the tree and is withdrawn).AppTypegains a workingregister()— previously absent; the base's generic one would have built a member withsvc='<null>'once this class mixed inEnumRegistrywithout an override, since it calls__new__with only one positional argument. Scoped to one per-transport registry, likeregister_alias, and now shares a_sanitize_identifierhelper with it.breaking, and this is why.TransportProtocolmoves from power-of-two values (undefined=0, tcp=1, udp=2, sctp=4, dccp=8) to sequentialauto()(undefined=0, tcp=1, udp=2, sctp=3, dccp=4), per the owner's follow-up ruling once|-joined values stopped being parsed at all; the stale comment claiming the values must stay power-of-two is deleted.AppType.get'sprotoparameter is documented public input (proto: 'TransportProtocol | str | int'), and_dispatchtreats whateverintit is given as a whole rather than decoding it, on either numbering — so the renumbering changes what specific integers mean, not only what hand-composed ones do. Measured onAppType.get(80, proto=...),mainvs. this branch:protomainTransportProtocol.tcp | TransportProtocol.udp(int3)ValueError: 3 names no transport protocol registrySCTP.http3ValueErrorSCTP.http(identical to the composed case —_dispatchcannot tell them apart)4SCTP.httpDCCP.unknown— silently, no exception, since a real member sits at4under the new numbering too, just a different one8DCCP.PORT_80_dccp(minted under the old contract)ValueError: 8 names no transport protocol registryThe
4row is the one that matters most: a caller holding an integer written against the old spacing gets routed to a different, real transport registry with no error at all, not merely refused where it used to resolve. This consequence is accepted (the owner's ruling explicitly retires the power-of-two spacing) and deliberately left untested for the composed case specifically — "No need to add test around that honestly. This is an obsoleted path from a breaking change" — but it is disclosed here rather than only in a code comment, since it reaches further than composed values alone.corekit/enum.py's own docstring describedAppType'sEnumRegistrymixin as future work ("stays as it is until tier two lands"); updated to reflect that it has landed, along with itsget()docstring's str-valued-registry census (119 -> 124).tests/vendor/test_vendor_reg_apptype_generator_unit.py's own #770 pin is updated too: it asserted a bare-literal-vs-auto()distinction forundefinedthat no longer exists now that everyTransportProtocolmember isauto()-valued and cast.All 5 crawlers (
apptype,tcp,udp,sctp,dccp) regenerate byte-identically on a second run;git status --porcelain pcapkit/constis clean relative to this commit. Fixed 9 existing tests whose executable bodies changed — 8 that pinned the old minting/power-of-two behaviour directly, plus the#770pin above (corrected from an earlier "6"; counted by comparing each test method's AST body againstmain, docstrings stripped) — and added 18 new tests intest_const_enum_no_mint.pyagainst 1 removed, net +17 (plus prose/count updates there and intest_const_registry_protocol.py). 403 test methods pass across the completetests/const/andtests/protocols/transport/directories; a further 87 acrosstests/vendor/(excluding the live-network crawler-reachability test) and 55 across theTransportProtocol-consuming suites outside those directories (tests/corekit/test_fields_numbers_port_option_no_mint_unit.py,tests/dumpkit/test_nameless_enum_rendering_unit.py,tests/dumpkit/test_common_unit.py,tests/foundation/registry/test_protocols.py,tests/utilities/test_compat.py).