const { test } = require('node:test'); const assert = require('node:assert/strict'); const fs = require('node:fs'); const path = require('node:path'); const root = path.join(__dirname, '..'); function read(relativePath) { return fs.readFileSync(path.join(root, relativePath), 'utf8'); } test('clinical assistant starter prompts are Redis or indexed-source backed', () => { const route = read('src/routes/clinicalAssistant.js'); const pool = read('src/utils/clinicalPromptPool.js'); assert.doesNotMatch(route, /EXAMPLE_CANDIDATES|TOPIC_SUGGESTIONS|topic_suggestions|buildSuggestionAnswer/); assert.match(route, /createClinicalPromptPool\(\{[\s\S]*redisCache: redisCache/); assert.match(pool, /opts\.redisCache\.getJson\(redisKey\)/); assert.match(pool, /opts\.redisCache\.setJson\(redisKey, payload, ttlSeconds\)/); assert.match(pool, /CLINICAL_ASSISTANT_PROMPT_POOL_TARGET, 200/); assert.match(pool, /var examples = await fallbackIndexedExamples\(\)/); });