Answer architecture round 6: a manifest's reads names namespaces, loadReached notes only those nothing loaded provides, a mounted module labels its files by its namespace, Source.Load checks its mount, and the README keeps namespace and reads in an edited copy

This commit is contained in:
2026-10-11 12:41:11 +02:00
committed by Lillem4n
parent 3750770735
commit 89cafb1a21
13 changed files with 102 additions and 78 deletions
+6 -5
View File
@@ -36,8 +36,8 @@ func (f *Generator) NewTemplate(input string) (*Template, error) {
}
f.mu.Lock()
defer f.mu.Unlock()
if err := loadInline(&f.root, n, "template", false); err != nil {
return nil, f.noDataNote(fmt.Errorf("fejkdata: %w", withDefaultModules(err, f.defaultModules)))
if err := loadInline(&f.root, f.manifestReads, n, "template", false); err != nil {
return nil, f.noDataNote(fmt.Errorf("fejkdata: %w", err))
}
return &Template{g: f, n: n}, nil
}
@@ -84,13 +84,14 @@ func inputValue(input string) jsonvalue.Value {
return raw
}
// loadInline loads the unloaded categories n reads, then runs n through the pipeline against root.
func loadInline(root *folder, n node, label string, typedByGo bool) error {
// loadInline loads the unloaded categories n reads, then runs n through the pipeline against root;
// reads is every namespace the loaded manifests read.
func loadInline(root *folder, reads []string, n node, label string, typedByGo bool) error {
nodes := inlineNodes(n, label)
if err := refuseFolderRefs(nodes); err != nil {
return err
}
if err := loadReached(root, nil, referenced(root, nil, nodes)); err != nil {
if err := loadReached(root, reads, nil, referenced(root, nil, nodes)); err != nil {
return loadError{err}
}
return pipeline{