mesh-delivery: remove the indexer's state config-candidates and its readers (issue 1982; ADR 0681 §2)
The mesh knows no pull request (design 47 G, G-1 §38-39), so the indexer keeps no pull request's config declarations. Removed: the code that writes the state (control_records.go: the candidate writes after a merge and for a pull message), its bucket, view family (views.config-candidates) and read tool (indexer_read_config_candidates) in the indexer's module.json, the view's tool indexer_config_candidates and its read of the indexer's tool, the state and its fixtures in the seat mesh-catalog's definition (generated Go and TypeScript regenerated by seatgen). indexer_config_readers no longer names an open pull request as a reader of a key. The state `predefined` stays. Builds: ADR 0681 §2 (the indexer keeps no config candidate: state, read tool and view, the seat contract's layout; `predefined` stays), §1 (indexer_config_readers names no pull request). Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -213,16 +213,6 @@ func Tools(r view.Reader, u view.UsageReader) []stdio.Tool {
|
||||
Run: func(map[string]any) (any, error) {
|
||||
return view.ControlRecord(r.PredefinedState, view.IndexerPredefinedState, view.PredefinedListKey)
|
||||
}},
|
||||
{Name: view.ConfigCandidatesReadTool,
|
||||
Description: "Each open pull request's config declarations as the indexer keeps them (novox/hq ADR 0565 §2): per pull " +
|
||||
"request (owner.repository.number), its head and per module the config keys its manifests add or change against the " +
|
||||
"trunk's, an empty set when none; deleted when it merges or closes. Give key for one. Read-only.",
|
||||
Input: map[string]any{"type": "object", "properties": map[string]any{
|
||||
"key": map[string]any{"type": "string", "description": "one pull request's key, owner.repository.number"}}},
|
||||
Run: func(args map[string]any) (any, error) {
|
||||
key, _ := args["key"].(string)
|
||||
return view.ControlRecord(r.ConfigCandidatesState, view.IndexerConfigCandidatesState, key)
|
||||
}},
|
||||
{Name: view.PackagesReadTool,
|
||||
Description: "The mesh packages as the indexer publishes them (novox/hq ADR 0593 §2): per mesh Go module (its module " +
|
||||
"path, such as git.novox.be/novox/mesh-sdk/go), the trunk merge that published it (the version a build pins), the " +
|
||||
@@ -422,11 +412,10 @@ func ownersRead(ask func(key string, body any) (json.RawMessage, error), holder
|
||||
}
|
||||
return module + "_" + meshwants.StateWants
|
||||
},
|
||||
HeardState: indexer("indexer_read_heard"),
|
||||
PredefinedState: indexer("indexer_read_predefined"),
|
||||
ConfigCandidatesState: indexer("indexer_read_config_candidates"),
|
||||
PackagesState: indexer("indexer_read_packages"),
|
||||
GraphState: indexer("indexer_read_graph")}
|
||||
HeardState: indexer("indexer_read_heard"),
|
||||
PredefinedState: indexer("indexer_read_predefined"),
|
||||
PackagesState: indexer("indexer_read_packages"),
|
||||
GraphState: indexer("indexer_read_graph")}
|
||||
}
|
||||
|
||||
// holderOf is a seat's holder as mesh-sdk's seatlist.HolderOf answers it (design 47 G A-126): false while the seat has none or
|
||||
|
||||
@@ -75,11 +75,10 @@ func ownersAnswerTheToolsAsBefore(t *testing.T) {
|
||||
view.IndexerModule + ".candidates": {"feat/x": cand, "fix": `{"v":1,"group":"fix","base":3,"heads":"h","pulls":[{"modules":["netcheck"]}]}`},
|
||||
assignerModule + ".wants": {"want.ace.zsh": `{"fp":"` + fp2A + `"}`, "want.novox.zsh": `{"fp":"` + fp2B + `"}`,
|
||||
"held." + keyB: `{"node":"ace","words":"failed"}`},
|
||||
assignerModule + ".differences": {"ace.zsh": `{"unexplained":true}`, "novox.zsh": `{"rule":3}`},
|
||||
view.IndexerModule + "." + view.IndexerPredefinedState: {view.PredefinedListKey: `{"v":1,"keys":["dir:state"]}`},
|
||||
view.IndexerModule + "." + view.IndexerConfigCandidatesState: {"novox.r.7": `{"v":1,"pull":"novox/r#7"}`},
|
||||
view.IndexerModule + "." + view.PackagesState: {pkgKey: `{"v":1,"module":"git.novox.be/novox/mesh-sdk/go","commit":"c1"}`},
|
||||
view.IndexerModule + "." + graph.State: {},
|
||||
assignerModule + ".differences": {"ace.zsh": `{"unexplained":true}`, "novox.zsh": `{"rule":3}`},
|
||||
view.IndexerModule + "." + view.IndexerPredefinedState: {view.PredefinedListKey: `{"v":1,"keys":["dir:state"]}`},
|
||||
view.IndexerModule + "." + view.PackagesState: {pkgKey: `{"v":1,"module":"git.novox.be/novox/mesh-sdk/go","commit":"c1"}`},
|
||||
view.IndexerModule + "." + graph.State: {},
|
||||
}
|
||||
// The kept history of the indexer's modules and heard and the assigner's wants (each declared with more than one
|
||||
// revision in its owner's manifest), which indexer_module_history, indexer_heard and view_tiers' times read.
|
||||
@@ -94,10 +93,9 @@ func ownersAnswerTheToolsAsBefore(t *testing.T) {
|
||||
st := func(name string) view.StateRead { return fake(states[name]).reader().State }
|
||||
direct := view.Reader{CandidatesState: st(view.IndexerModule + ".candidates"),
|
||||
WantsState: st(assignerModule + ".wants"), DifferencesState: st(assignerModule + ".differences"),
|
||||
PredefinedState: st(view.IndexerModule + "." + view.IndexerPredefinedState),
|
||||
ConfigCandidatesState: st(view.IndexerModule + "." + view.IndexerConfigCandidatesState),
|
||||
PackagesState: st(view.IndexerModule + "." + view.PackagesState),
|
||||
GraphState: st(view.IndexerModule + "." + graph.State)}
|
||||
PredefinedState: st(view.IndexerModule + "." + view.IndexerPredefinedState),
|
||||
PackagesState: st(view.IndexerModule + "." + view.PackagesState),
|
||||
GraphState: st(view.IndexerModule + "." + graph.State)}
|
||||
// The owners' read tools, answered by the owner's own Read over the same state; any other address is refused.
|
||||
tools := map[string]string{}
|
||||
for name := range states {
|
||||
@@ -153,8 +151,6 @@ func ownersAnswerTheToolsAsBefore(t *testing.T) {
|
||||
{view.WantReadTool, map[string]any{"node": "ace", "module": "zsh"}},
|
||||
{view.DifferencesReadTool, map[string]any{"node": "novox"}},
|
||||
{view.PredefinedReadTool, map[string]any{}},
|
||||
{view.ConfigCandidatesReadTool, map[string]any{}},
|
||||
{view.ConfigCandidatesReadTool, map[string]any{"key": "novox.r.7"}},
|
||||
{view.PackagesReadTool, map[string]any{"module": "git.novox.be/novox/mesh-sdk/go"}},
|
||||
{view.PackagesReadTool, nil},
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user