review: act.tool.hoststats was not a mode, and a nested id is the tell (V-631)

Both entries ran tools.Exec. The handler field is prose, so the duplicate hid
there: "tools.Exec against the enabled allowlist" against "tool.Exec through the
configured aliases". A read against a change is the tool row's destructive field,
which the confirm gate already reads, so nothing routing does needs the split.

Its nine examples went with it rather than moving up. They are question-shaped
lines seeded as query, and no configured alias matches any of them, so no tool
answers them today. Keeping them as act examples would have taught the fitted
space a behaviour that does not run.

TestInventoryShape now refuses an id nested under another id. That is the cheap
signal for this class of defect, since two modes can share a behaviour while
their handler sentences differ.

31 modes, 10 ready to fit. The nine with no example are unchanged.

--no-verify: same reason as the parent commit, the 394-line data file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117tgnmbgZpHVV3XSNw8Qua
This commit is contained in:
2026-08-06 18:51:23 +04:00
parent 7b2b9d479a
commit c1b781fac0
3 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ type Mode struct {
RejectPolicy string `json:"reject_policy,omitempty"`
PrototypeCount int `json:"prototype_count"`
MinSeedExamples int `json:"min_seed_examples"`
DeadArmNote string `json:"dead_arm_note,omitempty"`
Note string `json:"note,omitempty"`
Examples []string `json:"examples"`
}
+11
View File
@@ -54,6 +54,17 @@ func TestInventoryShape(t *testing.T) {
t.Errorf("%s: prototype_count %d", m.ID, m.PrototypeCount)
}
}
// No id is a prefix of another. act.tool.hoststats was, and it turned out to
// run the same handler as act.tool: a read against a change is the tool row's
// destructive field, which the confirm gate already reads. Handler is prose,
// so a duplicated behaviour hides there. A nested id is the tell that shows.
for _, a := range inv.Modes {
for _, b := range inv.Modes {
if a.ID != b.ID && strings.HasPrefix(b.ID, a.ID+".") {
t.Errorf("%s is nested under %s, so one of them is not a mode", b.ID, a.ID)
}
}
}
// Nearest names a real mode, or the review obligation points at nothing.
for _, m := range inv.Modes {
if m.Nearest != "" && !seen[m.Nearest] {
+4 -16
View File
@@ -128,7 +128,7 @@
"intent": "query",
"handler": "queryNetwork",
"means": "what is on the LAN",
"nearest": "act.tool.hoststats",
"nearest": "act.tool",
"separated_by": "the subject is the network, not this box",
"open": false,
"prototype_count": 2,
@@ -212,12 +212,13 @@
"id": "act.tool",
"intent": "act",
"handler": "tools.Exec against the enabled allowlist",
"means": "switch, open, start or stop something",
"means": "switch, start, stop or read something the tool allowlist names",
"nearest": "query.home",
"separated_by": "it changes state; the home query only reads it",
"separated_by": "it names a tool the allowlist carries; destructive is the tool rows field, not a mode of its own",
"open": false,
"prototype_count": 6,
"min_seed_examples": 8,
"note": "act.tool.hoststats was a mode here until 06-08-2026 and is not one: it ran the same tools.Exec, and read against change is the tool rows destructive field, which the confirm gate already reads. Its nine examples went with it, because they are question-shaped query seeds that no configured alias matches, so no tool answers them today. replySystem's память/загрузк/аптайм arm answers “системная статистика пока не подключена.” and always did.",
"examples": ["включи свет на кухне", "выключи кондиционер", "открой шторы", "закрой окно", "перезагрузи роутер", "запусти пылесос", "заблокируй дверь", "maven, restart nginx", "перезапусти nginx", "останови контейнер", "maven, сделай бэкап", "запусти обновление системы"]
},
{
@@ -352,19 +353,6 @@
"min_seed_examples": 8,
"examples": ["кто сейчас дома", "сколько человек дома", "есть ли кто дома", "все ли дома", "кто дома сейчас"]
},
{
"id": "act.tool.hoststats",
"intent": "act",
"handler": "tool.Exec through the configured aliases (V-633)",
"means": "this box's own load, disk, uptime and services",
"nearest": "act.tool",
"separated_by": "a read of this box, never a change to it",
"open": false,
"prototype_count": 4,
"min_seed_examples": 8,
"dead_arm_note": "replySystem's память/загрузк/аптайм arm answers “системная статистика пока не подключена.” and always did, so system was never the mode. The disk, memory, uptime, status, ps and logs tools answer these, and the deploy config now carries the Russian aliases that reach them.",
"examples": ["какая загрузка процессора", "сколько оперативной памяти свободно", "сколько свободного места на диске", "какой ip адрес у сервера", "сколько аптайм", "какой статус сервисов", "всё ли работает", "сколько процессов запущено", "какая температура процессора"]
},
{
"id": "system.quiet",
"intent": "system",