chore: normalize xpkg identity layout, enforce it in lint, pin CI to mcpp 0.0.105#117
Open
Sunrisepeak wants to merge 1 commit into
Open
chore: normalize xpkg identity layout, enforce it in lint, pin CI to mcpp 0.0.105#117Sunrisepeak wants to merge 1 commit into
Sunrisepeak wants to merge 1 commit into
Conversation
…mcpp 0.0.105
The index was already clean on identity: all 49 descriptors declare a
fully-qualified `name` and an atomic short segment, so mcpp#278's split
form appears nowhere here. What was NOT pinned was the layer below it —
where a descriptor lives — and that had let two real defects in.
Normalization (no identity/namespace/name value changes at all):
* pkgs/c/capi.lua.lua deleted. It was a BYTE-IDENTICAL duplicate of
pkgs/m/mcpplibs.capi.lua.lua — same md5, same identity
(mcpplibs.capi, lua). Whichever the directory scan reached first won;
edits to the other were dead code nobody would notice.
* pkgs/t/tensorvia-cpu.lua -> pkgs/a/aimol.tensorvia-cpu.lua, the
canonical path for identity (aimol, tensorvia-cpu). Off-canonical
names still resolve, but only via a COMPAT filename fallback that
mcpp schedules for removal in 1.0.0.
Lint now enforces all three identity rules mechanically:
1. `name` == `<namespace>.<short>` (existing check, kept)
2. `short` is a SINGLE atomic segment — depth belongs in `namespace`.
NEW. Both spellings of a nested package survive mcpp's normalizer
because it splits the FQN on its LAST dot, so
`namespace="mcpplibs", name="mcpplibs.capi.lua"` silently resolves
to `(mcpplibs.capi, lua)` — a namespace the descriptor never
declared. After this rule the declared and canonical namespace are
always the same string.
3. descriptor sits at the canonical path for its identity. NEW
(tests/check_package_filename.lua) — this is the check that found
both defects above.
Zero-namespace packages (imgui/ffmpeg/opencv) stay exactly as they are:
their bare `name` IS the FQN and that is a deliberate, legal form. Rule 2
still guards them — a dotted name with no declared namespace would
resolve into a namespace written down nowhere.
CI pinned to mcpp 0.0.105 (env.MCPP_VERSION + all three matrix entries),
where `mcpp xpkg parse` enforces rule 1 itself (INV-NAME, mcpp#278). The
lua lints therefore become an earlier, cheaper second gate rather than
the only one.
index.toml's min_mcpp/latest_mcpp deliberately stay at 0.0.102: the floor
is a CONSUMER contract, 0.0.105 carries a breaking change (bare names no
longer reach third-party namespaces), and nothing here needs 0.0.105
grammar — so there is no reason to force every consumer forward.
Verified locally against real mcpp 0.0.105: all 48 descriptors pass every
lint plus `mcpp xpkg parse`; the three counterexamples (split form,
non-atomic short, dotted-name-without-namespace) are each rejected with
the exact spelling to write instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The index was already clean on identity — all 49 descriptors declare a fully-qualified
namewith an atomic short segment, so mcpp#278's split form appears nowhere here. Nonamespaceornamevalue changes in this PR.What was not pinned was the layer below: where a descriptor lives. That gap had let two real defects in.
Normalization
pkgs/c/capi.lua.luadeletedpkgs/m/mcpplibs.capi.lua.lua— same identity(mcpplibs.capi, lua). Whichever the directory scan reached first won; edits to the other were dead code nobody would notice.pkgs/t/tensorvia-cpu.lua→pkgs/a/aimol.tensorvia-cpu.lua(aimol, tensorvia-cpu). Off-canonical names still resolve, but only through a COMPAT filename fallback mcpp schedules for removal in 1.0.0.Lint now enforces all three identity rules
Rule 1 —
name==<namespace>.<short>(existing, kept).Rule 2 —
shortis a SINGLE atomic segment; depth belongs innamespace. (new)Both survive mcpp's normalizer, because it splits the FQN on its last dot — so the second silently resolves to
(mcpplibs.capi, lua), a namespace the descriptor never declared. After this rule the declared namespace and the canonical one are always the same string.Rule 3 — descriptor sits at the canonical path for its identity. (new,
tests/check_package_filename.lua) — this is the check that found both defects above.The filename is not part of identity (mcpp resolves identity-first and re-verifies every hit against the file's own
package.{namespace,name}), so this is about two other things: keeping a package on mcpp's first filename probe, and making duplicate descriptors for one identity impossible to add unnoticed.Zero-namespace packages are untouched
imgui/ffmpeg/opencvkeepnamespace = ""— their barenameis the FQN, which is a deliberate, legal form. Consumers keep writingimgui = "0.0.3"; xlings key and store dir unchanged. Rule 2 still guards them: a dotted name with no declared namespace would resolve into a namespace written down nowhere.CI → mcpp 0.0.105
env.MCPP_VERSIONand all three matrix entries bumped0.0.102 → 0.0.105, wheremcpp xpkg parseenforces Rule 1 itself (INV-NAME, mcpp-community/mcpp#278). The two lua lints therefore become an earlier, cheaper second gate rather than the only defense.index.toml'smin_mcpp/latest_mcppdeliberately stay at0.0.102. The floor is a consumer contract; 0.0.105 carries a breaking change (bare names no longer reach third-party namespaces) and nothing in this index needs 0.0.105 grammar — so there is no reason to force every consumer forward. Rationale recorded inline invalidate.yml.Verification
Run locally against real mcpp 0.0.105:
mcpp xpkg parse.ns="chriskohlhoff",name="asio")ns="mcpplibs",name="mcpplibs.capi.lua")ns="",name="mcpplibs.capi.lua")Docs
docs/repository-and-schema.mdgains a 包身份:(namespace, name)的三条规则 section (rules + examples + why filenames are pinned even though they aren't identity), and the repo-layout / CI-behaviour / local-lint-reproduction sections are updated to match.