fix(evals): investigate boundary fixture identifies the owner question by its continue/abort options

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-19 04:22:33 +00:00
1 parent eb15c6cd15
commit 521fd755f0
5 files changed
+142 -4

No files matched your search

+1
View File
@@ -126,6 +126,7 @@ export const FREE_FIXTURES: Readonly<Record<string, readonly string[]>> = {
'test/fixtures/impeccable-captures.meta.json': ['test/design-detect-contract.test.ts', 'test/impeccable-fixtures.test.ts'],
'test/fixtures/impeccable-detect-dom-sample.json': ['test/impeccable-fixtures.test.ts'],
'test/fixtures/impeccable-detect-help.txt': ['test/impeccable-fixtures.test.ts'],
'test/fixtures/investigate-owned-question-39195396438.json': ['test/workflow-boundaries-fixture.test.ts'],
'test/fixtures/judge-calibration/**': ['scripts/judge-calibration.ts', 'test/judge-calibration.test.ts'],
'test/fixtures/judge-panel-replay-2026-10-05.json': ['test/judge-panel-median.test.ts'],
'test/fixtures/module-size-ratchet.json': ['test/helpers/module-size.ts', 'test/module-size-ratchet.test.ts'],
+11 -3
View File
@@ -150,11 +150,19 @@ already isolated to this fixture. Do not change them.`;
}
if (tool === 'AskUserQuestion') {
const owner = read(boundary).match(/gstack-freeze-v1:([a-f0-9]{32})/)?.[1];
const questions = input.questions as Array<{ question: string; options: Array<{ label: string }> }>;
const questions = input.questions as Array<{ question: string; options: Array<{ label: string; description?: string }> }>;
const question = questions?.[0];
const options = Array.isArray(question?.options) ? question.options : [];
// The declared question is identified by its two options' meanings, not its wording.
const proceed = options.filter(option => /\b(continue|proceed)\b/i.test(option.label));
const stop = options.filter(option => /\b(abort|stop|cancel)\b/i.test(option.label));
const means = (option: { description?: string } | undefined, contrary: RegExp) =>
Boolean(option) && (typeof option!.description !== 'string' || !contrary.test(option!.description));
const declared = options.length === 2 && proceed.length === 1 && stop.length === 1 && proceed[0] !== stop[0]
&& means(proceed[0], /\b(abort|stop|cancel|no edits?|without edit\w*)\b/i) && means(stop[0], /\b(continue|proceed)\b/i);
const abort = id === 'investigate-owned-abort';
const choice = question?.options?.find(option => (abort ? /\b(abort|stop|cancel)\b/i : /\b(continue|proceed)\b/i).test(option.label));
if (!owner || questions?.length !== 1 || !choice || !/continue|proceed|abort/i.test(question.question)) {
const choice = abort ? stop[0] : proceed[0];
if (!owner || questions?.length !== 1 || !declared || !choice) {
interactions.push({ tool, disposition: 'unsupported-question', input, owner });
return { behavior: 'deny', message: 'Ask only whether to continue or abort, after scope acquisition.' };
}