mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-11 15:39:04 +02:00
Preserve frontier models and quality thresholds while fixing truncated judge output, ordered section expansion, consent checks, QA scoring, and ship audit gates. Add regression coverage and refresh generated docs. Co-Authored-By: OpenAI Codex <noreply@openai.com>
20 lines
854 B
TypeScript
20 lines
854 B
TypeScript
/** Inspect lettered consent options, not narration that quotes an unavailable option. */
|
|
export function asideDriveOptions(text: string): string[] {
|
|
const options: string[] = [];
|
|
let current: string | undefined;
|
|
for (const line of text.replaceAll('**', '').split('\n')) {
|
|
const option = line.match(/^[ \t]*(?:[-*+][ \t]+)?[A-D][).][ \t]+(.*)$/);
|
|
if (option) {
|
|
if (current !== undefined) options.push(current);
|
|
current = option[1];
|
|
} else if (current !== undefined && /^[ \t]+\S/.test(line)) {
|
|
current += ` ${line.trim()}`;
|
|
} else if (current !== undefined) {
|
|
options.push(current);
|
|
current = undefined;
|
|
}
|
|
}
|
|
if (current !== undefined) options.push(current);
|
|
return options.filter(option => /\bAside\b/i.test(option) && /\b(?:drive|driving|browse|browsing|navigate|click)\b/i.test(option));
|
|
}
|