§717 (3), the builder, the checker and the indexer follow the assignments by the seat, at the holder the seat-holders view names
buildrun's AssignerHolder asked the seat's verb for the holder every 5 seconds. The builder and the checker now follow mesh-module-assigner's assignments through views.ProcessReader.FollowSeat with the catalog half's holder function (the checker gains the catalog half's reader of §614 for it); the indexer reads the claimant from its own catalog (Indexer.ClaimantNow) and follows its seat-holders view again at each refresh of its build modules. AssignerHolder goes; the manifests consume the seat-holders view (the checker also the catalog half's events and verbs), and the assigner's seat-holders first-view tool answers the checker and the indexer. The beds give each part a claimant and a seat-holders view in place of the seat verb's answer; the indexer's beds hold the claimant from the start, so the merge test reads the newest revision. Builds: design 47 G §717, §614, A-298, A-302 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -283,15 +283,14 @@ func startBedWith(t *testing.T, closed bool) *bed {
|
||||
"git": "mesh-delivery-forge-bridge", "mesh-catalog": "mesh-delivery-indexer", // the floor's sources are the holders of git and mesh-catalog
|
||||
"mesh-builds": builds.BuilderModule}) // the builder's own seat, whose verb reserved it answers once its definition is read (A-115, A-278)
|
||||
readers := []string{"n1_" + builds.BuilderModule, "n2_" + builds.BuilderModule}
|
||||
// The seat mesh-module-assigner's holder is read from the seat's verb assignments, as the builder finds it at run time (A-119).
|
||||
assignerSub, err := ctl.Subscribe("mesh.seat.mesh-module-assigner.call.assignments.>", func(m *nats.Msg) {
|
||||
reply, _ := json.Marshal(map[string]any{"result": map[string]any{"seats": []map[string]any{{"seat": "mesh-module-assigner", "holders": []map[string]string{{"module": testAssigner}}}}}, "node": "ctl"})
|
||||
_ = m.Respond(reply)
|
||||
})
|
||||
if err != nil {
|
||||
// Design 47 G §717, A-298: the catalog half names testAssigner the claimant of mesh-module-assigner, and its seat-holders view
|
||||
// names it the seat's holder, so the builder follows the assignments at it; nothing answers the seat's verb assignments.
|
||||
b.catalog.put(t, meshcatalog.CatalogEntry{Module: testAssigner, Repository: "novox/mesh-catalog", Commit: "c0", Fp: "src2:" + strings.Repeat("a", 64),
|
||||
ManifestDigest: "sha256:" + strings.Repeat("b", 64), Manifest: map[string]any{"module": testAssigner, "claims": []any{map[string]any{"name": "mesh-module-assigner"}}}})
|
||||
seatHolders := viewstest.Serve(t, ctx, js, ctl, testAssigner, "seat-holders", testAssigner+".seat-holders", readers...)
|
||||
if _, err := seatHolders.Put(ctx, "mesh-module-assigner", []byte(`{"seat":"mesh-module-assigner","holders":[{"module":"`+testAssigner+`","node":"n1"}]}`)); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { _ = assignerSub.Unsubscribe() })
|
||||
viewstest.Serve(t, ctx, js, ctl, testAssigner, "assignments", testAssigner+".assignments", readers...)
|
||||
b.builds = mk(builds.BuilderBuildsBucket, builds.BuilderBuildsHistory)
|
||||
b.instances = mk(instancesBucket, 1)
|
||||
@@ -990,6 +989,12 @@ func TestTheBuilderAsksTheBuildSeatsAndCallsNoNode(t *testing.T) {
|
||||
if n := calls.Load(); n != 0 {
|
||||
t.Errorf("%d tool calls reached a build module", n)
|
||||
}
|
||||
// Design 47 G §717, A-298: the assignments are followed at the holder the seat-holders view names, no seat verb asked for it.
|
||||
for deadline := time.Now().Add(10 * time.Second); !strings.Contains(b.out.String(), "holds "+testAssigner+"'s assignments, the holder of the seat mesh-module-assigner"); time.Sleep(10 * time.Millisecond) {
|
||||
if time.Now().After(deadline) {
|
||||
t.Fatalf("the builder did not follow the assignments at the seat's holder:\n%s", b.out.String())
|
||||
}
|
||||
}
|
||||
// 1887/AC1: one ask per build module the build needs (netcheck: a Go and a TypeScript bundle), each on its seat's
|
||||
// delivery stream.
|
||||
got := asked()
|
||||
|
||||
@@ -119,7 +119,9 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
// The build modules are no names (design 47 G A-82): the holders of the build seats, the seat list's definitions and the
|
||||
// catalog half's claims, found at each use.
|
||||
seatGate := newSeatGate()
|
||||
seatGate.Holders(branches.SeatHolders(ctx))
|
||||
// The part's one holder function (A-298): the seat list's callers and the views found by their seat (§717) read it.
|
||||
holders := branches.SeatHolders(ctx)
|
||||
seatGate.Holders(holders)
|
||||
seats := buildrun.NewBuildSeats(seatGate.definitions, versions.HolderOf(branches))
|
||||
bound := defaultStepBound
|
||||
if v := strings.TrimSpace(getenv("MESH_BUILDER_STEP_BOUND")); v != "" {
|
||||
@@ -344,26 +346,21 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
// asked when the bound ends), is call-unanswered in the builder's findings (issue 1966, ADR 0668 §3, ADR 0596 §2).
|
||||
reads.callsOf(found, pubBoundsKV.KV, heardBy(calls.CallKept), logger.Printf)
|
||||
b.Forms = reads.built
|
||||
// The assignments names the nodes the builder counts, once the seat list names the seat's holder and its first view is answered:
|
||||
// the view is the holder's first-view tool, followed by its views family (A-119, A-131); no assigner module is named.
|
||||
// The assignments names the nodes the builder counts: the seat mesh-module-assigner's view, followed at the holder the
|
||||
// seat-holders view names and as it moves (design 47 G §717), its first view the holder's tool named for the state; no
|
||||
// assigner module is named and nothing asks for the holder on a timer.
|
||||
assignmentsErrs := make(chan error, 1)
|
||||
assignments, err := reader.FollowSeat(mma.Seat, mma.StateAssignments, holders)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
holder, ok := buildrun.AssignerHolder(ctx, calls.Call, 5*time.Second, buildrun.SleepFor, logger.Printf)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
names := buildrun.AssignmentsOf(holder)
|
||||
assignments, err := reader.Follow(names.Holder, mma.StateAssignments, names.Tool)
|
||||
if err != nil {
|
||||
assignmentsErrs <- err
|
||||
return
|
||||
}
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-assignments.Follower().Ready():
|
||||
}
|
||||
pe, err := buildrun.FollowAssignmentsIn(ctx, reader, names.Bucket, gate, b.NodesChanged, logger.Printf)
|
||||
pe, err := buildrun.FollowAssignmentsIn(ctx, reader, assignments.Bucket(), gate, b.NodesChanged, logger.Printf)
|
||||
if err != nil {
|
||||
assignmentsErrs <- err
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user