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 only its callers list (CallersEnv), which the manifest writes. 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: "verdicts", State: VerdictsState, Words: "the judge's verdict on each manifest: accepted, waiting or refused."}, {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_config_candidates", State: ConfigCandidatesState, Words: "the config declarations of each open pull request."}, {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_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."}, {Tool: "indexer_read_unjudged", State: UnjudgedState, Words: "the manifests a take-in newly wrote that no judge pass judged yet, by digest, each with its module and merge; indexer_judge judges them."}, } // 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, VerdictsState: true, PredefinedState: true, ConfigCandidatesState: true, CandidatesState: true, PackagesState: true, HeardState: true, TakenState: true, FindingsState: true, SeatDefinitionsState: true, UnjudgedState: 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 }