ADR 0593 §7: the composer with its refusals leaves mesh-sdk, so mesh-sdk carries no composition rule. The catalogue functions only the node-engine's composition reaches (Resolve, Resolution's Compose, Declaration, DataItems, LeftOut, Rules and the rest, the settings, placeholder and template refusals, the rendering helpers) are copied with their tests into internal/compose/resolution; a method of a mesh-sdk shape becomes a function taking it first. The composition calls its own copies, and the captured catalogue its tests read lives here now, shared by mesh-compose's tests. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
24 lines
578 B
Go
24 lines
578 B
Go
package resolution
|
|
|
|
import (
|
|
"sort"
|
|
|
|
mcat "git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// OffersIssuedOutside is whether any module of a catalogue offers the provision with a credential issued outside
|
|
// the mesh (novox/hq ADR 0337), and the first such module by name.
|
|
func OffersIssuedOutside(shelf map[string]mcat.Manifest, provision string) (string, bool) {
|
|
var names []string
|
|
for name, m := range shelf {
|
|
if m.IssuedOutsideOf(provision) {
|
|
names = append(names, name)
|
|
}
|
|
}
|
|
if len(names) == 0 {
|
|
return "", false
|
|
}
|
|
sort.Strings(names)
|
|
return names[0], true
|
|
}
|