Answer architecture round 1: a module's reads sits on its index entry or, for a source without an index, in the load that walks it, the note names default modules, the shipped modules are listed by name, datafiles drops its unused base, and item 195 files the builtins' second parse

This commit is contained in:
2026-10-10 13:16:59 +02:00
committed by Lillem4n
parent e8b7d95559
commit 50e1a9fb22
14 changed files with 120 additions and 59 deletions
+4 -4
View File
@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"io/fs"
"path"
"sort"
"strings"
@@ -19,7 +18,8 @@ const ManifestFile = ".fejkdata.json"
type Manifest struct {
// Index is every category of the source by dot path; nil where the manifest has none.
Index map[string]IndexEntry `json:"index"`
// Reads is every module the source reads by default, directly or through another.
// Reads is every module the source reads by default, directly or through another; the
// error for a reference naming nothing names them, and nothing loads them.
Reads []string `json:"reads"`
}
@@ -35,7 +35,7 @@ func (s Source) Manifest() (Manifest, error) {
if err := s.check(); err != nil {
return Manifest{}, err
}
b, err := fs.ReadFile(s.fsys, path.Join(s.base, ManifestFile))
b, err := fs.ReadFile(s.fsys, ManifestFile)
if errors.Is(err, fs.ErrNotExist) {
return Manifest{}, nil
}
@@ -50,7 +50,7 @@ func (s Source) Manifest() (Manifest, error) {
}
// ManifestPath is the manifest's path as errors name it.
func (s Source) ManifestPath() string { return s.labelled(path.Join(s.base, ManifestFile)) }
func (s Source) ManifestPath() string { return s.labelled(ManifestFile) }
// decodeManifest decodes a manifest, refusing any key or shape it does not define, and
// reports every mistake: first each entry's own, in path order, then each parent naming