diff --git a/src/routes/learningAI.js b/src/routes/learningAI.js index cb35b2f6..28c40f2f 100644 --- a/src/routes/learningAI.js +++ b/src/routes/learningAI.js @@ -152,6 +152,9 @@ function buildGeneratePrompt(opts) { source += '\nThe following excerpts come from this institution\'s indexed clinical library. ' + 'Prefer them over your own recall wherever they disagree, and do not contradict them. ' + 'They are reference material, not a template: write the resource in your own words.\n\n' + + 'End the resource with a short References section listing only the excerpts you actually ' + + 'drew on, by title and page. In a presentation this is the final slide, titled References. ' + + 'Do not invent references, and do not list an excerpt you did not use.\n\n' + 'LIBRARY EXCERPTS:\n"""\n' + corpusContext + '\n"""\n'; } diff --git a/test/learning-retrieval.test.js b/test/learning-retrieval.test.js index 1d836978..abb6ae2a 100644 --- a/test/learning-retrieval.test.js +++ b/test/learning-retrieval.test.js @@ -111,6 +111,10 @@ test('the corpus block tells the model to prefer it over recall', () => { const route = read('src/routes/learningAI.js'); assert.match(route, /Prefer them over your own recall wherever they disagree/); assert.match(route, /reference material, not a template/, 'so it writes rather than copies'); + // Provenance a clinician can check, on the deck itself rather than only in a + // log. Restricted to excerpts actually used, and explicitly not invented. + assert.match(route, /In a presentation this is the final slide, titled References/); + assert.match(route, /Do not invent references, and do not list an excerpt you did not use/); // Opt in: a resource on something the library does not cover is better // written without it than padded with the nearest unrelated excerpts. assert.match(route, /var useCorpus\s+= String\(req\.body\.useCorpus\) === 'true'/);