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:
@@ -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] {
|
||||
|
||||
Reference in New Issue
Block a user