fix(eval,ci): isolate interview eval and harden skill lint and design gate

- Run eval sessions in a temp dir outside the repo so Codex no longer reads the root AGENTS.md; empty streams, timeouts and crashes judge as ERROR instead of PASS
- Close interview-gate lint gaps: softening phrases hidden on allowed lines, reordered phrasing, sibling-anchor bypass
- design-gate: bold threshold 700, axe incomplete reported as manual checks, follow @import with query strings, report unverified color literals; keep site copy in sync via test
- publish-npm.sh fails without NPM_TOKEN; CI requires Node 22.6+; ignore outputs/
This commit is contained in:
Yun Chan 2026-10-09 18:18:41 +09:00
parent bc914eafc5
commit 97f2c241e4
19 changed files with 767 additions and 139 deletions

View file

@ -17,7 +17,7 @@ import { scoreQuestionText, detectSlots, isScopeQuestion, countDirectionCards, p
export const QUESTION_TOOLS = new Set(["AskUserQuestion", "request_user_input", "ask_user", "askQuestions"]);
export const WRITE_TOOLS = new Set(["Write", "Edit", "MultiEdit", "NotebookEdit", "file_change", "apply_patch"]);
// 셸 명령 중 파일을 만들거나 바꾸는 것. 판정은 스냅샷(filesChanged)이 주 근거이고 이것은 순서 보조용이다.
const SHELL_WRITE_RE = /(?:^|[\s;&|])(?:>|>>|tee\b|Set-Content|Add-Content|Out-File|New-Item|mkdir\b|md\b|touch\b|cp\b|copy\b|mv\b|Move-Item|Copy-Item|apply_patch|npm\s+(?:i|install|init)\b|pnpm\s+(?:add|install|i)\b|npx\b|git\s+(?:commit|add)\b)/i;
const SHELL_WRITE_RE = /(?:^|[\s;&|])(?:>|>>|tee\b|Set-Content|Add-Content|Out-File|New-Item|mkdir\b|md\b|touch\b|cp\b|copy\b|mv\b|Move-Item|Copy-Item|apply_patch|npm\s+(?:i|install|add|init)\b|pnpm\s+(?:add|install|i)\b|yarn\s+add\b|bun\s+add\b|pip3?\s+install\b|npx\b|git\s+(?:commit|add)\b)/i;
// 방향 체크포인트 전에 쓰면 안 되는 구현 파일
export const IMPL_EXT = /\.(?:html?|css|scss|sass|less|m?js|jsx|tsx?|vue|svelte|astro)$/i;
// 방향 체크포인트 전에 바꾸면 안 되는 설정·토큰 파일. brief-interview.md §16-4: 답을 받기 전에 3단계 토큰 확정,
@ -30,6 +30,18 @@ export const TEMP_DIR_RE = /(?:^|[\s"'=(:])\/tmp\/|\$\{?TMPDIR\b|%TE?MP%|\$env:T
const SHELL_FILE_WRITE_RE = /(?:^|[\s;&|])(?:>|>>|tee\b|Set-Content|Add-Content|Out-File|New-Item|mkdir\b|md\b|touch\b|cp\b|copy\b|mv\b|Move-Item|Copy-Item|apply_patch|git\s+(?:commit|add)\b)/i;
const SHELL_LOCAL_INSTALL_RE = /(?:^|[\s;&|])(?:npm\s+(?:i|install|add|init)\b(?![^;&|\n]*\s(?:-g|--global)\b)|pnpm\s+(?:add|install|i)\b(?![^;&|\n]*\s(?:-g|--global)\b)|yarn\s+add\b|bun\s+add\b|pip\s+install\b)/i;
/**
* 쓰기가 아닌 `>` 를 지운 명령 문자열. 정규식 판정 전에 거친다(감사 F028).
* - 널 장치·파일 기술자로 가는 리다이렉트: `> /dev/null`, `2>&1`, `> nul`, `> $null`
* - 피연산자 뒤의 숫자 비교: `if (1 > 0)`, `print(1 > 0)`
* 따옴표 안을 통째로 지우지는 않는다 — `powershell -Command "Set-Content …"` 처럼 명령 전체가 따옴표 안에 오기 때문이다.
*/
export function stripNonWriteRedirects(cmd) {
return String(cmd || "")
.replace(/\d?>>?\s*(?:\/dev\/null|nul|\$null|&\d)(?![\w./\\-])/gi, " ")
.replace(/(?<=[\w)\]])\s>=?\s*-?\d+(?:\.\d+)?(?![\w./\\-])/g, " ");
}
/**
* 읽기 전용 경로(expectNoWrites)에서 셸 쓰기 명령을 분류한다.
* "write" — 작업 디렉터리를 바꿀 수 있는 쓰기(임시 디렉터리 언급 없음) 또는 로컬 패키지 설치 → FAIL 근거
@ -39,7 +51,7 @@ const SHELL_LOCAL_INSTALL_RE = /(?:^|[\s;&|])(?:npm\s+(?:i|install|add|init)\b(?
* `GetTempPath()` 아래 디렉터리 생성을 작업 디렉터리 쓰기로 셌다(스냅샷 변경 0건).
*/
export function classifyShellWrite(cmd) {
const c = String(cmd || "");
const c = stripNonWriteRedirects(cmd);
if (SHELL_LOCAL_INSTALL_RE.test(c)) return "write";
if (SHELL_FILE_WRITE_RE.test(c)) return TEMP_DIR_RE.test(c) ? "temp" : "write";
if (SHELL_INSTALL_RE.test(c)) return "install";
@ -102,7 +114,7 @@ function toolEvent(name, input) {
name,
input,
question: QUESTION_TOOLS.has(name),
write: WRITE_TOOLS.has(name) || (isShell && SHELL_WRITE_RE.test(cmd)),
write: WRITE_TOOLS.has(name) || (isShell && SHELL_WRITE_RE.test(stripNonWriteRedirects(cmd))),
paths: toolPaths(input),
};
}
@ -583,6 +595,24 @@ export function judge(scenario, events, extra = {}) {
}
function judgeCore(scenario, events) {
// 텍스트·도구 이벤트가 하나도 없는 실행(로그인 만료, CLI 오류, 타임아웃)은 아무것도 보여주지 않았다.
// 이것을 no-trigger 시나리오의 PASS 로 세면 통과율이 부풀려진다.
if (!events.some((e) => e.kind === "text" || e.kind === "tool")) {
return {
skillInvoked: false,
asked: false,
askChannel: null,
questionText: null,
slots: [],
endedTurnAfterQuestion: null,
toolsAfterQuestion: [],
wroteBeforeQuestion: [],
wroteBeforeAnswer: 0,
turnCount: 0,
verdict: "ERROR",
note: "빈 스트림 — 모델의 텍스트·도구 이벤트가 하나도 없다(로그인 만료·CLI 오류·타임아웃 가능성)",
};
}
const skillInvoked = detectSkillInvoked(events);
const turns = splitTurns(events);
const t1 = analyzeTurn(turns[0]);