backend and governance: MCP contract, agent capabilities, API, and release-control

Manifest-backed MCP tools, prompts, and resources with surface affordance contracts; agent capability manifest and governance projection; API contract tests and capability route projection; operations-loop and intelligence-funnel telemetry; release-control subsystem documentation, registry, and tooling; licensing and configuration.
This commit is contained in:
rcourtman 2026-06-23 17:26:15 +01:00
parent 27ba85ddc6
commit ee8a24e14a
279 changed files with 43945 additions and 9404 deletions

View file

@ -956,7 +956,7 @@ test.describe("Patrol runtime-state browser contract", () => {
await expect(page.getByText("Failed to start patrol run")).toHaveCount(0);
});
test("surfaces scoped trigger context inside the summary and split trigger controls on the Patrol page", async ({
test("keeps scoped trigger context out of the default Patrol status strip", async ({
page,
}, testInfo) => {
test.skip(
@ -978,15 +978,18 @@ test.describe("Patrol runtime-state browser contract", () => {
page.getByText(
"Recent activity mix: 1 full, 1 alert-triggered, 1 anomaly-triggered",
),
).toBeVisible();
).toHaveCount(0);
await expect(
page.getByText("Trigger mode: 4 queued · busy mode · anomalies off"),
).toBeVisible();
).toHaveCount(0);
await expect(
page.getByText("Trigger status: 4 queued · busy mode · anomalies off"),
page.getByText("Automation: 4 queued · busy mode · anomalies off"),
).toBeVisible();
await page.getByRole("button", { name: "Configure Patrol" }).click();
await expect(
page.getByRole("link", { name: "Open Patrol settings" }),
).toHaveAttribute("href", "/settings/pulse-intelligence/patrol");
await page.getByRole("link", { name: "Open Patrol settings" }).click();
await expect(page.getByText("Alert-Triggered Patrols")).toBeVisible();
await expect(page.getByText("Anomaly-Triggered Patrols")).toBeVisible();
@ -995,9 +998,9 @@ test.describe("Patrol runtime-state browser contract", () => {
"Alert and anomaly triggers run targeted scoped checks that update",
),
).toBeVisible();
await expect(page.getByText("Last full patrol")).toBeVisible();
await page.getByRole("button", { name: "Runs" }).click();
await page.goto("/patrol", { waitUntil: "domcontentloaded" });
await page.getByRole("button", { name: "History" }).click();
await page.getByRole("button", { name: /Alert fired/i }).click();
await expect(
page.getByText("Selected model does not support Patrol tools"),
@ -1009,7 +1012,7 @@ test.describe("Patrol runtime-state browser contract", () => {
await expect(page.getByText(/No endpoints found/)).toHaveCount(0);
await expect(
page.getByRole("link", { name: "Open Patrol provider settings" }),
).toHaveAttribute("href", "/settings/system-ai");
).toHaveAttribute("href", "/settings/pulse-intelligence/provider");
await page.getByTestId("patrol-run-assistant-button").click();
const assistantContext = page.getByLabel("Assistant context");
@ -1044,18 +1047,16 @@ test.describe("Patrol runtime-state browser contract", () => {
await page.goto("/patrol", { waitUntil: "domcontentloaded" });
await expect(
page.getByText(`Trigger status: ${PATROL_EVENT_TRIGGERS_BLOCKED}`),
page.getByText(`Automation: ${PATROL_EVENT_TRIGGERS_BLOCKED}`),
).toBeVisible();
await expect(
page.getByText(`Trigger mode: ${PATROL_EVENT_TRIGGERS_BLOCKED}`),
).toBeVisible();
).toHaveCount(0);
await expect(page.getByText("alerts off")).toHaveCount(0);
await expect(page.getByText("anomalies off")).toHaveCount(0);
await page.getByRole("button", { name: "Configure Patrol" }).click();
const configPanel = page.getByRole("dialog", {
name: "Patrol Configuration",
});
await page.getByRole("link", { name: "Open Patrol settings" }).click();
const configPanel = page.getByRole("main");
await expect(
configPanel.getByRole("button", { name: "Alert-Triggered Patrols" }),
).toHaveAttribute("aria-pressed", "true");

View file

@ -459,7 +459,7 @@ async function openMonitoredSystemUpgradeArrival(page: Page) {
);
await expect(
page.getByText(
"Community includes core monitoring at no cost. Relay is optional for secure access from anywhere, and Pulse Pro adds root-cause analysis, safe remediation workflows, and 90-day history.",
"Community includes core monitoring at no cost. Relay is optional for secure access from anywhere. Pulse Pro adds Patrol control, alert investigation, verified fixes, and 90-day history.",
),
).toBeVisible();
await expect(page.getByRole("button", { name: "Hide counting rules" })).toHaveCount(0);
@ -535,7 +535,7 @@ test.describe("Self-hosted upgrade return flow", () => {
),
).toBeVisible();
await expect(activationSummary.getByText("Available now on this instance")).toBeVisible();
await expect(activationSummary.getByText("Safe Remediation Workflows")).toBeVisible();
await expect(activationSummary.getByText("Patrol Fixes Safe Issues")).toBeVisible();
await expect(page.getByRole("link", { name: "Review usage" })).toHaveCount(0);
await expect(page.getByRole("link", { name: "Review plan" })).toHaveCount(0);
});
@ -572,7 +572,7 @@ test.describe("Self-hosted upgrade return flow", () => {
page.getByText("Checkout completed and this instance is now running Pulse Pro."),
).toHaveCount(0);
await expect(page.getByText("Current plan: Community")).toBeVisible();
await expect(page.getByText("Safe Remediation Workflows")).toHaveCount(0);
await expect(page.getByText("Patrol Fixes Safe Issues")).toHaveCount(0);
await expect.poll(() => requestCounts.inactive.entitlements).toBeGreaterThan(0);
expect(requestCounts.activated.entitlements).toBe(0);
});
@ -655,7 +655,7 @@ test.describe("Self-hosted upgrade return flow", () => {
),
).toBeVisible();
await expect(activationSummary.getByText("Available now on this instance")).toBeVisible();
await expect(activationSummary.getByText("Safe Remediation Workflows")).toBeVisible();
await expect(activationSummary.getByText("Patrol Fixes Safe Issues")).toBeVisible();
await expect(page.getByRole("link", { name: "Review plan" })).toHaveCount(0);
await expect(page.getByRole("link", { name: "Review usage" })).toHaveCount(0);
});

View file

@ -80,7 +80,7 @@ test.describe("Pulse Account upgrade bootstrap", () => {
).toBeVisible();
await expect(
page.getByText(
"Community keeps core monitoring free. Relay gets your Pulse web UI securely reachable from anywhere. Pro adds root-cause analysis, safe remediation workflows, and 90-day history.",
"Community keeps core monitoring free. Relay gets your Pulse web UI securely reachable from anywhere. Pro adds Patrol control, alert investigation, verified fixes, and 90-day history.",
),
).toBeVisible();
await expect(

View file

@ -220,7 +220,7 @@ test.describe('Self-hosted plans entitlement summary', () => {
await expect(currentPlanCard.getByText('Current plan: Pulse Pro')).toBeVisible();
await expect(
currentPlanCard.getByText(
'Pulse Pro is active on this instance. Root-cause analysis, safe remediation workflows, 90-day history, and admin/reporting extras are available right now.',
'Pulse Pro is active on this instance. Patrol control, alert investigation, verified fixes, 90-day history, and admin/reporting extras are available right now.',
),
).toBeVisible();
await expect(currentPlanCard.getByText('Grandfathered price')).toBeVisible();
@ -248,10 +248,10 @@ test.describe('Self-hosted plans entitlement summary', () => {
await expect(currentPlanCard.getByText('Primary capabilities')).toBeVisible();
await expect(currentPlanCard.getByText('Included extras')).toBeVisible();
await expect(
currentPlanCard.getByText('Safe Remediation Workflows', { exact: true }),
currentPlanCard.getByText('Patrol Fixes Safe Issues', { exact: true }),
).toBeVisible();
await expect(
currentPlanCard.getByText('Alert Root-Cause Analysis', { exact: true }),
currentPlanCard.getByText('Patrol Investigates Alerts', { exact: true }),
).toBeVisible();
await expect(currentPlanCard.getByText('PDF/CSV Reporting', { exact: true })).toBeVisible();
await expect(

View file

@ -188,7 +188,7 @@ const DIAGNOSTICS_PAYLOAD = {
enabled: true,
running: true,
healthy: true,
mcpConnected: true,
assistantRuntimeConnected: true,
notes: [],
},
errors: [],

View file

@ -251,8 +251,8 @@ test.describe('Self-hosted manual activation success', () => {
),
).toBeVisible();
await expect(activationSummary.getByText('Available now on this instance')).toBeVisible();
await expect(activationSummary.getByText('Safe Remediation Workflows')).toBeVisible();
await expect(activationSummary.getByText('Alert Root-Cause Analysis')).toBeVisible();
await expect(activationSummary.getByText('Patrol Fixes Safe Issues')).toBeVisible();
await expect(activationSummary.getByText('Patrol Investigates Alerts')).toBeVisible();
await expect.poll(() => requestCounts.activate).toBe(1);
await expect.poll(() => requestCounts.active.entitlements).toBeGreaterThan(0);
await expect.poll(() => requestCounts.active.runtimeCapabilities).toBeGreaterThan(0);
@ -265,7 +265,7 @@ test.describe('Self-hosted manual activation success', () => {
.first();
await expect(
currentPlanCard.getByText(
'Pulse Pro is active on this instance. Root-cause analysis, safe remediation workflows, 90-day history, and admin/reporting extras are available right now.',
'Pulse Pro is active on this instance. Patrol control, alert investigation, verified fixes, 90-day history, and admin/reporting extras are available right now.',
),
).toBeVisible();
await expect(currentPlanCard.getByText('Included extras')).toBeVisible();

View file

@ -0,0 +1,143 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { expect, test as base } from "@playwright/test";
import { createAuthenticatedStorageState } from "./helpers";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
type WorkerFixtures = {
authStorageStatePath: string;
};
const test = base.extend<{}, WorkerFixtures>({
storageState: async ({ authStorageStatePath }, use) => {
await use(authStorageStatePath);
},
authStorageStatePath: [
async ({ browser }, use, workerInfo) => {
const storageStatePath = path.resolve(
__dirname,
"..",
"..",
"tmp",
"playwright-auth",
`agent-integrations-surface-contract-${workerInfo.project.name}.json`,
);
fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
await createAuthenticatedStorageState(browser, storageStatePath);
try {
await use(storageStatePath);
} finally {
fs.rmSync(storageStatePath, { force: true });
}
},
{ scope: "worker" },
],
});
test.describe("Agent integrations surface contract", () => {
test("projects Pulse Intelligence surfaces from the live capabilities manifest", async ({
page,
}) => {
const manifestResponse = page.waitForResponse(
(response) =>
response.url().includes("/api/agent/capabilities") &&
response.request().method() === "GET",
);
await page.goto("/settings/security/api", {
waitUntil: "domcontentloaded",
});
await page.waitForURL(/\/settings\/security\/api/, { timeout: 15_000 });
await expect(
page.getByRole("heading", { level: 2, name: "Agent integrations" }),
).toBeVisible();
const response = await manifestResponse;
expect(response.ok()).toBeTruthy();
const surfaces = page.getByRole("heading", {
level: 3,
name: "Pulse Intelligence surfaces",
});
await expect(surfaces).toBeVisible();
const surfaceSection = surfaces.locator("..");
for (const label of [
"Pulse Intelligence Core",
"Pulse Patrol",
"Pulse Assistant",
"Pulse MCP",
]) {
await expect(
surfaceSection.getByText(label, { exact: true }),
).toBeVisible();
}
await expect(
surfaceSection.getByText("Native surface", { exact: true }),
).toBeVisible();
await expect(
surfaceSection.getByText("External adapter", { exact: true }),
).toBeVisible();
await expect(
surfaceSection.getByText("Tools", { exact: true }).first(),
).toBeVisible();
await expect(
surfaceSection.getByText("Interactive questions", { exact: true }),
).toBeVisible();
await expect(
surfaceSection.getByText("Capability metadata", { exact: true }),
).toBeVisible();
await expect(
surfaceSection.getByText(
"Canonical context, governed actions, safety gates, approval state, action audit, and verification shared by Pulse Assistant, Pulse MCP, and Pulse Patrol.",
{ exact: true },
),
).toBeVisible();
const horizontalOverflow = await surfaceSection
.locator("ul")
.evaluate((node) => ({
clientWidth: node.clientWidth,
scrollWidth: node.scrollWidth,
}));
expect(horizontalOverflow.scrollWidth).toBeLessThanOrEqual(
horizontalOverflow.clientWidth + 1,
);
const createTokenLink = page.getByRole("link", {
name: "Create token",
});
await expect(page.getByText("Token setup", { exact: true })).toBeVisible();
await expect(
page.getByText("Pulse Intelligence agent", { exact: true }).last(),
).toBeVisible();
await expect(
page.getByText("Stable failure codes", { exact: true }),
).toBeVisible();
await expect(page.getByText("resource_not_found").first()).toBeVisible();
await expect(createTokenLink).toHaveAttribute("href", "#api-token-create");
await expect(
page.getByRole("heading", { level: 3, name: "MCP client config" }),
).toBeVisible();
await expect(
page.getByRole("heading", { level: 4, name: /OpenCode.*opencode\.json/ }),
).toBeVisible();
await expect(
page.getByRole("heading", { level: 4, name: /mcpServers/ }),
).toBeVisible();
await expect(page.getByText("PULSE_API_TOKEN").first()).toBeVisible();
await expect(page.getByText("--base-url").first()).toBeVisible();
await createTokenLink.click();
await expect(page).toHaveURL(/#api-token-create$/);
await expect(
page.getByRole("heading", { level: 2, name: "Create token" }),
).toBeVisible();
await expect(
page.getByRole("button", { name: "Pulse Intelligence agent" }),
).toBeVisible();
});
});