chore: migrate descriptors to SPEC-001 short-name identity (mcpp 0.0.106)#120
Open
Sunrisepeak wants to merge 3 commits into
Open
chore: migrate descriptors to SPEC-001 short-name identity (mcpp 0.0.106)#120Sunrisepeak wants to merge 3 commits into
Sunrisepeak wants to merge 3 commits into
Conversation
…106) mcpp 0.0.106 restores the canonical identity form: `namespace` carries the hierarchy, `name` is a single atomic segment. 0.0.105 briefly required the opposite (name spelled as the fully-qualified `<namespace>.<name>`), which was an encoding constraint rather than a design rule — it existed only because mcpp re-derived the wire name instead of using the literal it had already read. namespace = "compat", name = "compat.zlib" -> name = "zlib" 45 descriptors migrated; the 3 namespace-less public module packages (imgui/ffmpeg/opencv) are unchanged — a bare name IS their full identity. Three short names now repeat across namespaces: `imgui`, `ffmpeg` and `lua` (compat's versus the default namespace's, and compat's `lua` versus mcpplibs.capi's). That is legal — identity is the PAIR, and only the pair has to be unique. It needs xlings >= 0.4.69 (openxlings/xlings#381), which keys the index by (namespace, name); 0.0.106 bundles it. Verified against a local path index: bare `imgui` resolves to `mcpplibs:imgui` and `[dependencies.compat] imgui` resolves to `compat:imgui`, each installing to its own store dir. check_package_name.lua is inverted to match: `name` must be atomic, hierarchy belongs in `namespace`, and the legacy fully-qualified spelling stays accepted (the prefix is stripped before judging) so nothing published before this is invalidated. No filename lint — the filename is not part of identity. min_mcpp/latest_mcpp move to 0.0.106 in lock-step with the CI pin. This one is NOT optional: a client older than 0.0.106 re-derives `<ns>.<short>`, misses the short-name key, and reports a bare E_NOT_FOUND with nothing pointing at the cause. Verified locally: all 48 descriptors pass the inverted lint; identity pairs are unique; no `name` still carries a dot; the three counterexamples (non-atomic short name, dotted name without a namespace, legacy FQN) each behave as specified.
CI caught a real conflict the short-name migration introduced:
build_index failed: duplicate package identity 'compat:ffmpeg'
`imgui`, `ffmpeg` and `opencv` declared `namespace = ""`, meaning "inherit the
index's default namespace". 11 workspace members register this repo as
`[indices] compat = { path = ... }`, so under those members the repo default IS
`compat` — and the namespace-less descriptors became `compat:ffmpeg` /
`compat:imgui`, colliding head-on with the freshly shortened `compat.ffmpeg`
and `compat.imgui`.
The migration exposed it, but the fragility is older and independent of it: a
namespace-less descriptor's identity depends on the NAME THE CONSUMER HAPPENS
TO REGISTER THE INDEX UNDER. The same repo mounted as `compat` and as `default`
gives those three packages two different identities. That is exactly what
SPEC-001 exists to remove — identity should be what the descriptor declares.
So rather than reverting the two colliding descriptors to the legacy spelling
(which would have unblocked CI while leaving the trap armed), declare the
namespace outright:
namespace = "", name = "imgui" -> namespace = "mcpplibs"
Identity is now context-free. Verified by simulating all three registration
styles (repo default = mcpplibs / compat / default): zero duplicate identities
in every case, where before `compat` produced two.
Consumers are unaffected: a bare `imgui` still resolves via the default-namespace
search path, and `[dependencies.compat] imgui` still resolves to compat's.
Checked against the released mcpp 0.0.106 with the index mounted as `compat` —
builds clean, no duplicate-identity error.
48/48 descriptors still pass the lua lint and `mcpp xpkg parse`.
…gration
Shortening every `package.name` (SPEC-001) also changed how a descriptor must
ADDRESS another package: `pkginfo.install_dir("compat:xcb-proto")`, not the old
`compat:compat.xcb-proto`. Two install hooks kept the old spelling, and neither
failed where the mistake was:
* compat.xcb could not find xcb-proto's XML, so c_client.py never ran and the
install aborted with a bare `[xcb] failed`. libxcb.so was never built, and
CI reported it three levels downstream as
`libX11.so: undefined reference to xcb_connection_has_error` in gui-stack,
imgui-module and imgui-window.
* compat.x11 only checked the lookup for nil, never `os.isdir`, so it carried
on with a directory that does not exist and generated its keysym tables from
no headers at all — silently, with a successful build.
Both now try the SPEC-001 spelling first and keep the pre-SPEC-001 ones as
fallbacks, so these descriptors still resolve against an unmigrated index.
compat.x11 gets the same isdir guard compat.xcb already had.
Add tests/check_cross_package_refs.lua to the lint job: it resolves every
`pkginfo.install_dir`/`build_dep` string against the identities the repository
actually declares. A reference into a foreign namespace (xim:python) is skipped,
and a ladder of spellings only needs one that resolves, so legacy fallbacks stay
legal. Matching is against the literal `package.name`, deliberately not a
normalised form — normalising the dots away would have called the broken
reference resolvable.
Verified with mcpp 0.0.106 against this branch: gui-stack 5/5, imgui-module 1/1,
imgui-window 1/1. Reverting the descriptor fix makes the lint flag exactly these
two references and nothing else.
This was referenced Jul 25, 2026
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.
What
mcpp 0.0.106 restores the canonical identity form:
namespacecarries the hierarchy,nameis a single atomic segment.45 descriptors migrated. The 3 namespace-less public module packages (
imgui/ffmpeg/opencv) are unchanged — a bare name IS their full identity.Why the rule flipped
0.0.105 briefly required the opposite (
namespelled as the fully-qualified<namespace>.<name>). That was an encoding constraint, not a design rule — it existed only because mcpp re-derived the wire name instead of using the literalpackage.nameit had already read. 0.0.106 uses the literal, and the constraint disappears.Full normative text: mcpp
docs/spec/package-identity.md(SPEC-001), landed in mcpp-community/mcpp#280.Three short names now repeat across namespaces
imgui,ffmpegandlua— compat's versus the default namespace's, and compat'sluaversusmcpplibs.capi's.That is legal: identity is the PAIR, and only the pair must be unique. It needs xlings >= 0.4.69 (openxlings/xlings#381), which keys the index by
(namespace, name); mcpp 0.0.106 bundles it.Verified against a local path index built from this branch:
[dependencies] imguimcpplibs:imguimcpplibs-x-imgui[dependencies.compat] imguicompat:imguicompat-x-imguiNo ambiguity — the namespace-less descriptors take the index's default namespace, so the pairs differ.
Lint inverted to match
check_package_name.luanow requiresnameto be atomic and the hierarchy to live innamespace. The legacy fully-qualified spelling stays accepted (the prefix is stripped before judging), so nothing published before this is invalidated — this repo simply no longer uses it.No filename lint: the filename is not part of identity. mcpp 0.0.106 discovers descriptors by declared identity, falling back to a scan when the recommended names miss, so a descriptor may be called anything.
<name>.lua/<namespace>.<name>.luaremain recommended because they hit the fast path.Floor bump is NOT optional
min_mcpp/latest_mcpp→ 0.0.106, in lock-step with the CI pin. A client older than 0.0.106 re-derives<ns>.<short>, misses the short-name key, and reports a bareE_NOT_FOUNDwith nothing pointing at the cause. Theindex.tomlfloor is what turns that into a clear E0006 upgrade message instead.Verification
Run locally against the actually released mcpp 0.0.106 (
xlings install mcpp@0.0.106, bundling xlings 0.4.69):mcpp xpkg parse.(namespace, name)are unique; nonamestill carries a dot.Docs:
docs/repository-and-schema.mdgains a 包身份 section (rules, the three same-short-name pairs, why filenames are free-form); CI-behaviour and local-lint sections updated.