Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

manifest_composite

Structural composite classification for a commit manifest. A manifest entry is a composite — a folder that owns no bytes of its own (a .scene / .component / .material / .assetType / ... root, whose children ride their own entries) — when it declares itself so OR it is the path-parent of another entry in the same manifest (<path>/...). This mirrors the rule the publisher applies when it writes the wire: composite ⇔ no blob of its own OR it parents another entry.

The runtime passthrough loader partitions a manifest with this to route composite entries to identity-only registration (nil bytes, no content fetch) instead of a content-store fetch. Deciding structurally — rather than trusting the row's is_composite flag — keeps the loader correct for a manifest whose folder-root rows carry a tree-hash checksum that no content blob backs.

Exports

  • M.parentPaths(paths: { string }) -> { [string]: boolean } — one pass over the manifest paths; returns the set of every path that is a strict path-parent of another entry.
  • M.isComposite(entry: { path: string, is_composite: boolean? }, parents) -> boolean — true when the entry declares itself composite OR structurally parents another entry.

Usage

local ManifestComposite = require("@builtin::modules.manifest_composite")

local paths = {}
for _, e in ipairs(entries) do
    paths[#paths + 1] = e.path
end
local parents = ManifestComposite.parentPaths(paths)

for _, e in ipairs(entries) do
    if ManifestComposite.isComposite(e, parents) then
        -- register identity only, no content fetch
    else
        -- fetch the leaf's bytes
    end
end