diff --git a/claude-plugins/plugins/base/skills/swarm-logs/SKILL.md b/claude-plugins/plugins/base/skills/swarm-logs/SKILL.md index 4f0b1075..e8c5d20d 100644 --- a/claude-plugins/plugins/base/skills/swarm-logs/SKILL.md +++ b/claude-plugins/plugins/base/skills/swarm-logs/SKILL.md @@ -38,10 +38,15 @@ one, so a bare word matches across every hive in the swarm." There's no per-hive flag to fix this from the CLI side — scope it in the query string instead. The collector tags every log line with `_HOSTNAME`, `_MACHINE_ID`, and `_SYSTEMD_UNIT` as stream fields, so add one of those -to a query you want confined to your own hive or service: +to a query you want confined to your own machine or service: + +Reach for `_MACHINE_ID` rather than `_HOSTNAME` when you mean one +machine. A hostname is a configuration value, so two machines can carry +the same one, and a query keyed on it silently merges their streams — +the collector's own config warns about this case for exactly that reason. ```console -$ swarm-logs query '_time:1h _stream:{_HOSTNAME="atlas"} "connection refused"' +$ swarm-logs query '_time:1h _stream:{_MACHINE_ID=""} "connection refused"' $ swarm-logs query '_time:1h _SYSTEMD_UNIT:="hive-agent.service"' --format json ``` diff --git a/report.md b/report.md new file mode 100644 index 00000000..321089c0 --- /dev/null +++ b/report.md @@ -0,0 +1,43 @@ +# Report — #4460 swarm-logs skill + +PR: https://forge.constellation.darkest.space/hyperhive/hyperhive/pulls/4471 + +## git show --stat +``` +b9e62b06 claude-plugins: add a swarm-logs skill + 1 file changed, 84 insertions(+) + create mode 100644 claude-plugins/plugins/base/skills/swarm-logs/SKILL.md +``` + +## Verbatim `--help` checked flags against +``` +$ swarm-logs --help +query the swarm's log store from an agent +Usage: swarm-logs +Commands: query, help +Options: -h/--help, -V/--version + +$ swarm-logs query --help +Usage: swarm-logs query [OPTIONS] +Arguments: — bare word is full-text search; quote it (shell claims `|`) +Options: --limit (unset = store default; bare word hits whole swarm), + --format [default: message] (message = only `_msg`; json = raw NDJSON) +``` +One subcommand (`query`) + `help`, three options total (``, `--limit`, +`--format`) — matches what's documented, nothing invented. + +## Content points covered +All five: `_time:` predicates + worked queries; bare-word-hits-whole-swarm + +scoping via `_stream`/`_SYSTEMD_UNIT` stream fields (verified in +`nix/host-modules/swarm-otel.nix`); `message` vs `json` format; telling empty +result from refused request (exit code + stderr); control-query closing rule. +`_time:`/field-filter syntax verified against upstream VictoriaLogs LogsQL +docs (the deployed store), not guessed. + +Note: first commit's `-m` string had unescaped backticks that triggered shell +command substitution, splicing `swarm-logs --help` output into the message — +caught it, amended with `-F` from a file, force-pushed the clean version. + +PR: https://forge.constellation.darkest.space/hyperhive/hyperhive/pulls/4471 · SKILL-PATH: claude-plugins/plugins/base/skills/swarm-logs/SKILL.md · HELP-VERIFIED: y · INVENTED-SYNTAX: none · TRAILER-CLEAN: y · VALE: pass + +**Subagent `skill-4460` stopped:** its turn ended and there was no goal to continue toward