// Package manifests judges every module's manifest as the node-engine reads it, and the catalogue as one shelf: each // modules/*/module.json through mesh-sdk's ParseManifestWith against the predefined.json at the root, with its templates // read from the tree beside it (WithTemplatesFrom), then the rules between manifests (CatalogueProblems, // IdentityProblems, DataProblems). // // Why it is here (issue 774): on 2026-10-30 mesh-catalog ca8d6f33 gave power's bar item two attributes its bar places // by none of. ParseManifest refuses that, and every node-engine refused to compose at 19:13; no check of the pull // request had parsed the manifest. That judgement was mesh-controller's `module check`, which the merge gate ran over // every manifest before the checker moved to mesh-delivery; the checker runs this repository's Go tests and the // composition, and no test parsed a manifest whole. This one does, in the same functions the nodes use. package manifests import ( "fmt" "os" "path/filepath" "sort" "git.novox.be/novox/mesh-sdk/go/catalogue" ) // Problems is what is wrong with the manifests under root/modules, one line each: a manifest the mesh refuses, named by // its path, then the rules between the manifests that parse. func Problems(root string) ([]string, error) { files, err := filepath.Glob(filepath.Join(root, "modules", "*", "module.json")) if err != nil { return nil, err } sort.Strings(files) list, err := catalogue.ReadPredefined(root) if err != nil { return nil, err } var out []string shelf := catalogue.Shelf{} for _, f := range files { raw, err := os.ReadFile(f) if err != nil { return nil, err } rel, _ := filepath.Rel(root, f) m, err := catalogue.ParseManifestWith(raw, list) if err == nil { m, err = catalogue.WithTemplatesFrom(m, filepath.Dir(f)) } if err != nil { out = append(out, fmt.Sprintf("%s: %v", rel, err)) continue } if _, twice := shelf[m.Module]; twice { out = append(out, fmt.Sprintf("%s: %s was already given; two manifests name one module", rel, m.Module)) continue } shelf[m.Module] = m } between := catalogue.CatalogueProblems(shelf) between = append(between, catalogue.IdentityProblems(shelf, catalogue.DefaultLongestMachine)...) between = append(between, catalogue.DataProblems(shelf)...) sort.Strings(between) return append(out, between...), nil }