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
29 lines
1.1 KiB
Go
29 lines
1.1 KiB
Go
package pipeline
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strings"
|
|
|
|
builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshbuilds"
|
|
nodebuildgo "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo"
|
|
)
|
|
|
|
// ToolchainOf reads a toolchain-agreed as the toolchain a step ask names: its language and version (design 47 G §416, A-104).
|
|
// The recipe and the building node's digest are the seat's to report, not the runner's to know.
|
|
func ToolchainOf(raw []byte) (*nodebuildgo.ToolchainUsed, error) {
|
|
var t builds.ToolchainAgreed
|
|
if err := json.Unmarshal(raw, &t); err != nil {
|
|
return nil, err
|
|
}
|
|
if t.Language == "" {
|
|
return nil, nil
|
|
}
|
|
return &nodebuildgo.ToolchainUsed{Language: t.Language, Version: t.Version}, nil
|
|
}
|
|
|
|
// InPackage says whether a kept result's package is the artifact's package name or lies beneath it (A-104: the kept entries
|
|
// whose package is the artifact's package, a Go module's packages being the module path and the paths beneath it).
|
|
func InPackage(pkg, name string) bool {
|
|
return name != "" && (pkg == name || strings.HasPrefix(pkg, name+"/"))
|
|
}
|