Files
mesh-delivery/modules/mesh-delivery-pipeline/internal/pipeline/toolchain.go
T
jschoubben 71a35a6376 MV1: move contracts and sdk under modules/, importers follow
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
2026-11-12 05:09:56 +01:00

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+"/"))
}