fix(tag-vocab): T2 review minor/nit 2건 (#3 v0.2.3)

- M1: prompt.test.ts test 4 변수명 candidateIdx → headerIdx (실제 anchor 가 'Today's date' 헤더)
- N1: prompt.ts return 직전 self-delimited block 컨벤션 1줄 코멘트

skip: N2 (PROMPT_VERSION 테스트 redundancy nit — harmless guard), N3 (vocab dedup/normalize — Task 1 caller 책임)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
altair823
2026-05-02 12:19:39 +09:00
parent 134d59ddb4
commit 896b374f56
2 changed files with 5 additions and 4 deletions

View File

@@ -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}

View File

@@ -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);
});
});