IX31: the whole test judges the indexer's manifest against a seat list holding the assigner seat's view

The indexer consumes the seat mesh-module-assigner's views.assignments in the seat's form, which the validator accepts only
where the seat list holds the seat and offers the state as a view; TestIndexerWhole seeds that definition.

Builds: design 47 G §616, §699, A-119, A-131
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 05:48:20 +01:00
parent b90e767529
commit 3c38f9c468
@@ -100,6 +100,7 @@ func TestIndexerWhole(t *testing.T) { // 1238/AC2, AC10; 1585/T14, T15
t.Fatal(err)
}
}
seedAssignerSeat(t, ctx, js)
// The take-in events are the indexer's ordinary events (ADR 0633 §5), on the path manifest-accepted takes.
tc, err := js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.ToolchainsBucket("mesh-build-go"), History: 1})
if err != nil {
@@ -787,6 +788,25 @@ func seedBuildModules(t *testing.T, ctx context.Context, js jetstream.JetStream,
}
}
// seedAssignerSeat keeps the trunk definition of the seat mesh-module-assigner, which offers its state assignments as a view (§616,
// §699): the indexer consumes it in the seat's form, and its own manifest is judged against the seat list it holds.
func seedAssignerSeat(t *testing.T, ctx context.Context, js jetstream.JetStream) {
t.Helper()
defs, err := js.KeyValue(ctx, index.SeatDefinitionsBucket)
if err != nil {
t.Fatal(err)
}
assignerDef := json.RawMessage(`{"format":1,"seat":"mesh-module-assigner","scope":"mesh","grain":"whole","domain":"Delivery","decision":"novox/hq ADR 0567",` +
`"verbs":[{"name":"assignments","input":{"type":"object"},"answer":{"type":"object"}}],"states":[{"name":"assignments","template":"state","view":true,` +
`"key-forms":[{"key":"<node>.node","value":{"type":"object"}}]}]}`)
assignerSum := sha256.Sum256(assignerDef)
assignerEntry, _ := json.Marshal(index.SeatDefinitionEntry{Seat: "mesh-module-assigner", Source: index.SourceTrunk, Repository: "novox/mesh-contracts", Module: "mesh-contracts",
Directory: ".", Commit: "4444444444444444444444444444444444444444", Digest: hex.EncodeToString(assignerSum[:]), Definition: assignerDef})
if _, err := defs.Put(ctx, "mesh-module-assigner.trunk", assignerEntry); err != nil {
t.Fatal(err)
}
}
// startIndexer is startIndexerRun for a test that never starts the program again.
func startIndexer(t *testing.T, put func(context.Context, buildLog), before ...func(context.Context, jetstream.JetStream)) (jetstream.JetStream, context.Context, jetstream.KeyValue, revisionView) {
js, ctx, candidates, modules, _ := startIndexerRun(t, put, before...)