mesh/delivery merged: source.main moved to novox/mesh-sdk@044ead7db83e
mesh/delivery-group group fix/774-new-words-first merged: every member is merged
mesh/check pass 78c9ec881771 on 307b6234e6bb | unit 9174 run, 546 kept, 51 skipped | integration 9952 run, 659 kept, 60 skipped | over bound: unit, in…
50 lines
3.7 KiB
Go
50 lines
3.7 KiB
Go
package catalogue
|
|
|
|
// **The artifact sweep, out of the controller** (novox/hq ADR 0571 clause 2, issue 1955): what the artifact store keeps
|
|
// and lets go of, the seat `mesh-artifact-sweep` (named for its scope, ADR 0121 §1; the operator, 2026-10-29), held
|
|
// once for the mesh by artifact-store-tools, serves what the controller served of its store (artifacts, held, mirrors, images, collect) and says `artifacts-gone`. Its keep set is the store's own listing joined
|
|
// with every want's fingerprint and each module's five newest builds from the builder's log (ADR 0526 §1); it lets go
|
|
// of nothing until the controller's lease names a holder that is no controller.
|
|
|
|
// ArtifactSweepSeat is the seat artifact-store-tools holds. Not the seat mesh-artifact-store, the store itself held by
|
|
// distribution, and not the provision artifact-store it delivers.
|
|
const ArtifactSweepSeat = "mesh-artifact-sweep"
|
|
|
|
// artifactSweepVerbs are the seat's verbs, with the controller's arguments so a caller changes only the seat it asks.
|
|
func artifactSweepVerbs() []Verb {
|
|
return []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"})},
|
|
}
|
|
}
|