Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const ALWAYS_MUTATING_TOOLS = new Set([
"write",
]);

// View mode protects monitored workloads and infrastructure from changes.
// Saving a Grafana dashboard persists a visualization of observed data, which is
// part of the View workflow. Both dashboard creation tools are intentionally
// allowed here; a Grafana API write alone does not make an action require Edit.
const READ_ONLY_TOOLS = new Set([
"agents_list",
"bcm_execute_cmsh",
Expand All @@ -25,6 +29,7 @@ const READ_ONLY_TOOLS = new Set([
"bcm_node_health_summary",
"bcm_search_notes",
"bcm_search_tools",
"dashboard_create",
"dashboard_list",
"dashboard_open",
"dcgm_current",
Expand All @@ -35,6 +40,7 @@ const READ_ONLY_TOOLS = new Set([
"find",
"get_goal",
"glob",
"grafana_dashboard_create",
"grafana_dashboard_health",
"grafana_dashboard_open",
"grafana_dashboard_presets",
Expand Down
11 changes: 10 additions & 1 deletion helm/mosaic-stack/tests/automation-context.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ test("uses fixed tool capabilities with a narrow diagnostic exception", () => {
for (const tool of [
"write", "edit", "apply_patch",
"run_kubectl_admin", "bcm_execute_cmsh_admin", "bcm_add_note", "bcm_remove_note",
"dashboard_create", "grafana_dashboard_create",
]) {
assert.equal(toolRequiresEdit(tool), true, tool);
}
Expand All @@ -150,3 +149,13 @@ test("applies explicit per-server MCP tool access without trusting unknown serve
assert.equal(toolAccess("unconfigured__inspect"), "unknown");
configureMcpToolPolicies(undefined);
});

// Dashboard persistence is an observation workflow, not infrastructure mutation.
test("View permits dashboard authoring while infrastructure changes still require Edit", () => {
for (const name of ["dashboard_create", "grafana_dashboard_create"]) {
assert.equal(toolRequiresEdit(name), false, name);
}
for (const name of ["run_kubectl_admin", "bcm_execute_cmsh_admin", "apply_patch"]) {
assert.equal(toolRequiresEdit(name), true, name);
}
});
Loading