feat(using-system-snapshot): v1.0.0 — mappa meta.health/admin.status + machine snapshot (#983)
Два слоя: mappa-сервис (meta_health + admin_status — живая нагрузка) + машина (meta_system_snapshot: поллер/докер/таски из кэша).
This commit is contained in:
@@ -1,78 +1,87 @@
|
|||||||
---
|
---
|
||||||
name: using-system-snapshot
|
name: using-system-snapshot
|
||||||
author: ours
|
author: ours
|
||||||
version: 0.1.0
|
version: 1.0.0
|
||||||
description: "Use at the start of an ops-context session, and ALWAYS before asserting anything about the agent poller, local docker containers, or cross-project task load — call `mcp__projects-meta__meta_system_snapshot` instead of running `tasklist` / `docker ps` / `meta_status` by hand. Triggers on «что запущено», «что сейчас крутится», «состояние системы», «состояние машины», «поллер работает?», «поллер живой?», «что с докером», «сводка по задачам», «what's running», «system status», «system snapshot», «is the poller up», «is the runner alive», «what containers are up». Read-only — no per-session grant needed. Skip for deep single-container docker diagnosis (that's using-vds-ops for the VDS / docker logs locally) and for mutating or precise per-task work (that's using-projects-meta)."
|
description: "Use at the start of an ops-context session, and ALWAYS before asserting anything about the mappa meta-service, the agent poller, local docker containers, or cross-project task load — call `mcp__mappa__meta_health` + `mcp__mappa__admin_status` (сервис жив, нагрузка) and `mcp__projects-meta__meta_system_snapshot` (поллер/докер/таски) instead of running `tasklist` / `docker ps` / guessing by hand. Triggers on «что запущено», «что сейчас крутится», «состояние системы», «состояние машины», «поллер работает?», «поллер живой?», «что с докером», «сводка по задачам», «what's running», «system status», «system snapshot», «is the poller up», «is the runner alive», «what containers are up». Read-only — no per-session grant needed. Skip for deep single-container docker diagnosis (that's using-vds-ops for the VDS / docker logs locally) and for mutating or precise per-task work (that's using-projects-meta / mappa task.*)."
|
||||||
---
|
---
|
||||||
|
|
||||||
# using-system-snapshot
|
# using-system-snapshot
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
One call — `mcp__projects-meta__meta_system_snapshot` — returns a whole-machine ops snapshot: agent **poller** status, local **docker** containers, and a cross-project **task** summary (active / blocked counts) from the projects-meta cache. It replaces the old scatter of `tasklist`, `docker ps`, and a manual `meta_status` read with a single round-trip.
|
Two layers, one mental model: **mappa meta-service** (решение 14/15 — мета в сервисе) + **машина** (поллер/докер/таск-нагрузка — внешняя инфра).
|
||||||
|
|
||||||
**Core rule: never assert the state of the poller, local containers, or task load without calling this tool first.** Memory and "it was running earlier" are not evidence.
|
1. Сервис жив и как загружен: `mcp__mappa__meta_health` (no args → `{ok}`) + `mcp__mappa__admin_status` (счётчики сущностей по типам/проектам — живая нагрузка).
|
||||||
|
2. Машина: `mcp__projects-meta__meta_system_snapshot` — поллер agents-task-runner, локальные docker-контейнеры, сводка таск-нагрузки из кэша.
|
||||||
|
|
||||||
|
Заменяет старый разброс `tasklist` / `docker ps` / ручного `meta_status` одной-двумя зондами.
|
||||||
|
|
||||||
|
**Core rule: never assert состояние сервиса, поллера, контейнеров или таск-нагрузки без вызова тула в этом же turn.** Память и «он же работал ранее» — не evidence.
|
||||||
|
|
||||||
## When to use
|
## When to use
|
||||||
|
|
||||||
- Session start in an **ops context** — orienting before doing infra / runner / task-board work.
|
- Session start в **ops-контексте** — ориентация перед infra/раннер/борд-работой.
|
||||||
- The user asks what's alive: «что запущено», «состояние системы», «поллер работает?», «что с докером», «what's running», «is the poller up».
|
- User спрашивает что живо: «что запущено», «состояние системы», «поллер работает?», «что с докером», «what's running», «is the poller up».
|
||||||
- **Before any claim** about whether the poller is running, which projects it scans, whether a container is up/healthy, or how many tasks are active/blocked.
|
- **Перед любым claim** о живости mappa-сервиса, поллера, контейнера или числа активных/блокированных тасок.
|
||||||
- A quick cross-project task-load glance ("where's the work concentrated right now").
|
- Быстрый взгляд на таск-нагрузку (где сейчас сконцентрирована работа).
|
||||||
|
|
||||||
## When NOT to use
|
## When NOT to use
|
||||||
|
|
||||||
- Deep diagnosis of **one** container (logs, inspect, stats, restart-loops) — that's `using-vds-ops` for the Rusonyx VDS, or `docker logs` locally. The snapshot only gives name + status.
|
- Глубокая диагностика **одного** контейнера (logs/inspect/stats/restart-loop) — это using-vds-ops для Rusonyx VDS или `docker logs` локально.
|
||||||
- **Mutating** task state, or reading the **full** board / a precise per-task body — that's `using-projects-meta` (and local `.tasks/` disk for the current project).
|
- **Мутации** тасок или чтение полного борда/тела задачи — using-projects-meta (и mappa task.* / локальный `.tasks/` для текущего проекта).
|
||||||
- Library docs, code search, single-file questions — unrelated.
|
- Библиотечные доки, поиск по коду — не сюда.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
Requires the tool `mcp__projects-meta__meta_system_snapshot` (shipped by the `projects-meta-mcp` server; the `meta-system-snapshot` capability lives in `OpeItcLoc03/common`). If the tool is missing from the session, the server isn't registered — trigger **`setup-projects-meta`** to install and register it, then retry.
|
- `mcp__mappa__*` — mappa MCP (сервис meta; установка — setup-проект mappa).
|
||||||
|
- `mcp__projects-meta__meta_system_snapshot` — projects-meta-mcp (поллер/докер/кэш-таски). Если тула нет — `setup-projects-meta`.
|
||||||
|
|
||||||
## The call
|
## The calls
|
||||||
|
|
||||||
`mcp__projects-meta__meta_system_snapshot` takes **no arguments**. Read-only — call it directly, no preview / confirm, no per-session grant.
|
`mcp__mappa__meta_health` — no args, read-only. `{ok: true, service: "mappa"}` — сервис жив.
|
||||||
|
`mcp__mappa__admin_status` — no args, read-only. Счётчики по типам и проектам.
|
||||||
It returns three keys:
|
`mcp__projects-meta__meta_system_snapshot` — no args, read-only. Три ключа:
|
||||||
|
|
||||||
| Key | Shape | Liveness |
|
| Key | Shape | Liveness |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `poller` | `{ running: bool, projects: "<owner/repo …>" }` | **live** at call time |
|
| `poller` | `{ running: bool, projects: "<owner/repo …>" }` | **live** на момент вызова |
|
||||||
| `docker` | `[{ name, status }]` — local containers | **live** at call time |
|
| `docker` | `[{ name, status }]` — локальные контейнеры | **live** на момент вызова |
|
||||||
| `tasks` | `{ "<owner>/<repo>": { active, blocked }, … }` | **from the projects-meta cache** — may be stale |
|
| `tasks` | `{ "<owner>/<repo>": { active, blocked }, … }` | **из кэша** projects-meta — может быть stale |
|
||||||
|
|
||||||
`docker` is the **local** machine's containers (includes `agents-task-runner-*`), NOT the VDS. `tasks` counts mirror the cache, so treat them as approximate; for accurate task state run the `using-projects-meta` Step 0 freshness gate or read local `.tasks/` on disk.
|
`docker` — **локальная** машина (включая `agents-task-runner-*`), НЕ VDS. `tasks` — кэш; для точного состояния — using-projects-meta Step 0 или mappa/локальный `.tasks/`.
|
||||||
|
|
||||||
## Output format — one line per section
|
## Output format — одна строка на секцию
|
||||||
|
|
||||||
Compress the JSON into **three lines**. Don't dump the raw object.
|
Сожми в 3–4 строки, не дампи raw-object.
|
||||||
|
|
||||||
```
|
```
|
||||||
🟢 Poller running — OpeItcLoc03/skills (🔴 if running:false)
|
🟢 Mappa alive — 42 wiki / 18 tasks, 12 проектов
|
||||||
🟢 Docker — 8/8 up (else list only the bad ones)
|
🟢 Poller running — OpeItcLoc03/skills (🔴 если running:false)
|
||||||
📋 Tasks — 23 active / 41 blocked, 17 projects (name the busiest 2–3)
|
🟢 Docker — 8/8 up (иначе только проблемные)
|
||||||
|
📋 Tasks — 23 active / 41 blocked, 17 проектов (назвать 2–3 самых загруженных)
|
||||||
```
|
```
|
||||||
|
|
||||||
Rules per line:
|
Правила на строку:
|
||||||
|
|
||||||
- **Poller** — 🟢/🔴 + running flag + the `projects` string. If stopped, say so plainly — that's the headline.
|
- **Mappa** — 🟢/🔴 + admin_status-сводка (счётчики по типам или проектам — кратко). Сервис упал = заголовок.
|
||||||
- **Docker** — if every status starts with `Up` (incl. `Up … (healthy)`), report `N/N up`. Otherwise list **only** the problem containers by name + status (`Restarting`, `Exited`, `(unhealthy)`, `Created`, `Paused`). Don't enumerate healthy ones.
|
- **Poller** — 🟢/🔴 + running-flag + projects-строка. Остановлен — скажи прямо.
|
||||||
- **Tasks** — totals (Σ active / Σ blocked across all projects) + the 2–3 projects with the most active work. Full per-project breakdown only if asked.
|
- **Docker** — если всё `Up` (вкл. `Up … (healthy)`) — `N/N up`. Иначе только проблемные (`Restarting`, `Exited`, `(unhealthy)`, `Created`, `Paused`) по имени + статусу.
|
||||||
|
- **Tasks** — суммы (Σ active / Σ blocked) + 2–3 проекта с наибольшей активностью. Полный расклад — только по запросу.
|
||||||
|
|
||||||
## What NOT to do
|
## What NOT to do
|
||||||
|
|
||||||
- **Do NOT** state "the poller is running" / "all containers are up" / "you have N active tasks" from memory or a prior snapshot. Call the tool in the current turn first. A snapshot from earlier in the session is already stale for liveness claims.
|
- **НЕ** утверждай «поллер работает» / «все контейнеры up» / «N активных тасок» по памяти или прошлому снапшоту. Зови тулы в текущем turn — liveness требует свежих данных.
|
||||||
- **Do NOT** fall back to `tasklist` / `docker ps` / a manual `meta_status` to answer these questions — that's the scatter this skill exists to replace. (Drop to raw `docker logs` only for the deep single-container diagnosis this skill explicitly defers.)
|
- **НЕ** падай на `tasklist` / `docker ps` / ручной `meta_status` — это scatter, который скил заменяет. (`docker logs` — только для глубокой диагностики одного контейнера.)
|
||||||
- **Do NOT** paste the raw JSON. Three lines, one per section.
|
- **НЕ** вставляй raw-JSON. Строки, по одной на секцию.
|
||||||
- **Do NOT** present `tasks` counts as exact — they come from the cache. Flag staleness if precision matters, and point at `using-projects-meta`.
|
- **НЕ** подавай `tasks`-счётчики как точные — они из кэша. При важности точности — флаг сталезности + using-projects-meta.
|
||||||
|
|
||||||
## Common mistakes
|
## Common mistakes
|
||||||
|
|
||||||
| Mistake | Fix |
|
| Mistake | Fix |
|
||||||
|---|---|
|
|---|---|
|
||||||
| "Poller's still up" without calling the tool this turn | Call `meta_system_snapshot` first — liveness claims need current evidence. |
|
| «Сервис жив» без вызова в этом turn | Зови `meta_health`/`admin_status` — liveness требует текущих данных. |
|
||||||
| Running `docker ps` / `tasklist` instead | Use the single snapshot call; that's the point. |
|
| «Poller up» без вызова | `meta_system_snapshot` в текущем turn. |
|
||||||
| Reading the snapshot's `docker` as the VDS fleet | It's the **local** machine. VDS containers → `using-vds-ops`. |
|
| `docker ps` / `tasklist` вместо зондов | Один-два вызова тула; в этом смысл. |
|
||||||
| Treating `tasks` counts as authoritative | They're cached. For exact state use `using-projects-meta` Step 0 or local `.tasks/`. |
|
| Читать снапшот-`docker` как VDS-флот | Это **локальная** машина. VDS — using-vds-ops. |
|
||||||
| Dumping the raw JSON object | Collapse to three lines (poller / docker / tasks). |
|
| `tasks`-счётчики как авторитетные | Они кэшированы. Точность — using-projects-meta Step 0 / mappa / `.tasks/`. |
|
||||||
|
| Дампить raw-объект | Сожми в строки (mappa / poller / docker / tasks). |
|
||||||
|
|||||||
Reference in New Issue
Block a user