Repository navigation
#647 [test] GUI の残り 14 関数を状態待機 helper に統一する - #652
Merged
Merged
Conversation
判断: 14 関数・23 箇所の生の `Instant::now() + Duration` ループを J (#621) の gui_wait helper (`wait_for` / `wait_for_file_content` / `wait_for_stop_evidence` / `wait_for_idle_lease`) に置き換え、上限は 名前つきテスト用定数 DELEGATED_ARTIFACT_TIMEOUT (5s) / DRAFT_DELEGATION_TIMEOUT (3s) / SESSION_STATE_TIMEOUT (5s) と gui_wait の 既存定数 (IDLE_LEASE_TIMEOUT / DESCENDANT_READY_TIMEOUT / STOP_EVIDENCE_TIMEOUT) にした。製品 timeout は変えていない 判断: 待機完了条件は元の assertion と一致させ、events は event 名だけでなく 内容一致・バイト一致で待ち、args/env は期待内容が揃うまで ready としない。 部分書込みを ready と認めない 判断: 待った直後に読むサーバーの状態自体も待機の完了条件に入れた。 `GET /api/sessions/{id}` の gate / recovery_auto_run / failure_explanation は サーバーが委譲プロセスの終了を観測して初めて確定するため、events や args を 待っただけでは 1 回読みで gate_2 / current 0 / projection null を掴みうる。 後の assertion と同じ値を gui_wait::wait_for で待ってから read し、 既存 assertion はそのまま残した 判断: gui_server.rs 冒頭に 17 関数の J/K 対応表をコメントで置き、下の 30 箇所の表と突き合わせて漏れが無いことを示した 元の 17 関数・30 箇所の対応表(元の行 = 調査基準 f8ce541、J は merge 済み): J (#621) - 3 関数 / 7 箇所 gui_stop_is_generation_bound_idempotent_and_records_cli_interruption 1863 wait_for_descendant_pid / 1938 wait_for_idle_lease gui_stop_force_kills_the_exact_process_group_without_false_success 1979 wait_for_descendant_pid / 2009 wait_for_idle_lease gui_stop_targets_the_confirmed_directive_process_generation 2050 wait_for_idle_lease / 2074 wait_for_descendant_pid / 2099 wait_for_idle_lease K (#647) - 14 関数 / 23 箇所 gui_lists_and_proposes_an_external_draft_profile_with_a_local_pack 917 wait_for_event(DRAFT_DELEGATION_TIMEOUT) extension_supply_api_enforces_auth_origin_and_the_full_pack_lifecycle 1226 gui_wait::wait_for(content predicate) later_gate_one_ignores_products_from_an_isolated_session_workspace 2187 wait_for_idle_lease malformed_session_events_return_a_dedicated_error_code 2363 wait_for_idle_lease failed_session_projects_exact_interval_and_reads_only_current_recovery_documents 2523 gui_wait::wait_for_file_content(exact) recovery_documents_are_readable_when_trial_token_auth_is_off 2675 gui_wait::wait_for_file_content(exact) confirmed_session_delegates_with_cli_event_bytes_unchanged 2963 gui_wait::wait_for(byte equality) / 3242 gui_wait::wait_for(gate_3) / 3269 wait_for_idle_lease selected_working_directory_is_hash_bound_persisted_and_reused_after_restart 3413 wait_for_idle_lease / 3474 wait_for_idle_lease typed_trial_intents_are_validated_frozen_and_delegated 3613 wait_for_idle_lease unclassified_nextjs_create_is_unmeasured_confirmed_and_delegated 3772 gui_wait::wait_for_file_content(args pairs) / 3798 wait_for_idle_lease selected_think_is_confirmed_and_delegated_only_for_an_ollama_role 3887 wait_for_idle_lease recovery_auto_run_limit_is_hash_bound_validated_and_delegated 3999 gui_wait::wait_for_file_content(args pair) gate_four_recovery_run_requires_confirmation_and_executes_exact_frozen_identity 4048 wait_for_idle_lease / 4051 wait_for_idle_lease / 4116 wait_for_path(DESCENDANT_READY_TIMEOUT) / 4184 wait_for_idle_lease recovery_run_rejects_stale_drift_pending_directive_and_treatment_rejection 4200 wait_for_idle_lease / 4229 wait_for_idle_lease / 4272 wait_for_idle_lease 合計: J 7 + K 23 = 30 箇所、3 + 14 = 17 関数で漏れなし。 表の外(上の 30 箇所以外に統一・追加した待ち): Gate 4 の 8 秒 stop evidence (元 4182) -> wait_for_stop_evidence (session_id と process_generation に拘束) confirmed_session_delegates_with_cli_event_bytes_unchanged 元 3141 の GET の前に gate_3 を待つ (ローカル helper wait_for_session_gate)。 同じ test の directive continuation (元 3242) の gate_3 待ちも同 helper に統一 failed_session_projects_exact_interval_and_reads_only_current_recovery_documents 元 2588 の GET の前に failure_explanation.projection_status == "supported" を待つ recovery_auto_run_limit_is_hash_bound_validated_and_delegated 元 4053 の GET の前に recovery_auto_run == {current:1,used:1,limit:1,stop_reason:recovery_succeeded} を待つ いずれも上限は既存の名前つき定数 (SESSION_STATE_TIMEOUT / STOP_EVIDENCE_TIMEOUT)、 後の assertion と同値を完了条件にし、既存 assertion は全て残置 テスト: 変換対象 14 test と、今回待ちを足した 3 test (`cargo test --features gui --test gui_server` の名前指定) が緑。3 test は 連続 4 回実測していずれも緑 二点測定: auto-run の待機 predicate を到達不能な値に変異させ、 gui_wait.rs の「timed out after 5s ...; last state: ...」で赤を実測し、 復元して緑に戻した 本文に無い指摘: この worktree には gui/out が無いため、gui feature の静的配信系 test は base でも赤になる。変換対象は gui/out に依存しないため名前指定で緑を実測 証跡: 契約の gate を実行し以下を実測 — cargo fmt --all -- --check / RUSTFLAGS='-D warnings' cargo clippy --all-targets -- -D warnings (gui feature も別途) / RUSTFLAGS='-D warnings' cargo test --all-targets / validate_codex_skills / ruff (両方) / shellcheck / pytest codex_orchestrate / unittest management scripts / eval 3 本 / npm ci + nextjs oracle 制約: 変更は tests/gui_server.rs のみ。tests/support/gui_wait.rs と製品コードは 未変更。CARGO_TARGET_DIR / CARGO_BUILD_JOBS は上書きせず cargo mutants は未実行 Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
tests/gui_server.rsに残っていた、状態を待つ独自のループを、#621 の状態待機 helper(tests/support/gui_wait.rs)に統一します。対象は 14 関数・23 箇所です。変更
tests/gui_server.rs(+230 −166)だけを変えました。製品コードとgui_wait.rsは変えていません。recovery_auto_run、failure_explanation.projection_status、gate。gui_wait::wait_forで待つ形にしました(上限はSESSION_STATE_TIMEOUT)。検証
commandmate verifyの 15 ゲート(fmt・clippy-D warnings・cargo testの全体を含む)は、developc98bdc7cの上の HEAD26d9bf56で 15/15 pass でした。cargo test --features gui --test gui_server:87 passed でした。c98bdc7cを対照として回すと、10 本中 9 本が FAIL しました(主にunclassified_nextjs_create_is_unmeasured_confirmed_and_delegated)。runner.rs・loop_run.rs・baseline)は変えていません。確かめてほしい点
gui_stop_*・server_ready_wait_*)は、修正の前の同時実行でまれに落ちました。修正後の 10 本では起きていませんが、この PR では直していません。レビュー
テストの変更なので、merge 前レビューは行いません(利用者承認済み)。
Refs #647
🤖 Generated with Claude Code