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
40 lines
1.5 KiB
Go
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
|
|
}
|