Skip to content

feat(cli-push-runner): LINT_SCREEN_ENABLED env var override (順位 115)#147

Merged
aloekun merged 1 commit into
masterfrom
env-override-115
May 12, 2026
Merged

feat(cli-push-runner): LINT_SCREEN_ENABLED env var override (順位 115)#147
aloekun merged 1 commit into
masterfrom
env-override-115

Conversation

@aloekun
Copy link
Copy Markdown
Owner

@aloekun aloekun commented May 12, 2026

Summary

Phase D D-1 (PR #145) で systemic に発見した workflow gap (jj auto-snapshot vs session-only opt-in) を解消する LINT_SCREEN_ENABLED env var overridecli-push-runner に追加する。D-3 (順位 102、paths filter 実装) 着手前 critical path。post-merge-feedback Tier 1 #1 で再 validate された Tier 1 priority。

実装 (src/cli-push-runner/src/config.rs)

  • ENV_LINT_SCREEN_ENABLED const = "LINT_SCREEN_ENABLED"
  • parse_lint_screen_env() pure function: env raw value → LintScreenEnvOverride enum
    • true / 1 / yes / on (case-insensitive、空白 trim) → ForceEnable
    • false / 0 / no / off / "" / unset → RespectToml (no-op)
    • その他 → InvalidValue (warning emit + 安全側で TOML 値尊重)
  • apply_lint_screen_env_override() side-effect: env を TOML override に適用
    • ForceEnable + [lint_screen] section absent → default LintScreenConfig を生成 (enabled=true)
    • ForceEnable + section present → enabled = true で上書き
    • RespectToml → no-op (片方向設計、誤って commit しても remote PR は default OFF)
  • load_config() で TOML parse 後・validate 前に apply_lint_screen_env_override 呼出

設計の本質: 片方向設計

env var は force enable のみ で force disable は無し:

  • LINT_SCREEN_ENABLED=true で session opt-in、unset で TOML default (= OFF) に自然復帰
  • 誤って env を commit しても remote PR は config 上 OFF のまま (= dogfood は走らない)
  • Phase D guide §1 の「local enable / remote disable」が構造的に成立
  • ADR-039 試験運用標準パターン (config opt-in + kill-switch + bounded lifetime) と整合

unit test 10 件

  • parse_lint_screen_env_* (4 件、enum variant 網羅): unset / ForceEnable variants / RespectToml variants / InvalidValue
  • apply_env_override_* (6 件、副作用検証): absent section + force enable creates default / overwrites toml false / respect toml keeps toml true / respect toml keeps toml false / unset keeps absent / invalid value respects toml

docs

  • docs/local-llm-offload-phase-d-guide.md §1 Setup を env var ベースに rewrite
    • PowerShell example: $env:LINT_SCREEN_ENABLED = "true" / Remove-Item env:LINT_SCREEN_ENABLED
    • Bash example: export / unset
    • 片方向設計の意義 + ADR-039 整合性
  • docs/local-llm-offload-analysis.md Phase D section を順位 115 land 反映 (D-3 unblock、D-1/D-2 副産物 list 整理)
  • docs/todo8.md / docs/todo-summary.md から順位 115 entry を削除

diff stat

ファイル 行数
src/cli-push-runner/src/config.rs (impl + 10 tests) +237
docs/local-llm-offload-phase-d-guide.md (§1 rewrite) +18 / -12
docs/local-llm-offload-analysis.md (Phase D section 更新) +14 / -11
docs/todo-summary.md (順位 115 行削除) -1
docs/todo8.md (順位 115 entry 削除) -32
合計 5 files, +268 / -57 ≒ 325 line changes

Test plan

  • cargo test -p cli-push-runner (67 tests pass、新規 10 + 既存 57、ZERO regression)
  • markdownlint (0 error) — Phase D guide / analysis.md / todo-summary.md / todo8.md
  • takt pre-push-review APPROVE (2 iterations、reviewer の visibility 指摘 1 件を fix で解消後 2 回目 APPROVE)
  • CodeRabbit review (PR 作成後の自動 trigger)
  • D-3 で env var override workflow を実証 ($env:LINT_SCREEN_ENABLED = "true" → pnpm push → lint_screen 実行確認 → unset で TOML 復帰確認)

関連

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • 新機能

    • Phase D dogfood のセットアップが環境変数 LINT_SCREEN_ENABLED による設定に対応しました。TOML ファイルの手動編集が不要になり、より安全で簡便な操作フローに変更されました。
  • ドキュメント

    • セットアップ手順書を更新し、Windows PowerShell と Bash/WSL での環境変数の有効化・無効化方法を追加しました。
    • Phase D の計画と進捗情報を最新化しました。

Review Change Stack

…hase D D-1 workflow gap 解消)

