Skip to content

release: 0.5.13 — spec-completion-gate.sh 가 spec 없는 triage 직후 매 커밋마다 jq 에러를 찍던 것 - #15

Merged
bluecheat merged 1 commit into
mainfrom
fix/spec-gate-skipped-result
Sep 14, 2026
Merged

bluecheat merged 1 commit into
mainfrom
fix/spec-gate-skipped-result

Conversation

@bluecheat

Copy link
Copy Markdown
Owner

무엇이 잘못됐었나

phase != idle 인데 spec_id·spec_dir 이 아직 없는 구간(triage 직후, /spec 이전)에서 tasks-gate.sh --json 은 {"status":"skipped","result":{},…} 를 돌려줘요 — "검사할 spec 이 없다" 는 정상 신호예요. 그런데 spec-completion-gate.sh 의 가드 jq -e '.result' 는 {} 도 참으로 봐서 통과시키고, 그 다음 줄

UNCOV=$(printf '%s' "$OUT" | jq -r '.result.ac_uncovered | join(", ")')

이 null 을 배열처럼 돌려서 jq: error (at <stdin>:0): Cannot iterate over null (null) 을 매 git commit 마다 stderr 에 찍었어요. exit 0 이라 커밋은 안 막았지만, triage 만 하고 spec 을 아직 안 쪼갠 동안엔 커밋할 때마다 보였어요. commerce-monorepo 에서 0.5.12 를 쓰다 발견했어요.

무엇이 바뀌었나

  • templates/default/.ax/hooks/pre-commit/spec-completion-gate.sh
    • OUT 을 받은 직후 .status 를 봐요. ok·warning 만 아래 보고 로직으로 내려가고, skipped·error (result 가 항상 {} — common.sh 의 json_skip/json_error) 는 조용히 통과해요. tasks-gate.sh 가 자기 next_step 으로 사유를 이미 말해요.
    • 위반이 있을 때 tasks-gate 는 "ok" 가 아니라 "warning" 으로 내요 — 그래서 가드가 ok|warning 이에요. != ok 로 했으면 hook 의 본래 기능(위반 보고)이 통째로 꺼졌을 거예요. 위반 픽스처로 보고가 그대로 나오는 걸 확인했어요.
    • ac_uncovered 읽기도 (.result.ac_uncovered // []) | join(", ") 로 — 바로 아래 dispatched_unreported·done_without_report 와 같은 스타일. 이중 방어예요.
  • tests/smoke.sh — 기존 phase=idle 픽스처 옆에 phase=triaged·spec 없음 픽스처 1개. stdout+stderr 빈 문자열 + exit 0 을 단언해요. 수정 전 hook 으로는 이 검사가 실패함을 먼저 확인했어요.
  • 버전 0.5.13 (VERSION·plugin.json·marketplace.json ×2) + changelog/0.5.13.md + README 인덱스.

검증

$ echo '{"status":"skipped","result":{}}' | jq -r '.result.ac_uncovered | join(", ")'
jq: error (at <stdin>:1): Cannot iterate over null (null)

main(0.5.12) 원본 hook + current-task.json={"phase":"triaged"}  → stderr: jq 에러, exit 0
수정본 hook, 같은 픽스처                                        → stdout/stderr 빈 문자열, exit 0
status:"warning" 픽스처(미완료 task 1 + 미커버 AC 1)             → [goax gate] spec 001-x — 1/2 완료 … 그대로 출력

bash tests/smoke.sh → 592 통과 / 0 실패 (같은 환경의 main 은 591 — 새 검사 +1)

구현·검증은 별도 컨텍스트 두 개(executor → verifier)가 각각 픽스처를 새로 만들어 했어요.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XgYfK9moXVF9YCRPvfg8tH

…jq 에러를 찍던 것

phase != idle 인데 spec_id/spec_dir 이 없는 구간(triage 직후, /spec 이전)에서 tasks-gate.sh 는
{"status":"skipped","result":{}} 를 돌려줘요. hook 의 가드 `jq -e '.result'` 는 {} 도 참으로 봐서
통과시키고, 다음 줄 `.result.ac_uncovered | join(", ")` 이 null 을 배열처럼 돌려서
`jq: error … Cannot iterate over null` 을 매 git commit 마다 stderr 에 찍었어요 (exit 0 이라 커밋은
안 막았어요).

- spec-completion-gate.sh: OUT 을 받은 직후 .status 를 봐요. ok·warning 만 아래로 내려가고
  skipped·error(result 가 항상 {}) 는 조용히 통과해요 — 위반은 tasks-gate 가 "warning" 으로
  내니까 이 가드가 위반 보고를 죽이지 않아요. ac_uncovered 읽기도 `// []` 로 굳혔어요
- smoke: phase=triaged·spec 없음 픽스처 1개 추가 (수정 전 hook 으로는 실패함을 먼저 확인).
  592 통과 / 0 실패

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XgYfK9moXVF9YCRPvfg8tH
@bluecheat
bluecheat merged commit 179d953 into main Sep 14, 2026
2 checks passed
@bluecheat
bluecheat deleted the fix/spec-gate-skipped-result branch September 25, 2026 10:54
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.

2 participants