feat(ai): AiWorker merges rule parser + AI due_date
GenerateInput gains todayKst field. AiWorker computes KST-aligned date once per job, runs parseDueDate on rawText, calls provider.generate with todayKst, then merges: rule.iso wins if matched (deterministic), else AI's due_date, else null. Logs dueDateSource (rule|ai|none) for debugging. now() injection for testability. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ describe.skipIf(skip)('LocalOllamaProvider integration', () => {
|
||||
];
|
||||
|
||||
it.each(cases)('Korean title + 3 lines for: %s', async (input) => {
|
||||
const r = await provider.generate({ text: input });
|
||||
const r = await provider.generate({ text: input, todayKst: '2026-04-26' });
|
||||
expect(/[가-힣]/.test(r.title)).toBe(true);
|
||||
expect(r.summary.split('\n')).toHaveLength(3);
|
||||
for (const t of r.tags) expect(t).toMatch(/^[a-z0-9]+(-[a-z0-9]+)*$/);
|
||||
|
||||
Reference in New Issue
Block a user