Find a tool by the shell command it replaces, best first (hq ADR 0245)

The agent searched with journalctl, logs and docker ps and found nothing, so it went over ssh. Search
now reads what each verb and tool replaces from the controller's records, matches a command line
against it, ranks the matches, and says the command it matched.
This commit is contained in:
jochen
2026-10-07 19:21:13 +02:00
parent 26a58c7a79
commit 49cb06f6c5
5 changed files with 443 additions and 72 deletions
+7
View File
@@ -68,6 +68,13 @@ address) and `mesh_runtimes` (which runtimes answered discovery: per runtime its
answer took, its size in bytes, how many modules and tools it announced, whether it was shortened to
fit the bus, when it was last heard — and who was expected and not heard).
`mesh_search` also finds a tool by the shell command it replaces (novox/hq ADR 0242): each seat verb and
module tool says what it replaces in the controller's records (`replaces`, read from the controller's
`tools` and `modules` answers), so `journalctl -u x`, `systemctl status x` or `docker ps` puts the verb
for it first, and says the command it matched as `instead_of`. A word also matches through a short table
of the words agents use for the mesh's (`logs` finds the journal). Best first: a replaced command, then
words in a name or a replaced command, then words in a description; seats before modules on a tie.
Discovery asks the bus (ADR 0197): every runtime answers the NATS services protocol's `$SRV.PING` and
`$SRV.INFO` with what it serves at that moment, and the console reads where the controller's records
place each module. The console waits at least 750 ms, and up to 5 s for every runtime that answered