Files
openmaic/OpenMAIC/tests/pbl/v2/instructor-prompt.test.ts
2026-08-16 14:58:47 +08:00

23 lines
889 B
TypeScript

import { describe, expect, it } from 'vitest';
import { loadPBLV2Prompt } from '@/lib/pbl/v2/prompts/loader';
describe('instructor base rules — concept_unlocked examples carry a label', () => {
// Why: `label` is optional in the schema, so the model copies the prompt
// examples. If any concept_unlocked example shows `signature=` without
// `label=`, the model omits the human-readable concept name and the
// end-of-project report falls back to a machine slug (the reviewer's finding).
it('no concept_unlocked example shows signature= without label=', () => {
const md = loadPBLV2Prompt('instructor-base-rules');
const offenders = md
.split('\n')
.filter(
(line) =>
line.includes('concept_unlocked') &&
line.includes('signature=') &&
!line.includes('label='),
);
expect(offenders).toEqual([]);
});
});