nomadcode/agent-task/m-plane-work-item-webhook-intake/02+01_trigger_dispatch/CODE_REVIEW-local-G07.md
toki f23ba78eba feat: plane webhook intake & protosocket consumer wire readiness
- Add Plane webhook handler for issue events (created, state, assignees)
- Add Plane webhook integration tests with testdata fixtures
- Add Gito Protosocket consumer wire readiness milestone
- Add Plane work item webhook intake milestone
- Add agent-task for plane-work-item-webhook-intake (trigger dispatch, idempotency, live smoke)
- Update service config, router, handlers for Plane webhook endpoints
- Add SOPS env setup script and secrets configuration
- Update agent-ops domain rules and phase roadmap
2026-06-14 20:37:48 +09:00

5.9 KiB

Code Review Reference - WEBHOOK_DISPATCH

[IMPLEMENTING AGENT - READ FIRST] Filling in this file is the mandatory final step of implementation. The task is NOT complete until every implementation-owned section below is filled in. Complete the 구현 체크리스트; the final checklist item is mandatory before saving. Fill implementation-owned sections, then stop with active files in place and report ready for review. If implementation is blocked by a user-only decision, user-owned external environment prerequisite, or scope conflict, fill 사용자 리뷰 요청 with evidence and stop with active files in place; code-review decides whether to write USER_REVIEW.md. Do not ask the user directly, present choices in chat, or call request_user_input during implementation. Finalization is review-agent-only.

개요

date=2026-06-14 task=m-plane-work-item-webhook-intake/02+01_trigger_dispatch, plan=0, tag=WEBHOOK_DISPATCH

Roadmap Targets

  • Milestone: agent-roadmap/phase/agent-ops-mcp-control-plane/milestones/plane-work-item-webhook-intake.md
  • Task ids:
    • trigger-dispatch: Backlog + AGENT assignee 이벤트만 기존 workitempipeline.CreateTaskFromWorkItem 경로로 넘기고 나머지는 side effect 없이 ignored 처리한다.
  • Completion mode: check-on-pass

이 파일을 읽는 리뷰 에이전트에게

[REVIEW AGENT ONLY] 구현 결과를 실제 소스와 대조하고, PASS이면 code-review 절차에 따라 log/complete/archive를 처리한다. 구현 에이전트는 이 섹션을 실행하지 않는다.

구현 항목별 완료 여부

항목 완료 여부
[WEBHOOK_DISPATCH-1] Dispatch Configuration [ ]
[WEBHOOK_DISPATCH-2] Handler Dispatch Path [ ]
[WEBHOOK_DISPATCH-3] Side Effect Guard Verification [ ]

구현 체크리스트

  • Plane webhook dispatch 설정을 config/server/handler에 추가하고 PLANE_CREATION_BACKLOG_STATE_ID, PLANE_AGENT_ASSIGNEE_ID, optional PLANE_SELF_ACTOR_ID env를 주입한다.
  • ReceivePlaneWebhook에서 normalized Plane issue event만 workitempipeline.CreateTaskFromWorkItem으로 넘기고 ignored event는 side effect 없이 202로 반환한다. 검증: ignored event가 workspace provision 또는 slot reservation을 발생시키지 않는다.
  • handler/config tests를 추가해 matching event는 trigger input으로 전달되고 non-matching/ignored event는 task creator를 호출하지 않음을 확인한다.
  • CODE_REVIEW-*-G??.md의 구현 에이전트 소유 섹션을 실제 구현 내용과 검증 출력으로 채운다. 이 항목이 완료되기 전에는 구현이 완료된 것이 아니다.

코드리뷰 전용 체크리스트

[REVIEW AGENT ONLY] 이 체크리스트는 코드리뷰 에이전트만 사용한다.

  • 코드리뷰 결과PASS, WARN, FAIL 중 하나의 판정을 append한다.
  • active CODE_REVIEW-*-G??.mdPLAN-*-G??.md.log로 아카이브한다.
  • PASS이면 complete.log를 작성하고 active task 디렉터리를 agent-task/archive/YYYY/MM/m-plane-work-item-webhook-intake/02+01_trigger_dispatch/로 이동한다.
  • PASS이고 task group이 m-plane-work-item-webhook-intake이므로 완료 이벤트 메타데이터를 보고한다. roadmap 수정은 런타임 책임이다.

계획 대비 변경 사항

구현 에이전트가 계획과 다르게 구현한 부분을 이유와 함께 기록한다.

주요 설계 결정

구현 에이전트가 주요 설계 결정 사항을 기록한다.

사용자 리뷰 요청

기본값은 없음이다. 구현 중 사용자 결정, 사용자 소유 외부 환경/secret/서비스 준비, 또는 계획 범위 변경 없이는 안전하게 진행할 수 없으면 아래 항목을 실제 내용으로 교체하고, 구현을 중단한 뒤 active 파일을 그대로 둔 채 리뷰를 요청한다. 구현 에이전트는 사용자에게 직접 질문하거나 선택지를 제시하거나 request_user_input을 호출하지 않는다. 후속 에이전트가 명령 재실행이나 산출물 수집으로 해소할 수 있는 검증 증거 공백만으로는 사용자 리뷰 요청을 작성하지 않는다.

  • 상태: 없음
  • 사유 유형: 없음
  • 결정 필요: 없음
  • 차단 근거: 없음
  • 실행한 검증/명령: 없음
  • 자동 후속 불가 이유: 없음
  • 재개 조건: 없음

리뷰어를 위한 체크포인트

  • Dispatch 설정이 raw secret을 추가로 노출하지 않고 non-secret ids만 문서화한다.
  • Matching event만 creator에 전달되고 ignored event는 creator call 없이 202가 된다.
  • ErrCreationTriggerIgnored가 provider retry storm을 만들지 않도록 202로 매핑된다.

검증 결과

구현 에이전트가 각 중간 검증 및 최종 검증 명령 실행 후 출력을 여기에 붙여 넣는다.

WEBHOOK_DISPATCH-1 중간 검증

$ cd services/core && go test -count=1 ./internal/config
(output)

WEBHOOK_DISPATCH-2 중간 검증

$ cd services/core && go test -count=1 ./internal/http
(output)

WEBHOOK_DISPATCH-3 중간 검증

$ cd services/core && go test -count=1 ./internal/http ./internal/workitempipeline
(output)

최종 검증

$ cd services/core && gofmt -w internal/config/config.go internal/config/config_test.go internal/http/handlers.go internal/http/plane_webhook.go internal/http/plane_webhook_test.go cmd/server/main.go
(output)
$ cd services/core && go test -count=1 ./internal/config ./internal/http ./internal/workitempipeline
(output)
$ tar -C services/core -czf - . | ssh toki@toki-labs.com 'mkdir -p ~/agent-work/nomadcode/services/core && tar -C ~/agent-work/nomadcode/services/core -xzf -'
(output)
$ ssh toki@toki-labs.com 'zsh -lc "cd ~/agent-work/nomadcode/services/core && go test -count=1 ./..."'
(output)