The node-engine serves manifest-reads and says manifest-reads-changed once per link (ADR 0618 §3, §4, issue 774)

Claude-Session: https://claude.ai/code/session_01JG73KG7AfSdh6FP8VrBqCn
This commit is contained in:
2026-11-04 12:38:30 +01:00
parent c93feeb30f
commit 271de0108d
6 changed files with 95 additions and 1 deletions
+12
View File
@@ -16,6 +16,7 @@ import (
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/asker"
"git.novox.be/novox/mesh-sdk/go/asks"
"git.novox.be/novox/mesh-sdk/go/delivery"
)
// The node seat node-engine's acts (novox/hq ADR 0563).
@@ -50,6 +51,8 @@ const (
// ActPullWaits reads the failed applies that wait on a store's holder, and the last retry with its trigger (design 51,
// issue 1966 ENG-9).
ActPullWaits = "pull-waits"
// ActManifestReads reads the reader capabilities this engine states (novox/hq ADR 0618 §3).
ActManifestReads = "manifest-reads"
)
// The states of an act.
@@ -154,6 +157,9 @@ type HandActs struct {
ComposeCandidate func(candidate string, input bool) (any, error)
// PullWaits answers which failed applies wait on which store's holder, and the last retry of each with what triggered it.
PullWaits func() (any, error)
// ManifestReads is what this engine states it reads of a manifest and when its record last carried them (the verb
// manifest-reads, novox/hq ADR 0618 §3).
ManifestReads func() ([]string, time.Time)
// Say says one of the seat's events, asked, done or refused; nil says nothing.
Say func(event string, body any)
Now func() time.Time
@@ -240,6 +246,12 @@ func (h *HandActs) Call(c EngineCall) (any, error) {
return nil, errors.New("this engine waits on no store yet: its node agent has not started")
}
return h.PullWaits()
case ActManifestReads:
if h.ManifestReads == nil {
return nil, errors.New("this engine states no manifest reads yet: its node agent has not started")
}
reads, at := h.ManifestReads()
return delivery.ManifestReadsAnswer{V: delivery.Version, Node: h.Node, ManifestReads: reads, StatedAt: at}, nil
case "acts":
if id := arg("id"); id != "" {
return h.Act(id)