Repository navigation
feat(loader): a package's extensions -- namespaced data kept as JSON text (0.0.66) - #51
Merged
Merged
Conversation
…text, never interpreted (0.0.66)
`extensions = { luban = { tier = 2, title = { en = "labwc" } } }` at the
package level is loaded into `Package::extensions` as canonical JSON text of an
object (keys sorted; a table keyed exactly 1..n, or empty, is an array).
libxpkg and xlings keep it and hand it on unchanged; each first-level key names
the program that reads it (xpkg V2 spec, "extensions").
Rules: a value JSON cannot carry (function, userdata, non-finite number, a
non-string key outside an array) and a table nested deeper than 16 are
dropped; the whole `extensions` is dropped when its text is over 4 KiB --
never cut, so half of it is never read as all of it. Each drop is a line in
`Package::warnings`. Only package-level metadata: it changes nothing that is
installed, so it bumps no revision; an older loader reads known fields by name
and ignores it.
Tests: LoaderTest.Extensions_* (canonical JSON, absent, dropped types, a
self-reference, the size limit, a non-table, other fields unchanged).
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.
extensions = { <program> = { ... } }at the package level is loaded intoPackage::extensionsas canonical JSON text; libxpkg and xlings keep it and hand it on unchanged, never interpreting it. First user: Luban (extensions.luban: tier, gpu, title, summary, size, highlights).Package::warnings: values JSON cannot carry, tables nested deeper than 16, and the wholeextensionswhen over 4 KiB (never cut).Design: openxlings/xlings
.agents/docs/2026-10-19-luban-os-one-app-versions-and-quick-start-design.md§8 (L1).Tests:
LoaderTest.Extensions_*.