spec-runner 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -298,12 +298,16 @@ schema_drift_check() {
|
|
|
298
298
|
run_health_check() {
|
|
299
299
|
local drifts=()
|
|
300
300
|
local current_phase=0
|
|
301
|
+
local current_step_id=""
|
|
302
|
+
local is_quality_step=0
|
|
301
303
|
|
|
302
304
|
# フェーズに応じてチェック強度を段階適用する
|
|
303
305
|
if [[ -x ".spec-runner/scripts/spec-runner-core.sh" ]] && command -v jq >/dev/null 2>&1; then
|
|
304
306
|
current_phase="$(.spec-runner/scripts/spec-runner-core.sh --json 2>/dev/null | jq -r '.phase // 0' 2>/dev/null)"
|
|
305
307
|
[[ -n "$current_phase" && "$current_phase" != "null" ]] || current_phase=0
|
|
308
|
+
current_step_id="$(.spec-runner/scripts/spec-runner-core.sh --json 2>/dev/null | jq -r '.step_id // empty' 2>/dev/null)"
|
|
306
309
|
fi
|
|
310
|
+
[[ "$current_step_id" == "clarify" || "$current_step_id" == "analyze" ]] && is_quality_step=1
|
|
307
311
|
|
|
308
312
|
UC_ROOT="$(get_steps_common_doc "uc_root")"
|
|
309
313
|
DOMAIN_ROOT="$(get_steps_common_doc "domain_root")"
|
|
@@ -320,16 +324,21 @@ run_health_check() {
|
|
|
320
324
|
count=$(grep -c '\\[要確認:' "$f" 2>/dev/null || echo 0)
|
|
321
325
|
count=$(echo "$count" | head -1 | tr -cd '0-9'); count=${count:-0}
|
|
322
326
|
[[ "$count" -gt 3 ]] && drifts+=("UC ${base}: [要確認: が ${count} 個(3個以下にすること)")
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
# `## 実装方針` / `## タスク(一覧)` は実装計画以降で埋まる想定。
|
|
328
|
+
# ただし `clarify/analyze` は「任意フェーズで挿入」されるため、
|
|
329
|
+
# 実装計画が回っていない(=生成物がまだ無い)タイミングで先回りで落とさない。
|
|
330
|
+
if [[ "$current_phase" -ge 3 && "$is_quality_step" -eq 0 ]]; then
|
|
331
|
+
grep -qE '^## 実装方針' "$f" 2>/dev/null || drifts+=("UC ${base}: 「## 実装方針」の見出しがありません(UC 仕様書の一番下に記載すること)")
|
|
332
|
+
grep -qE '^## タスク一覧|^## タスク\\b' "$f" 2>/dev/null || drifts+=("UC ${base}: 「## タスク」または「## タスク一覧」の見出しがありません(UC 仕様書の一番下に記載すること)")
|
|
333
|
+
fi
|
|
325
334
|
done
|
|
326
335
|
|
|
327
|
-
if [[ "$current_phase" -ge 3 ]]; then
|
|
336
|
+
if [[ "$current_phase" -ge 3 && "$is_quality_step" -eq 0 ]]; then
|
|
328
337
|
adr_count=$(find "$ARCH_ROOT/設計判断記録" -name "*.md" 2>/dev/null | wc -l)
|
|
329
338
|
[[ "${adr_count:-0}" -lt 1 ]] && drifts+=("ADR が 1 件もありません(設計判断記録)")
|
|
330
339
|
fi
|
|
331
340
|
|
|
332
|
-
if [[ "$current_phase" -ge 2 ]]; then
|
|
341
|
+
if [[ "$current_phase" -ge 2 && "$is_quality_step" -eq 0 ]]; then
|
|
333
342
|
if [[ ! -f "$DOMAIN_ROOT/ユビキタス言語辞書.md" ]]; then
|
|
334
343
|
drifts+=("ユビキタス言語辞書.md が存在しません")
|
|
335
344
|
else
|
|
@@ -345,13 +354,13 @@ run_health_check() {
|
|
|
345
354
|
elif command -v jq >/dev/null 2>&1; then
|
|
346
355
|
grade=$(jq -r '.current_grade' .spec-runner/grade-history.json)
|
|
347
356
|
[[ -n "$grade" && "$grade" != "null" ]] || drifts+=("grade-history.json の current_grade が未設定です")
|
|
348
|
-
if [[ "$grade" == "A" && "$current_phase" -ge 4 ]]; then
|
|
357
|
+
if [[ "$grade" == "A" && "$current_phase" -ge 4 && "$is_quality_step" -eq 0 ]]; then
|
|
349
358
|
[[ ! -f "$INFRA_ROOT/schema.dbml" ]] && drifts+=("Grade A 必須: schema.dbml が存在しません")
|
|
350
359
|
schema_sync_check >/dev/null 2>&1 || drifts+=("Prisma と schema.dbml のテーブルが一致していません(スキーマ同期チェック)")
|
|
351
360
|
fi
|
|
352
361
|
fi
|
|
353
362
|
|
|
354
|
-
if [[ "$current_phase" -ge 3 ]]; then
|
|
363
|
+
if [[ "$current_phase" -ge 3 && "$is_quality_step" -eq 0 ]]; then
|
|
355
364
|
[[ ! -f "$OPENAPI_PATH" ]] && drifts+=("openapi.yaml が存在しません")
|
|
356
365
|
fi
|
|
357
366
|
|