From 75571cd52865f3c1c0e7003457882054e3d32072 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 Oct 2026 18:06:10 +0100 Subject: [PATCH] fix(notes): keep a commit's breaking flag when the LLM reports it as not breaking The enhance-and-categorize merge took the model's `breaking` answer over the entry's own, so a `false` from the model cleared the flag a `!` commit set, and the notes lost their Breaking section. The model can now add the flag but not remove it. Co-Authored-By: Claude Opus 5.5 --- .../notes/src/llm/tasks/enhance-and-categorize.ts | 2 +- packages/notes/test/unit/llm/tasks.spec.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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); + }); }); // ---------------------------------------------------------------------------