RR-3: the manifest reader reads an artifact's needs

The reader release reads the manifest words G writes: version MAJOR.MINOR, a * emitter in consumes and an
observer's finding stream already read; an artifact's needs is new.

Builds: design 47 G §340, §409, §47, §432, §368, §386, §387

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 10:35:22 +01:00
parent 317605963f
commit 9db65adb81
2 changed files with 25 additions and 0 deletions
+5
View File
@@ -1236,6 +1236,11 @@ type Artifact struct {
// DefaultSeries (SeriesOf).
Series string `json:"series,omitempty"`
// Needs are the artifact references, `<module>:<artifact>`, of the catalog graph's edges this artifact has where no
// other line of the manifest or of a seat's definition says them (design 47 G §47, §432). Read here so a reader
// release keeps a manifest that names them whole (design 47 G §340, §409); the manifest validator checks their form.
Needs []string `json:"needs,omitempty"`
// GeneratedFrom marks a package of a contracts module (novox/hq ADR 0608 §5, design 26 *Contracts modules*): the
// directory, relative to the module's, of the seat definitions every file of the package is generated from. A
// module carrying it holds contracts only and claims no seat, which the judge refuses naming the seat; the build
+20
View File
@@ -0,0 +1,20 @@
package catalogue
import "testing"
// A manifest carrying the words design 47 G writes is read whole by the reader release (design 47 G §340, §409):
// `version` as MAJOR.MINOR (§368), a `*` emitter in `consumes` (§386), an observer's finding stream (§387) and an
// artifact's `needs` (§47, §432).
func TestTheReaderReleaseReadsTheManifestWordsGWrites(t *testing.T) {
m, err := decodeForTest([]byte(`{"module":"mesh-watcher","version":"1.4",` +
`"consumes":["*.finding-written","mesh-conditions.findings-asked"],` +
`"streams":[{"name":"mesh-watcher-findings","events":["finding-written","finding-cleared","findings-stated"],"max-age-days":7,"max-mib":16}],` +
`"build":{"artifacts":[{"name":"program","kind":"bundle","language":"go","needs":["mesh-grants:program","node-tools:runtime"]}]}}`))
if err != nil {
t.Fatalf("a manifest with G's words was refused: %v", err)
}
if m.Version != "1.4" || m.Consumes[0] != "*.finding-written" || m.Streams[0].Name != "mesh-watcher-findings" ||
len(m.Build.Artifacts[0].Needs) != 2 || m.Build.Artifacts[0].Needs[0] != "mesh-grants:program" {
t.Fatalf("read as %+v", m)
}
}