Raise agent-root where who can become root is not measured, so the router never reads a missing measure as a no (hq ADR 0259 §8)
A machine where the router or a verified channel runs and the sudo module is absent or does not answer made the probe fail to run, which raises nothing the router reads, so it went on approving there. Each such machine now raises the same urgent condition, saying it was not measured.
This commit is contained in:
@@ -100,3 +100,24 @@ func TestTheLoginShellCountsOnlyWhereExecuteIsServed(t *testing.T) {
|
||||
t.Errorf("execute still answered: %+v", got)
|
||||
}
|
||||
}
|
||||
|
||||
// hq ADR 0259 §8 as amended on 2026-10-09: a machine where a trusted party runs and who can become root is not
|
||||
// measured raises the same urgent condition, so the router, which reads the condition, approves nothing there.
|
||||
func TestRootNotMeasuredWhereTheRouterRunsIsSaidAndNeverAPass(t *testing.T) {
|
||||
o := agentRootUnmeasured(agentRootFacts{Machine: "anchor", Trusted: []string{"telegram", "messenger"}},
|
||||
"the sudo module is not assigned there, so who can become root is not measured")
|
||||
if o.Kind != kindAgentRoot || o.Severity != conditions.Urgent || o.Machine != "anchor" ||
|
||||
!strings.Contains(o.Summary, "not measured") || !strings.Contains(o.Summary, "messenger, telegram") {
|
||||
t.Errorf("%+v", o)
|
||||
}
|
||||
if why, ok := conditions.PlainWords(conditions.Words{Headline: o.Headline, Explanation: o.Explanation,
|
||||
Needs: o.Needs, Resolved: o.Resolved}, "anchor"); !ok {
|
||||
t.Errorf("not plain: %s", why)
|
||||
}
|
||||
// The same key as a measured yes, so the router's one rule reads both.
|
||||
measured := agentRootObservations(agentRootFacts{Machine: "anchor", Trusted: []string{"telegram"}, Runtime: "ops",
|
||||
Agent: "ops", Answers: map[string]escalation{"ops": {Root: true, Why: "x"}}})[0]
|
||||
if o.Key() != measured.Key() {
|
||||
t.Errorf("keys differ: %s, %s", o.Key(), measured.Key())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user