diff --git a/packages/notes/src/llm/tasks/enhance-and-categorize.ts b/packages/notes/src/llm/tasks/enhance-and-categorize.ts index 5e8b0374..3a827271 100644 --- a/packages/notes/src/llm/tasks/enhance-and-categorize.ts +++ b/packages/notes/src/llm/tasks/enhance-and-categorize.ts @@ -115,7 +115,7 @@ export function createEnhanceAndCategorizeValidator( ...original, description: llmEntry.description, scope: llmEntry.scope ?? undefined, - breaking: llmEntry.breaking ?? original.breaking, + breaking: original.breaking || llmEntry.breaking === true, leadIn: llmEntry.leadIn ?? undefined, }; }); diff --git a/packages/notes/test/unit/llm/tasks.spec.ts b/packages/notes/test/unit/llm/tasks.spec.ts index 9de793e2..7221dd0f 100644 --- a/packages/notes/test/unit/llm/tasks.spec.ts +++ b/packages/notes/test/unit/llm/tasks.spec.ts @@ -232,6 +232,21 @@ describe('createEnhanceAndCategorizeValidator()', () => { } expect(result.error).toBe('Unknown categories: Mystery. Valid categories: New, Fixed, Changed'); }); + + it.each([ + ['keep a breaking change breaking when the model says it is not', true, false], + ['mark an entry breaking when the model says it is', undefined, true], + ])('should %s', (_label, sourceBreaking, modelBreaking) => { + const validate = createEnhanceAndCategorizeValidator( + [{ type: 'changed', description: 'Rename the preset', breaking: sourceBreaking }], + ctx, + ); + const result = validate( + structured({ entries: [{ ...fullEntry('Renamed the preset', 'Changed'), breaking: modelBreaking }] }), + ); + + expect(result.valid && result.value.enhancedEntries[0]?.breaking).toBe(true); + }); }); // ---------------------------------------------------------------------------