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 evals/product-journeys/graders/pj-s-question.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function markdownCitations(transcript) {
try { const outcome = JSON.parse(raw); return typeof outcome.summary === 'string' ? outcome.summary : line; }
catch { return line; }
});
const rows = /`([A-Za-z0-9_.-]+\.[A-Za-z0-9]+):(\d+)`[ \t]*(?:—|–|-|:)[ \t]*`([^`\n]+)`/g;
const rows = /`([A-Za-z0-9_.-]+\.[A-Za-z0-9]+):(\d+)`[ \t]*(?:—|–|→|->|-|:)[ \t]*`([^`\n]+)`/g;
return [...transcript.matchAll(rows)].map(m => ({ file: m[1], line: Number(m[2]), str: m[3] }));
}

Expand Down
10 changes: 10 additions & 0 deletions scripts/eval-journeys-graders.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ test('pj-s-question: Markdown file-line citations retain exact content verificat
assert.equal((await w.grade(w.transcript(good))).pass, true);
const html = good.replace('`Furniture made on the coast`', '`<p class="tagline">Furniture made on the coast</p>`');
assert.equal((await w.grade(w.transcript(html + '\nOutcome: ' + JSON.stringify({ summary: html })))).pass, true);
for (const separator of ['→', '->']) {
const arrows = html.replaceAll(' — ', ` ${separator} `);
assert.equal((await w.grade(w.transcript(arrows))).pass, true);
assert.equal((await w.grade(w.transcript('Outcome: ' + JSON.stringify({ summary: arrows })))).pass, true);
for (const bad of [arrows.replace('index.html:16', 'index.html:600'),
arrows.replace('index.html:16', 'missing.html:16'),
arrows.replace('Furniture made on the coast', 'Invented tagline')]) {
assert.equal((await w.grade(w.transcript(bad))).pass, false);
}
}
for (const bad of [good.replace('index.html:6', 'index.html:600'),
good.replace('about.html:20', 'missing.html:20'),
good.replace('Furniture made on the coast', 'Invented tagline')]) {
Expand Down
Loading