Files
mesh-catalog/modules/mesh-self-check/cmd/mesh-self-check/catalogfeed.go
T
jschoubben e4ef67adcd 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

40 lines
1.5 KiB
Go

package main
// The self-check's reading of which modules exist (design 47 G §196, §594, §614): the catalog half, taken through
// meshcatalogclient's follower of the watched branches on the part's one views reader. A module's manifest is the one its
// catalog graph entry carries whole (§443), never the indexer's state `modules` or `manifests`.
import (
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient"
catalog "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
)
// CatalogHalf is every module's entry in the catalog half, as the self-check holds it.
type CatalogHalf interface {
// Modules is each module's entry; with a branch that has no first view yet it is an error naming it, never no module.
Modules() (map[string]catalog.CatalogEntry, error)
}
// branchesHalf is the CatalogHalf over the follower of the watched branches.
type branchesHalf struct{ b *meshcatalogclient.Branches }
func (h branchesHalf) Modules() (map[string]catalog.CatalogEntry, error) {
if err := h.b.Ready(); err != nil {
return nil, err
}
out := map[string]catalog.CatalogEntry{}
for _, branch := range h.b.Followed() {
c, ok := h.b.Catalog(branch)
if !ok {
continue
}
half, _ := c.View() // a branch at none-yet is ready and empty (§614)
for m, e := range half.Entries {
if _, ok := out[m]; !ok { // the branch followed first names a module both hold
out[m] = e
}
}
}
return out, nil
}