Skip to content

改善: executable bit audit CI guard の適用範囲を .claude/skills 外のスクリプトへ拡張する #213

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: none
goal_ref: "CI guard の executable bit 監査対象をリポジトリ全域の *.sh / *.py に拡張し、.claude/skills 外のスクリプトの mode 消失も CI ブロッカーとして検知できる状態にする"
change_kind: code

Parent Issue

なし(単独改善)

Parent Goal Ref

  • Goal: なし(単独改善)
  • Desired Destination: N/A

Current Validated Scope

  • scripts/check-executable-bits.sh(実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205 で作成予定)の対象パターンを .claude/skills/**/*.sh から **/*.sh / **/*.py(またはプロジェクト全域)に拡張する
  • 拡張後の guard スクリプトが scripts/ 以外のディレクトリ(例: tmp/ 等の除外対象)を適切にスキップするよう修正する
  • CI ワークフロー(.github/workflows/)の guard ジョブを更新し、拡張された対象範囲でチェックが実行されるようにする
  • 任意: docs/dev/ に executable bit 管理ポリシーを追記する

Remaining Parent Gaps

なし

Outcome

scripts/check-executable-bits.sh(#205 成果物)の監査対象パターンが **/*.sh / **/*.py に拡張されたコミットが main にマージされ、.claude/skills 外の .sh / .py ファイルの mode 消失も CI 失敗としてブロックされる状態になる。

In Scope

  • scripts/check-executable-bits.sh の対象パターン拡張(.claude/skills/** → **/*.sh / **/*.py またはリポジトリ全域)
  • 除外対象ディレクトリ(tmp/、node_modules/ 等)のスキップ処理追加
  • CI ワークフロー(.github/workflows/)の guard ジョブ更新
  • 任意: docs/dev/ に executable bit 管理ポリシーのドキュメント追記

Out of Scope

Acceptance Criteria

  • scripts/check-executable-bits.sh の対象パターンが拡張され、.claude/skills 外の .sh / .py ファイルも監査対象になっている
  • tmp/、node_modules/ 等の除外対象が guard スクリプト内でスキップされている
  • CI ワークフロー(.github/workflows/)の guard ジョブが更新されており、拡張後の範囲でチェックが実行される
  • .claude/skills 外のディレクトリ(例: scripts/)に存在する .sh ファイルの mode を 644 に変更した場合、CI guard が exit 1 を返すことをローカル dry-run で確認できる
  • pnpm typecheck / pnpm lint / pnpm test / pnpm build が通る

Verification Commands

# AC1: guard スクリプトの対象パターンが .claude/skills 外を含むことを確認
grep -n '\.claude/skills' scripts/check-executable-bits.sh && echo "WARN: still limited to .claude/skills only" || echo "PASS: pattern is not limited to .claude/skills"

# AC2: 除外対象ディレクトリのスキップ処理が存在することを確認
grep -nE '(node_modules|tmp)' scripts/check-executable-bits.sh && echo "PASS: exclude patterns found" || echo "FAIL: exclude patterns not found"

# AC3: CI ワークフローに guard ジョブが存在し、拡張後の記述になっていることを確認
grep -rn "check-executable" .github/workflows/ && echo "PASS: CI guard job found" || echo "FAIL: CI guard job not found"

# AC4: guard スクリプトの dry-run(scripts/ 等のファイルを含めて mode チェック)
bash scripts/check-executable-bits.sh && echo "PASS: no mode violations" || echo "FAIL: mode violation detected"

# AC5: 品質ゲート
pnpm typecheck && pnpm lint && pnpm test && pnpm build

Allowed Paths

  • scripts/check-executable-bits.sh(対象パターン拡張)
  • .github/workflows/(CI ジョブ更新)
  • docs/dev/(executable bit 管理ポリシー追記、任意)

Stop Conditions

  • Allowed Paths 外の変更が必要と判明した場合
  • In Scope の固定契約(キー集合・スキーマ・型定義)の変更が必要になった場合
  • 新規 Issue の起票が必要と判断した場合(スコープ分割が発生する場合)
  • 後続 Phase / 別スコープへの波及が判明した場合
  • nested SubAgent delegation が必要になった場合
  • 外部サービス利用・権限昇格・既存テスト大規模改変が必要になった場合
  • 実装: .claude/skills 配下スクリプトの executable bit を監査し CI guard を追加する #205 の成果物(scripts/check-executable-bits.sh)が予想と大きく異なり、パターン拡張の方法が変わる場合

Required Skills

  • Bash / POSIX shell
  • Git filemode(git ls-tree / git ls-files)
  • GitHub Actions YAML

Scope Delta(任意)

N/A

Background

Issue #205 では .claude/skills 配下の .sh / .py スクリプトの executable bit を CI で監査する guard を実装する。しかし、リポジトリには scripts/ 等の他ディレクトリにも実行可能スクリプトが存在する可能性があり、#205 の guard が .claude/skills 限定だと他ディレクトリのスクリプトの mode 消失は検知されない。本 Issue は #205 の完了後に、CI guard の対象範囲をリポジトリ全域の *.sh / *.py に拡張する follow-up である。

Depends on #205

関連 Issue:

Source

  • dedupe_key: follow-up:squne121/loop-protocol:pr/212:exec-bit-audit-extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementphase/implementationstate/blockedstate/queued

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions