Every seat constant of mesh-sdk is mesh-contracts' generated name; the four whole seats' (BrokerSeat, CheckerSeat, asks.Seat, buscompose.VaultSeat) are marked deprecated for their importers. The package walk of mesh-sdk's own check refuses a string literal naming a defined seat or its subjects, and an exported name given to one, beyond testdata/seat-names.txt, which lists what stands before the move (module names that equal a seat's among them) and only shrinks. No new test function. Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
62 lines
2.5 KiB
Go
62 lines
2.5 KiB
Go
package catalogue
|
|
|
|
import contractseats "git.novox.be/novox/mesh-contracts/go/seats"
|
|
|
|
import "encoding/json"
|
|
|
|
// CatalogSeat is the seat of the catalog: what the mesh holds of every module (novox/hq ADR 0604 §1). Its states are
|
|
// its holder's: the modules the trunk holds, their manifests by digest and the module graph (the indexer's states
|
|
// `modules`, `manifests` and `graph`), announced with who may read them; a reader that only watches reads them and calls
|
|
// no verb. It names no event. What must be built again is no verb: a module whose fingerprint differs from its newest
|
|
// build, which the delivery view derives. The verbs' answers are CatalogModules, CatalogOne, CatalogProvides and
|
|
// CatalogDependents, whose field names are those of the catalog module's tools they replace.
|
|
const CatalogSeat = contractseats.MeshCatalog
|
|
|
|
// CatalogEntry is one module of the catalog: its repository, its directory there ("." for the root), the merge commit it
|
|
// was last changed at, and its new-form fingerprint or why it has none.
|
|
type CatalogEntry struct {
|
|
Module string `json:"module"`
|
|
Repository string `json:"repository"`
|
|
Path string `json:"path"`
|
|
Commit string `json:"commit"`
|
|
FP string `json:"fp,omitempty"`
|
|
None string `json:"none,omitempty"`
|
|
}
|
|
|
|
// CatalogModule is one module whole: its entry and its manifest as the trunk holds it.
|
|
type CatalogModule struct {
|
|
CatalogEntry
|
|
Manifest json.RawMessage `json:"manifest"`
|
|
}
|
|
|
|
// CatalogEnd is a module that provides, requires or depends on something, with its commit; Scope is a provider's scope
|
|
// (a module provides its own name at node scope).
|
|
type CatalogEnd struct {
|
|
Module string `json:"module"`
|
|
Commit string `json:"commit"`
|
|
Scope string `json:"scope,omitempty"`
|
|
}
|
|
|
|
// CatalogModules is the answer of the verb modules: every module the trunk holds, sorted by name.
|
|
type CatalogModules struct {
|
|
Modules []CatalogEntry `json:"modules"`
|
|
}
|
|
|
|
// CatalogOne is the answer of the verb module.
|
|
type CatalogOne struct {
|
|
Module CatalogModule `json:"module"`
|
|
}
|
|
|
|
// CatalogProvides is the answer of the verb provides: the modules that provide the provision and those that require it.
|
|
type CatalogProvides struct {
|
|
Provision string `json:"provision"`
|
|
Provides []CatalogEnd `json:"provides"`
|
|
Requires []CatalogEnd `json:"requires"`
|
|
}
|
|
|
|
// CatalogDependents is the answer of the verb dependents: the modules whose build edges reach the module.
|
|
type CatalogDependents struct {
|
|
Module string `json:"module"`
|
|
Dependents []CatalogEnd `json:"dependents"`
|
|
}
|