diff --git a/src/main/ai/prompt.ts b/src/main/ai/prompt.ts index 147fc8f..a649ec2 100644 --- a/src/main/ai/prompt.ts +++ b/src/main/ai/prompt.ts @@ -17,6 +17,7 @@ ${candidates.map((c, i) => ` ${i + 1}. ${c.iso ?? '(ambiguous)'} — matched to ? `\nExisting vocabulary tags (most-used first): ${vocab.join(', ')}\nPrefer reusing a vocabulary tag when the meaning matches; create new tags only when the meaning is genuinely new.\n` : ''; + // candidateBlock & vocabBlock are self-delimited with leading/trailing \n return `You organize raw personal notes into structured metadata. Today's date in Korea Standard Time (KST): ${todayKst} diff --git a/tests/unit/prompt.test.ts b/tests/unit/prompt.test.ts index e19cee6..6d27932 100644 --- a/tests/unit/prompt.test.ts +++ b/tests/unit/prompt.test.ts @@ -19,13 +19,13 @@ describe('prompt', () => { expect(out).toContain('Prefer reusing'); }); - it('vocab block appears between candidate block and JSON rules', () => { + it('vocab block appears after header and before JSON rules', () => { const out = buildPrompt('hello', '2026-05-02', [], ['design']); - const candidateIdx = out.indexOf("Today's date"); + const headerIdx = out.indexOf("Today's date"); const vocabIdx = out.indexOf('Existing vocabulary'); const jsonRulesIdx = out.indexOf('Return a JSON object'); - expect(candidateIdx).toBeGreaterThan(-1); - expect(vocabIdx).toBeGreaterThan(candidateIdx); + expect(headerIdx).toBeGreaterThan(-1); + expect(vocabIdx).toBeGreaterThan(headerIdx); expect(jsonRulesIdx).toBeGreaterThan(vocabIdx); }); });