From b992c6600b9572ddf737dd9a83749dc3b412a501 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 9 Sep 2026 23:06:13 +0200 Subject: [PATCH] feat: admin can turn citations off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New setting clinical_assistant.citations_enabled (default true, admin checkbox). With it off, retrieval, grounding and every other rule are unchanged — answers are still built only from retrieved sources — but: - buildSystemPrompt swaps only the citation block: the "cite factual claims with [1]" rules are replaced with "do not include citations, source numbers or bracketed markers", and the note that the sourcing requirement itself is unchanged. Grounding, scope, table formatting and tone rules are byte-identical between the two modes. - The server strips any stray [n] the model emits anyway, from the stored answer rather than only the view, so saved chats and exports match what was shown. - No sources are sent to the client at all, and the status endpoint reports the mode so the UI hides the Sources panel and gives its 330px column back to the chat instead of showing an empty rail. Validated as a boolean in adminConfig, like the feature.* keys. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BkfrkQwA4YGrGw9LZSpeAq --- public/components/admin.html | 10 ++++ public/css/assistant.css | 4 ++ public/js/admin/clinicalAssistant.js | 4 ++ public/js/clinicalAssistant.js | 13 +++++ src/routes/adminConfig.js | 3 ++ src/routes/clinicalAssistant.js | 22 ++++++-- src/utils/clinicalAnswer.js | 24 ++++++++- test/admin-clinical-assistant-wiring.test.js | 4 +- test/assistant-citations.test.js | 55 ++++++++++++++++++++ test/clinical-release-integration.test.js | 2 +- test/frontend-prompt-env.test.js | 1 + 11 files changed, 132 insertions(+), 10 deletions(-) diff --git a/public/components/admin.html b/public/components/admin.html index 8a24174f..68c3dae8 100644 --- a/public/components/admin.html +++ b/public/components/admin.html @@ -327,6 +327,16 @@ +
+ Citations +
+ +

Retrieval and grounding are unchanged when this is off — answers are still built only from retrieved sources, but the [1] markers and the Sources panel are hidden.

+
+