phasegate 0.118.0 → 0.119.0

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/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.119.0] - 2026-05-07
11
+
12
+ ### Fixed
13
+
14
+ - **WI-087 Phase A: `phasegate init` がデプロイする hook スクリプトが macOS 標準 bash 3.2 で silent no-op になる問題を修正** — 外部レポーター nakataj-mti が GitHub Issue [#3](https://github.com/junpei-9898/phasegate/issues/3) で報告。`templates/.claude/scripts/format-typescript-hook.sh` および `analyze-errors-hook.sh` の `mapfile -t TARGET_DIRS < <(jq ...)` が bash 4+ builtin であり、macOS 標準 `/bin/bash` (3.2.57) では `mapfile: command not found` エラーで `TARGET_DIRS` 配列が空になり、後続の `${#TARGET_DIRS[@]} -eq 0` 判定で hook が exit 0 で抜けていた。結果としてユーザーには何も表示されず、format / lint hook が deliberately quiet と誤認される状態だった。
15
+ - `mapfile -t ARRAY < <(...)` を bash 3.2 互換の `while IFS= read -r line; do ARRAY+=("$line"); done < <(...)` idiom に置換(`format-typescript-hook.sh` 内 2 箇所、`analyze-errors-hook.sh` 内 1 箇所)。
16
+ - shebang は `#!/bin/bash` を維持(追加インストール不要、既存ユーザーへの影響なし)。
17
+ - 検証: macOS bash 3.2.57 で `targetDirs` を含む hook-config.json をロード後、対象ディレクトリ下のファイルに対して `format-typescript-hook.sh` が `Formatted: ...` を出力、`analyze-errors-hook.sh` が `{"decision": "approve", ...}` を返すことを確認。
18
+ - 関連: WI-086(GitHub Issue [#2](https://github.com/junpei-9898/phasegate/issues/2), reporter: junpei-9898)の "post-tool-use がセッション中に呼ばれても通知されない" 症状の主因も同じ `mapfile` であり、本修正で副次的に解消する。
19
+ - スコープ外(後続フェーズで対応予定): `phasegate init` の monorepo 自動検出(WI-087 Phase B)、Quick Mode 通過時の stderr notice / Stop hook `--enforce` flag(WI-087 Phase C)、`phasegate init` の formatter 自動検出(WI-087 Phase B)。
20
+
10
21
  ## [0.118.0] - 2026-05-07
11
22
 
12
23
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phasegate",
3
- "version": "0.118.0",
3
+ "version": "0.119.0",
4
4
  "packageManager": "pnpm@10.30.1",
5
5
  "description": "Phasegate — AI-agnostic quality defense toolkit. Enforces structural integrity between design intent and code.",
6
6
  "license": "MIT",
@@ -15,7 +15,10 @@ CONFIG_FILE="$SCRIPT_DIR/hook-config.json"
15
15
  TARGET_DIRS=()
16
16
 
17
17
  if [[ -f "$CONFIG_FILE" ]] && command -v jq >/dev/null 2>&1; then
18
- mapfile -t TARGET_DIRS < <(jq -r '.targetDirs[]' "$CONFIG_FILE" 2>/dev/null)
18
+ # bash 3.2 (macOS default) has no mapfile; use portable while-read.
19
+ while IFS= read -r line; do
20
+ [[ -n "$line" ]] && TARGET_DIRS+=("$line")
21
+ done < <(jq -r '.targetDirs[]' "$CONFIG_FILE" 2>/dev/null)
19
22
  fi
20
23
 
21
24
  if [[ ${#TARGET_DIRS[@]} -eq 0 ]]; then
@@ -17,9 +17,14 @@ FORMATTER="biome"
17
17
  FORMATTER_ARGS=()
18
18
 
19
19
  if [[ -f "$CONFIG_FILE" ]] && command -v jq &> /dev/null; then
20
- mapfile -t TARGET_DIRS < <(jq -r '.targetDirs[]' "$CONFIG_FILE" 2>/dev/null)
20
+ # bash 3.2 (macOS default) has no mapfile; use portable while-read.
21
+ while IFS= read -r line; do
22
+ [[ -n "$line" ]] && TARGET_DIRS+=("$line")
23
+ done < <(jq -r '.targetDirs[]' "$CONFIG_FILE" 2>/dev/null)
21
24
  FORMATTER=$(jq -r '.formatter // "biome"' "$CONFIG_FILE" 2>/dev/null)
22
- mapfile -t FORMATTER_ARGS < <(jq -r '.formatterArgs[]' "$CONFIG_FILE" 2>/dev/null)
25
+ while IFS= read -r line; do
26
+ [[ -n "$line" ]] && FORMATTER_ARGS+=("$line")
27
+ done < <(jq -r '.formatterArgs[]' "$CONFIG_FILE" 2>/dev/null)
23
28
  fi
24
29
 
25
30
  if [[ ${#TARGET_DIRS[@]} -eq 0 ]]; then