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:
parent
bc914eafc5
commit
97f2c241e4
19 changed files with 767 additions and 139 deletions
|
|
@ -89,7 +89,7 @@ export const GATE_LINKS = ["references/harness.md", "references/brief-interview.
|
|||
// 인터뷰 게이트를 받쳐 주는 형제 문서의 앵커. 게이트가 "여기서 바뀌지 않는다"고 선언한 문구다.
|
||||
export const SIBLING_ANCHORS = {
|
||||
"references/brief-interview.md": [
|
||||
{ label: "스스로 판정해서 생략하지 않는다", re: /생략하지 않는다/ },
|
||||
{ label: "스스로 판정해서 생략하지 않는다", re: /스스로 판정해서? 생략하지 않는다/ },
|
||||
{ label: "턴 종료 규칙 절 제목", re: /^##\s.*턴 종료/m },
|
||||
],
|
||||
"references/harness.md": [
|
||||
|
|
@ -107,6 +107,14 @@ export const WEAKENING_PATTERNS = [
|
|||
{ label: "'only ask/question' 조건", re: /\b(?:only\s+(?:ask|question)|ask\s+only\s+(?:when|if))/gi },
|
||||
{ label: "'합리적·적절한 가정으로 계속/진행' 허용", re: /(?:합리적|적절한)\s*가정으로\s*(?:계속|진행)/g, quotedOk: true },
|
||||
{ label: "'묻지 않고 계속/진행' 허용", re: /(?:묻지|질문하지)\s*않고\s*(?:계속|진행)/g, quotedOk: true },
|
||||
// 어순을 바꾼 우회형. 동사가 앞에 오는 문장도 잡는다. "인터뷰 생략" 같은 방어 문구(harness.md)는 어미를 요구해 피한다.
|
||||
{ label: "'질문은 필요할 때만 한다' 어순 변형", re: /(?:질문|인터뷰)[은는]?\s*(?:[^\s.]+\s+){0,2}?(?:필요할|필요하다고 판단될)\s*때(?:에)?만\s*(?:한다|하면 된다)/g },
|
||||
{ label: "'질문·인터뷰 생략/건너뜀' 허용", re: /(?:질문|인터뷰)[을를]?\s*(?:생략|건너뛰)(?:어도|해도|할 수 있다|한다)/g, quotedOk: true },
|
||||
{ label: "'묻지 말고 진행·굳이 묻지 않아도' 허용", re: /(?:(?:묻지|질문하지)\s*말고\s*(?:진행|계속)|굳이\s*(?:묻지|질문하지)\s*않아도)/g, quotedOk: true },
|
||||
{ label: "'가정을 세워/가정하고 진행' 허용", re: /(?:가정|추정)(?:을 세워|하고)\s*(?:진행|계속)/g, quotedOk: true },
|
||||
{ label: "'질문 최소화·불필요한 질문 금지' 자기판정", re: /(?:질문[은는을를]?\s*최소화|불필요한\s*질문[은을]?\s*(?:하지|묻지))/g, quotedOk: true },
|
||||
{ label: "'물을 필요가 없다고 판단' 자기판정", re: /물을\s*필요가\s*없다고\s*판단/g, quotedOk: true },
|
||||
{ label: "'only when … ask' 어순 변형", re: /\bonly\s+when\b[^.\n]{0,40}\bask\b/gi },
|
||||
];
|
||||
// 완화 정규식에 걸리지만 객관적 조건이라 합법인 문장. 게이트 절 안에는 적용하지 않는다.
|
||||
// 새로 추가할 때는 "조건이 모델의 판단이 아니라 관측 가능한 사실인가"를 확인하고 이유를 남긴다.
|
||||
|
|
@ -120,7 +128,17 @@ export const WEAKENING_ALLOWLIST = [
|
|||
"design.md에 없을 때만 묻는다",
|
||||
"추가하거나 바꿀 때만** 묻는다", // 국소 경로 고유명사(01 F7): 이번 작업이 값을 추가·변경하는가는 diff 로 판정
|
||||
"추가하거나 바꿀 때만 묻는다",
|
||||
"끝까지 묻지 말고 진행", // 사용자가 방향까지 위임한 발화를 따옴표로 인용한 것(brief-interview §16)
|
||||
];
|
||||
/** 매치 [idx, idx+len)가 허용 문구 하나의 출현 구간 안에 완전히 들어가면 true. 같은 줄의 다른 완화 문구는 면제하지 않는다. */
|
||||
export function insideAllowed(text, idx, len) {
|
||||
return WEAKENING_ALLOWLIST.some((ok) => {
|
||||
for (let i = text.indexOf(ok); i !== -1; i = text.indexOf(ok, i + 1)) {
|
||||
if (idx >= i && idx + len <= i + ok.length) return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
// 완화 문구를 찾는 문서. 게이트 절은 별도로 허용 목록 없이 검사한다.
|
||||
export const WEAKENING_SCAN_FILES = ["SKILL.md", "references/brief-interview.md", "references/harness.md"];
|
||||
|
||||
|
|
@ -380,7 +398,7 @@ export function rowCitations(line, prefixes) {
|
|||
const edgeL = "(?<![A-Za-z0-9_#/.-])";
|
||||
const edgeR = "(?![A-Za-z0-9_-])";
|
||||
const ranges = [];
|
||||
for (const m of line.matchAll(new RegExp(`${edgeL}(${tok})\s?[~–]\s?(${tok})${edgeR}`, "g"))) {
|
||||
for (const m of line.matchAll(new RegExp(String.raw`${edgeL}(${tok})\s?[~–]\s?(${tok})${edgeR}`, "g"))) {
|
||||
ranges.push({ from: m[1], to: m[2], col: m.index });
|
||||
}
|
||||
const ids = [];
|
||||
|
|
@ -505,7 +523,8 @@ export async function lintSkill(root, opts = {}) {
|
|||
}
|
||||
}
|
||||
|
||||
// 4. 완화 문구 — 게이트 밖(SKILL.md 나머지, brief-interview, harness)도 본다. 허용 목록은 줄 단위다.
|
||||
// 4. 완화 문구 — 게이트 밖(SKILL.md 나머지, brief-interview, harness)도 본다. 허용 목록은 매치 단위다:
|
||||
// 허용 문구가 차지한 구간 안에 매치가 완전히 들어갈 때만 면제하므로 같은 줄의 다른 완화 문구는 잡힌다.
|
||||
for (const rel of WEAKENING_SCAN_FILES) {
|
||||
let text = texts.get(rel);
|
||||
if (text === undefined) continue;
|
||||
|
|
@ -513,8 +532,7 @@ export async function lintSkill(root, opts = {}) {
|
|||
for (const p of WEAKENING_PATTERNS) {
|
||||
for (const m of text.matchAll(p.re)) {
|
||||
if (p.quotedOk && /["“'「]$/.test(text.slice(Math.max(0, m.index - 1), m.index))) continue;
|
||||
const line = lineText(text, m.index);
|
||||
if (WEAKENING_ALLOWLIST.some((ok) => line.includes(ok))) continue;
|
||||
if (insideAllowed(text, m.index, m[0].length)) continue;
|
||||
errors.push(`${rel}:${lineOf(text, m.index)}: 질문 여부를 자기판정에 맡기는 완화 문구(${p.label}): "${m[0]}"`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue