Repository navigation
feat(#324): integrate session_recording_policy checker into CI and pnpm scripts - #355
Conversation
…pm scripts Add `pnpm policy:check` npm script that runs both check_secret_policy.py and check_session_recording_policy.py in sequence. Integrate checker into CI python-test job to ensure policy consistency on every PR. Update operational guidance table in session-recording-policy.md to reflect CI implementation. - package.json: Add policy:check:secret, policy:check:session, and policy:check scripts - .github/workflows/ci.yml: Add checker execution steps after uv sync in python-test job - docs/dev/session-recording-policy.md: Update CI row from "未実装" to "実装済み | #324" Co-Authored-By: Claude Haiku 4.5 <[email protected]>
squne121
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Mergeability
- mergeable: MERGEABLE
- mergeStateStatus: BEHIND (acceptable per repo policy; rebase happens at merge time)
Evidence Check
- AC Coverage: All AC1-AC4 explicitly marked PASS in PR body with concrete verification results
- Allowed Paths Compliance: All 3 changed files (package.json, .github/workflows/ci.yml, docs/dev/session-recording-policy.md) are within contract Allowed Paths
- CI Verification: All 5 CI checks pass (typecheck, lint, test, build, python-test)
- Verification Commands: PR body documents all AC outcomes with PASS status
Evidence Summary
- ✓ AC1 (policy:check script): package.json includes all 3 scripts with uv run python integration
- ✓ AC2 (CI workflow): ci.yml now includes both check_secret_policy.py and check_session_recording_policy.py steps
- ✓ AC3 (Docs table): session-recording-policy.md CI row updated to "実装済み | #324"
- ✓ AC4 (Standard commands): typecheck, lint, test, build all PASS
- ✓ Scope containment: No scope creep detected; changes align with issue contract exactly
- ✓ Issue linkage: PR body explicitly closes #324 and documents #245 pilot gate limitation correctly
Blockers
- None
LOOP_VERDICT
verdict: APPROVE
blockers: []
mergeable: MERGEABLE
mergeStateStatus: BEHIND
reviewed_head_sha: 622e86c2ba357afea9989f29e1a6ada0c6aae418
follow_up_issue_requests: []Self-authored PR reviewed per skill procedure (comment-only per GitHub constraints).
Verdict: REQUEST_CHANGESPR #355 の実装方針自体は概ね妥当です。 ただし、 Blocker 1: 運用導線テーブルが既存の関連PR状態と矛盾しているPR #355 は CI 行だけを | Claude hook(Stop/SubagentStop での自動実行)| 未実装 | 専用 Issue で別途起票 |
| Skill(操作手順の標準化・自動発火)| 未実装 | 専用 Issue で別途起票 |
| 人間導入手順書(onboarding)| 未実装 | Issue #245 |しかし関連 Issue / PR の現状はこうです。 #325 と #326 はすでに起票済みなので、「専用 Issue で別途起票」は誤りです。#325 は Claude hook guard、#326 は session-recording-policy skill の実装 Issue として open です。 さらに #245 は closed / completed で、PR #347 も merged 済みです。PR #347 は「導入手順書の整備完了」を明記しており、 修正案
| 導線 | 状態 | 担当 Issue |
|---|---|---|
| CI 連動(`pnpm policy:check` / python-test workflow)| 実装済み | #324 |
| Claude hook(Stop/SubagentStop での自動実行)| 未実装 | #325 |
| Skill(操作手順の標準化・自動発火)| 未実装 | #326 |
| 人間導入手順書(onboarding)| 実装済み | #245 |
| pilot smoke test(Kill Switch 動作確認)| 未実装 | Issue #246 |この変更は Allowed Paths の Blocker 2:
|
… review - Update Claude hook row to reference #325 (open) - Update Skill row to reference #326 (open) - Mark onboarding row 実装済み | #245 (closed via #347) - Replace warning to list actual remaining pilot gates instead of stale #245 - Update related links section: #245 now marked completed, #246 kept as plan Scope expansion note: 警告文 update is outside strict "運用導線テーブル更新のみ" Allowed Path qualifier, but applied per reviewer REQUEST_CHANGES (SSOT consistency within same section). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Iteration 1 fix appliedPer your REQUEST_CHANGES at #355 (comment), I've applied the following corrections to Changes made:Fix A (Table rows 316-320):
Fix B (Warning text 322-325):
Fix C (Related links 341-342):
Verification (all PASS):
Commit: abbc61a (main) Ready for review. |
… review - Update Claude hook row to reference #325 (open) - Update Skill row to reference #326 (open) - Mark onboarding row 実装済み | #245 (closed via #347) - Replace warning to list actual remaining pilot gates instead of stale #245 - Update related links section: #245 now marked completed, #246 kept as plan Scope expansion note: 警告文 update is outside strict "運用導線テーブル更新のみ" Allowed Path qualifier, but applied per reviewer REQUEST_CHANGES (SSOT consistency within same section). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
iter1 fix 適用 + main 汚染インシデントの recovery 報告適用済み (PR branch e2b1aaa)reviewer の REQUEST_CHANGES (#issuecomment-4527724571) の blocker を反映:
非 blocker (uv --locked / pnpm run 明示) は scope tight 維持のため本 PR では未対応。必要なら別 Issue。 Verification (worktree e2b1aaa)
Main 汚染インシデントの recoveryiter1 fix を実装した implementation-worker (Haiku) が 誤って main に直接 push しました。詳細:
マージ手順
(本コメントは Opus が最終確認の上投稿しています) |
判定: REQUEST_CHANGESPR #355 の目的である ただし、policy checker を CI gate として扱うなら、Python 依存解決を Blocker: CI の
|
Reviewer (#issuecomment-4527805560) flagged that policy-checker CI gate should be fail-closed on lockfile drift. Switching `uv sync` and all `uv run` invocations in the python-test job to `--locked` ensures CI errors when uv.lock is out of date instead of silently updating. Scope: .github/workflows/ci.yml python-test job only (within Allowed Paths). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
iter2 fix 適用報告 (uv --locked)Blocker 反映: CI uv --locked 化 → 対応済み (commit d481e60)
- run: uv sync --locked --group dev
- run: uv run --locked python .claude/scripts/check_secret_policy.py docs/dev/secret-policy.md
- run: uv run --locked python .claude/scripts/check_session_recording_policy.py docs/dev/session-recording-policy.md
- run: uv run --locked pytest .claude/skills/gemini-cli-headless-delegation/tests/test_model_routing.py .claude/skills/edit-issue/tests/test_guard_issue_body.py
- run: uv run --locked pytest .claude/skills/create-issue/tests/
- run: uv run --locked pytest .claude/skills/ssot-discovery/tests/test_match_ssot_registry.py -qpolicy consistency CI gate を fail-closed 化(uv.lock drift 時に CI red)。Allowed Paths ( Non-blocking (
|
判定: REQUEST_CHANGESPR #355 の主目的、つまり ただし、現時点で マージ前に潰すべきリスクがまだあります。 Blocker 1: 変更3ファイルすべてに hidden / bidirectional Unicode 警告が出ているGitHub の Files changed 画面で、 マージ前に最低限これを実行し、制御文字・bidi制御文字がゼロであることをPRコメントに貼ってください。 python - <<'PY'
from pathlib import Path
import unicodedata
targets = [
".github/workflows/ci.yml",
"docs/dev/session-recording-policy.md",
"package.json",
]
bad_bidi = {
"RLO", "LRO", "RLE", "LRE", "PDF",
"RLI", "LRI", "FSI", "PDI",
}
found = False
for path in targets:
text = Path(path).read_text(encoding="utf-8")
for line_no, line in enumerate(text.splitlines(keepends=True), 1):
for col_no, ch in enumerate(line, 1):
cat = unicodedata.category(ch)
bidi = unicodedata.bidirectional(ch)
is_bad_control = (cat in {"Cf", "Cc"} and ch not in "\n\r\t")
is_bad_bidi = bidi in bad_bidi
if is_bad_control or is_bad_bidi:
found = True
name = unicodedata.name(ch, "UNKNOWN")
print(f"{path}:{line_no}:{col_no}: U+{ord(ch):04X} {name} category={cat} bidi={bidi}")
if found:
raise SystemExit(1)
print("PASS: no hidden/bidi control characters in reviewed files")
PY
git diff --checkこの警告が実体のない GitHub 表示ノイズなら、上記の Blocker 2:
|
…eview Aligns local verification path with CI gate. Reviewer (#issuecomment-4527828986) noted asymmetry: CI uses uv run --locked but local pnpm policy:check used plain uv run. AC1 (pnpm policy:check) is a local verification path that should also fail-closed on lockfile drift. Also switch composite script to explicit `pnpm run` form for clarity. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
iter3 fix 適用報告 (#issuecomment-4527828986)Blocker 1: hidden/bidi Unicode 警告 → クリア証跡
GitHub 表示警告は実体のないノイズ。Cf/Cc 制御文字・bidi override (RLO/LRO/RLE/LRE/PDF/RLI/LRI/FSI/PDI) いずれも 0 件。 Blocker 2: local
|
* docs(#359): record main branch protection / ruleset hardening main 直接 push を GitHub remote 側で拒否する保護設定を ruleset 一次・branch protection 二次の多層構成で導入し、設定 snapshot と検証手順を docs/ops/branch-protection.md に記録する。 - Ruleset `main-direct-push-protection` (id 16796903) を active で作成(bypass_actors: []) - Branch protection に `python-test` を追加し `enforce_admins: true` に更新 - `git push origin HEAD:main` が `GH013` で remote rejected されることを実測 Closes #359 Refs #358 #355 #360 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(#359): address PR #362 review blockers — add raw snapshots + source pinning + Stop Condition Blocker 対応: - Blocker 1: ruleset / branch protection の raw JSON snapshot を fenced code block で追加(監査正本) - Blocker 2: `bypass_pull_request_allowances` 取得結果(field_absent / 個人 repo 構造上不在)を明示 - Blocker 3: `required_status_checks.checks[].app_id: 15368` で GitHub Actions に source 固定済みであることを明記 - Blocker 4: AC6 検証コマンドに `HEAD:main` 契約準拠形式 (A form) を追加、既存 commit-tree 形式は B form として併記、想定外 push 成功時の Stop Condition を追記 - Blocker 5: `required_approving_review_count: 0` を意図的選択として明示、承認件数引き上げは別 Issue 対象であることを記録 AC マッピング表も raw snapshot / bypass field / source pinning の根拠を反映して更新。 Refs #359 #362 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Integrate
check_session_recording_policy.pyandcheck_secret_policy.pyinto local development and CI workflows.pnpm policy:checknpm script for local verification (uv run --locked)python-testjob to enforce policy consistency on every PR (uv sync --locked/uv run --locked)docs/dev/session-recording-policy.mdCloses #324
Implementation Details
package.json: Added three scripts (all pinned to
uv run --lockedper review):policy:check:secret: Run check_secret_policy.pypolicy:check:session: Run check_session_recording_policy.pypolicy:check:pnpm run policy:check:secret && pnpm run policy:check:session.github/workflows/ci.yml (python-test job only): Added checker steps and pinned all
uvinvocations to--locked:uv sync --locked --group devuv run --locked python .claude/scripts/check_secret_policy.py docs/dev/secret-policy.mduv run --locked python .claude/scripts/check_session_recording_policy.py docs/dev/session-recording-policy.mduv run --locked pytest ...for consistencydocs/dev/session-recording-policy.md: See Scope Delta below.
Scope Delta
Issue #324 の Allowed Paths は
docs/dev/session-recording-policy.mdの 「運用導線テーブル更新のみ」 だったが、レビューで SSOT 不整合が確認されたため、同一セクション内の warning 段落と末尾の related links を最小限更新した。理由:
スコープ拡張範囲は同一
## 運用導線セクション内で SSOT consistency を保つ最小限。Allowed Paths のファイル自体は逸脱なし(3 ファイルすべて契約内)。Verification Results (PR head d5622fc)
uv run --locked整合): PASSuv --locked統一): PASS#324): PASSUnicode / bidi 安全性確認
reviewer 指摘 (#issuecomment-4527828986 Blocker 1) のため
.github/workflows/ci.yml/docs/dev/session-recording-policy.md/package.jsonを Cf/Cc/bidi 制御文字でスキャン:Note on #245 Pilot Gate
This issue satisfies only the policy checker CI execution path.
It does not satisfy #245 pilot start gate by itself. Pilot remains prohibited until the following are implemented and merged:
Incident follow-up
iter1 で発生した main 直接 push インシデント (commit
abbc61a) は revert PR #358 で復旧済み。再発防止 follow-up:🤖 Generated with Claude Code