Skip to content

feat(loader): a package's extensions -- namespaced data kept as JSON text (0.0.66) - #51

Merged
Sunrisepeak merged 1 commit into
openxlings:mainfrom
speak-agent:feat/extensions
Oct 18, 2026
Merged

Sunrisepeak merged 1 commit into
openxlings:mainfrom
speak-agent:feat/extensions

Conversation

@speak-agent

Copy link
Copy Markdown
Contributor

extensions = { <program> = { ... } } at the package level is loaded into Package::extensions as 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).

  • Canonical JSON: object keys sorted; a table keyed exactly 1..n, or empty, is an array.
  • Dropped with a line in Package::warnings: values JSON cannot carry, tables nested deeper than 16, and the whole extensions when over 4 KiB (never cut).
  • Package-level metadata: changes nothing installed, bumps no revision; older loaders ignore it.

Design: openxlings/xlings .agents/docs/2026-10-19-luban-os-one-app-versions-and-quick-start-design.md §8 (L1).

Tests: LoaderTest.Extensions_*.

…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).
@Sunrisepeak
Sunrisepeak merged commit 5523780 into openxlings:main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants