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
44 lines
2.9 KiB
Go
44 lines
2.9 KiB
Go
package resolution
|
|
|
|
import (
|
|
mcat "git.novox.be/novox/mesh-sdk/go/catalogue"
|
|
)
|
|
|
|
// artifactSweepVerbs are the seat's verbs, with the controller's arguments so a caller changes only the seat it asks.
|
|
func artifactSweepVerbs() []mcat.Verb {
|
|
return []mcat.Verb{
|
|
{Name: "artifacts", Description: "Every artifact the mesh made that lives in its artifact store, each with its " +
|
|
"repository, digest, kind (image or archive) and state: kept, and why (a want names it, or one of the five " +
|
|
"newest builds of its module in the builder's log), eligible (made, kept for no reason, not yet let go), or " +
|
|
"unrecorded (in the store and named by nothing the mesh made: never removed). Reads only.",
|
|
Input: schema(map[string]string{
|
|
"repository": "only this repository's references, as <module>/<artifact> (the counts stay whole)",
|
|
"collected": "\"true\": list the collected references too (counted always)",
|
|
}, nil, "collected")},
|
|
{Name: "held", Description: "Whether the artifact store holds each reference given, asked with one HEAD each: " +
|
|
"held, gone (the store answered 404) or unknown with why. The builder asks it before it reuses a done key. " +
|
|
"Reads only.",
|
|
Input: listed(schema(map[string]string{
|
|
"references": "the artifacts' references, artifact-store://<module>/<artifact>/blobs/sha256:<hex>: a list, " +
|
|
"or one text separated by commas",
|
|
}, []string{"references"}), "references")},
|
|
{Name: "collect", Description: "The artifact store's sweep, now: what is eligible is let go of. Without confirm a " +
|
|
"dry run: what would be let go, nothing held or deleted. With confirm and why: every kept archive held first, " +
|
|
"then each eligible artifact let go of, oldest first, an index with the platform manifests no kept index " +
|
|
"names, each deletion recorded in the hand-act log. Bounded by most (500 by default, at most 5000) and 45 " +
|
|
"seconds; what is left is said. Never touches a digest the mesh did not make.",
|
|
Input: schema(map[string]string{
|
|
"confirm": "\"true\": let go of what is eligible (needs why); without it nothing is done",
|
|
"why": "with confirm: why, required and recorded",
|
|
"most": "let go of at most this many (500 by default, at most 5000)",
|
|
}, nil, "confirm")},
|
|
{Name: "mirrors", Description: "The bases the mesh copied into its artifact store, each kept (a kept build stood on " +
|
|
"it), eligible (only builds no longer kept stood on it) or unrecorded (no build the builder's log holds stood on " +
|
|
"it: never removed), by what the builder's log says each build stood on. Records nothing by hand.",
|
|
Input: schema(map[string]string{}, nil)},
|
|
{Name: "images", Description: "Every container image one machine's want and have name, each with the resources " +
|
|
"naming it: what the machine keeps when it prunes its images. Reads only.",
|
|
Input: schema(map[string]string{"node": "the machine's name"}, []string{"node"})},
|
|
}
|
|
}
|