Files
mesh-sdk/go/catalogue/seat_invokes.go
T
jschoubben 68aaf235d4 Take the judge out of mesh-sdk: it is mesh-delivery's now (ADR 0578 §4, §7)
Issue 1585, S19: the strict parser, every manifest problem function and the judge's tables (192 declarations,
about 5,200 lines) and their 244 tests leave; composition keeps its own refusals and the helpers it uses. The
catalogue's tests decode the manifests they build. ParseManifest, ParseManifestWith, ParseManifestForInputs,
CatalogueProblems and the rest are gone; mesh-delivery-indexer/judge holds them.

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
2026-11-01 02:36:24 +01:00

27 lines
1.2 KiB
Go

package catalogue
import (
"strings"
)
// A seat verb a module invokes is one some holder serves (issue 774, sweep item 1). messenger invoked
// `seat:node-engine.root-free`, which nothing in the mesh answered, so every ask that offers an approval was held on
// Telegram, silently. A manifest names what it calls (novox/hq ADR 0152); that a seat by that name exists, promises
// that verb, and has a holder is only known over the whole catalogue, so it is judged here, beside the seats' other
// rules (CatalogueProblems).
// UnheldSeat ends the problem of a `seat:<seat>.<verb>` whose seat no module given claims: over the whole catalogue a
// refusal, over some manifests alone a seat whose holder was not given (IsUndeclaredSeat says both).
const UnheldSeat = "which no module claims, so nothing answers it"
// SeatInvoke splits an invoke `seat:<seat>.<verb>` into its seat and verb; ok is false for anything else (a module's
// tool, `*`).
func SeatInvoke(invoke string) (seat, verb string, ok bool) {
rest, isSeat := strings.CutPrefix(invoke, "seat:")
if !isSeat {
return "", "", false
}
seat, verb, ok = strings.Cut(rest, ".")
return seat, verb, ok && seat != "" && verb != ""
}