Repository navigation
리포트: 진단 보고서를 저장한 뒤 Discord로 전달한다 - #17
Conversation
…ture/donghun-report-discord-mvp
…' into feature/donghun-report-discord-mvp
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b65fa48208
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const source = record(value, ["diagnosis_id", "request", "completion_reason", "observations"]); | ||
| const diagnosisId = string(source.diagnosis_id, 41); | ||
| if (!DIAG_ID.test(diagnosisId)) invalid(); | ||
| string(source.request, MAX_REQUEST); |
There was a problem hiding this comment.
symptom에 줄바꿈이나 탭이 포함된 경우 createReportFlow는 공백 여부와 길이만 확인한 뒤 전체 진단을 실행하지만, 원문을 담은 handoff는 여기서 제어 문자 때문에 거부됩니다. /diagnose 옵션도 최대 길이만 설정하므로 이런 입력은 접수될 수 있고, 진단 비용을 모두 사용한 뒤 보고서가 저장·전달되지 않고 일반 실패 메시지만 반환됩니다. 진단 전에 같은 제약으로 입력을 거부하거나, 보고서에 사용하지 않는 request를 정규화 또는 제외해야 합니다.
Useful? React with 👍 / 👎.
요약
#14의
DiagnosisHandoff를 검증해 1차 MVP 보고서를 파일에 저장하고, 다시 읽은 보고서만 Discord/diagnose응답으로 보냅니다. Report 모델은 제한된 입력으로 원인 가설만 작성합니다.관련 작업: #7의 일부 구현입니다. 이 PR로 #7을 닫지 않습니다. 대상 브랜치는
develop입니다.동작 흐름
DiagnosisHandoff→ 호출 ID·순서·오류 검증 → 모델용 최소 정보 투영 → 원인 가설 → 서버의 보고서 조립·검증 → 파일 게시·재조회 → Discord 요약과amdc-report.md전달이번 PR의 범위
diagnosis-report/1.0.0스키마와 검증기, Report Agent, 파일 저장소, Discord 접점, 실패 주입 테스트를 추가합니다.ajv의존성과 Docker 이미지의 보고서 스키마도 포함합니다.ReportAgentInputV1과 SQLite Run/Evidence/Report 트랜잭션은 이 MVP로 대체하지 않습니다. 실제 AMDB 조회, 재시작 이후 중복 처리, 전역 실행 대기열은 이번 범위 밖입니다.검증
Windows, Node.js 24.13.0의 격리된 통합 checkout에서 실행했습니다.
npm ci --ignore-scriptsnpm run typecheck,npm run buildnpm testnpm run smoke:reportnpm ci,npm test,npm run typecheck,npm run build테스트는 가짜 제공자·도구·Discord 전송 계층을 사용합니다. 실제 AMDB 조회와 실제 LiteLLM·Discord 연결, Docker 실행은 이 head에서 재검증하지 않았습니다.
리뷰 포인트와 위험
DiagnosisHandoff의 ID·순서·참조 검증과 원시 결과가 Report 모델·Discord 경계를 넘지 않는지 확인이 필요합니다.롤백 계획은 이 PR의 봇 연결 변경을 되돌려 이전 진단 표시 경로로 복귀하는 것입니다. 이미 저장된 보고서 파일은 보존합니다.