# Complete - m-webhook-revision-reconcile/01_http_delivery

## 완료 일시

2026-06-17

## 요약

HTTP webhook delivery 계약 보강 리뷰 루프 3회 완료, 최종 판정 PASS.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G05_0.log` | `code_review_local_G05_0.log` | FAIL | HMAC signature, `secret_ref` unsigned delivery, empty delivery id, webhook failure retry blocking Required 발견 |
| `plan_cloud_G06_1.log` | `code_review_cloud_G06_1.log` | FAIL | empty provider delivery id retry에서 fallback consumer delivery id가 random event id에 기대는 Required 발견 |
| `plan_local_G05_2.log` | `code_review_local_G05_2.log` | PASS | deterministic revision-based fallback delivery id와 retry 안정성 검증 완료 |

## 구현/정리 내용

- `X-Gito-Signature`를 HMAC-SHA256 body signature로 계산한다.
- `secret_ref`가 있는데 resolver가 없거나 unresolved이면 unsigned webhook delivery를 보내지 않고 오류 처리한다.
- provider delivery id가 없을 때 consumer-facing delivery id를 revision identity 기반 fallback으로 안정화한다.
- webhook delivery 실패 시 provider delivery dedupe record를 rollback해 같은 delivery/revision retry가 가능하게 한다.
- fake consumer 테스트로 generic `branch.updated` payload, header, signature, retry idempotency를 검증한다.

## 최종 검증

- `cd services/core && go test -run 'TestRuntime_WebhookDeliveryFallbackDeliveryID|TestRuntime_WebhookDeliveryFailureAllowsRetry' ./internal/controlplane/ -v -count=1` - PASS; fallback id와 retry 안정성 테스트 통과
- `cd services/core && go test -run TestWebhookDeliveryBranchUpdated ./internal/controlplane/ -v -count=1` - PASS; S02 delivery evidence 테스트 통과
- `cd services/core && go test ./...` - PASS; core 전체 테스트 통과
- `git diff --check` - PASS; whitespace 검증 통과
- `gofmt -l services/core/internal/controlplane/runtime.go services/core/internal/controlplane/runtime_test.go` - PASS; 출력 없음

## Roadmap Completion

- Milestone: `agent-roadmap/phase/provider-change-request-integration/milestones/webhook-revision-reconcile.md`
- Completed task ids:
  - `deliver`: PASS; evidence=`agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/plan_local_G05_2.log`, `agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/code_review_local_G05_2.log`; verification=`cd services/core && go test -run TestWebhookDeliveryBranchUpdated ./internal/controlplane/ -v -count=1`
  - `nomadcode-wakeup`: PASS; evidence=`agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/plan_local_G05_2.log`, `agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/code_review_local_G05_2.log`; verification=`fake consumer receives generic branch.updated payload without NomadCode-only required fields in TestWebhookDeliveryBranchUpdated`
- Not completed task ids: 없음

## Spec Completion

- SDD: `agent-roadmap/sdd/provider-change-request-integration/webhook-revision-reconcile/SDD.md`
- Completed scenario ids:
  - `S02`: PASS; task=`deliver`; evidence=`agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/plan_local_G05_2.log`, `agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/code_review_local_G05_2.log`; verification=`cd services/core && go test -run TestWebhookDeliveryBranchUpdated ./internal/controlplane/ -v -count=1`
  - `S03`: PASS; task=`nomadcode-wakeup`; evidence=`agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/plan_local_G05_2.log`, `agent-task/archive/2026/06/m-webhook-revision-reconcile/01_http_delivery/code_review_local_G05_2.log`; verification=`fake consumer receives generic branch.updated payload without NomadCode-only required fields in TestWebhookDeliveryBranchUpdated`
- Not completed scenario ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
