Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/notes/src/llm/tasks/enhance-and-categorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
Expand Down
15 changes: 15 additions & 0 deletions packages/notes/test/unit/llm/tasks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

// ---------------------------------------------------------------------------
Expand Down
Loading