From 051474c0f45808416cd1083b4b24830f88b2c7ea Mon Sep 17 00:00:00 2001 From: Mike Schwarz Date: Thu, 9 Apr 2026 16:56:36 -0700 Subject: [PATCH] Vault specialist: add specialist visibility in library review Add Specialist Agent summary card to LibraryReview for service-backed rigs, showing canonical identity (vault.specialist). Update test mocks to canonical topology and summary mentioning specialist. Non-service rigs explicitly tested to show no specialist card. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/ui/src/components/LibraryReview.tsx | 11 +++++++++++ packages/ui/test/library-review.test.tsx | 11 +++++++++-- packages/ui/test/specs-panel.test.tsx | 6 +++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/ui/src/components/LibraryReview.tsx b/packages/ui/src/components/LibraryReview.tsx index a4dee866a..11a5a060e 100644 --- a/packages/ui/src/components/LibraryReview.tsx +++ b/packages/ui/src/components/LibraryReview.tsx @@ -108,6 +108,17 @@ function LibraryRigReviewContent({ review }: { review: LibraryRigReview }) { {review.services && ( )} + {review.services && reviewPods.length > 0 && (() => { + const specialistPod = reviewPods.find((p) => p.members.some((m) => m.id === "specialist")); + if (!specialistPod) return null; + return ( + + ); + })()} { kind: "rig", name: "secrets-manager", version: "0.2", - summary: "HashiCorp Vault in dev mode", + summary: "HashiCorp Vault in dev mode with a dedicated Vault specialist agent", format: "pod_aware", - pods: [{ id: "dev", label: "Dev", members: [{ id: "impl", agentRef: "local:agents/impl", runtime: "claude-code" }], edges: [] }], + pods: [{ id: "vault", label: "Vault", members: [{ id: "specialist", agentRef: "local:agents/apps/vault-specialist", runtime: "claude-code" }], edges: [] }], edges: [], graph: { nodes: [], edges: [] }, raw: "name: secrets-manager\n", @@ -68,6 +68,11 @@ describe("LibraryReview", () => { expect(screen.getByTestId("library-review-rig")).toBeDefined(); }); + // Specialist card shows canonical identity + const specialistCard = screen.getByTestId("lib-rig-specialist"); + expect(specialistCard).toBeDefined(); + expect(specialistCard.textContent).toContain("vault.specialist"); + // Environment tab exists expect(screen.getByTestId("lib-tab-environment")).toBeDefined(); @@ -150,6 +155,8 @@ describe("LibraryReview", () => { expect(screen.queryByTestId("lib-tab-environment")).toBeNull(); // No setup prompt button expect(screen.queryByTestId("copy-setup-prompt")).toBeNull(); + // No specialist card + expect(screen.queryByTestId("lib-rig-specialist")).toBeNull(); }); it("opens the matching agent spec from a rig member row", async () => { diff --git a/packages/ui/test/specs-panel.test.tsx b/packages/ui/test/specs-panel.test.tsx index 305fb2afc..4e1cbc273 100644 --- a/packages/ui/test/specs-panel.test.tsx +++ b/packages/ui/test/specs-panel.test.tsx @@ -174,7 +174,7 @@ describe("SpecsPanel filter chips and richer rows", () => { sourcePath: "/specs/rigs/launch/secrets-manager/rig.yaml", relativePath: "rigs/launch/secrets-manager/rig.yaml", updatedAt: "2026-04-09T00:00:00Z", - summary: "HashiCorp Vault in dev mode", + summary: "HashiCorp Vault in dev mode with a dedicated Vault specialist agent", hasServices: true, }, { @@ -253,10 +253,10 @@ describe("SpecsPanel filter chips and richer rows", () => { expect(screen.getByTestId("filter-rigs")).toBeDefined(); expect(screen.getByTestId("filter-agents")).toBeDefined(); - // Service-backed rig shows APP badge and summary + // Service-backed rig shows APP badge and summary mentioning specialist const appRow = screen.getByTestId("library-entry-app-1"); expect(appRow.textContent).toContain("APP"); - expect(screen.getByText("HashiCorp Vault in dev mode")).toBeDefined(); + expect(appRow.textContent).toContain("specialist"); // Builtin launch-path rig shows Stable badge const rigRow = screen.getByTestId("library-entry-rig-1");