Skip to content

feat(report): 완료 보고는 실행 명령·종료코드·통과/실패 수를 적어야 하고, 같은 diff의 문서는 근거가 아니다 (AGT-4900) - #921

Open
unohee wants to merge 1 commit into
mainfrom
heewonoh/agt-4900-report-evidence
Open

unohee wants to merge 1 commit into
mainfrom
heewonoh/agt-4900-report-evidence

Conversation

@unohee

@unohee unohee commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator

무엇

  • 신규 src/agents/completionReportEvidence.ts: 완료 보고가 검사 통과를 주장하면("All tests pass", "lint clean", "테스트 통과" 등) 실행 증거를 요구합니다. 증거 형식은 검사마다 한 줄입니다.
    • Ran: npm test -> exit 0, 412 passed, 0 failed: 테스트 러너는 passed/failed 수가 필수입니다.
    • Ran: npm run lint -> exit 0: lint·typecheck·build는 개수가 없으므로 종료코드만으로 충분합니다.
  • 아래 경우는 거부합니다.
    • 증거 줄이 없는 주장
    • 종료코드가 없는 증거 줄
    • 테스트 러너인데 개수가 없는 줄
    • 주장은 성공인데 증거가 exit≠0 또는 failed>0인 경우
    • adapter가 실행을 관찰한 경우(executedCommands): 관찰되지 않은 명령, 또는 관찰된 [exit N]과 다른 종료코드
  • 같은 diff에서 워커가 추가·수정한 문서(git이 판정한 filesChanged 중 README/CHANGELOG/docs/·.md 등)를 가리키는 Ran:/Evidence: 줄은 근거에서 뺍니다. 남는 실행 증거가 없으면 "자기가 쓴 문서는 증거가 아니다"라는 메시지로 거부합니다.
  • worker.ts: git 승격 단계 뒤(되돌려지지 않게), zero-diff 게이트 다음에 검사합니다. 실패하면 success=false, unverifiedCompletionClaim=true, error=worker-evidence: …를 설정합니다.
  • pairIterationLoop.ts: 그냥 실패한 워커의 error는 다음 프롬프트에 전달되지 않습니다. 그래서 이 실패를 validation reflection으로 기록해, 재시도하는 워커가 빠진 것과 줄 형식을 받게 했습니다.
  • 워커 프롬프트(en/ko)에 위 줄 형식과 "자기가 쓴 문서는 근거가 아니다"를 추가했습니다.
  • 주장이 없는 보고는 이 게이트가 판단하지 않습니다. 침묵은 기존 missing-validation nudge가 맡습니다.

왜

AGT-4900 (AGT-4190 방어 4·5번). 워커 완료 보고가 실행 증거 없이 "테스트 통과"를 쓰거나, 같은 커밋에서 자기가 쓴 문서(cgf-portal #215)를 근거로 드는데 지금은 이를 성공으로 받아들입니다.

검증

  • npx vitest run src/agents src/adapters src/locale → 144 files(1 skipped), 2200 passed / 7 skipped.
  • 신규 테스트:
    • completionReportEvidence.test.ts 13개: 증거 없는 "통과" 거부, 같은 diff 문서 근거 거부, 정상 증거 수락, 개수 누락, 실패 run, 관찰 불일치, 부정·유보 문장은 주장이 아님 등
    • worker.completionEvidence.test.ts 5개: runWorker 경유, git 승격 뒤에도 유지
    • pairPipeline.completionEvidence.test.ts 1개: 재시도 프롬프트에 이슈와 형식이 전달됨
  • mutation check:
    • worker.ts 게이트를 끄면 runWorker 테스트 3개가 실패합니다.
    • reflection 기록을 끄면 pipeline 테스트가 실패합니다.
  • npm run typecheck 통과, oxlint 0 warnings.

리뷰 포인트 / 한계

  • 동작 변경: 지금까지 "All tests pass"만 쓰고 끝내던 워커는 Ran: 줄을 쓰기 전까지 실패합니다. 프롬프트와 재시도 피드백으로 형식을 알려 주지만, 따르지 않는 모델은 iteration을 소모합니다. 실제 운영에서 거부율을 지켜봐야 합니다.
  • 주장 탐지는 좁은 정규식입니다(검사 종류 + 긍정 결과, 부정·유보 단어가 있으면 제외). 놓치는 표현이 있을 수 있습니다.
  • executedCommands가 없는 CLI adapter(claude CLI 등)는 실행을 관찰할 수 없어서, Ran: 줄의 형식과 일관성만 검사합니다.

…iff docs are not evidence (AGT-4900)

A worker report that says tests or lint pass now has to carry one Ran: line
per check (command, exit code, and passed/failed counts for test runners).
Without one, or when its only evidence is a document written in the same
diff, the worker result is not a success. Where the adapter observed
execution, reported runs must match an observed command and its exit code.
The rejection is fed back to the retry with the exact line format, and the
worker prompt (en/ko) asks for these lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant