The delivery repository's contracts and SDK live under modules/ as mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths renamed to match the folders (the TypeScript names already did), and every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools and mesh-sdk follows in the same group: a design as it should be, one path per module, checked by the group's check building every importer. Builds: design 47 G §427, §88 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
46 lines
2.5 KiB
Go
46 lines
2.5 KiB
Go
package main
|
|
|
|
// **The artifact store's holder takes its own new build even when its seat is the one broken** (novox/hq design 47,
|
|
// lines 1888-1906 at b229f5c4; test 60; milestone 47/G W12.5, issue 1966): the verb kept-artifact sits in every build
|
|
// seat's definition, so this module serves it too. It keeps no build of its own: its answer is the domain SDK's
|
|
// judgement (sdk/buildstep KeptArtifact, ADR 0634 §2) over no kept build, so a module that claims no
|
|
// oci-artifact-registry is refused as such and the store's holder is answered not kept here. Who may call it is the
|
|
// seat definition's (the node-engines alone), granted by the grants part (ADR 0666 §20): this module checks no caller.
|
|
|
|
import (
|
|
seat "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildnode"
|
|
sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
|
stdio "git.novox.be/novox/mesh-sdk/go"
|
|
)
|
|
|
|
// keptArtifact is the verb kept-artifact's answer for in: this node keeps no build.
|
|
func (m *Module) keptArtifact(in seat.KeptArtifactInput) sdkstep.KeptArtifactAnswer {
|
|
return sdkstep.KeptArtifact(in.Module, in.Fp, in.Digest, nil, "", func(module string) (bool, error) {
|
|
call := m.Call
|
|
if call == nil {
|
|
call = stdio.Ask
|
|
}
|
|
raw, err := call(sdkstep.CatalogModuleVerb, map[string]any{"module": module})
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
return sdkstep.ClaimsStoreOf(module, raw)
|
|
})
|
|
}
|
|
|
|
// keptArtifactVerb serves `<seat>.kept-artifact`.
|
|
func (m *Module) keptArtifactVerb() stdio.Tool {
|
|
return stdio.Tool{Name: Seat + "." + seat.VerbKeptArtifact,
|
|
Description: "Where the build this node kept for the artifact store's holder (the holder of " + sdkstep.StoreSeat +
|
|
") is. This build module keeps none: it refuses a module that claims no " + sdkstep.StoreSeat +
|
|
" and answers the holder's build not kept here, naming the module.",
|
|
Input: map[string]any{"type": "object", "required": []string{"module", "fp", "digest"}, "properties": map[string]any{
|
|
"module": map[string]any{"type": "string", "description": "the module, the holder of " + sdkstep.StoreSeat},
|
|
"fp": map[string]any{"type": "string", "description": "its build's fingerprint"},
|
|
"digest": map[string]any{"type": "string", "description": "the artifact's sha256, 64 lowercase hex digits"}}},
|
|
Run: func(args map[string]any) (any, error) {
|
|
str := func(k string) string { s, _ := args[k].(string); return s }
|
|
return m.keptArtifact(seat.KeptArtifactInput{Module: str("module"), Fp: str("fp"), Digest: str("digest")}), nil
|
|
}}
|
|
}
|