G §422, §698: the node-engine serves first-views, first-view-again and entry-again, and its manifest names the verbs it serves
first-views answers {first-views, entries, wants}, entry-again asks one entry again as a recorded hand act and
answers {asked, read}; first-view-again names no view the engine follows (it follows no branch) and refuses in
words. module.json's claim of node-engine lists every verb the engine serves.
Builds: design 47 G §422, §698
This commit is contained in:
@@ -390,3 +390,27 @@ func composeCandidateFrom(node string, shadow *atomic.Pointer[selfcompose.Shadow
|
||||
return json.RawMessage(raw), nil
|
||||
}
|
||||
}
|
||||
|
||||
// firstViewsFrom answers the seat's verb first-views from the composer of this run (design 47 G §698): the views the node-engine
|
||||
// follows (none), the entries it keeps and the wants it composes from.
|
||||
func firstViewsFrom(composer *atomic.Pointer[selfcompose.Composer]) func() (any, error) {
|
||||
return func() (any, error) {
|
||||
c := composer.Load()
|
||||
if c == nil {
|
||||
return nil, errors.New("this node composes none of its own modules now (it applies the controller's compositions, or its node agent is starting), so it keeps no entry")
|
||||
}
|
||||
views, entries, wants := c.FirstViews()
|
||||
return map[string]any{"first-views": views, "entries": entries, "wants": wants}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// entryAgainFrom asks one entry of the catalog half again, for the seat's verb entry-again (design 47 G §698).
|
||||
func entryAgainFrom(composer *atomic.Pointer[selfcompose.Composer]) func(ctx context.Context, fingerprint string) error {
|
||||
return func(ctx context.Context, fingerprint string) error {
|
||||
c := composer.Load()
|
||||
if c == nil {
|
||||
return errors.New("this node composes none of its own modules now, so it keeps no entry to ask again")
|
||||
}
|
||||
return c.EntryAgain(ctx, fingerprint)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1019,6 +1019,7 @@ func runLink(ctx context.Context, opts options) error {
|
||||
queue.Acts.Composition = compositionFrom(current)
|
||||
queue.Acts.Compose = composeFrom(current, &composerNow)
|
||||
queue.Acts.Packages = packagesFrom(mine.Node, queue, &composerNow)
|
||||
queue.Acts.FirstViews, queue.Acts.EntryAgain = firstViewsFrom(&composerNow), entryAgainFrom(&composerNow)
|
||||
queue.Acts.SeatList, queue.Acts.SeatListAgain = seatListRead, seatListAgain
|
||||
queue.Acts.ProcessBuilds = func(module string) (any, error) {
|
||||
d, err := declaredNow(opts.state, nil)
|
||||
|
||||
Reference in New Issue
Block a user