B-src: the builder's floor wakes on the indexer's take-in.taken
The seat mesh-catalog defines no manifest-accepted any more: the builder consumes the indexer's take-in.taken in its place (module.json, names.go's patterns) and wakes its floor on every one, looking at every module again as before (versions.go, the wake take-in.taken). With the in-progress commit before it the builder reads no source stamp and its untagged suite is green. Builds: design 47 H §764 (the indexer: its events manifest-refused and manifest-accepted, with their reader); lead answers H-A-48, H-A-49, H-A-66, H-A-116 (hq 508faf0c) Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -399,7 +399,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
// The seat mesh-artifact-sweep says artifacts-gone when it found a key's blob gone (issue 1937, ADR 0571 §2): the
|
||||
// builder's durable consumer on EVENTS, made by the grants part from the manifest's consumes. Where it is not there yet the builder says
|
||||
// so; it still asks held at its start and at every module value.
|
||||
// The same consumer carries what wakes a floor (design 51 *The floor*): the indexer's manifest-accepted and the
|
||||
// The same consumer carries what wakes a floor (design 51 *The floor*): the indexer's take-in.taken (design 47 H H-A-116) and the
|
||||
// condition keeper's condition-cleared.
|
||||
floor := floorWake{b: b, waits: floorWaits, logf: logger.Printf}
|
||||
// And the four registry seats' published, refused and removed (DLV-B4), which move a numbered version.
|
||||
@@ -416,7 +416,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
}
|
||||
heardGone(ctx, b, m, logger.Printf)
|
||||
}
|
||||
// The seats' events (artifacts-gone, the registry seats' words, the build seats' toolchain-reported, manifest-accepted and
|
||||
// The seats' events (artifacts-gone, the registry seats' words, the build seats' toolchain-reported, the indexer's take-in.taken and
|
||||
// manifest-reads-changed and the seat mesh-conditions' condition-cleared: seatEventPatterns); the owners' views events and the
|
||||
// catalog half's catalog-revision and registration-changed and the gate's source-moved are the views reader's (a message has
|
||||
// one taker, so no pattern here covers them).
|
||||
|
||||
@@ -9,7 +9,7 @@ const namedTreePrefix = "named:"
|
||||
|
||||
// seatEventPatterns are the seats' events the builder's own handler takes off its durable consumer (its manifest's `consumes` of
|
||||
// them): the registry seats' words, artifacts-gone, the build seats' toolchain-reported, condition-cleared, the node-engine
|
||||
// seat's events and, of the seat mesh-catalog, manifest-accepted, version-released and versions-filled. The seat mesh-catalog's
|
||||
// seat's events, of the seat mesh-catalog, version-released and versions-filled, and the indexer's take-in.taken. The seat mesh-catalog's
|
||||
// catalog-revision and registration-changed and the seat mesh-delivery's source-moved are the views reader's (the branch
|
||||
// follower's), so no pattern here covers them: a message has one taker.
|
||||
var seatEventPatterns = func() []string {
|
||||
@@ -18,8 +18,9 @@ var seatEventPatterns = func() []string {
|
||||
"mesh-artifact-sweep", "mesh-conditions", "node-engine", "node-build-go", "node-build-image", "node-build-node"} {
|
||||
out = append(out, "mesh.seat."+seat+".event.>")
|
||||
}
|
||||
for _, event := range []string{meshcatalog.EventManifestAccepted, meshcatalog.EventVersionReleased, meshcatalog.EventVersionsFilled} {
|
||||
for _, event := range []string{meshcatalog.EventVersionReleased, meshcatalog.EventVersionsFilled} {
|
||||
out = append(out, "mesh.seat."+meshcatalog.Seat+".event."+event, "mesh.seat."+meshcatalog.Seat+".event."+event+".>")
|
||||
}
|
||||
return out
|
||||
// And the indexer's take-in.taken, which wakes the floor (design 47 H H-A-116).
|
||||
return append(out, takenInSubject)
|
||||
}()
|
||||
|
||||
@@ -32,9 +32,13 @@ func TestTheNamesAreTheManifests(t *testing.T) {
|
||||
t.Errorf("the builder reads %s, its manifest's reads are %v", read, m.Reads)
|
||||
}
|
||||
}
|
||||
// The catalog half (design 47 G §348, §614) is followed through the seat, and no state of the indexer is.
|
||||
// The catalog half (design 47 G §348, §614) is followed through the seat, and no state of the indexer is; the indexer's
|
||||
// event take-in.taken wakes the floor (design 47 H H-A-116).
|
||||
if !slices.Contains(m.Consumes, "mesh-delivery-indexer.take-in.taken") {
|
||||
t.Errorf("the builder's floor wakes on no take-in.taken: its manifest consumes %v", m.Consumes)
|
||||
}
|
||||
for _, c := range m.Consumes {
|
||||
if strings.HasPrefix(c, "mesh-delivery-indexer.") {
|
||||
if strings.HasPrefix(c, "mesh-delivery-indexer.") && c != "mesh-delivery-indexer.take-in.taken" {
|
||||
t.Errorf("the builder follows %s, an indexer state, its manifest consumes it", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,9 +257,9 @@ func aFloorsWakeIsHeard(t *testing.T) {
|
||||
waits.Wait("m/lib", versions.SeatGoPackages, "", versions.Floor{Silent: []string{versions.SourceRequirements}}, nil, time.Unix(0, 0))
|
||||
waits.Wait("m/img", versions.SeatImages, "", versions.Floor{Silent: []string{versions.SourceTags}}, nil, time.Unix(0, 0))
|
||||
f := &floorWake{b: &build.Builder{}, waits: waits, logf: log.New(&logs, "", 0).Printf}
|
||||
accepted := &wakeMsg{subject: manifestAcceptedSubject}
|
||||
if !f.heard(context.Background(), accepted) || !accepted.acked || !strings.Contains(logs.String(), "the floor of m/lib is asked again: manifest-accepted") {
|
||||
t.Fatalf("manifest-accepted: acked %v, log %q", accepted.acked, logs.String())
|
||||
accepted := &wakeMsg{subject: takenInSubject}
|
||||
if !f.heard(context.Background(), accepted) || !accepted.acked || !strings.Contains(logs.String(), "the floor of m/lib is asked again: take-in.taken") {
|
||||
t.Fatalf("take-in.taken: acked %v, log %q", accepted.acked, logs.String())
|
||||
}
|
||||
logs.Reset()
|
||||
cleared := &wakeMsg{subject: conditionClearedSubject, data: []byte(`{"subject":{"scope":"probe","id":"ace/mesh-delivery-forge-bridge"}}`)}
|
||||
@@ -299,8 +299,8 @@ func aFloorsWakeIsHeard(t *testing.T) {
|
||||
if !h.heard(context.Background(), published) || !published.acked || published.naked || len(saidPub) != 1 || saidPub[0].Artifact != "m:program" {
|
||||
t.Fatalf("a published of a reserved version: acked %v, naked %v, said %+v, log %q", published.acked, published.naked, saidPub, logs.String())
|
||||
}
|
||||
if h.heard(context.Background(), &wakeMsg{subject: manifestAcceptedSubject}) {
|
||||
t.Fatal("manifest-accepted was taken as a seat's outcome")
|
||||
if h.heard(context.Background(), &wakeMsg{subject: takenInSubject}) {
|
||||
t.Fatal("take-in.taken was taken as a seat's outcome")
|
||||
}
|
||||
// Design 47 G A-420: a message left for the bus is said given up on the last delivery its consumer allows, never before.
|
||||
for _, n := range []uint64{4, EventDeliveries} {
|
||||
|
||||
@@ -13,7 +13,6 @@ import (
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions"
|
||||
gitseat "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/git"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
|
||||
"mesh-delivery-builder/internal/build"
|
||||
@@ -189,7 +188,8 @@ func emitSeatEvent(ctx context.Context, js jetstream.JetStream, cred process.Acc
|
||||
|
||||
// The events on the builder's consumer of EVENTS that wake a floor (design 51 *The floor*, DLV-B3b).
|
||||
var (
|
||||
manifestAcceptedSubject = meshcatalog.SubjectManifestAccepted
|
||||
// The indexer's take-in.taken, which the builder consumes in place of the retired manifest-accepted (design 47 H H-A-116).
|
||||
takenInSubject = "mesh.mod.mesh-delivery-indexer.event.take-in.taken"
|
||||
conditionClearedSubject = meshconditions.SubjectConditionCleared
|
||||
)
|
||||
|
||||
@@ -204,9 +204,9 @@ type floorWake struct {
|
||||
// heard takes a message of the consumer in when it is one that wakes a floor, acknowledged, and answers whether it was.
|
||||
func (f *floorWake) heard(ctx context.Context, m jetstream.Msg) bool {
|
||||
switch m.Subject() {
|
||||
case manifestAcceptedSubject:
|
||||
case takenInSubject:
|
||||
f.ack(m)
|
||||
f.wake(ctx, versions.WakeAccepted, "", "")
|
||||
f.wake(ctx, versions.WakeTakenIn, "", "")
|
||||
case conditionClearedSubject:
|
||||
f.ack(m)
|
||||
var e meshconditions.ConditionEvent
|
||||
|
||||
Reference in New Issue
Block a user