Repository navigation
fix(hooks): run verification tools through the flake dev shell - #132
Conversation
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| return MissingTool(f"{tool} not found on PATH and the project has no flake dev shell") | ||
| if not shutil.which("nix", path=search_path): | ||
| return MissingTool(f"{tool} not found on PATH; the project has a flake dev shell but nix is not on PATH") | ||
| return Launch(("nix", "develop", "--command", "sh", "-c", _PROBE, "sh", *arguments), via_dev_shell=True) |
There was a problem hiding this comment.
P2 The time nix develop spends evaluating and building the flake counts against the check's test budget (300s by default, and less once the gate budget has been partly used). On a cold store, entering the dev shell can take minutes, and then the check is reported as TIMEOUT. TIMEOUT counts as failing, so Stop is blocked with "Verification failed" even though no test ran. That is the same kind of false failure this PR is meant to remove. One option is to build the shell first (e.g. nix develop --command true, or nix print-dev-env) under its own budget and report a timeout there as MISSING_TOOL/unavailable. Another is to tell nix-startup time apart from test time before calling it a test timeout.
There was a problem hiding this comment.
Fixed in ce8e63f. The probe now prints a second marker once sh is running inside the dev shell. If the budget ends before that marker, the result is MISSING_TOOL ("the flake dev shell did not start within the check budget"), not TIMEOUT, so Stop is not blocked. Covered by test_dev_shell_still_building_when_the_budget_ends_is_unavailable_not_a_timeout.
| if any(Status(row["status"]).failing for row in rows): | ||
| return "failed" | ||
| if any(row["status"] == Status.MISSING_TOOL for row in rows): | ||
| return "unavailable" |
There was a problem hiding this comment.
P3 The new unavailable state in current_status (what verification_session.py status reports) has no test. The new tests only cover gate/verify. A status test with a current missing_tool receipt would lock in unavailable, and one with missing_tool next to a failed receipt would lock in failed.
There was a problem hiding this comment.
Fixed in ce8e63f. Added test_status_reports_a_missing_tool_as_unavailable_unless_a_check_failed, which locks unavailable for missing_tool alone or next to passed, and failed when a failed or timeout receipt sits next to it.
|
Review summary (read-only) No blocking findings (0 P0, 0 P1).
Checks that hold up:
|
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| return MissingTool(f"{tool} not found on PATH and the project has no flake dev shell") | ||
| if not shutil.which("nix", path=search_path): | ||
| return MissingTool(f"{tool} not found on PATH; the project has a flake dev shell but nix is not on PATH") | ||
| return Launch(("nix", "develop", "--command", "sh", "-c", _PROBE, "sh", *arguments), via_dev_shell=True) |
There was a problem hiding this comment.
P2: When nix develop itself fails, the check is reported as a failed test and Stop gets blocked. Only the probe's marker plus exit 127 maps to MISSING_TOOL. Any other non-zero exit from nix develop becomes Status.FAILED, and that blocks Stop with "Verification failed", even though no test ever ran. Some cases where this happens:
- The regex match is text-only, so a flake that declares
devShells.aarch64-darwin.defaultpasses the check on an x86_64-linux machine.nix developthen exits 1 with "does not provide attribute devShells.x86_64-linux.default". nix-command/flakesare not enabled.- The flake fails to evaluate.
Separately, the first nix develop run may spend the whole test budget building or downloading the shell, which ends in TIMEOUT and also blocks.
This isn't a regression, since the old FileNotFoundError path also blocked. But it goes against the PR's goal of not judging code when the tool environment is the problem. One fix: add a second probe marker that is printed only once sh starts inside the shell. If that marker is absent, nix never reached the command, so classify the result as MISSING_TOOL/unavailable with the nix error tail. A test for a failing nix develop stub would cover this.
There was a problem hiding this comment.
Fixed in ce8e63f with the second marker you suggested. A nix develop failure (missing attribute for the system, flakes disabled, evaluation error) exits without the marker, so it becomes MISSING_TOOL with the last line of nix output as the reason. One guard: when the retained output tail was truncated, the marker may have been dropped, so the test result stands (test_failure_with_output_past_the_retained_tail_stays_failed). Covered by test_nix_develop_that_fails_before_the_command_is_unavailable_not_a_test_failure.
|
Review summary: 0 blocking findings (P0/P1), 1 P2. The overall flow looks correct:
Receipt identity still picks up PATH and
🤖 Generated with Claude Code |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
||
| def _not_started(self, end: ProcessEnd) -> MissingTool | None: | ||
| if end.timed_out: | ||
| return MissingTool("the flake dev shell did not start within the check budget") |
There was a problem hiding this comment.
P2 — Running out of budget before the dev shell starts is reported as MISSING_TOOL. That status doesn't block Stop, and its receipt is reused.
current_receipt gives each check min(check_budget(), GATE_BUDGET_SECONDS - elapsed), with a floor of 0.01s. If earlier checks in the same Stop use up most of the 540s gate budget, a later dev-shell check gets almost no time. Even a cold-but-healthy nix develop (evaluation or substitution) is then killed before it prints the entered marker. This branch reports that as "did not start within the check budget" → MISSING_TOOL.
What changes compared to the PATH case:
- On PATH, the same budget starvation gives
TIMEOUT, which is failing and blocks Stop. - Here, Stop is not blocked, and the receipt is saved with an unchanged identity. Later Stops return the cached "unavailable" result via
valid_receiptand never retry, until the worktree, PATH or hooks change.
So a temporary condition (an earlier check eating the budget, a cold nix store, a network hiccup during substitution) ends up as a lasting, non-blocking "unavailable". The code is never checked again.
Suggested fixes, any one of:
- Keep a timeout before the marker as
TIMEOUT. - Don't make
MISSING_TOOLreceipts from timeouts or non-zeronix developexits reusable.
Either way, add a test where the check runs with a starved budget.
There was a problem hiding this comment.
Fixed in 043ea56. A timeout before the entered marker stays MISSING_TOOL (so a cold store does not block Stop), but a MISSING_TOOL receipt is no longer reused: VerificationRun.current_receipt reruns it on every verify/Stop pass, so a starved budget or cold nix store cannot become a lasting unavailable. status still shows the saved receipt as unavailable. Covered by test_missing_tool_receipt_is_retried_on_the_next_pass_not_reused.
Review summary1 finding (P2), 0 blocking.
Other parts look correct:
All JS, Go, Rust and pytest runners use bare executable names, so the |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| return MissingTool(f"{tool} not found on PATH and the project has no flake dev shell") | ||
| if not shutil.which("nix", path=search_path): | ||
| return MissingTool(f"{tool} not found on PATH; the project has a flake dev shell but nix is not on PATH") | ||
| entered = ("nix", "develop", "--command", "sh", "-c", _PROBE, "sh", *arguments) |
There was a problem hiding this comment.
P2: nix develop can change the worktree it is checking.
nix develop writes flake.lock when it is missing, or when flake.nix gained an input that the lock doesn't have yet. Then:
verify()takes a newcapture(record.root)after the checks. The lock file is new (untracked files still count toward the digest) or its tracked content changed. Either way the digest differs, so the result is a blockingVerification unresolved · inputs changed during verification; retry required. It is not a real result.- The hook leaves a
flake.lockin the user's worktree that the agent never wrote. It then appears in later changed-path selection.
The verifier should not write to the tree it checks. Passing --no-write-lock-file keeps evaluation read-only (nix uses the in-memory lock), or use --no-update-lock-file if a stale lock should fail instead:
| entered = ("nix", "develop", "--command", "sh", "-c", _PROBE, "sh", *arguments) | |
| entered = ("nix", "develop", "--no-write-lock-file", "--command", "sh", "-c", _PROBE, "sh", *arguments) |
No test covers this. A fake nix that creates flake.lock in its cwd would reproduce it through gate(). Note the fake in test_dev_shell_verification.py asserts arguments[:2] == ["develop", "--command"], so that check would need updating too.
There was a problem hiding this comment.
Fixed in ed59ddd. The dev shell now runs as nix develop --no-write-lock-file --command ..., so a missing or stale flake.lock is resolved in memory and the verified worktree is left untouched. The fake nix in test_dev_shell_verification.py now asserts the flag is passed, which covers every dev-shell test.
Review summary1 finding (P2), nothing blocking.
What I checked and found sound:
The new tests cover the dev shell paths and the gate and status handling well. 🤖 Generated with Claude Code |
Stop ran project test tools from the agent PATH only. A repo whose tools live in its flake dev shell (go in rater) failed every Stop. A tool absent from PATH now runs as nix develop --command when flake.nix declares a dev shell. Timeout, process group, logs and receipts are unchanged. A tool that neither PATH nor a dev shell provides is the new MISSING_TOOL status. It is reported as Verification unavailable, is not a failure, and does not block Stop. Tools found on PATH, such as uv for Python projects, run exactly as before. check_execution.py also gets its docstrings and private helpers. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t its API Only main, dispatch and failure are used outside the module (provider_adapter.py). Every other helper was module-internal, so it is now private instead of documented. main, dispatch and failure get contract docstrings; helpers are ordered after them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A real go on the CI runner satisfied the PATH lookup the tests expect to fail. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A second probe marker shows that nix reached the command inside the dev shell. Without it, a nix develop error or a budget spent building the shell is MISSING_TOOL. A truncated output tail may have dropped the marker, so it keeps the test result. Adds status tests for the unavailable state. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A dev shell that missed the budget once must not stay unavailable for the session. The receipt is kept for status, but verify and Stop no longer reuse it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
nix develop creates or refreshes flake.lock, which changed the verified worktree. The run now passes --no-write-lock-file, and the fake nix asserts the flag. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Also covers status through the public entry point. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ed59ddd to
030d16f
Compare
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| return MissingTool("the flake dev shell did not start within the check budget") | ||
| if end.returncode: | ||
| last_line = next((line for line in reversed(end.output.splitlines()) if line.strip()), "no output") | ||
| return MissingTool(f"the flake dev shell did not start: {last_line.strip()[:_REASON_LIMIT]}") |
There was a problem hiding this comment.
P2 — When nix develop fails before it reaches the probe, the result is always MISSING_TOOL, which doesn't block Stop. That includes a broken flake.nix that the agent itself edited in this session. flake.nix lives in the verified worktree, so this is a change under review, not an outside environment problem.
Scenario: in a repo where go only comes from the dev shell (rater), the agent edits flake.nix and introduces a syntax or evaluation error, and the Go tests would also fail. nix develop exits non-zero without printing the entered marker, so _not_started returns MissingTool. Stop then shows only "Verification unavailable" and lets the session end, even though the code is broken. A deliberate edit to flake.nix gets the same result, so it can also be used to dodge failing tests.
Consider treating a dev-shell startup failure as blocking (or as UNAVAILABLE) when flake.nix or flake.lock is among the changed paths. Keep MISSING_TOOL for timeouts while the shell is still building and for the case where the shell starts but lacks the tool.
There was a problem hiding this comment.
Fixed in f9da52b. A project that declares a dev shell is now expected to enter it: when nix exits before the probe marker (a broken flake.nix, evaluation error, wrong system), the check is a FAILED result that blocks Stop, with nix output in the log and summary. MISSING_TOOL remains only for a working shell that lacks the tool, no declared shell with the tool off PATH, or nix not installed. A budget spent before the shell starts is unchanged (MISSING_TOOL, retried each pass). Covered by test_broken_flake_that_nix_cannot_enter_is_a_blocking_failure_with_nix_output and test_dev_shell_that_lacks_the_tool_is_a_missing_tool.
|
Review summary (read-only) I found 1 problem: 1 × P2, and nothing at P0 or P1.
Things I checked that looked correct:
The new tests cover the changed behavior well. Note: the PR also changes a tool missing from PATH in non-flake repos from blocking to non-blocking. The PR description says this is intended. 🤖 Generated with Claude Code |
A project that declares a dev shell is expected to enter it. nix exiting before the probe marker, such as a broken flake.nix, is now a blocking failure. MISSING_TOOL stays for a working shell without the tool, no declared shell, or no nix. A budget spent before the shell starts is still MISSING_TOOL and retried. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| if _ENTERED_MARKER not in end.output: | ||
| # A truncated tail may have dropped the marker, which proves the shell started. | ||
| started_late = end.timed_out and not end.truncated | ||
| return MissingTool("the flake dev shell did not start within the check budget") if started_late else None |
There was a problem hiding this comment.
P2 — Every non-timeout nix develop exit before the shell starts counts as a code failure, not just evaluation errors in a flake.nix edited this session. That includes transient environment errors: the nix daemon is unreachable, a substituter or input fetch fails while offline, or the store is out of disk. Each of these returns None here, so execute reports FAILED. Stop then blocks with "Verification failed" even when flake.nix and the code are unchanged.
FAILED receipts can also be reused (only MISSING_TOOL is excluded in current_receipt). So the transient failure is cached as evidence against the code, and later passes show "Verification unresolved · unchanged; not rerun" until something changes the inputs. This is the reverse of how the PR treats the "budget spent before the shell started" case, which is retried as unavailable.
The PR description also says a nix develop evaluation or build failure becomes MISSING_TOOL, which disagrees with this code and with DESIGN.md.
Possible fixes:
- Classify this ending as
FAILEDonly whenflake.nixorflake.lockchanged in the session, and asMISSING_TOOL(retried) otherwise. - Or at least don't reuse a
FAILEDreceipt that has no entered marker.
There was a problem hiding this comment.
PR description fixed: it still described the earlier design and now says nix failing before the marker is a blocking FAILED, matching the code and DESIGN.md.
On the reuse of a transient FAILED I am keeping the code. That a project which declares a dev shell must enter it is a deliberate decision (a flake.nix the agent broke must not pass Stop). A FAILED receipt from an environment hiccup behaves like any other FAILED check: it blocks once, then shows "unresolved · unchanged; not rerun" until inputs change, and verify --force reruns it (documented in delivery.md and DESIGN.md). Making only some FAILED receipts non-reusable would need a new distinction between transient and permanent nix errors, which nix output cannot give reliably.
There was a problem hiding this comment.
Changed in 9b365c0, as decided. A dev shell entry failure (nix exits before the probe marker) is still a blocking failure with nix output in the log, but it is now recorded as its own status, dev_shell_failed, which like missing_tool is never reused (Status.retried). Every verification reruns it: a broken flake.nix blocks each time because nix fails fast, and a transient nix problem clears on the next Stop without verify --force; once nix succeeds the check passes. No transient/permanent distinction is needed. Covered by test_dev_shell_entry_failure_blocks_then_is_rerun_and_passes_once_nix_succeeds and the updated broken-flake execution test. DESIGN.md, DESIGN_ja.md and the PR description are updated.
Review summaryBlocking findings: 0 (P0: 0, P1: 0, P2: 1, P3: 0)
What I checked:
🤖 Generated with Claude Code |
The failure still blocks Stop but is recorded as dev_shell_failed. Like missing_tool, it is never reused, so a transient nix error clears on the next Stop. A broken flake.nix keeps blocking because nix fails fast. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
レビュー結果(read-only): ブロッキングな指摘はありません(P0/P1: 0 件,P2/P3: 0 件). 確認した点:
設計上のトレードオフ(指摘ではない): PATH に無いツールは従来 |
## 概要 ruff の D (pydocstyle, google),DOC,N (pep8-naming) を有効化する最終 PR (#74 stage 1B の持ち越し分).設定は template-python / dotfiles と同じ形にした.先行 lane (#130, #131, #132, #133) の修正は既にマージ済みで,この PR は残りの違反を直したうえで設定を有効化する. `ruff check .` は有効化後の設定で 0 件.ブランチは 1 コミットで,lefthook の全フックを除外なしで通過している. Refs #74 ## 設定 (pyproject.toml) - `select` に `D`,`DOC`,`N` を `W` と `F` の間に追加 (template-python / dotfiles と同じ並び).`DOC` による新規指摘は 0 件を確認済み - `ignore` に `D104`,`D105`,`D107` を追加 - `per-file-ignores` の `tests/**` に `D` を追加 - `[tool.ruff.lint.pydocstyle] convention = "google"` を追加 既存の ignore は削除していない. ## この PR での修正 ### 改名 (N818) ドメイン概念はそのまま,`Error` 接尾辞のみ追加し,agents と tests の全使用箇所を更新した. - `UnexpandableGlob` → `UnexpandableGlobError` - `UnsupportedSyntax` → `UnsupportedSyntaxError` - `UnplacedCommit` → `UnplacedCommitError` - `UnknownTestCommand` → `UnknownTestCommandError` ### 非公開化 (外部から使われないことを `git grep` で agents/ scripts/ tests/ に対して確認) | ファイル | 件数 | 名前 | | ---------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `guard_file.py` | 10 | `_policy_path`, `_load_policy`, `_protected_reason`, `_validate_filename_rule`, `_commit_reason`, `_content_match`, `_scan_content`, `_judged_commit`, `_context`, `_session` | | `shell_paths.py` | 1 | `_brace_words` | ### docstring を書いた公開 API | ファイル | 件数 | 名前 | 理由 | | ---------------- | ---- | ----------------------------------------------- | ------------------------------------------------------------------ | | `guard_file.py` | 3 | `commit_filename_rules`, `content_text`, `main` | テストと CLI から使われる公開 API | | `shell_words.py` | 1 | `home_directory` | `tests/hooks/test_shell_words.py` が直接呼ぶため非公開化しなかった | docstring は名前の言い換えではなく,返す値・拒否する入力・例外を述べている. ## リポジトリ全体の内訳 (ac-dn の全 lane) | PR | 非公開化 | docstring 追加 | 改名 (N818) | | -------------------------------------------- | -------: | -------------: | -----------------: | | #130 (hooks/lib) | 38 | 23 | 0 (他に表記修正 2) | | #131 (session_store ほか 4 ファイル) | 48 | 20 | 0 | | #133 (hooks/\*.py, scripts, skills, tests) | 44 | 15 | 2 | | #132 (verification_session, check_execution) | 8 | 7 | 0 | | この PR | 11 | 4 | 4 | | 合計 | 149 | 69 | 6 | #130 と #133 の件数は各 PR 本文の表,#131 は本文の合計行,#132 は ac-dn の表 (非公開化 7 + `collect`,文書化 `main`/`dispatch`/`failure`/`Status`/`Result`/`Result.failed`/`execute`) による. ## 検証 - `ruff check .`: All checks passed - `ruff format --check .`: 239 files already formatted - `ty check`: All checks passed - `pytest`: 手元 (sandbox) では 2 件を除き通過.失敗は `tests/hooks/test_formatter_config.py` の dprint 統合テスト 2 件のみで,sandbox が `plugins.dprint.dev` への通信を遮断するため (この PR の変更とは無関係).CI で確認する - pre-commit (lefthook) は `LEFTHOOK_EXCLUDE` なしで全フック通過 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: furedea <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.1.1](v0.1.0...v0.1.1) (2026-11-11) ### Features * **hooks:** judge session changes with jev-lint model rules at Stop ([#150](#150)) ([946e976](946e976)) ### Bug Fixes * **hooks:** ask for zsh's $=name and $~name expansions ([#152](#152)) ([9255c87](9255c87)) * **hooks:** judge a ~user path by the secret-path rules of the own home ([#129](#129)) ([64221f6](64221f6)) * **hooks:** match static words by their single-quoted form in precise command rules ([#147](#147)) ([c432a20](c432a20)) * **hooks:** run verification tools through the flake dev shell ([#132](#132)) ([63dd2f5](63dd2f5)) * **hooks:** start trusted model-rule programs and send only in-repository regular files ([#156](#156)) ([183496b](183496b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
Stop フックの検証が,プロジェクトのテストツールをエージェントの PATH からだけ起動していたため,ツールが flake の dev shell にしか無いリポジトリ(rater の
go)では,コードが正しくても毎回go: unavailable · [Errno 2] No such file or directory: goで検証失敗になっていた.これを設計で直す.Issue はない(指示に番号なし).
Refs対象なし.設計
uvなど)nixは呼ばないflake.nixが dev shell を宣言し,nixが PATH にあるnix develop --command sh -c <probe> sh <元の引数>で実行nixが無い / dev shell にも無いMISSING_TOOL状態で報告flake.nixのテキストにdevShell(s)があるかを正規表現で見るだけ.Nix の評価は走らせないので安価.flake-parts のように別ファイルで dev shell を宣言する構成は検出できず,MISSING_TOOLになる(制限として許容).command:も元の引数のまま.shのプローブが 2 つのマーカーを使う.nix developがマーカーより前に非 0 で終了した場合(flake.nixの評価エラーなど)は新しい状態DEV_SHELL_FAILED(失敗扱い,Stop をブロック)とし,nix の出力をログと要約に残す(エージェントが壊したflake.nixを見逃さないため).MISSING_TOOLと同様に再利用せず検証のたびに再実行する(Status.retried).壊れたflake.nixは nix がすぐ失敗するので毎回ブロックし,一時的な nix の問題ならverify --forceなしで次の Stop で解消する.一時的か恒久的かの区別は不要.シェル構築中に予算を使い切った場合だけはMISSING_TOOL(毎回再試行).出力が保持上限で切り詰められたときはマーカーが押し出された可能性があるため,判定せずテスト結果を維持する.MISSING_TOOL.MISSING_TOOLは「コードを判定していない」状態.Verification unavailableと表示し,Stop をブロックしない.成功でもないためverifyは非 0 で終了し,statusはunavailableを返す.失敗が同時にあれば従来どおり失敗が優先してブロックする.MISSING_TOOLのレシートは再利用せず,verify/Stop のたびに再試行する(コールドな dev shell や,先行チェックが使い切った予算といった一時的な原因が「利用不可」として固定されないようにするため).statusは保存済みレシートをunavailableとして表示する.uvは PATH にあるため経路は変わらない.既存のtest_session_gate.pyなどが無変更で通ることで確認.ac-dn(verification_session.py / check_execution.py の docstring)
verification_session.pyの公開main,dispatch,failureを docstring 付きで公開のままprovider_adapter.py:146,148がverification_session.dispatch/failureを使用verification_session.pyの非公開化registered_record,check_scope,require_inside,confirm_tool,end_session,explicit_result,hook_payload(7 件)git grep -wで agents/scripts/tests に外部参照なしcheck_execution.pyStatus,Result,Result.failed,executeを文書化.collectを_collectに非公開化session_gate.pyが使うのはStatusとexecuteのみ.collectの外部参照なしruff check --extend-select D,N(google, D104/D105/D107 を ignore)は,verification_session.py/check_execution.py/ 新規dev_shell.pyで 0 件.pyproject.tomlの ruff 設定は変更していない.設計上の判断(lint 由来)
_runの引数が 4 個になり PLR0913(max 3)に当たったため,「コマンド・作業ディレクトリ・環境」を 1 つの意味のある型_Processにまとめた(無名 tuple/dict にはしていない).dev_shell.py(Launch/MissingToolの和型)に分離し,check_execution.pyの責務(実行と分類)から切り離した.Status.failingを 1 箇所に置き,session_gate.pyの 3 か所にあったnot in {PASSED, SKIPPED}の重複を置き換えた.検証
ruff check/ruff format --check: 通過ty check: 通過pytest全件(dev shell 経由): 4552 passed, 1 skippedtests/hooks/test_dev_shell_verification.py(fake のnixと専用名のツール,実ネットワークなし)13 件:PATH 優先 / dev shell 経由 / 失敗・タイムアウト・空実行が dev shell 経由でも維持 / flake なし・devShell なし・dev shell にツールなし・nixなし・シェル構築中の予算切れがMISSING_TOOL/ 壊れた flake(マーカー前に nix が非 0 終了)はブロックするDEV_SHELL_FAILED,次の検証で再実行され,nix が成功すれば通る / 出力が切り詰められても失敗は失敗のままtest_session_gate.py:利用不可がブロックしない表示になること,失敗が優先してブロックすること,statusのunavailable判定(5 ケース)test失敗は,テストが実在のgoを使っており,ランナーにgoがあって「PATH に無い」前提が崩れたため.実在しないツール名に変更して解消した.nix developで rater を検証してはいない(fake のみ).レビュー対応
nix developの失敗の扱いは,最初は「利用不可」とし,エージェントが壊したflake.nixが Stop を通ってしまうという指摘を受けて,ユーザーの判断で「ブロックする失敗」に変更した(現在の設計).その後,一時的な nix エラーでの失敗レシートが再利用される点を指摘され,ユーザーの判断でDEV_SHELL_FAILEDを再利用しない(毎回再実行)設計にした.計画との差異
なし.
🤖 Generated with Claude Code