Skip to content

fix(agents): 폴링 중 malformed bus 파일 격리·tester 필드 검증·guard 경로 containment·비실행 evidence 거부 (AGT-3441) - #897

Open
unohee wants to merge 2 commits into
mainfrom
heewonoh/agt-3441-pipeline-input-hardening
Open

unohee wants to merge 2 commits into
mainfrom
heewonoh/agt-3441-pipeline-input-hardening

Conversation

@unohee

@unohee unohee commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

무엇

AGT-3441의 5개 항목을 origin/main(3ef5b70, #840/#841/#865 이후)과 대조하고 남은 것을 고쳤습니다.

항목 상태
AgentBus 폴링 중 malformed 메시지 파일 격리 이 PR — getAllMessages에는 #718(AGT-3487)이 격리를 넣었지만 폴링 경로(checkNewMessages)는 그대로였음. 파싱 실패가 바깥 catch로 빠져 그 패스를 끊고, processed로 표시되지 않아 이후 모든 폴링이 같은 파일에서 멈췄음. 이제 파일별로 격리(파일명·execution·사유 로그) 후 다음 메시지로 진행
tester JSON 결과 필드 타입 검증 이 PR — success: "false"가 Boolean()으로 true가 되던 것 수정(리터럴 true만 성공), 카운트는 유한 비음수, 목록은 문자열만(500자 clip, 50개 상한), error는 문자열만
guard가 파일 열기 전 프로젝트 밖 경로 거부 이 PR — guardPaths.ts: 절대경로·..·NUL·symlink 디렉터리/파일 우회를 거부. runGuards가 이런 경로를 파일 읽는 guard에서 빼고 non-blocking pathContainment 결과로 보고(프로젝트 밖을 가리키는 tracked symlink는 정상일 수 있어 run을 막지 않음). getAddedLinesForFile, contract evidence 읽기도 같은 검사
실행하지 않는 명령 형태를 validation evidence에서 거부 이 PR — # npm test, : npm test, command -v, type, man, --help/--version/--listTests/--collect-only/--showConfig, make -n 등. pytest -v/-n 4는 실제 실행이라 그대로 인정
fan-out 후보가 공유 프로젝트 경로를 변경 남음 — 운영자 결정 필요. 기본값은 감사 시점부터 이미 sandbox 로컬 copy였고, 감사가 지적한 것은 fanout.linkSharedPaths: true일 때의 symlink 모드 자체임. 이 모드에서는 후보가 실제 프로젝트의 공유 경로(예: node_modules)를 바꿀 수 있음. 문서화된 설정 옵션을 없애거나 fan-out에서 copy로 강제하는 것은 동작 변경이라 이 PR에서 하지 않음

왜

잘못된 bus 파일 하나가 실행 전체의 메시지 소비를 멈췄고, 모델이 낸 JSON의 타입을 믿어 실패를 성공으로 읽을 수 있었습니다. guard는 worker가 보고한 경로를 그대로 join해 프로젝트 밖 파일을 열 수 있었고, npx vitest --help 같은 출력만 하는 명령이 검증 증거로 통과했습니다.

검증

  • npx vitest run src/agents → 75 files, 1143 tests 통과 (새 테스트: guardPaths.test.ts, 폴링 격리, tester 필드 검증, 경로 escape guard, non-executing 명령 28 케이스)
  • testerFixPromptBudget.test.ts 한 케이스는 parser가 비문자열 항목을 이제 버리므로 기대값을 바꾸고, prompt builder의 관용성은 직접 만든 결과로 계속 검증
  • npm run typecheck 통과. pipelineGuards.ts는 1000줄 초과 파일이라 helper를 guardPaths.ts로 빼서 줄 수를 줄임 (1001 → 994)

…fields, contain guard paths, reject non-executing evidence (AGT-3441)

- agentBus: a malformed message file no longer aborts every poll; it is quarantined with file/execution/reason and marked processed
- tester: success only for literal true, counts finite and non-negative, list entries strings (clipped, capped), error a string
- pipelineGuards: changed paths that are absolute-outside, traverse, or leave through a symlink are dropped from file-reading guards and reported by a blocking pathContainment result (guardPaths.ts)
- workerValidationEvidence: comments, no-op builtins, lookups and help/version/list/collect-only/make dry-run forms are not validation evidence
…AGT-3441)

A tracked symlink that points outside the project is legitimate; the guards only need to not open it.
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