assigner: read the builder's build ends whole from the first message at its start

Rule 1 held mesh-delivery-pipeline's want on novox as being built, though its build ended at 00:57:36: the assigner
reads the builder's stream of build ends whole at its start only when the bus keeps it last per subject, and the bus
keeps MESH_DELIVERY_BUILDER_BUILDS by age (168 hours, no max per subject), so after each restart it heard only the ends
said since. It now reads the stream from its first message whichever way it is kept (A-233), the last end of each
fingerprint standing. The integration test's stream is kept by age, as live.

Builds: design 47 G A-181, A-233, §556
This commit is contained in:
2026-11-15 16:13:03 +01:00
parent 9bb02a2cb2
commit 0fe5f0aaaf
2 changed files with 2 additions and 2 deletions
@@ -181,7 +181,7 @@ func hearBuilds(ctx context.Context, js jetstream.JetStream, ends *builtEnds, wa
logf("acknowledging %s: %v", m.Subject(), err)
}
wake()
}, logf)
}, logf, process.FromFirst()) // read whole from its first message whether the bus keeps it last per subject or by age (A-181, A-233)
if err != nil {
nh.NotHeard(buildsStreamName, "what the builder built is not heard until the assigner starts again, so no want names a build's parts or its keeping node and no put goes on", err)
return
@@ -208,7 +208,7 @@ func startBed(t *testing.T, leaveOut string) *bed {
}
// The builder's stream of build ends, kept last per subject (its manifest's `last-per-subject`, design 47 G A-181), which the assigner
// reads whole at its start and follows through its durable, as the grants part makes it (from the last of each subject).
if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: buildsStreamName, Subjects: []string{process.ModuleStreamSubject(builds.BuilderModule, builds.BuildEndedEvent+".>")}, MaxMsgsPerSubject: 1}); err != nil {
if _, err := js.CreateStream(ctx, jetstream.StreamConfig{Name: buildsStreamName, Subjects: []string{process.ModuleStreamSubject(builds.BuilderModule, builds.BuildEndedEvent+".>")}, MaxAge: 168 * time.Hour}); err != nil { // kept by age, as the bus keeps it live (2026-11-15): read whole from its first message all the same (A-233)
t.Fatal(err)
}
if _, err := js.CreateOrUpdateConsumer(ctx, buildsStreamName, jetstream.ConsumerConfig{Durable: "n1_mesh-delivery-assigner", AckPolicy: jetstream.AckExplicitPolicy,