Skip to content

Commit eaab29f

Browse files
committed
docs(v04): add phase-a5 progress doc (smoke tests passed)
1 parent c353926 commit eaab29f

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

‎docs/v04/progress/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ README의 7-Phase 로드맵(Phase 1 외부 deps → Phase 7 검증)이 **horizon
2626
| 마일스톤 | 상태 | 문서 | 관련 커밋 |
2727
|---|---|---|---|
2828
| Phase A — MCP boot (handshake + tools/list) | ✅ 합격 | [phase-a-mcp-boot.md](phase-a-mcp-boot.md) | `19b7bf6` (브랜치 `yg/first-mcp-boot`) |
29-
| Phase A.5 — smoke test 추가 (CI 회귀 방지) | ⏳ 예정 | — | — |
29+
| Phase A.5 — smoke test 추가 (CI 회귀 방지) | ✅ 합격 | [phase-a5-smoke-test.md](phase-a5-smoke-test.md) | `c353926` (브랜치 `yg/phase-a5-smoke-test`, PR #87) |
3030
| Phase B — `rune_diagnostics` environment 섹션 진짜 응답 (stdlib only) | ⏳ 예정 | — | — |
3131
| Phase 1 — `go.mod` 외부 deps 본격 추가 (gRPC · envector SDK · embedder proto) | ⏳ 예정 | — | — |
3232
| Phase 2 — `internal/domain` + `internal/policy` 순수 로직 (TM scope) | ⏳ 예정 | — | — |
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Phase A.5 — smoke tests
2+
3+
> ✅ 통과 (2026-04-27) · 커밋 `c353926` · 브랜치 `yg/phase-a5-smoke-test` · PR #87
4+
> 핵심 파일 2개: `internal/mcp/register_test.go` (137줄) · `cmd/rune-mcp/main_test.go` (33줄)
5+
6+
## 1. 한 줄 요약
7+
8+
Phase A 의 bash/jq cookbook (`phase-a-mcp-boot.md` §4.2 / §4.3) 을 Go test 로 정착. `go test ./...` 한 번이 handshake + tools/list + tools/call stub + shutdown 정상성 회귀를 모두 가드. 외부 의존 0 (SDK 의 `NewInMemoryTransports` 사용 — 네트워크/stdio 없음, ~1.5s).
9+
10+
## 2. 동작하는 것
11+
12+
| 테스트 | 위치 | 잡아주는 회귀 |
13+
|---|---|---|
14+
| `TestRegister_All8ToolsListed` | `internal/mcp/register_test.go` | tool 누락 / 오타 / 이름 변경 (예: `rune_caputre`) |
15+
| `TestRegister_InputSchemaInferred` | 동 | domain struct 가 schema 화 불가능한 형태로 변경 (`map[interface{}]any` 등) |
16+
| `TestRegister_StubReturnsIsError` (4 subtest) | 동 | stub 응답 포맷 변경, IsError 누락, "not yet implemented" 문구 깨짐 |
17+
| `TestIsNormalShutdown` (6 subtest) | `cmd/rune-mcp/main_test.go` | EOF 매칭 잘못 추가, ctx.Canceled 누락, 진짜 에러를 정상 종료로 오판 |
18+
19+
총 4 함수 / 11 케이스, ~1.5s.
20+
21+
## 3. 검증 — 30초 컷
22+
23+
### 3.1. 전체 (가장 흔한 사용)
24+
25+
```bash
26+
go test ./...
27+
```
28+
29+
기대: 두 패키지 `ok`, 나머지 `[no test files]`.
30+
31+
### 3.2. Phase A.5 만
32+
33+
```bash
34+
go test ./internal/mcp/ ./cmd/rune-mcp/
35+
```
36+
37+
### 3.3. verbose / 단일 테스트
38+
39+
```bash
40+
go test -v ./internal/mcp/ # 모든 subtest 출력
41+
go test -v -run TestRegister_All8ToolsListed ./internal/mcp/ # 한 함수
42+
go test -v -run 'TestRegister_StubReturnsIsError/rune_diagnostics' ./internal/mcp/ # 한 subtest
43+
```
44+
45+
### 3.4. 캐시 무시 / 커버리지
46+
47+
```bash
48+
go test -count=1 ./... # 캐시 우회
49+
go test -cover ./internal/mcp/ ./cmd/rune-mcp/ # 커버리지 한 줄
50+
go test -coverprofile=coverage.out ./internal/mcp/ && go tool cover -html=coverage.out # HTML
51+
```
52+
53+
## 4. 새 tool 추가 시 절차
54+
55+
1. `internal/mcp/tools.go` `Register` 에 `sdkmcp.AddTool(...)` 한 줄 추가
56+
2. `internal/mcp/register_test.go` 의 `expectedTools` 슬라이스에 새 이름 추가 (알파벳순 유지)
57+
3. `go test ./internal/mcp/` 통과 확인 — 안 통과하면 보통 알파벳순 깨졌거나 이름 오타
58+
59+
## 5. 흔한 실패 → 원인
60+
61+
| 메시지 | 원인 |
62+
|---|---|
63+
| `tool count: got 7, want 8` | `tools.go` 에서 `AddTool` 빠뜨림 |
64+
| `tool[N]: got "X", want "Y"` | `expectedTools` 알파벳 순서 미준수 또는 이름 변경 |
65+
| `InputSchema is nil` | input struct 가 schema inference 안 되는 타입 |
66+
| `Content[0].Text does not contain stub marker` | `stubResult` 메시지 변경 — Phase 5 진입 전엔 실패해야 정상 |
67+
| `isNormalShutdown(...) = true, want false` | `isNormalShutdown` 에 의도치 않은 매칭 추가 |
68+
69+
## 6. 다음 마일스톤
70+
71+
- **Phase B** — `rune_diagnostics` environment 섹션 stdlib 응답 (`runtime.GOOS` · `runtime.Version` · `os.Getwd`). 첫 진짜 응답 흐름. Phase A.5 의 `TestRegister_StubReturnsIsError/rune_diagnostics` 는 의도적으로 깨짐 — 새 메시지 expectations 로 갱신 필요
72+
- **Phase 4 이후** — Vault/envector/embedder adapter 가 들어오면 in-memory mock 패턴 같이 도입 (Phase A.5 의 `NewInMemoryTransports` 패턴이 reference)

0 commit comments

Comments
 (0)