Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/adr/adr-039-experimental-feature-standard-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- crate / module の物理削除は **dogfood 失敗判定後にまとめて実施**。途中段階での部分削除は機械的損傷の risk が高い
- ADR-038 §10.6 の C 案 (採用 / 簡易版 / 完全版の階層化) が良いテンプレ
- kill-switch 経路の table を ADR / PR body に必ず含める (項目: 起動経路 / 停止コマンド / 影響範囲)
- **診断メッセージは実装の受理値を網羅する**: kill-switch 発動時 (SKIP / 停止) の診断メッセージは、判定関数 (`is_*_value` 等) が受理する全 value variant を反映する。判定ロジックが複数値 (`1` / `true` / `TRUE` / `True` 等) を受理するのに固定文字列 (例: `"{}=1 detected"`) で 1 値のみ表記すると spec-impl drift となり、user が受理値を誤解する診断 UX 低下を招く。(a) 全受理値を列挙 (例: `"{}=1 (or =true) detected"`) するか、(b) 実際の env var 値を動的取得して表示 (例: `format!("{}={} detected", env_name, raw_value)`) のいずれかを採用する。本 ADR はテンプレートとして参照されるため、原則の欠落は全 experimental feature に波及する (PR #179 で `CLI_DOCS_LINT_DISABLE` の kill-switch message が `=1` 固定で実受理値 `true` / `TRUE` / `True` を反映しなかった spec-impl drift を pre-push simplicity reviewer が指摘した実例)

### 3. Bounded lifetime (試験期限と採否判定基準)

Expand All @@ -79,6 +80,22 @@ decision trigger は **config (TOML コメント) / code comment (module doc) /

既存試験運用 ADR (014/023/025/029/030/031/033/034/036/037/038) の bounded lifetime 記述に formless な箇所があれば、後続 PR で個別に追補する。

### 新規 experimental feature 追加時の self-review checklist

新規 experimental feature を追加する PR では、push 前 self-review で以下 4 点の整合を **mechanical に** 確認する。各点は discretionary 判断を含まず、config / code / docs / test の差分を機械的に照合できる:

1. **config schema**: 該当 hook / module の config struct (例: `WeeklyReviewReminderConfig`) が `enabled: Option<bool>` field を持つ
2. **feature flag default OFF**: 該当 config の `enabled` の default が **OFF** (= `unwrap_or(false)`) になっている。`unwrap_or(true)` は § 決定 1 (Config opt-in) 違反
3. **docs / config example**: `.claude/hooks-config.toml` 等の repo config example で `enabled = false` を明示し、enable 時の挙動をコメントで添える (= opt-in 運用 guidance)
4. **test coverage**: `enabled = false` (disabled state) の test case があり、feature が完全 skip されることを assert する (= kill-switch が機能することの regression gate)

実例 (PR #184 CR Major M-2 = `weekly_review_reminder` の `enabled = true` が opt-in 契約違反として CR re-review で検出された事例):

- **NG** (fix 前): `enabled = true` で (2) と (3) が違反、CR Major finding で検出
- **OK** (fix 後): `WeeklyReviewReminderConfig::enabled` Option + `unwrap_or(false)` + `.claude/hooks-config.toml` で `enabled = false` + `compute_weekly_review_reminder_nudge_returns_none_when_disabled` test

本 checklist は **新規 feature 追加時** の self-review 手順であり、既存 grandfathered case (例: `[session_start.staleness]` の pre-existing な `enabled = true`) の retro-cleanup は scope 外 (別 PR で個別判断)。

## 帰結

### 利点
Expand Down
2 changes: 0 additions & 2 deletions docs/claude-code-web-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
| 120 | T3 | `takt-workflow-persona-without-model` rule コメント拡張(field 拡張手順 4-5 行)+ ADR-007 case study 追記(enumeration-based 正規表現層、Rust regex lookahead 非対応の pragmatic 対処)(PR #150 T1-#1、実体 Tier 3) | [.claude/custom-lint-rules.toml](../.claude/custom-lint-rules.toml) ルール⑨ + [docs/adr/adr-007-custom-linter-layer-boundary.md](adr/adr-007-custom-linter-layer-boundary.md) | XS |
| 127 | T3 | extensions 拡張時の test 追加 pattern を Rust ソース内コメントで明文化 (PR #151 T3-#2、順位 124 と同 PR 推奨) | Rust ソース内コメント(test location を正確に参照) | XS |
| 134 | T3 | ADR-035 に docs-only PR 評価の適用外基準リスト追加(mutation / error handling / DRY / YAGNI / function length / test coverage / magic-number 等)(PR #156 T3 #2) | [docs/adr/adr-035-doc-evaluation-policy.md](adr/adr-035-doc-evaluation-policy.md) | S |
| 164 | T3 | ADR-039 kill-switch standard pattern に「診断メッセージは実装の受理値を網羅」原則追記(`CLI_DOCS_LINT_DISABLE` の `=1` 固定 vs 実受理値 `true`/`TRUE`/`True` の spec-impl drift 由来、PR #179 T3-#1)※順位 174 と同 PR 推奨(同一 ADR-039 編集) | [docs/adr/adr-039-experimental-feature-standard-pattern.md](adr/adr-039-experimental-feature-standard-pattern.md) | XS |
| 174 | T3 | ADR-039 experimental feature lifecycle checklist 拡張 — 新規 feature 追加時の 4 点整合確認(config schema ↔ feature flag default OFF ↔ docs/config example ↔ test coverage、PR #184 T3-#2)※順位 164 と同 PR 推奨(同一 ADR-039 編集) | [docs/adr/adr-039-experimental-feature-standard-pattern.md](adr/adr-039-experimental-feature-standard-pattern.md) | S |

### 着手フロー

Expand Down
2 changes: 0 additions & 2 deletions docs/todo-summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
| 161 | 🔧 Tier 2 | **Subprocess timeout+kill lifecycle 検証テスト追加 (PR #177 T2-#1 採用)** | todo9.md | M | なし (PR #177 Major #2 「jj kill on timeout 漏れ」fix の回帰テスト、`Child::is_finished` で 2 hook の `run_jj_with_timeout` lifecycle 検証、Severity High + Frequency Medium、ADR-024 shared lib 統合候補との関係明示) |
| 162 | 🔧 Tier 2 | **fail-closed error path (Option::None) 個別テスト追加 (PR #177 T2-#2 採用)** | todo9.md | S | なし (PR #177 Major #1 「`behind.unwrap_or(0)` fail-closed 漏れ」fix の回帰テスト、`check_todo_staleness` / `build_todo_staleness_message` の None ケース独立検証、Severity High + Frequency Medium、security gate + Option return pattern の reference) |
| 163 | 🔧 Tier 2 | **Cross-ref edge case test coverage 追加 — percent-encode / GFM heading slug / relative path normalize (PR #179 T2-#1 採用)** | todo9.md | S | なし (PR #179 で cli-docs-lint の cross_ref validator を新規実装したが、percent-encode (`%20` / `%23`) / heading slug / `../` resolve の edge case が fixture テストで明示的に保護されていない silent regression リスク回避) |
| 164 | 💎 Tier 3 | **ADR-039 kill-switch standard pattern に「診断メッセージは実装の受理値を網羅」原則追記 (PR #179 T3-#1 採用)** | todo9.md | XS | なし (PR #179 で `CLI_DOCS_LINT_DISABLE` の kill-switch message が `=1` 固定で実受理値 `true`/`TRUE`/`True` を反映しなかった spec-impl drift、ADR-039 は全 experimental feature の標準参照のため systemic reach、`docs/adr/adr-039-*.md` 編集) |
| 165 | 🔧 Tier 2 | **`pnpm create-pr` PR body truncation 回避を検証する e2e/integration test 追加 (PR #181 T2-#1 採用)** | todo9.md | S | なし (PR #134 + #181 の 2 回観測で Medium frequency に昇格、memory `feedback_pnpm_create_pr_body` の `--body-file` workaround を自動 regression gate 化、shell argument truncation の境界 (行数/バイト数) を fixture で測定、silent UX 劣化の早期検出、cli-pr-monitor の argv 組み立て層を test 対象、順位 166 と相補 = test 層 vs docs 層) |
| 167 | 🚀 Tier 1 | **`check-ci-coderabbit` の `RATE_LIMIT_MARKER` を新フォーマット対応に更新 (PR #182 T1-#1 採用) ★ Bundle CR-RL** | todo9.md | M | なし (`src/check-ci-coderabbit/src/main.rs:251` 旧 marker `Rate limit exceeded` 固定 → multi-variant array `["Rate limit exceeded", "rate limited by coderabbit.ai"]` に変更、現行 CR は HTML マーカー + `## Review limit reached` フォーマットを使用、PR #182 で 30+ 分 polling 観測の root cause、`RateLimitOutcome::Parked` 経路 (ADR-018) が silent regression で無効化されている critical bug、順位 168 + 169 と Bundle CR-RL で同 PR land 推奨) |
| 168 | 🔧 Tier 2 | **CR rate-limit detection integration test — 新旧両フォーマット対応 fixture 追加 (PR #182 T2-#1 採用) ★ Bundle CR-RL** | todo9.md | S | 順位 167 の marker 配列化と pair、`#[cfg(test)]` に新 format fixture 2-3 variant 追加 (HTML マーカー + `## Review limit reached` の minimum reproduction)、既存 6 fixture (旧 format) は維持して backward compat、silent regression を test で検出可能化 |
Expand All @@ -86,7 +85,6 @@
| 171 | 💎 Tier 3 | **`docs-governance.md` に「Operational reference vs Pointer reference」区別 section を追加 (PR #183 T3-#2 採用) ★ Bundle DG-RULES** | todo9.md | S | 順位 172 と同 PR 推奨、PR #183 A01 修正で実適用した判定ロジック (operational = workflow 動作記述 = 保持可 / pointer = section 名・順位番号参照 = 置換必要) を `~/.claude/rules/common/docs-governance.md` § Cross-File Reference Lifecycle に新 sub-section として codify、ADR-031 lines 79-302 中 line 270 のみが真の pointer だった実例を inline cite、派生プロジェクトへ自動波及、`feedback_global_config_backup` 適用必須 |
| 172 | 💎 Tier 3 | **CR ephemeral artifact Nitpick の統一 skip 基準を memory に codify (PR #183 T3-#3 採用) ★ Bundle DG-RULES** | todo9.md | XS | 順位 171 と同 PR 推奨、CR が `docs/todo*.md` 系 ephemeral artifact 内の行番号参照を Nitpick 指摘した場合は skip 推奨という判断基準を新 memory `feedback_coderabbit_ephemeral_nitpick.md` に codify、既存 memory `feedback_coderabbit_no_actionable_merge_signal` の補完、本リポジトリ専用 (派生プロジェクトには波及しない)、`feedback_global_config_backup` 適用推奨 |
| 173 | 🔧 Tier 2 | **`combine_output` 5 crate 重複を `lib-runner-utils` (or 既存 lib-*) に extract (PR #182 dry-run S01 採用)** | todo9.md | S-M | なし (`src/cli-pr-monitor/src/runner.rs:80-89` の `combine_output` 8 行関数が `#[allow(dead_code)]` 付与で生産未使用、同関数が 4 他 crate (cli-push-runner, cli-push-pipeline, cli-merge-pipeline, hooks-post-tool-linter) にも複製 = 5 crate 横断 systemic duplication、ADR-026 Cargo workspace + ADR-012 lib-* naming で解決、Phase B dogfood の最初の実体ベース finding (A01 と並ぶ)、A01 は PR #183 で fix 済) |
| 174 | 💎 Tier 3 | **ADR-039 experimental feature lifecycle checklist 拡張 — 新規 feature 追加時の 4 点整合確認 (PR #184 T3-#2 採用)** | todo9.md | S | なし (PR #184 CR Major M-2 (`weekly_review_reminder` の `enabled = true` が ADR-039 opt-in 違反) の self-review 捕捉化、`docs/adr/adr-039-experimental-feature-standard-pattern.md` に「新規 feature 追加時の self-review checklist」section を追加、config schema ↔ feature flag default OFF ↔ docs / config example ↔ test coverage の 4 点 mechanical 確認、PR #184 fix 前後を OK/NG 実例として inline cite、T3-1 不採用根拠 (analyzer rubric は推奨で user 判断と完全一致は構造的に困難) との対比で discretionary 部分なしの mechanical checklist のため採用条件成立) |
| 175 | 🚀 Tier 1 | **`cargo clippy` を stop_quality ステップに追加 — Rust lint structural gap 補填 (PR #185 T1-#1 採用)** | todo10.md | S | なし (`.claude/hooks-config.toml` の stop_quality / quality_gate に `cargo clippy --workspace -- -D warnings` step を追加、現状 stop_quality は `pnpm lint` / `pnpm lint:md` / `pnpm test` / `pnpm build` のみで Rust の cargo clippy が完全欠落、PR #185 開発時の `doc_lazy_continuation` clippy error も手動 cargo clippy まで未検出だった structural gap、option A = 直接 cargo clippy / option B = `pnpm lint:rust` 新設の 2 アプローチ、incremental 後は高速で実行コスト許容範囲) |
| 176 | 🔧 Tier 2 | **check-ci-coderabbit format extraction 関数への variant fixture 追加 (PR #185 T2-#4 採用)** | todo10.md | M | なし (順位 167-169 Bundle CR-RL の follow-up、bold-wrapper variant (`**More reviews will be available**`) / 短形態 (secs のみ) / 複数 separator / wait time なし graceful failure の 4 fixture 追加、PR #182 + #185 の 2 PR 連続観測で CR format 多様性 systemic、`extract_old_format_wait_time` / `extract_new_format_wait_time` の coverage gap 補填、regex 拡張 vs fixture 先行の 2 アプローチを着手時判断、analyzer rationale の「Edit 集中 = test gap signal」は incidental で採用根拠から除外、true 採用根拠は format 多様性 + 防御的 variant) |
| 177 | 🚀 Tier 1 | **PostToolUse hook — Edit / Write したファイルのサイズ閾値超過を検出してファイル分割を促す (2026-05-29 ユーザー追加要望)** | todo10.md | S-M | なし (本セッション PR #181-#185 chain で `docs/todo9.md` が 50KB 超 + 1168 行に到達し `docs/todo10.md` split した実体観測ベース、PR #133 (todo.md → todo2.md) / PR #172 (todo8.md → todo9.md) / 本 PR (todo9.md → todo10.md) の 3 PR 観測で systemic、PostToolUse Edit/Write 直後にサイズチェックを mechanical 強制、`.claude/hooks-config.toml` の `[post_tool_use.file_size_check]` で `enabled = false` default OFF (ADR-039 opt-in) + `threshold_bytes` (default 51200 = 50KB) + `paths` glob + `touch_trigger` ratchet を設定可能、配置先は option A = 新 binary `hooks-post-tool-file-size-check` / option B = 既存 `hooks-post-tool-linter` 統合の 2 案を着手時判断、ADR-007 custom-linter layer boundary に位置付け追記) |
Expand Down
Loading