A-6 the capability: the tool runner states approval-mark/1 in its announcement
Its gate sits on every handler it serves, so it says it honours the mark, and the grants part, reading its node's readings, composes no deny of its modules' marked subjects. Builds: design 46 7-approval-mark §6 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -140,7 +140,7 @@ func TestTheRunnerStatesTheCapabilitiesOfItsCallsInItsPing(t *testing.T) {
|
|||||||
t.Fatalf("ping of the instance: %v", err)
|
t.Fatalf("ping of the instance: %v", err)
|
||||||
}
|
}
|
||||||
var ping micro.Ping
|
var ping micro.Ping
|
||||||
if err := json.Unmarshal(msg.Data, &ping); err != nil || ping.Metadata[announce.Capabilities] != "bus-state-calls,ledger-calls,put-sessions,seat-settle-delay" {
|
if err := json.Unmarshal(msg.Data, &ping); err != nil || ping.Metadata[announce.Capabilities] != "approval-mark/1,bus-state-calls,ledger-calls,put-sessions,seat-settle-delay" {
|
||||||
t.Errorf("the runner states %q (%v), want its bus-state and ledger calls", ping.Metadata[announce.Capabilities], err)
|
t.Errorf("the runner states %q (%v), want its bus-state and ledger calls", ping.Metadata[announce.Capabilities], err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ const (
|
|||||||
CapLedgerCalls = "ledger-calls"
|
CapLedgerCalls = "ledger-calls"
|
||||||
// CapPutSessions is the put and get sessions' word (design 47 G §518, §622), mesh-sdk's.
|
// CapPutSessions is the put and get sessions' word (design 47 G §518, §622), mesh-sdk's.
|
||||||
CapPutSessions = stdio.CapPutSessions
|
CapPutSessions = stdio.CapPutSessions
|
||||||
|
// CapApprovalMark says the runner honours the approval mark: its gate sits on every handler it serves (design 46
|
||||||
|
// 7-approval-mark §6, §20), so the grants part composes no deny of its modules' marked subjects.
|
||||||
|
CapApprovalMark = "approval-mark/1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// callFamilies are the methods each capability stands for, the ones BusState and BusStateWatch answer.
|
// callFamilies are the methods each capability stands for, the ones BusState and BusStateWatch answer.
|
||||||
@@ -36,7 +39,7 @@ var callFamilies = map[string][]string{
|
|||||||
// CallCapabilities is every capability of the calls this runner answers, sorted. The delayed settle of a pulled seat
|
// CallCapabilities is every capability of the calls this runner answers, sorted. The delayed settle of a pulled seat
|
||||||
// message names a fate, not a method, so it stands beside the method families (novox/hq ADR 0664 §5).
|
// message names a fate, not a method, so it stands beside the method families (novox/hq ADR 0664 §5).
|
||||||
func CallCapabilities() []string {
|
func CallCapabilities() []string {
|
||||||
out := []string{stdio.CapSeatSettleDelay}
|
out := []string{stdio.CapSeatSettleDelay, CapApprovalMark}
|
||||||
for c := range callFamilies {
|
for c := range callFamilies {
|
||||||
out = append(out, c)
|
out = append(out, c)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ func TestABundleToolNamedAsALedgerRepairIsRefused(t *testing.T) {
|
|||||||
// no other name; none answers "the runtime answers no ...".
|
// no other name; none answers "the runtime answers no ...".
|
||||||
func TestEveryCallOfAStatedCapabilityIsAnswered(t *testing.T) {
|
func TestEveryCallOfAStatedCapabilityIsAnswered(t *testing.T) {
|
||||||
m, _, _ := aLedger(t)
|
m, _, _ := aLedger(t)
|
||||||
if got := strings.Join(CallCapabilities(), ","); got != "bus-state-calls,ledger-calls,put-sessions,seat-settle-delay" {
|
if got := strings.Join(CallCapabilities(), ","); got != "approval-mark/1,bus-state-calls,ledger-calls,put-sessions,seat-settle-delay" {
|
||||||
t.Fatalf("the runner states %s", got)
|
t.Fatalf("the runner states %s", got)
|
||||||
}
|
}
|
||||||
for capability, methods := range callFamilies {
|
for capability, methods := range callFamilies {
|
||||||
|
|||||||
Reference in New Issue
Block a user