Join item 2, indexer: its views family and the assigner's by their manifests' names; its ask-again records a hand act
views.IndexerStream and views.AssignerStream are gone from mesh-sdk (J3 lead's (a)): the indexer names its own views
family "indexer-views" and the assigner's "assigner-views", as each manifest's `streams` names them. Its first-view
ask-again records the hand act through seat:mesh-hand-acts.hand-act (views.StatusTools takes a handacts.Recorder;
the manifest already invokes the verb). judge_test.go gofmt'd (c6c6687 left it unformatted).
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
"git.novox.be/novox/mesh-sdk/go/handacts"
|
||||
"git.novox.be/novox/mesh-sdk/go/health"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
@@ -28,7 +29,7 @@ func viewTools(getenv func(string) string, state func(string) views.Source, now
|
||||
out = append(out, views.ReadTool(delivery.IndexerModule, t.Tool, t.State, t.Words, state(t.State), marks, now))
|
||||
}
|
||||
// Its own first views, of the assigner's placement (DLV-F3r): read, and asked again by hand.
|
||||
return append(out, views.StatusTools(delivery.IndexerModule, "indexer_first_views", "indexer_first_view_again", stdio.State(views.StatusState), now)...)
|
||||
return append(out, views.StatusTools(delivery.IndexerModule, "indexer_first_views", "indexer_first_view_again", stdio.State(views.StatusState), handacts.Recorder{Ask: stdio.Ask}, now)...)
|
||||
}
|
||||
|
||||
// keptSource is one of the indexer's states as its runtime reads it.
|
||||
|
||||
@@ -82,6 +82,9 @@ var firstViewsBucket = delivery.IndexerModule + "_" + views.StatusState
|
||||
// placementTool is the assigner's first-view tool of its placement, as the indexer's invokes names it (ADR 0621 §2).
|
||||
const placementTool = delivery.AssignerModule + "." + delivery.PlacementState
|
||||
|
||||
// assignerViewsStream is the assigner's views family, as the assigner's manifest's `streams` names it (ADR 0615 §5).
|
||||
const assignerViewsStream = "assigner-views"
|
||||
|
||||
// followPlacement reads the seat mesh-placement's placement through the assigner's first view and then its views
|
||||
// family, never its bucket (ADR 0615 §1, DLV-F1r), into gate: each key as it changes, settled once answered, with
|
||||
// changed told whenever what the gate passes on changed. It waits for the first answer at most views.Bound, so a
|
||||
@@ -129,10 +132,10 @@ func followPlacement(ctx context.Context, js jetstream.JetStream, cred process.A
|
||||
close(answered)
|
||||
}()
|
||||
// The assigner's views family, on the indexer's durable consumer, once the first view is asked.
|
||||
switch cons, err := cred.EventConsumer(ctx, js, catalogue.StreamBusName(views.AssignerStream)); {
|
||||
switch cons, err := cred.EventConsumer(ctx, js, catalogue.StreamBusName(assignerViewsStream)); {
|
||||
case err != nil:
|
||||
logf("the consumer %s on %s does not exist yet (%v): the placement is the first view's alone, asked again by hand, until the indexer starts again",
|
||||
cred.EventConsumerName(), catalogue.StreamBusName(views.AssignerStream), err)
|
||||
cred.EventConsumerName(), catalogue.StreamBusName(assignerViewsStream), err)
|
||||
default:
|
||||
if _, err := process.HearEvents(cons, views.Hear(ctx, map[string]*views.Follower{delivery.PlacementState: f}, logf), logf); err != nil {
|
||||
logf("the assigner's views family is not heard (%v): the placement is the first view's alone until the indexer starts again", err)
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
// ViewsStream is the indexer's views family on its old streams section (ADR 0615 §5): one event per changed key of
|
||||
// each state in ViewedStates.
|
||||
const ViewsStream = views.IndexerStream
|
||||
// each state in ViewedStates. Its name is the manifest's `streams` entry.
|
||||
const ViewsStream = "indexer-views"
|
||||
|
||||
// MarksBucket is the indexer's state of what its views family said each state up to.
|
||||
const MarksBucket = delivery.IndexerModule + "_" + views.MarksState
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestTheJudge(t *testing.T) {
|
||||
// (the enrolment's first-view tools, DLV-M6), and the judge takes it.
|
||||
{name: "a claimed seat's module with tools of its own",
|
||||
raws: map[string]string{
|
||||
"def": `{"module":"def","version":"1","seats":[{"name":"enrolment","scope":"mesh","serves":["issue","again"]}]}`,
|
||||
"def": `{"module":"def","version":"1","seats":[{"name":"enrolment","scope":"mesh","serves":["issue","again"]}]}`,
|
||||
"enrolment": `{"module":"enrolment","version":"1","claims":[{"name":"enrolment","scope":"mesh","serves":["issue","again"]}],` +
|
||||
`"tools":["enrolment_first_views","enrolment_first_view_again"]}`}},
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user