Phase D D-1 (PR #145) 着手時に発見した workflow gap (jj auto-snapshot vs session-only opt-in) を
解消する env var override 経路を cli-push-runner に追加する。post-merge-feedback Tier 1 #1 で再
validate された Tier 1 priority。D-3 (順位 102) 着手前の critical path。

順位 115 (PR #145 post-merge-feedback Tier 1 #1):

実装 (config.rs):
  - ENV_LINT_SCREEN_ENABLED const = "LINT_SCREEN_ENABLED"
  - parse_lint_screen_env() pure function: env raw value → LintScreenEnvOverride enum
    * true / 1 / yes / on (case-insensitive、空白 trim) → ForceEnable
    * false / 0 / no / off / "" / unset → RespectToml (no-op)
    * その他 → InvalidValue (warning emit + 安全側で TOML 値尊重)
  - apply_lint_screen_env_override() side-effect: env をTOML override に適用
    * ForceEnable + [lint_screen] section absent → default LintScreenConfig 生成 (enabled=true)
    * ForceEnable + section present → enabled = true で上書き
    * RespectToml → no-op (片方向設計、誤って commit しても remote PR は default OFF)
  - load_config() で TOML parse 後・validate 前に apply_lint_screen_env_override 呼出

unit test 10 件追加:
  - parse_lint_screen_env_unset_yields_respect_toml
  - parse_lint_screen_env_force_enable_variants (8 variants)
  - parse_lint_screen_env_respect_toml_variants (8 variants)
  - parse_lint_screen_env_invalid_value (5 variants)
  - apply_env_override_force_enable_on_absent_section_creates_lint_screen_config
  - apply_env_override_force_enable_overwrites_toml_false
  - apply_env_override_respect_toml_keeps_toml_enabled_true
  - apply_env_override_respect_toml_keeps_toml_enabled_false
  - apply_env_override_unset_keeps_toml_section_absent
  - apply_env_override_invalid_value_respects_toml

docs:
  - Phase D guide §1 Setup を env var ベースに rewrite (旧 'config 編集' 記述を削除)
    * PowerShell example: $env:LINT_SCREEN_ENABLED = "true" / Remove-Item env:LINT_SCREEN_ENABLED
    * 片方向設計の意義 + ADR-039 試験運用標準パターンとの整合
  - analysis.md Phase D section を順位 115 land 反映に更新 (D-3 unblock、D-1/D-2 副産物 list 整理)
  - todo8.md / todo-summary.md から順位 115 entry 削除

cargo test pass: cli-push-runner 67 tests (新規 10 + 既存 57、ZERO regression)。

Phase D 進行: D-1 ✅ / D-2 ✅ / 順位 115 ✅ / D-3 ⏳ (env var workflow で初の実 dogfood)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23e66650-3249-4f19-8632-28d0ff028a7e

📥 Commits

Reviewing files that changed from the base of the PR and between f3b6e21 and 337ffa2.

📒 Files selected for processing (5)
  • docs/local-llm-offload-analysis.md
  • docs/local-llm-offload-phase-d-guide.md
  • docs/todo-summary.md
  • docs/todo8.md
  • src/cli-push-runner/src/config.rs
💤 Files with no reviewable changes (2)
  • docs/todo8.md
  • docs/todo-summary.md

📝 Walkthrough

Walkthrough

このPRは、LINT_SCREEN_ENABLED 環境変数によるlint_screen設定のセッション限定オーバーライド機能を cli-push-runner に実装し、TOML編集ベースから環境変数ベースの設定管理へ移行を完了したもの。ドキュメントとバックログを更新して、このタスク(優先度115)の完了を記録している。

Changes

LINT_SCREEN_ENABLED環境変数オーバーライド機能と関連ドキュメント

Layer / File(s) Summary
環境変数オーバーライド実装とテスト
src/cli-push-runner/src/config.rs
load_config() がLINT_SCREEN_ENABLED環境変数を読み込み、受容値ルール(true/1/yes/onで強制有効化、false/0/no/off/未設定で既存設定尊重、その他で警告)に従ってconfig.lint_screenを上書き。内部パーサー、オーバーライド適用ロジック、TOML未存在時の既定構成生成を実装。解析・適用・組み合わせの全パターンをカバーする単体テスト(+139行)を追加。
フェーズDセットアップガイドの手順更新
docs/local-llm-offload-phase-d-guide.md
TOML手動編集からセッション環境変数オーバーライドへ方針転換。LINT_SCREEN_ENABLED設定値解釈ルールと受容値を明示し、Windows PowerShellおよびBash/WSL環境での有効化・無効化手順を併記。誤コミット事故防止、即時キルスイッチ適用、他プロジェクト影響回避の運用上の利点を整理(+19行/-11行)。
フェーズD進捗記録とバックログ整理
docs/local-llm-offload-analysis.md, docs/todo-summary.md, docs/todo8.md
Phase D前提整備完了後の計画セクションを、D-1/D-2完了・優先度115進行・D-3次着手の最新状況に更新。D-1/D-2では実dogfoodが成立しない前提を明確化し、副産物(優先度115バックログ登録、ADR-040不整合修正など)を記録。推奨実行順序テーブルと現在進行中タスク一覧から優先度115を削除。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、変更内容の主要な目的(cli-push-runner に LINT_SCREEN_ENABLED 環境変数による override 機能を追加)を正確かつ簡潔に表現しており、コミット履歴を確認する開発者が主な変更を理解できます。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aloekun aloekun merged commit fbe6a18 into master May 12, 2026
1 check passed
@aloekun aloekun deleted the env-override-115 branch May 12, 2026 11:29
aloekun added a commit that referenced this pull request May 12, 2026
…hase D D-3)

PR #140 post-merge-feedback Tier 1 #2 採用。lint runner に glob ベースの paths filter
を追加し、path-sensitive な lint rule を explicit filter で表現可能にする。

実装 (src/hooks-post-tool-linter/src/main.rs + Cargo.toml):
  - globset = 0.4 を依存追加 (BurntSushi 製、ripgrep の依存と同じ)
  - CustomRule::paths: Option<Vec<String>> field 追加 (optional、既存 rule に影響なし)
  - CompiledRule に paths_glob: Option<GlobSet> を cache (lint 実行時の repeated compile を回避)
  - compile_paths_glob() helper: None / Some(empty) → None (filter なし)、glob valid → Some(GlobSet)、invalid → Err (rule drop)
  - rule_matches_path() helper: paths_glob None なら全 path 受容、Some なら GlobSet match で判定
  - Windows-style backslash path も  に normalize して match
  - run_custom_rules で extensions × paths を AND 結合 (両方マッチで rule 対象)
  - 関数長 50 行制限維持のため build_violation_json / collect_violations_for_rule に切り出し
  - CustomRule doc comment の planned: paths → supported: paths に更新

unit test 7 件追加:
  - paths_filter_none_accepts_any_path
  - paths_filter_empty_vec_accepts_any_path
  - paths_filter_recursive_glob_matches_docs_only
  - paths_filter_normalizes_windows_separators
  - paths_filter_multiple_globs_or_semantics
  - paths_filter_invalid_glob_drops_rule
  - run_custom_rules_extensions_and_paths_are_anded (AND 結合 E2E)

意図的保留 (順位 118 として todo 化):
  - rule⑧ への paths = ["docs/**/*.md"] migration は当初計画していたが、D-2 (順位 101)
    で追加した root-level MD (CLAUDE.md / README.md) からの ../docs/ fire 挙動が
    scope narrow で壊れるため保留。trade-off 検討は別 PR に分離。

cargo test pass: hooks-post-tool-linter 102 tests (新規 7 + 既存 95、ZERO regression)。

Phase D D-3: 順位 115 (PR #147) land 後の **初の real lint_screen dogfood**。
LINT_SCREEN_ENABLED=true 経路で push pipeline 経由 lint_screen を実行し、metrics
(screen_decision / findings / fallback_reason / Diagnostic section / latency) を観測。
aloekun added a commit that referenced this pull request May 12, 2026
…hase D D-3) (#148)

PR #140 post-merge-feedback Tier 1 #2 採用。lint runner に glob ベースの paths filter
を追加し、path-sensitive な lint rule を explicit filter で表現可能にする。

実装 (src/hooks-post-tool-linter/src/main.rs + Cargo.toml):
  - globset = 0.4 を依存追加 (BurntSushi 製、ripgrep の依存と同じ)
  - CustomRule::paths: Option<Vec<String>> field 追加 (optional、既存 rule に影響なし)
  - CompiledRule に paths_glob: Option<GlobSet> を cache (lint 実行時の repeated compile を回避)
  - compile_paths_glob() helper: None / Some(empty) → None (filter なし)、glob valid → Some(GlobSet)、invalid → Err (rule drop)
  - rule_matches_path() helper: paths_glob None なら全 path 受容、Some なら GlobSet match で判定
  - Windows-style backslash path も  に normalize して match
  - run_custom_rules で extensions × paths を AND 結合 (両方マッチで rule 対象)
  - 関数長 50 行制限維持のため build_violation_json / collect_violations_for_rule に切り出し
  - CustomRule doc comment の planned: paths → supported: paths に更新

unit test 7 件追加:
  - paths_filter_none_accepts_any_path
  - paths_filter_empty_vec_accepts_any_path
  - paths_filter_recursive_glob_matches_docs_only
  - paths_filter_normalizes_windows_separators
  - paths_filter_multiple_globs_or_semantics
  - paths_filter_invalid_glob_drops_rule
  - run_custom_rules_extensions_and_paths_are_anded (AND 結合 E2E)

意図的保留 (順位 118 として todo 化):
  - rule⑧ への paths = ["docs/**/*.md"] migration は当初計画していたが、D-2 (順位 101)
    で追加した root-level MD (CLAUDE.md / README.md) からの ../docs/ fire 挙動が
    scope narrow で壊れるため保留。trade-off 検討は別 PR に分離。

cargo test pass: hooks-post-tool-linter 102 tests (新規 7 + 既存 95、ZERO regression)。

Phase D D-3: 順位 115 (PR #147) land 後の **初の real lint_screen dogfood**。
LINT_SCREEN_ENABLED=true 経路で push pipeline 経由 lint_screen を実行し、metrics
(screen_decision / findings / fallback_reason / Diagnostic section / latency) を観測。
aloekun added a commit that referenced this pull request May 12, 2026
…D 完遂状況反映 (#149)

PR #148 (D-3 = paths filter + 初 real lint_screen dogfood) merge 後の post-merge-feedback で
採用された Tier 2-1 を todo 系列に登録 + analysis.md の Phase D section を完遂状況に更新。

順位 119 (PR #148 T2-#1 採用、Tier 2 / Effort S):
  - MAX_CUSTOM_VIOLATIONS outer/inner loop break scope を explicit test で seal
  - PR #148 で発見した bug fix (inner break が outer に伝播しない問題) を test net で保護
  - takt reviewer が 'Behavioral change: improvement' と評価した動作を regression 防止

analysis.md Phase D section 更新:
  - 見出し: '🔄 進行中' → '✅ 計画完遂 2026-05-12'
  - PR 構成 table: 順位 115 (PR #147) / D-3 (PR #148) を land 済に更新
  - D-3 dogfood outcome table (7 metrics) を新規追加 = screen_decision auto_fix /
    findings 1 (false positive) / fallback_reason なし / Diagnostic 不在 / latency 推定
    80-120s / kill-switch 0% (基準内)
  - D-3 観測の意義 5 項目 (env override 実証 / num_ctx 32768 容量実証 / advisory
    consumption 成立 / Phase b' agreement 整合 / 順位 118/119 副産物)
  - Phase E 判定材料 (✅ 4 / ⚠️ 1 / ⏳ 1) と着手前提 (3-5 PR 累積、D-3 で 1/N 取得済) を追記

Phase E (採否判定 + retirement) は別セッションで実施予定 (本 PR は計画完遂 land のみ)。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant