Skip to content

Commit 5c6c1be

Browse files
authored
feat: add runtime policy to desktop desk (#78)
1 parent b0a4e74 commit 5c6c1be

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/desktop/src/pages/PoliciesPage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ import { fetchPolicies } from "../lib/api";
44
import { Button } from "../components/ui/Button";
55
import { Card, CardBody, CardHeader, CardTitle } from "../components/ui/Card";
66

7-
const POLICY_SECTIONS = ["agent_registry", "command_allowlist", "forbidden_actions", "tool_registry"] as const;
7+
const POLICY_SECTIONS = [
8+
"control_plane_runtime_policy",
9+
"agent_registry",
10+
"command_allowlist",
11+
"forbidden_actions",
12+
"tool_registry",
13+
] as const;
814
const SECTION_LABELS: Record<string, string> = {
15+
control_plane_runtime_policy: "Control-plane runtime policy",
916
agent_registry: "Agent registry",
1017
command_allowlist: "Command allowlist",
1118
forbidden_actions: "Forbidden actions",
@@ -24,7 +31,7 @@ export function PoliciesPage() {
2431

2532
return (
2633
<div className="content">
27-
<div className="section-header"><div><h1 className="page-title">Policies</h1><p className="page-subtitle">Security policy settings: agent registry, command allowlist, tool permissions, and forbidden actions</p></div><Button onClick={load} disabled={loading}>{loading ? "Refreshing..." : "Refresh"}</Button></div>
34+
<div className="section-header"><div><h1 className="page-title">Policies</h1><p className="page-subtitle">Audit control-plane runtime rules, agent registry, command allowlist, tool permissions, and forbidden actions from one policy desk.</p></div><Button onClick={load} disabled={loading}>{loading ? "Refreshing..." : "Refresh"}</Button></div>
2835
{error && <div className="alert alert-danger" role="alert" aria-live="assertive">{error}</div>}
2936
{loading ? <div className="skeleton-stack-lg"><div className="skeleton skeleton-row" /><div className="skeleton skeleton-row" /></div> : (
3037
<div className="grid-2">

apps/desktop/src/pages/overview_policies_branch.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ describe("overview + policies low-branch coverage", () => {
176176
)
177177
.mockRejectedValueOnce(new Error("policies error"))
178178
.mockResolvedValueOnce({
179+
control_plane_runtime_policy: { completion_governance: { components: ["dod_checker", "reply_auditor", "continuation_policy"] } },
179180
agent_registry: "ALLOW_ALL",
180181
command_allowlist: { commands: ["run"] },
181182
forbidden_actions: null,
@@ -199,7 +200,9 @@ describe("overview + policies low-branch coverage", () => {
199200
fireEvent.click(screen.getByRole("button", { name: "Refresh" }));
200201
await waitFor(() => {
201202
expect(screen.queryByText("policies error")).not.toBeInTheDocument();
203+
expect(screen.getByText("Control-plane runtime policy")).toBeInTheDocument();
202204
expect(screen.getByText("ALLOW_ALL")).toBeInTheDocument();
205+
expect(screen.getByText(/"completion_governance": \{/)).toBeInTheDocument();
203206
expect(screen.getByText(/"commands": \[/)).toBeInTheDocument();
204207
expect(screen.getAllByText("No data").length).toBeGreaterThanOrEqual(2);
205208
});

0 commit comments

Comments
 (0)