spec-runner 1.1.0 → 1.1.2

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/README.md CHANGED
@@ -22,7 +22,6 @@ curl -sSL https://raw.githubusercontent.com/TEEE88/spec-runner/main/install.sh |
22
22
 
23
23
  - `mkdocs.yml` / `requirements-docs.txt`
24
24
  - `docs/index.md`(サイトのホーム)
25
- - `docs/spec-runner-フロー.md`(`spec-runner` パッケージ同梱の手順書)
26
25
 
27
26
  `.spec-runner/` がすでにあり **2 回目以降はエラーで止まる** 場合も、**その手前**で上記 MkDocs 用ファイルの不足分だけ補完される(初回導入以前のリポジトリで MkDocs だけ足したいときに便利)。
28
27
 
@@ -22,7 +22,6 @@
22
22
  * MkDocs(任意・プロジェクトルート):
23
23
  * - templates/mkdocs-scaffold/ の mkdocs.yml / requirements-docs.txt / docs/index.md を
24
24
  * 未有効時のみコピー(憲章・設計書は既存の docs/01..06 をそのまま閲覧)
25
- * - パッケージ同梱の docs/flow.md を docs/spec-runner-フロー.md としてコピー(未存在時のみ)
26
25
  */
27
26
 
28
27
  const fs = require("fs");
@@ -35,7 +34,6 @@ const DEST_DIR = path.join(CWD, ".spec-runner");
35
34
  const TEMPLATES_DIR = path.join(TEMPLATE_SPEC_RUNNER_DIR, "templates");
36
35
  const PHASE_LOCKS_TEMPLATE = path.join(TEMPLATES_DIR, "phase-locks.json");
37
36
  const MKDOCS_SCAFFOLD_DIR = path.join(PKG_DIR, "templates", "mkdocs-scaffold");
38
- const FLOW_DOC_SRC = path.join(PKG_DIR, "docs", "flow.md");
39
37
  const SKILLS_TEMPLATE_DIR = path.join(PKG_DIR, "templates", "skills");
40
38
 
41
39
  /** コピー時はスキップし、FORCE 時は消さない(ユーザー状態を保持) */
@@ -234,9 +232,6 @@ function installMkdocsScaffold() {
234
232
  path.join(MKDOCS_SCAFFOLD_DIR, "docs", "index.md"),
235
233
  path.join(CWD, "docs", "index.md"),
236
234
  );
237
- if (exists(FLOW_DOC_SRC)) {
238
- copyFileIfMissing(FLOW_DOC_SRC, path.join(CWD, "docs", "spec-runner-フロー.md"));
239
- }
240
235
  appendGitignoreVenvDocsIfNeeded();
241
236
  }
242
237
 
package/docs/flow.md CHANGED
@@ -49,6 +49,7 @@
49
49
  - 全 UC レビュー済みなら `domain`(必要に応じ `clarify` / `analyze`)
50
50
  4. `architecture.completed` が false
51
51
  - `architecture_plan`(必要に応じ `clarify` / `analyze`)
52
+ - lock が true でも、設計成果物(`docs/03` / `docs/04` の `.md`)が無い場合は該当設計フェーズに戻る
52
53
  5. 最新 UC がレビュー済みかつテスト準備済み
53
54
  - `implement`
54
55
  それ以外は `test_design`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-runner",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "フェーズ駆動で設計先行を強制。npx で .spec-runner を展開し、次のステップ .md に従って進める",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -91,7 +91,7 @@ latest_unreviewed_uc_spec() {
91
91
  local f key
92
92
  while IFS= read -r f; do
93
93
  key="$(basename "$f" .md)"
94
- jq -e --arg u "$key" '.uc_reviewed[]? == $u' "$LOCK_FILE" >/dev/null 2>&1 && continue
94
+ jq -e --arg u "$key" 'any(.uc_reviewed[]?; . == $u)' "$LOCK_FILE" >/dev/null 2>&1 && continue
95
95
  echo "$f"
96
96
  return 0
97
97
  done < <(find docs/02_ユースケース仕様 -mindepth 2 -maxdepth 2 -type f -name "UC-*.md" 2>/dev/null | sort -V)
@@ -143,6 +143,8 @@ run_phase() {
143
143
  charter_doc="$(get_steps_common_doc "charter")"
144
144
  domain_root="$(get_steps_common_doc "domain_root")"
145
145
  architecture_root="$(get_steps_common_doc "architecture_root")"
146
+ domain_spec_present=0
147
+ arch_spec_present=0
146
148
 
147
149
  doc_key() { basename "$1" .md; }
148
150
  first_md_in_dir() {
@@ -153,6 +155,12 @@ run_phase() {
153
155
 
154
156
  uc_count_total=$(find docs/02_ユースケース仕様 -mindepth 2 -maxdepth 2 -name "UC-*.md" 2>/dev/null | wc -l | tr -d ' ')
155
157
  uc_count_total=${uc_count_total:-0}
158
+ [[ -n "$(first_md_in_dir "$domain_root" || true)" ]] && domain_spec_present=1
159
+ [[ -n "$(first_md_in_dir "$architecture_root" || true)" ]] && arch_spec_present=1
160
+
161
+ # lock が先に立っていても、設計成果物が無い場合は必ず設計フェーズへ戻す
162
+ [[ $domain_spec_present -eq 0 ]] && has_domain_lock=0
163
+ [[ $arch_spec_present -eq 0 ]] && has_arch_lock=0
156
164
 
157
165
  if [[ $has_charter_lock -eq 0 ]]; then
158
166
  if [[ -f "$charter_doc" ]]; then
@@ -240,7 +248,7 @@ run_phase() {
240
248
  feature_dir="$(dirname "$uc_spec")"
241
249
  uc_key="$(doc_key "$uc_spec")"
242
250
  reviewed=0
243
- jq -e --arg u "$uc_key" '.uc_reviewed[]? == $u' "$LOCK_FILE" 2>/dev/null | grep -q true && reviewed=1
251
+ jq -e --arg u "$uc_key" 'any(.uc_reviewed[]?; . == $u)' "$LOCK_FILE" >/dev/null 2>&1 && reviewed=1
244
252
  if [[ $reviewed -eq 0 ]]; then
245
253
  if ! quality_done "clarified" "uc" "$uc_key"; then
246
254
  phase=1; phase_name_ja="ユースケース仕様(曖昧さ解消)"; resolve_step "clarify"
@@ -13,7 +13,7 @@
13
13
  | インフラ設計 | `docs/05_インフラ設計/` |
14
14
  | API 仕様 | `docs/06_API仕様/` |
15
15
 
16
- 手順・コマンド・ロックの考え方は **[spec-runner のフロー](spec-runner-フロー.md)** を参照してください(`npx spec-runner` 時にコピーされます)。
16
+ 手順・コマンド・ロックの考え方は、リポジトリの `docs/flow.md` を参照してください。
17
17
 
18
18
  ---
19
19