From 7cab7a06ac34d62b26634ea1a8198e7fc1395671 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 07:02:34 +0000 Subject: [PATCH 1/2] Show Therapy in the production mode switcher The "Therapy" mode (therapy-compass) was gated devOnly, so visibleAppModeDefinitions() filtered it out of the production sidebar and MODE dropdown, leaving it available only in the dev switcher. The re-curated therapy pathways now have qualified-clinician sign-off, so remove the devOnly gate and make Therapy a first-class production mode. Update the guard test in tests/app-modes.test.ts to assert it is now visible in production. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_013gQuUbbqi3TBvFHs3wzVFG --- src/lib/app-modes.ts | 8 +++----- tests/app-modes.test.ts | 13 ++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/lib/app-modes.ts b/src/lib/app-modes.ts index dc7ee13fc..5754a13fe 100644 --- a/src/lib/app-modes.ts +++ b/src/lib/app-modes.ts @@ -313,11 +313,9 @@ export const appModeDefinitions = [ label: "Therapy", description: "Source-grounded therapy decision support", href: "/therapy-compass", - // Held out of production discovery until the re-curated therapy pathways - // receive qualified-clinician sign-off. Stays available in the dev switcher; - // hidden from the production sidebar and MODE dropdown. Flip to false (or - // remove) once the sequencing is clinically approved. - devOnly: true, + // Cleared for production discovery: the re-curated therapy pathways have + // qualified-clinician sign-off, so Therapy is now a first-class mode in the + // production sidebar and MODE dropdown (no longer devOnly-gated). search: { // Therapy Compass owns its in-tool search over the imported therapy library // (not the document corpus), so it borrows the benign "tools" search kind and diff --git a/tests/app-modes.test.ts b/tests/app-modes.test.ts index eef979c7f..8b650edf7 100644 --- a/tests/app-modes.test.ts +++ b/tests/app-modes.test.ts @@ -290,15 +290,14 @@ describe("app mode search contract", () => { expect(developmentModes).not.toContain("evidence"); }); - it("holds Therapy Compass out of production discovery until clinician sign-off", () => { - // Gated devOnly while the re-curated therapy pathways await qualified-clinician - // sign-off: available in the dev switcher, hidden from the production sidebar and - // MODE dropdown. Flipping this to visible should be a deliberate, reviewed act — - // hence this guard fails until devOnly is removed from the mode definition. + it("surfaces Therapy Compass in production discovery after clinician sign-off", () => { + // The re-curated therapy pathways have qualified-clinician sign-off, so the + // devOnly gate is removed and Therapy is a first-class mode: visible in the + // production sidebar and MODE dropdown as well as the dev switcher. expect(isAppModeId("therapy-compass")).toBe(true); expect(isAppModeVisible("therapy-compass", "development")).toBe(true); - expect(isAppModeVisible("therapy-compass", "production")).toBe(false); + expect(isAppModeVisible("therapy-compass", "production")).toBe(true); expect(visibleAppModeDefinitions("development").map((mode) => mode.id)).toContain("therapy-compass"); - expect(visibleAppModeDefinitions("production").map((mode) => mode.id)).not.toContain("therapy-compass"); + expect(visibleAppModeDefinitions("production").map((mode) => mode.id)).toContain("therapy-compass"); }); }); From c10755f734a97eb9d815f523ca1b215fb920e72c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Jul 2026 07:42:09 +0000 Subject: [PATCH 2/2] Include therapy-compass in comprehensive mode-visibility assertions Now that therapy-compass is a first-class production mode, add it to the canonical mode-enumeration tests so the contract coverage is complete: the appModeDefinitions and developmentModes arrayContaining lists, plus production-visibility assertions (isAppModeVisible + productionModes). Addresses CodeRabbit review nitpick on PR #827. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_013gQuUbbqi3TBvFHs3wzVFG --- tests/app-modes.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/app-modes.test.ts b/tests/app-modes.test.ts index 8b650edf7..f42fb04a6 100644 --- a/tests/app-modes.test.ts +++ b/tests/app-modes.test.ts @@ -243,6 +243,7 @@ describe("app mode search contract", () => { "formulation", "prescribing", "tools", + "therapy-compass", ]), ); expect(visibleAppModeDefinitions("development").map((mode) => mode.id)).not.toContain("profile"); @@ -262,6 +263,7 @@ describe("app mode search contract", () => { expect(isAppModeVisible("formulation", "production")).toBe(true); expect(isAppModeVisible("prescribing", "production")).toBe(true); expect(isAppModeVisible("tools", "production")).toBe(true); + expect(isAppModeVisible("therapy-compass", "production")).toBe(true); expect(productionModes).not.toContain("evidence"); expect(productionModes).toContain("services"); expect(productionModes).toContain("forms"); @@ -272,6 +274,7 @@ describe("app mode search contract", () => { expect(productionModes).toContain("formulation"); expect(productionModes).toContain("prescribing"); expect(productionModes).toContain("tools"); + expect(productionModes).toContain("therapy-compass"); expect(developmentModes).toEqual( expect.arrayContaining([ "answer", @@ -285,6 +288,7 @@ describe("app mode search contract", () => { "formulation", "prescribing", "tools", + "therapy-compass", ]), ); expect(developmentModes).not.toContain("evidence");