diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da3a75..5a49e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,9 @@ ## 0.2.4 (prepared; not yet published) -- Bundles the skills from metergraph/skills 93edccd, which use `tools call` for the - loop and start a classification when none is current. +- Bundles the skills from metergraph/skills e376bbd, which use `tools call` for the + model-swap workflow, start a classification when none is current, and offer + `login --role debug` with the `--allow-*` flags when the workflow needs more access. - One key for an agent. The read commands and `experiments` accept a coding-agent key with the Debug role and the workflow permissions a workspace owner grants (Allow evaluation writes, Allow evaluation previews, Allow analysis starts) as well as a diff --git a/assets/skill/SKILL.md b/assets/skill/SKILL.md index fe8f487..ecd1418 100644 --- a/assets/skill/SKILL.md +++ b/assets/skill/SKILL.md @@ -134,7 +134,7 @@ a command, and never put it in a project file. Ingest setup cannot run over SSH, in a cloud workspace or in CI; it runs on the person's machine. The Metadata key is separate from the application's ingest key and never replaces it. A CLI whose help does not list `tools` refuses Debug and Replay keys rather than -reducing them; a loop-access key needs a newer metergraph CLI there. +reducing them; a key with the Debug role needs a newer metergraph CLI there. ## MCP routes, for clients without a shell @@ -232,13 +232,14 @@ Use https://www.metergraph.dev/docs/ for public product documentation and https: More Metergraph skills are at https://github.com/metergraph/skills. When the person wants to know whether a workload could use a cheaper or better model, or asks to run a model-swap analysis, use `metergraph-model-swap` if it is -installed; it walks the whole loop and hands each stage to its own skill. The -loop needs loop access (the Debug role plus Allow evaluation writes, Allow -evaluation previews and Allow analysis starts), which only a workspace owner -grants; that skill checks for it before the loop starts and says how to get it -on each deployment. If it is not installed, offer to install the skills (a separate verified installation from the skills repository, or in -Claude Code and Claude Desktop the plugin marketplace `metergraph/skills`) -rather than improvising the analysis steps. +installed; it walks the whole workflow and hands each stage to its own skill. +It needs the Debug role plus Allow evaluation writes, Allow evaluation previews +and Allow analysis starts, which only a workspace owner grants; that skill +checks for them before it starts and says how to get them on each deployment. +If it is not installed, offer to install the skills (a separate verified +installation from the skills repository, or in Claude Code and Claude Desktop +the plugin marketplace `metergraph/skills`) rather than improvising the +analysis steps. ## When already connected: bounded investigation diff --git a/assets/skill/manifest.json b/assets/skill/manifest.json index ce1e23e..38f9aac 100644 --- a/assets/skill/manifest.json +++ b/assets/skill/manifest.json @@ -3,7 +3,7 @@ "name": "metergraph", "file": "SKILL.md", "source_url": "https://www.metergraph.dev/SKILL.md", - "sha256": "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4", - "size": 27971, - "revision": "sha256-0946db53f827" + "sha256": "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce", + "size": 27961, + "revision": "sha256-f31c24c40747" } diff --git a/assets/skills/manifest.json b/assets/skills/manifest.json index fcf8a9a..98ae86b 100644 --- a/assets/skills/manifest.json +++ b/assets/skills/manifest.json @@ -1,25 +1,25 @@ { "manifest_version": 1, "repository": "metergraph/skills", - "commit": "93edccdb047d68e55104217269bf66d662611694", + "commit": "e376bbde0d9ae3cf64adde2e08f6cb0cf0f2fee6", "skills": [ { "name": "metergraph-analyze", - "sha256": "0288ad9e420ae37dcbee0fd274045dc0fa3ffa674d68495979975e57f13a9b01", - "size": 18668, - "revision": "sha256-0288ad9e420a" + "sha256": "47d6abd05096e6232188e5ee6fb225de87961cdb59a57af0536c14e3b48fe3c5", + "size": 19165, + "revision": "sha256-47d6abd05096" }, { "name": "metergraph-candidates", - "sha256": "923b1866587cad563ba42db0ed0406539cf8a4fe513ac8a0642c1bf29eec40d4", - "size": 7118, - "revision": "sha256-923b1866587c" + "sha256": "823d8a1905ce28fd6336208326fbda6196ac4550654614289d4fd3a8cd391582", + "size": 7353, + "revision": "sha256-823d8a1905ce" }, { "name": "metergraph-evals", - "sha256": "0a96439daa30d0dcac6b4821bf14f12279cbb793bd3af21b6363fd71b1c14cc6", - "size": 9962, - "revision": "sha256-0a96439daa30" + "sha256": "4a8ccc2fdf7ae6dbd96d52d4595bbd41613296daa1d52cbeb04734f159a07512", + "size": 10232, + "revision": "sha256-4a8ccc2fdf7a" }, { "name": "metergraph-investigate", @@ -29,9 +29,9 @@ }, { "name": "metergraph-iterate", - "sha256": "32aaa19b7fce6c365a5935f9eeb69daca357e7e2c99f330ca2d8ac81febb6225", - "size": 7997, - "revision": "sha256-32aaa19b7fce" + "sha256": "6f5824b0bc5852e561c1a37f0c9afee6859d7209f070d1a2651c9ae92d29a707", + "size": 8283, + "revision": "sha256-6f5824b0bc58" }, { "name": "metergraph-local-bundle", @@ -41,9 +41,9 @@ }, { "name": "metergraph-model-swap", - "sha256": "7a76b7121a5a0b4312a3e5dec7abe8184ee3f492b980a04f872a9547229c7a5e", - "size": 11863, - "revision": "sha256-7a76b7121a5a" + "sha256": "d4166ece3a0d2b31bf8c6f623315e1b37000987dced71a86cb3d2a9ebabf6ef8", + "size": 12572, + "revision": "sha256-d4166ece3a0d" }, { "name": "metergraph-onboarding", @@ -53,15 +53,15 @@ }, { "name": "metergraph-report", - "sha256": "6deb06f24d3c4e7a0e0c19d964b79a4b3278bdc8524776829821897f3e921a18", - "size": 8236, - "revision": "sha256-6deb06f24d3c" + "sha256": "cdf21b4dcc3b11a9a3fad94a6dcfc6596b1c67937e2cf5ea4176b098f7163bdc", + "size": 8471, + "revision": "sha256-cdf21b4dcc3b" }, { "name": "metergraph-workloads", - "sha256": "40161aa823a859cc3a1b2a1dd644bb54cf33ac32f82546346da785413abccfa6", - "size": 9607, - "revision": "sha256-40161aa823a8" + "sha256": "83c2b7372ec39d7c59fb2ef148781f321b0511655c5348c9109c9a297bee2be5", + "size": 9842, + "revision": "sha256-83c2b7372ec3" } ] } diff --git a/assets/skills/metergraph-analyze/SKILL.md b/assets/skills/metergraph-analyze/SKILL.md index 18cd2a7..b00eba7 100644 --- a/assets/skills/metergraph-analyze/SKILL.md +++ b/assets/skills/metergraph-analyze/SKILL.md @@ -7,7 +7,7 @@ description: Take one classified Metergraph workload to a model-swap recommendat This skill takes one classified workload to a recommendation: should this workload move to a different model, and what would that do to quality and cost. -It is stage 4 of the `metergraph-model-swap` loop. Choosing the workload, +It is stage 4 of the `metergraph-model-swap` workflow. Choosing the workload, candidates and eval first (`metergraph-workloads`, `metergraph-candidates`, `metergraph-evals`) makes the result easier to act on, but is not required. It adds no tools, scopes or authority, and works the same through the @@ -69,15 +69,18 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## 1. Check the tools and access @@ -91,16 +94,16 @@ Only a workspace owner grants loop access; **Loop access** in `analysis_start` capability with `available: true`. Do not guess a tool name or substitute a dashboard API, replay, generic SQL or an ad hoc shell command. -3. Reading needs read access. Starting needs the Debug role plus **Allow - analysis starts** (`agent:read` and `agent:analysis-run`), both part of loop - access. The start capability is classed `replay` because the run sends - captured content to providers, but it does not need `agent:replay`. Do not - request replay, read trace content or report evidence, or replay a trace to - reach a recommendation. +3. Reading needs the Metadata role. Starting needs the Debug role plus + **Allow analysis starts** (`agent:read` and `agent:analysis-run`). The + start capability is classed `replay` because the run sends captured content + to providers, but it does not need `agent:replay`. Do not request replay, + read trace content or report evidence, or replay a trace to reach a + recommendation. ## 2. When start access is missing -`metergraph setup` and the default sign-in grant read access only. Starting +`metergraph setup` and the default sign-in grant the Metadata role only. Starting needs only the Debug role and **Allow analysis starts**; the evaluation permissions belong to the full model-swap workflow, not to this step. If `metergraph_start_analysis` is not listed or `analysis_start` is unavailable, @@ -108,11 +111,15 @@ keep going with the read steps below, then tell the person once what to grant for their deployment (`deployment_profile`): - **Hosted** (`managed`). When the agent has a shell and `metergraph help - login` lists `--access`, run `metergraph login --access loop` with the - runtime and approval flags the `metergraph` skill uses for `login`; a - workspace owner approves the request on the consent page. Otherwise a - workspace owner creates a coding-agent key on the **Keys** page with the - **Model-swap loop** access choice. The person saves it in their own editor + login` lists `--role`, run `metergraph login --role debug + --allow-analysis-starts` (adding `--allow-evaluation-writes + --allow-evaluation-previews` only if they also want the agent to write and + test evaluations) with the runtime and approval flags the `metergraph` skill + uses for `login`; a workspace owner approves the request on the consent page. + Otherwise a workspace owner creates a coding-agent key with the Debug role + on the **Keys** page, then ticks **Allow analysis starts** for it under + Connection access and saves, which rotates the key; only the new token + works. The person saves it in their own editor as `export METERGRAPH_AGENT_TOKEN=…` in a private file outside the project (for example `~/.config/metergraph/agent.env`), runs `. ~/.config/metergraph/agent.env` in the shell that starts the agent, and @@ -129,9 +136,9 @@ for their deployment (`deployment_profile`): command or client is a supported-release blocker; never use the local browser Keys page or host HTTP as fallback. A consent-unavailable start is not a missing scope and must not trigger key escalation. -- **Customer-owned AWS** (`byoc-core`) **or the open-source server.** Loop - access is not offered there: there are no managed evaluations and no trace - content. Say so once and stop before the start step. +- **Customer-owned AWS** (`byoc-core`) **or the open-source server.** The + workflow permissions are not offered there: there are no managed evaluations + and no trace content. Say so once and stop before the start step. The same `METERGRAPH_AGENT_TOKEN` serves the CLI and an MCP configuration that references it; a client without a shell takes the key in its private connector diff --git a/assets/skills/metergraph-candidates/SKILL.md b/assets/skills/metergraph-candidates/SKILL.md index 87f42dd..51f65e6 100644 --- a/assets/skills/metergraph-candidates/SKILL.md +++ b/assets/skills/metergraph-candidates/SKILL.md @@ -1,6 +1,6 @@ --- name: metergraph-candidates -description: Choose the traces and candidate models for a Metergraph model-swap analysis - pick the environment and window, check provider readiness, shortlist candidates that fit the workload and the route's residency, and list the route settings (replay opt-out, limits) the person must change in the app. Use for "which models should we test", "set up the analysis", or stage 2 of the metergraph-model-swap loop. +description: Choose the traces and candidate models for a Metergraph model-swap analysis - pick the environment and window, check provider readiness, shortlist candidates that fit the workload and the route's residency, and list the route settings (replay opt-out, limits) the person must change in the app. Use for "which models should we test", "set up the analysis", or stage 2 of the metergraph-model-swap workflow. --- # Choose traces and candidate models @@ -43,15 +43,18 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## 1. Which traces diff --git a/assets/skills/metergraph-evals/SKILL.md b/assets/skills/metergraph-evals/SKILL.md index 67253bb..280b63d 100644 --- a/assets/skills/metergraph-evals/SKILL.md +++ b/assets/skills/metergraph-evals/SKILL.md @@ -1,6 +1,6 @@ --- name: metergraph-evals -description: Define or refine the quality bar for a Metergraph workload before or after a model-swap analysis - draft deterministic checks and a graded rubric from good production traces and the person's codebase, test them with the evaluation preview, then save and bind them when the key allows it, or hand a ready-to-enter rubric to the app when it does not. Use for "what should count as a good answer", "write an eval", "tighten the checks", or stage 3 of the metergraph-model-swap loop. +description: Define or refine the quality bar for a Metergraph workload before or after a model-swap analysis - draft deterministic checks and a graded rubric from good production traces and the person's codebase, test them with the evaluation preview, then save and bind them when the key allows it, or hand a ready-to-enter rubric to the app when it does not. Use for "what should count as a good answer", "write an eval", "tighten the checks", or stage 3 of the metergraph-model-swap workflow. --- # Define or refine the eval @@ -64,15 +64,18 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## 1. Find out what you can do @@ -87,11 +90,12 @@ only where the deployment has managed evaluations. | Attach to the workload | `metergraph_preview_evaluation_assignment` then `metergraph_apply_evaluation_assignment` (pass the preview's `scope_hash` as `expected_scope_hash`); `metergraph_retire_evaluation_assignment` | `agent:eval-write` | | Reference answers | `metergraph_preview_reference_binding` then `metergraph_bind_reference_cases` | `agent:eval-write` | -None of these calls a model provider or starts a run. Each needs part of loop -access: the Debug role to read, plus the evaluation permissions to preview and -write. If they are not listed, say once which part of loop access is missing -(**Loop access** in `metergraph-model-swap` says how each deployment grants -it), keep going with the draft, and finish with the app handoff in step 5. +None of these calls a model provider or starts a run. Each needs the Debug +role to read, plus Allow evaluation previews to preview and Allow evaluation +writes to write. If they are not listed, say once which role or permission is +missing (**Granting Debug and the permissions** in `metergraph-model-swap` says +how each deployment grants them), keep going with the draft, and finish with +the app handoff in step 5. ## 2. Start from what exists @@ -138,7 +142,7 @@ good and bad cases. A check that fails good cases or passes bad ones is wrong; fix the check, not the model. Report the per-check pass counts in a short table. Then `metergraph_validate_evaluation_draft`, and, after the person agrees, `metergraph_save_evaluation_draft` and the assignment pair. Keep the -returned revision and assignment IDs in the loop record. From the CLI, a tool +returned revision and assignment IDs in the model-swap record. From the CLI, a tool that `tools list` marks as writing takes `--yes` only once that agreement is given, for example `metergraph tools call metergraph_save_evaluation_draft --args '' --yes --json`. diff --git a/assets/skills/metergraph-iterate/SKILL.md b/assets/skills/metergraph-iterate/SKILL.md index cafd729..53480a0 100644 --- a/assets/skills/metergraph-iterate/SKILL.md +++ b/assets/skills/metergraph-iterate/SKILL.md @@ -1,6 +1,6 @@ --- name: metergraph-iterate -description: Refine and rerun a Metergraph model-swap analysis after the person has inspected the report in the app - turn their findings into a specific change (eval revision, cases, candidates, traffic or route settings), start a new approved run linked to the previous one, and compare the two honestly. Use when someone returns with "the grader is wrong on these cases", "drop that model", "rerun it", "what changed since last run", or stage 6 of the metergraph-model-swap loop. +description: Refine and rerun a Metergraph model-swap analysis after the person has inspected the report in the app - turn their findings into a specific change (eval revision, cases, candidates, traffic or route settings), start a new approved run linked to the previous one, and compare the two honestly. Use when someone returns with "the grader is wrong on these cases", "drop that model", "rerun it", "what changed since last run", or stage 6 of the metergraph-model-swap workflow. --- # Refine and rerun @@ -62,19 +62,22 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. - -## 1. Recover where the loop is - -1. Read the loop record (in the conversation or `.metergraph/model-swap.md`). If +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. + +## 1. Recover where the model swap is + +1. Read the model-swap record (in the conversation or `.metergraph/model-swap.md`). If there is none, `metergraph_list_analysis_runs` and `metergraph_get_report` on the latest run for this workload, and rebuild it. 2. Confirm the workload's `selection_reference` still exists with @@ -111,7 +114,8 @@ save the new revision first, as in `metergraph-evals`), then start. Then call `m - `rerun_of_run_id` set to the previous run ID; - `reference_binding_id` when reference cases were bound. -Starting needs loop access. If it is missing, say what to grant, as +Starting needs the Debug role and Allow analysis starts. If either is +missing, say what to grant, as `metergraph-analyze` describes; until it is granted, the person can start the rerun from the analysis page in the app. From the CLI, `--yes` stands for the new confirmation and nothing earlier: @@ -136,4 +140,4 @@ samples If the eval revision, the sample or the candidate set changed, say that a different grade may come from the change, not from the model. Then give the decision line from `metergraph-report` with the new report link, and update the -loop record. +model-swap record. diff --git a/assets/skills/metergraph-model-swap/SKILL.md b/assets/skills/metergraph-model-swap/SKILL.md index 13d0a0b..8f199cb 100644 --- a/assets/skills/metergraph-model-swap/SKILL.md +++ b/assets/skills/metergraph-model-swap/SKILL.md @@ -1,9 +1,9 @@ --- name: metergraph-model-swap -description: Run the Metergraph model-swap loop from a coding agent - choose a workload, choose traces and candidate models, define or refine the eval, start the analysis, summarize the report with its app link, then refine and rerun. Use when someone asks whether a workload could use a cheaper or better model, asks to plan or run a model swap analysis, asks "what should my largest workload run on", or comes back after inspecting a Metergraph report. Works through the metergraph CLI or the Agent Access MCP server; use the metergraph skill first only when neither can read the workspace. +description: Run a Metergraph model swap from a coding agent - choose a workload, choose traces and candidate models, define or refine the eval, start the analysis, summarize the report with its app link, then refine and rerun. Use when someone asks whether a workload could use a cheaper or better model, asks to plan or run a model swap analysis, asks "what should my largest workload run on", or comes back after inspecting a Metergraph report. Works through the metergraph CLI or the Agent Access MCP server; use the metergraph skill first only when neither can read the workspace. --- -# Model-swap loop +# Model swap This skill is the map. Each stage has its own skill; load it when you reach the stage. The person stays in the coding agent for choosing, defining and @@ -79,50 +79,59 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## Start every session the same way 1. Run step 0. -2. Check loop access once, as **Loop access** below describes, and say what is - missing before stage 1 rather than when a stage needs it. +2. Check the role and permissions once, as **Granting Debug and the + permissions** below describes, and say what is missing before stage 1 + rather than when a stage needs it. 3. Call `metergraph_list_analysis_runs` with a small limit (from the CLI, `metergraph tools call metergraph_list_analysis_runs --args '{"limit": 5}' --json`). If a run already exists for this workload, the person is probably on stage 6: read its report first instead of starting over, and give the report link (`/#analysis?report=`, as in `metergraph-report`). 4. Plan only with the tools step 0 listed. When a stage needs a tool that is - not listed, say what it needs (loop access, or a deployment that offers - it), keep the selection you have, and hand that step to the app page named - in the stage skill. Never invent a tool, call a dashboard API with an agent - key, or drive the app in a browser unless the person asks for that - specific change. - -## Loop access - -Read access covers choosing the workload and candidates, checking readiness -and reading reports. Reading and testing evals, saving them and starting runs -need loop access. Check it from `data.jobs.loop` in `metergraph status --json`, -or over MCP from the `available` flags of `analysis_start` and the evaluation -capabilities. When it is missing, tell the person once what to grant for their -deployment (`deployment_profile`), then carry on with the stages read access -allows: + not listed, say what it needs (the Debug role and a permission, or a + deployment that offers it), keep the selection you have, and hand that + step to the app page named in the stage skill. Never invent a tool, call a + dashboard API with an agent key, or drive the app in a browser unless the + person asks for that specific change. + +## Granting Debug and the permissions + +The Metadata role covers choosing the workload and candidates, checking +readiness and reading reports. Reading and testing evals, saving them and +starting runs need the Debug role with Allow evaluation writes, Allow +evaluation previews and Allow analysis starts. Check them from `data.access` in +`metergraph status --json`, or over MCP from the `available` flags of +`analysis_start` and the evaluation capabilities. When any is missing, tell the +person once what to grant for their deployment (`deployment_profile`), then +carry on with the stages the Metadata role allows: - **Hosted** (`managed`). When the agent has a shell and `metergraph help - login` lists `--access`, run `metergraph login --access loop` with the - runtime and approval flags the `metergraph` skill uses for `login`; a - workspace owner approves the request on the consent page. Otherwise a - workspace owner creates a coding-agent key on the **Keys** page with the - **Model-swap loop** access choice. The person saves it in their own editor - as `export METERGRAPH_AGENT_TOKEN=…` in a private file outside the project + login` lists `--role`, run `metergraph login --role debug + --allow-evaluation-writes --allow-evaluation-previews --allow-analysis-starts` + with the runtime and approval flags the `metergraph` skill uses for `login`; + a workspace owner approves the request on the consent page. Otherwise a + workspace owner creates a coding-agent key with the Debug role on the + **Keys** page, then ticks **Allow evaluation writes**, **Allow evaluation + previews** and **Allow analysis starts** for it under Connection access and + saves, which rotates the key; only the new token works. The person saves it + in their own editor as `export METERGRAPH_AGENT_TOKEN=…` in a private file + outside the project (for example `~/.config/metergraph/agent.env`), runs `. ~/.config/metergraph/agent.env` in the shell that starts the agent, and restarts the agent. @@ -136,9 +145,9 @@ allows: command or client is a supported-release blocker; never use the local browser Keys page or host HTTP as fallback. A consent-unavailable start is not a missing scope and must not trigger key escalation. -- **Customer-owned AWS** (`byoc-core`) **or the open-source server.** Loop - access is not offered there: there are no managed evaluations and no trace - content. Say so once and stop the loop. +- **Customer-owned AWS** (`byoc-core`) **or the open-source server.** The + workflow permissions are not offered there: there are no managed evaluations + and no trace content. Say so once and stop the model-swap workflow. The same `METERGRAPH_AGENT_TOKEN` serves the CLI and an MCP configuration that references it; a client without a shell takes the key in its private connector @@ -159,15 +168,16 @@ again. from the person, not a list of everything that could be configured. - **Spending and data egress need a yes.** Starting an analysis sends copies of captured prompts to other model providers and costs money. Stage 4 has the - exact confirmation to get. A connected key, loop access, a configured - provider key or an earlier yes for a different run is not approval. + exact confirmation to get. A connected key, the Debug role and its + permissions, a configured provider key or an earlier yes for a different run + is not approval. - **Settings are the person's.** Replay opt-out, data residency, candidate models, cost and latency limits and the size floor are changed in the app. Explain the change and give the page; do not make it for them. - **Keep answers short.** Lead with the answer or the blocker. Tables only for three or more rows. Give confidence once, where it matters. -## Keep a loop record +## Keep a model-swap record Treat loop records as sensitive metadata. Keep only the minimum needed in this conversation. Do not persist workspace or workload identifiers, origins, private diff --git a/assets/skills/metergraph-report/SKILL.md b/assets/skills/metergraph-report/SKILL.md index 5e53af4..205c84a 100644 --- a/assets/skills/metergraph-report/SKILL.md +++ b/assets/skills/metergraph-report/SKILL.md @@ -1,6 +1,6 @@ --- name: metergraph-report -description: Summarize a finished Metergraph analysis in a few lines with the link to its report in the app, say whether the evidence supports a switch, no switch or more testing, and tell the person exactly what to inspect in the app. Use after an analysis completes, when someone asks "what did the analysis find", "should we switch", "give me the report link", or stage 5 of the metergraph-model-swap loop. +description: Summarize a finished Metergraph analysis in a few lines with the link to its report in the app, say whether the evidence supports a switch, no switch or more testing, and tell the person exactly what to inspect in the app. Use after an analysis completes, when someone asks "what did the analysis find", "should we switch", "give me the report link", or stage 5 of the metergraph-model-swap workflow. --- # Summarize the report and hand off to the app @@ -42,15 +42,18 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## 1. Read it diff --git a/assets/skills/metergraph-workloads/SKILL.md b/assets/skills/metergraph-workloads/SKILL.md index dbf56f4..d60f5e6 100644 --- a/assets/skills/metergraph-workloads/SKILL.md +++ b/assets/skills/metergraph-workloads/SKILL.md @@ -1,6 +1,6 @@ --- name: metergraph-workloads -description: Choose which Metergraph workload to analyze - list classified workloads, rank them by spend with the source of each number stated, flag anomalies and suspect data, check readiness, and hand off when classification has not run. Use for "what is my largest workload", "list my workloads", "which workload should we optimize", or stage 1 of the metergraph-model-swap loop. +description: Choose which Metergraph workload to analyze - list classified workloads, rank them by spend with the source of each number stated, flag anomalies and suspect data, check readiness, and hand off when classification has not run. Use for "what is my largest workload", "list my workloads", "which workload should we optimize", or stage 1 of the metergraph-model-swap workflow. --- # Choose a workload @@ -55,15 +55,18 @@ as `metergraph tools call --args '' --json` and read only when this skill's approval rule for that exact call is met. Exit code 18 with reason `confirmation_required` means `--yes` was missing; ask the person. -Name missing access by the job it does. **Read access** is the Metadata role -(`agent:metadata`). **Loop access** is the Debug role (`agent:read`) plus -**Allow evaluation writes** (`agent:eval-write`), **Allow evaluation -previews** (`agent:eval-preview`) and **Allow analysis starts** -(`agent:analysis-run`). On the CLI, `data.jobs.read` and `data.jobs.loop` in -`metergraph status --json` say which this key has (`available`, and the -scopes still `missing`); over MCP, the capabilities' `available` flags do. -Only a workspace owner grants loop access; **Loop access** in -`metergraph-model-swap` says how on each deployment. +Name missing access by its role and permissions. The **Metadata** role +(`agent:metadata`) reads usage, workloads, readiness and reports. Reading and +testing evals, saving them and starting runs need the **Debug** role +(`agent:read`) with **Allow evaluation writes** (`agent:eval-write`), **Allow +evaluation previews** (`agent:eval-preview`) and **Allow analysis starts** +(`agent:analysis-run`). On the CLI, `data.access` in `metergraph status --json` +gives the `role` and one boolean per permission (`allow_evaluation_writes`, +`allow_evaluation_previews`, `allow_analysis_starts`); an older CLI without +`data.access` reports only `scopes`. Over MCP, the capabilities' `available` +flags say what this key can do. Only a workspace owner grants the permissions; +**Granting Debug and the permissions** in `metergraph-model-swap` says how on +each deployment. ## 1. Read what exists diff --git a/docs/reference.md b/docs/reference.md index 26696d7..320e9d9 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1239,8 +1239,8 @@ A successful `skill install`: "status": "installed", "source": { "name": "metergraph", - "revision": "sha256-0946db53f827", - "sha256": "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4" + "revision": "sha256-f31c24c40747", + "sha256": "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce" }, "discovery": "pending", "authenticated": false, diff --git a/python/metergraph-skills/src/metergraph_skills/bundle.py b/python/metergraph-skills/src/metergraph_skills/bundle.py index 91688b3..8751a04 100644 --- a/python/metergraph-skills/src/metergraph_skills/bundle.py +++ b/python/metergraph-skills/src/metergraph_skills/bundle.py @@ -13,7 +13,7 @@ from pathlib import Path from typing import NamedTuple, Optional -PINNED_SHA256 = "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4" +PINNED_SHA256 = "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce" SOURCE_URL = "https://www.metergraph.dev/SKILL.md" ASSET_DIR = Path(__file__).resolve().parent / "skill" diff --git a/python/metergraph-skills/src/metergraph_skills/skill/SKILL.md b/python/metergraph-skills/src/metergraph_skills/skill/SKILL.md index fe8f487..ecd1418 100644 --- a/python/metergraph-skills/src/metergraph_skills/skill/SKILL.md +++ b/python/metergraph-skills/src/metergraph_skills/skill/SKILL.md @@ -134,7 +134,7 @@ a command, and never put it in a project file. Ingest setup cannot run over SSH, in a cloud workspace or in CI; it runs on the person's machine. The Metadata key is separate from the application's ingest key and never replaces it. A CLI whose help does not list `tools` refuses Debug and Replay keys rather than -reducing them; a loop-access key needs a newer metergraph CLI there. +reducing them; a key with the Debug role needs a newer metergraph CLI there. ## MCP routes, for clients without a shell @@ -232,13 +232,14 @@ Use https://www.metergraph.dev/docs/ for public product documentation and https: More Metergraph skills are at https://github.com/metergraph/skills. When the person wants to know whether a workload could use a cheaper or better model, or asks to run a model-swap analysis, use `metergraph-model-swap` if it is -installed; it walks the whole loop and hands each stage to its own skill. The -loop needs loop access (the Debug role plus Allow evaluation writes, Allow -evaluation previews and Allow analysis starts), which only a workspace owner -grants; that skill checks for it before the loop starts and says how to get it -on each deployment. If it is not installed, offer to install the skills (a separate verified installation from the skills repository, or in -Claude Code and Claude Desktop the plugin marketplace `metergraph/skills`) -rather than improvising the analysis steps. +installed; it walks the whole workflow and hands each stage to its own skill. +It needs the Debug role plus Allow evaluation writes, Allow evaluation previews +and Allow analysis starts, which only a workspace owner grants; that skill +checks for them before it starts and says how to get them on each deployment. +If it is not installed, offer to install the skills (a separate verified +installation from the skills repository, or in Claude Code and Claude Desktop +the plugin marketplace `metergraph/skills`) rather than improvising the +analysis steps. ## When already connected: bounded investigation diff --git a/python/metergraph-skills/src/metergraph_skills/skill/manifest.json b/python/metergraph-skills/src/metergraph_skills/skill/manifest.json index ce1e23e..38f9aac 100644 --- a/python/metergraph-skills/src/metergraph_skills/skill/manifest.json +++ b/python/metergraph-skills/src/metergraph_skills/skill/manifest.json @@ -3,7 +3,7 @@ "name": "metergraph", "file": "SKILL.md", "source_url": "https://www.metergraph.dev/SKILL.md", - "sha256": "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4", - "size": 27971, - "revision": "sha256-0946db53f827" + "sha256": "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce", + "size": 27961, + "revision": "sha256-f31c24c40747" } diff --git a/python/metergraph-skills/tests/test_installer.py b/python/metergraph-skills/tests/test_installer.py index 0b07a27..09c7e3e 100644 --- a/python/metergraph-skills/tests/test_installer.py +++ b/python/metergraph-skills/tests/test_installer.py @@ -18,8 +18,8 @@ PACKAGE_ROOT = Path(__file__).resolve().parent.parent REPO_ROOT = PACKAGE_ROOT.parent.parent NPM_BIN = REPO_ROOT / "bin" / "metergraph.js" -SHA256 = "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4" -REVISION = "sha256-0946db53f827" +SHA256 = "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce" +REVISION = "sha256-f31c24c40747" PATHS = { "codex": ".agents/skills/metergraph/SKILL.md", "claude": ".claude/skills/metergraph/SKILL.md", diff --git a/skills-source.json b/skills-source.json index 938e2a9..e30495c 100644 --- a/skills-source.json +++ b/skills-source.json @@ -1,5 +1,5 @@ { "repository": "metergraph/skills", - "commit": "93edccdb047d68e55104217269bf66d662611694", + "commit": "e376bbde0d9ae3cf64adde2e08f6cb0cf0f2fee6", "path": "skills/metergraph/SKILL.md" } diff --git a/src/skill-bundle.js b/src/skill-bundle.js index 8931216..9924bab 100644 --- a/src/skill-bundle.js +++ b/src/skill-bundle.js @@ -5,7 +5,7 @@ import { readFileSync } from "node:fs"; // public skill at the manifest's source_url. The source has no version of its // own, so the revision is derived from the content hash. The hash is pinned // here as well as in the manifest, so editing either file alone is detected. -const PINNED_SHA256 = "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4"; +const PINNED_SHA256 = "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce"; const ASSET_DIR = new URL("../assets/skill/", import.meta.url); const MANIFEST_KEYS = ["file", "manifest_version", "name", "revision", "sha256", "size", "source_url"]; @@ -55,7 +55,7 @@ export function loadBundledSkill() { // The workflow skills that "skills install" writes, vendored from the public // skills repository at one commit. The manifest's own hash is pinned here, and // the manifest pins each skill's hash, so changing any file alone is detected. -const PINNED_PACK_SHA256 = "37289391407a6c322e66503e4c0135f29c27184c1b767a09f4993163f4726198"; +const PINNED_PACK_SHA256 = "0460133ebbe3bc4f1ea03e297f36a15b72b291ab9b9efb80a35df863ef974e0c"; const PACK_DIR = new URL("../assets/skills/", import.meta.url); const PACK_KEYS = ["commit", "manifest_version", "repository", "skills"]; diff --git a/test/package/pack.test.js b/test/package/pack.test.js index 6a37e21..8ac8f6c 100644 --- a/test/package/pack.test.js +++ b/test/package/pack.test.js @@ -94,7 +94,7 @@ const EXPECTED_FILES = [ "src/verify-output.js", "src/verify.js", ]; -const SKILL_SHA256 = "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4"; +const SKILL_SHA256 = "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce"; const NO_NETWORK = fileURLToPath(new URL("../fixtures/no-network.js", import.meta.url)); let workDir; diff --git a/test/skill.test.js b/test/skill.test.js index 37c7981..9f110eb 100644 --- a/test/skill.test.js +++ b/test/skill.test.js @@ -12,8 +12,8 @@ import { assertNoLeak, parseJsonLine, runCli } from "./helpers.js"; const ROOT = fileURLToPath(new URL("../", import.meta.url)); const SKILL = fs.readFileSync(path.join(ROOT, "assets", "skill", "SKILL.md")); -const SHA256 = "0946db53f82739da9ef2c44501b06b2734786be88fc3d30c84854b034462a8b4"; -const REVISION = "sha256-0946db53f827"; +const SHA256 = "f31c24c4074707df0e34502bd9efbfde4fff5703e6fd367e0f60692f9f5878ce"; +const REVISION = "sha256-f31c24c40747"; const GUIDE_URL = "https://www.metergraph.dev/docs/guides/agent-access/"; const FAULTS = pathToFileURL(fileURLToPath(new URL("./fixtures/fs-faults.js", import.meta.url))).href; const isWindows = process.platform === "win32"; @@ -154,7 +154,7 @@ function trySymlink(target, link, type) { test("the bundled skill matches the pinned hash and its manifest", () => { const manifest = JSON.parse(fs.readFileSync(path.join(ROOT, "assets", "skill", "manifest.json"), "utf8")); - assert.equal(SKILL.length, 27971); + assert.equal(SKILL.length, 27961); assert.equal(sha256(SKILL), SHA256); assert.deepEqual(manifest, { manifest_version: 1, @@ -162,7 +162,7 @@ test("the bundled skill matches the pinned hash and its manifest", () => { file: "SKILL.md", source_url: "https://www.metergraph.dev/SKILL.md", sha256: SHA256, - size: 27971, + size: 27961, revision: REVISION, }); assert.ok(SKILL.toString("utf8").startsWith("---\nname: metergraph\ndescription: "));