Indexer: a single * in invokes declares the verb revision (A-390)

The verb revision's callers rule matched seat:mesh-catalog.revision by exact text only; the grants part reads a single * as every seat verb, so node-tools was refused. Match that reading; the holder stays off the list.

Builds: design 47 G, lead answer A-390

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-14 03:20:47 +01:00
parent 0259d77d11
commit 6c47ffcf8f
2 changed files with 7 additions and 3 deletions
@@ -18,11 +18,12 @@ import (
const RevisionInvoke = "seat:" + meshcatalog.Seat + "." + meshcatalog.VerbRevision
// RevisionCallers are the parts the newest trunk revision's entries say declare the verb revision in their invokes,
// sorted, the holder itself never among them (ADR 0663 §2: granted to exactly the parts that declare it).
// sorted, the holder itself never among them (ADR 0663 §2: granted to exactly the parts that declare it). A single `*`
// in invokes declares every seat verb, as the grants part reads it (A-390).
func RevisionCallers(entries []meshcatalog.CatalogEntry, holder string) stdio.Callers {
var out stdio.Callers
for _, e := range entries {
if e.Module != holder && slices.Contains(e.Invokes, RevisionInvoke) {
if e.Module != holder && (slices.Contains(e.Invokes, RevisionInvoke) || slices.Contains(e.Invokes, "*")) {
out = append(out, e.Module)
}
}
@@ -622,6 +622,9 @@ func TestBasesAreComputedFirstAndNoFingerprintTakesTheBuilder(t *testing.T) { //
if declares[name] {
e.Invokes = []string{RevisionInvoke}
}
if name == "avahi" && rev.Kind == "trunk" {
e.Invokes = []string{"*"} // A-390: a single `*` declares every seat verb, as the grants part reads it
}
data, _ := json.Marshal(e)
digest := fmt.Sprintf("%s-%d-%s", rev.Kind, rev.Revision, name)
entries[digest] = data
@@ -636,7 +639,7 @@ func TestBasesAreComputedFirstAndNoFingerprintTakesTheBuilder(t *testing.T) { //
}
keep(meshcatalog.CatalogRevision{Revision: 3, Kind: "trunk"}, map[string]bool{"node-tools": true, testSelf: true})
keep(meshcatalog.CatalogRevision{Revision: 4, Kind: "candidate", Group: "feat/x", Heads: "0123456789ab"}, map[string]bool{"node-tools": true, "mesh-grants": true})
for caller, answered := range map[string]bool{"n1.node-tools": true, "n1.mesh-grants": false, "n1." + testSelf: false, "person.someone": false, "unproven": false} {
for caller, answered := range map[string]bool{"n1.node-tools": true, "n1.avahi": true, "n1.mesh-grants": false, "n1." + testSelf: false, "person.someone": false, "unproven": false} {
got, err := Revision(context.Background(), verbObjects, testSelf, caller, meshcatalog.RevisionInput{})
if (err == nil) != answered || (answered && (got.Revision.Revision != 3 || len(got.Entries) != 4 || got.Next != "")) {
t.Errorf("revision to %s answered %+v (%v), want answered %v with trunk revision 3 whole", caller, got, err, answered)