Files
mesh-delivery/modules/mesh-delivery-indexer/internal/index/views.go
T
jschoubben ea28f39319 I7, I6 (the pins' events): no validation at the take-in; a pipeline's events pin its revision
I7: the indexer judges no manifest. The judge pass, its verdicts and unjudged states,
the events manifest-accepted and manifest-refused, the tools verdicts, indexer_verdicts,
indexer_judge and indexer_say_accepted, and the take-in's wait for the verdicts state
go; indexer_bus_state answers from the modules state at its mark. The seed writes
validate required in every policy. oldsections stays (H-A-79).

I6, the half that follows C-R: the gate's pinned, freed, heads-replaced and
pins-stated are no longer heard. A pipeline-started pins the revision it names under
pipeline.<branch>.<source>, its pipeline-ended frees it, each on a durable of its own
stream; kept revisions are judged against the pins the state holds, never a count
(made and pins-stated go). A take-in pins its revision once, for its one pipeline.
indexer_pin_drop (§765) is still to do.

The entry's pull goes (§763). The tests of the old take-in (pending, behind, pushed)
go with it, ahead of I8. The unit suite is green except manifest_test's check that
the watchman's and the grants part's invokes of the indexer's verdicts tools are
served: their removal is the contracts developer's (H-A-79).

Builds: design 47 H §743, §745, §749, §763, §764 (the indexer); H-A-48, H-A-49, H-A-79

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
2026-11-20 04:56:27 +01:00

63 lines
4.1 KiB
Go

package index
import (
"time"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/graph"
"git.novox.be/novox/mesh-sdk/go/keys"
"git.novox.be/novox/mesh-sdk/go/views"
)
// FirstViewTools are the indexer's first-view tools (ADR 0621 §1, ADR 0622 §1, ADR 0631 §1): the tool, the state it answers, and
// the words of what that state holds. Each answers every caller (design 47 H §752, H-A-66). Which
// modules exist is the seat mesh-catalog's verb revision (ADR 0663 §1, RevisionTool), granted by declaration, not by a
// list; the first view modules stays beside it, in its form before milestone G and answered from the newest trunk
// revision (TrunkStates), until the grants part reads the catalog half (design 47 G A-354).
var FirstViewTools = []ViewedTool{
{Tool: "manifests", State: "manifests", Words: "every manifest the indexer keeps, by its digest."},
{Tool: "modules", State: ModulesState, Words: "every module the indexer holds, its fingerprint, inputs and manifest digest."},
{Tool: "graph", State: graph.State, Words: "the module graph: each module's build, provision and verb edges, whose verb edges a want waits on."},
}
// ReadTools are the indexer's ordinary read tools, one per state its readers read (design 25 § 12.2).
var ReadTools = []ViewedTool{
{Tool: "indexer_read_manifests", State: "manifests", Words: "every manifest the indexer keeps, by its digest."},
{Tool: "indexer_read_predefined", State: PredefinedState, Words: "the predefined config values of each module on the trunk."},
{Tool: "indexer_read_candidates", State: "candidates", Words: "the candidate groups: the pull requests sharing a branch, their heads and the modules each touches."},
{Tool: "indexer_read_packages", State: PackagesState, Words: "the published packages per series."},
{Tool: "indexer_read_graph", State: graph.State, Words: "the module graph: each module's build and provision edges."},
{Tool: "indexer_read_heard", State: HeardState, Words: "the forge messages the indexer heard and what it did with each."},
{Tool: "indexer_read_taken", State: "taken", Words: "each repository's merge the indexer took in last."},
{Tool: "indexer_read_takeins", State: TakeInsState, Words: "each take-in asked of the indexer: its ask, whether and when the indexer answered it and its answer (design 47 G A-464a)."},
{Tool: "indexer_read_findings", State: FindingsState, Words: "the indexer's findings, which the condition keeper raises and clears."},
{Tool: "indexer_read_seat_definitions", State: SeatDefinitionsState, Words: "the seat definitions the trunk's and each open pull request's contracts modules hold, resolved, or why one does not parse."},
}
// ViewedTool is one tool over one state of the indexer's.
type ViewedTool struct {
Tool, State, Words string
}
// ViewedStates are the states the indexer's views family says: the ones its readers read.
var ViewedStates = map[string]bool{
ManifestsState: true, PredefinedState: true, CandidatesState: true,
PackagesState: true, HeardState: true, TakenState: true, TakeInsState: true, FindingsState: true, SeatDefinitionsState: true,
}
// ModulesViewsEvent is what the indexer says on its views family of modules when a new revision of the trunk branch
// changes the modules (design 47 G A-360, completing A-354): the first view modules answers every value at the trunk
// revision's number, so one revision's changes are said as one event, the mark at that number, after which a reader
// whose picture is short of it asks the first view once and holds the new revision whole. A revision of another watched
// branch, or one that changes nothing, says nothing (false).
func ModulesViewsEvent(owner string, e meshcatalog.CatalogRevisionEvent) (views.Event, bool) {
if e.Kind != "trunk" || e.Branch != keys.EscapeName(TrunkBranch) || e.Revision <= 0 || len(e.Changed) == 0 {
return views.Event{}, false
}
var at time.Time
if e.At != nil {
at = e.At.UTC()
}
return views.Event{V: views.Version, Owner: owner, State: ModulesState, Revision: uint64(e.Revision), At: at, Mark: true}, true
}