A3e item 1: the tool runner serves through mesh-sdk's gate, translating the contracts for it
Builds: design 47 G §677, §700, lead answers A-219, A-224, A-228 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -7,15 +7,15 @@ import (
|
||||
"time"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient"
|
||||
catalogseat "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-sdk/go/approval"
|
||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
||||
|
||||
"github.com/novox/mesh-tools/node-tools/internal/approval"
|
||||
runnerapproval "github.com/novox/mesh-tools/node-tools/internal/approval"
|
||||
)
|
||||
|
||||
// Findings is the runner's held finding writer, the one the gate writes its findings through too (design 46 7-approval-mark
|
||||
// §4, §16, §19); nil when it was not made.
|
||||
func (v *Views) Findings() approval.FindingWriter {
|
||||
func (v *Views) Findings() runnerapproval.HeldWriter {
|
||||
if v.deps.Findings == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -55,20 +55,20 @@ func (c approvalCatalog) Revision() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (c approvalCatalog) Served(fingerprint string) (catalogseat.CatalogEntry, bool, string) {
|
||||
func (c approvalCatalog) Served(fingerprint string) (approval.Entry, bool, string) {
|
||||
if c.v.branches == nil {
|
||||
return catalogseat.CatalogEntry{}, false, errNotFollowed.Error()
|
||||
return approval.Entry{}, false, errNotFollowed.Error()
|
||||
}
|
||||
e, state := c.v.branches.Resolve(context.Background(), fingerprint)
|
||||
return e, state == meshcatalogclient.EntryAnswered, string(state)
|
||||
return runnerapproval.Entry(e), state == meshcatalogclient.EntryAnswered, string(state)
|
||||
}
|
||||
|
||||
func (c approvalCatalog) Newest(module string) (catalogseat.CatalogEntry, bool) {
|
||||
func (c approvalCatalog) Newest(module string) (approval.Entry, bool) {
|
||||
if c.v.branches == nil {
|
||||
return catalogseat.CatalogEntry{}, false
|
||||
return approval.Entry{}, false
|
||||
}
|
||||
e, ok, err := c.v.branches.Entry(module)
|
||||
return e, ok && err == nil
|
||||
return runnerapproval.Entry(e), ok && err == nil
|
||||
}
|
||||
|
||||
func (c approvalCatalog) Definitions() map[string]seatdef.Definition {
|
||||
@@ -78,15 +78,15 @@ func (c approvalCatalog) Definitions() map[string]seatdef.Definition {
|
||||
return c.defs()
|
||||
}
|
||||
|
||||
func (c approvalCatalog) Entries() []catalogseat.CatalogEntry {
|
||||
func (c approvalCatalog) Entries() []approval.Entry {
|
||||
halves, err := c.v.Halves()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
var out []catalogseat.CatalogEntry
|
||||
var out []approval.Entry
|
||||
for _, half := range halves {
|
||||
for _, e := range half.Entries {
|
||||
out = append(out, e)
|
||||
out = append(out, runnerapproval.Entry(e))
|
||||
}
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user