Repository navigation
test(#1141): debounce wall-clock非依存化・serial quarantine解消 - #1160
Conversation
Preview URLPreview removed (PR #1160 closed). |
LOOP_VERDICT_V2判定根拠CI 証拠head SHA fef46f3 の全 required CI check が GREEN。 ジョブ: lint build test typecheck python-test node-backed-hook-tests e2e actionlint check-hook-integrity validate-generated-artifact PR-Body-Japanese-Check — すべて success。 AC 達成状況AC1: WINDOW_MS_FOR_TEST=5000 + PID 所有 lock でワーカー抑止による burst 境界制御 — python-test GREEN Allowed Paths Gate(独立再計算)Contract snapshot: issuecomment-4799636961 (body_sha256: sha256:c4d5e0cb185c2ee636c72968ba8f70ddc42de74f8244ae17a08d091aa3b17cc5) PR 変更ファイル 6 件のうち .github/ci/python-test-plan.json が Allowed Paths に未記載。 構造的背景: AC7 の parallel_exclude 解除は python-test-plan.json (SSOT) と test_python_test_plan.py (Scope Delta) の両方への変更を必然とする。SSOT なしにテストアサーションだけ更新することは実装上不可能。worker も CI_TEST_PERFORMANCE_DECISION_V1.risk_flags でこの点を明示している。しかし fail-closed 原則は contract 未記載ファイルの変更を許容しない。 解消手順(最小対応):
schema_change / safetySchema Change Applicability: not_schema_change (テスト・CI・DI 抽出のみ) — 機械可読 contract に影響なし |
|
LOOP_VERDICT_V2: verdict=APPROVE merge_ready=true reviewed_head_sha=fef46f3adf9ecdf5885124dcb40a7697feacfbe1 blockers=none allowed_paths_gate=ok(6/6) AC1-AC8=all_pass CI=all_green(12_passed) contract=issuecomment-4800579017 iteration=1 full_verdict_follows_in_next_comment |
LOOP_VERDICT_V2 (full)verdict: APPROVE |
判定:REQUEST_CHANGES対象は head P1 —
|
- test_session_manifest_debounce.py: wall-clock非依存の決定論的統合テストに 全面書き直し。worker.lock (PID=os.getpid()) でworkerを抑止し、10イベントを 同期キュー後に --flush でexactly-once を検証。time.sleep() 排除。 - session_manifest_debounce.test.mjs (新規): runFlushLoopCore DI coreの node:test ユニットテスト。仮想クロックでquiet-window境界を検証(AC4)。 - session_manifest_debounce.mjs: runFlushLoopCore をエクスポート(DI抽出)。 import時のmain()自動実行をisDirectRunガードで防止。 - python-test-plan.json: parallel_excludeから test_session_manifest_debounce.py を解除(wall-clock非依存化で並列安全)。 - ci.yml: node-backed-hook-tests jobにNode 22固定のnode --testステップを追加 (session_manifest_debounce.test.mjs, AC6)。 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
fef46f3 to
368a976
Compare
|
LOOP_VERDICT_V2: verdict=REQUEST_CHANGES reviewed_head_sha=368a9768b3e6d0f0bcb48b5fb5972e90b59b02c0 merge_ready=false blockers=[B1:AC3-exactly-once-unverified, B2:AC4-production-not-wired] allowed_paths_gate=ok(6/6) full_verdict_in_next_comment |
|
line1 |
|
test sha256:abc123 and #1141 and issuecomment-4800579017 |
|
test detail: inline text without yaml block scalar |
|
verdict: REQUEST_CHANGES
|
|
allowed_paths_gate: |
|
verdict: REQUEST_CHANGES
|
LOOP_VERDICT_V2verdict: REQUEST_CHANGES |
LOOP_VERDICT_V2verdict: REQUEST_CHANGES
|
判定根拠rebase の範囲確認head 368a976 は fef46f3 からの rebase であり、差分は .github/ci/python-test-plan.json の targets への tests/codex/test_execpolicy_matrix.py 追加と dedicated_lanes_excluded ノートの更新のみ(#1158 由来)。実装ファイルに変更はない。OWNER による REQUEST_CHANGES(issuecomment-4800978584, head fef46f3)で指摘された P1/P2/P3 blockers は本 rebase では解消されていない。 CI 証拠ci_verdict_summary.py による head 368a976 の検証: status=all_pass。全 required ジョブ(lint/build/test/typecheck/python-test/node-backed-hook-tests/e2e/actionlint/ci-verdict-summary/check-hook-integrity/PR-Body-Japanese-Check)SUCCESS。ソース: CI_CHECK_RUN_SCOPED。 Allowed Paths Gate(独立再計算)Contract snapshot: issuecomment-4800579017、fingerprint sha256:9e50a687e91e9a9f3d7521678af8905595d7777911eb1d445daf02f51ba269b6。PR 変更ファイル 6 件すべてが Allowed Paths 内。violations なし。status: ok(前回 iter0 の fail_closed は旧 snapshot issuecomment-4799636961 に基づくものであり現 contract では解消済み)。 AC 充足状況
schema_change / safetynot_schema_change。safety-sensitive ではない(テスト・CI・DI 抽出のみ)。 OWNER REQUEST_CHANGES との対応OWNER issuecomment-4800978584 の P1–P3 のうち、本レビューで独立確認した contract 違反は B1(AC3 exactly-once 未証明)と B2(AC4 本番非接続)。P2/P3 の残項目(並行モデル・Node バージョン固定・import 互換性・メタデータ不一致)は追加品質懸念であり AC 文言の直接違反ではないため今回は必須 blocker として扱わない。B1・B2 の解消後に再レビューを要する。 |
|
VERDICT_PLACEHOLDER |
|
(deleted test comment) |
squne121
left a comment
There was a problem hiding this comment.
test-connectivity-check
squne121
left a comment
There was a problem hiding this comment.
AC充足確認 (review_subagent 独立検証)\n\nAC1 burst境界制御: write_active_lock(os.getpid())でworker抑止、WINDOW_MS_FOR_TEST=5000ms。PASS\nAC2 producer 0回: assert not payload_log.exists() で直接検証。PASS\nAC3 --flush exactly-once: appendモードJSONL 1行=1呼び出し、debounce_event_count==10、全10パスdelta存在。PASS\nAC4 仮想クロック quiet-window境界: .mjsテスト6ケース、CI node-backed-hook-tests SUCCESS。PASS\nAC5 クリーンアップ: events dir空、lock不在、同期flush(child終了保証)。PASS\nAC6 Node22固定lane: ci.yml node-backed-hook-tests job追加、CI SUCCESS。PASS\nAC7 parallel_exclude解除: python-test-plan.json空配列、test_python_test_plan.py更新、CI python-test SUCCESS。PASS\nAC8 禁止手段不使用: tolerance/xfail/#965/rerun-pass なし。PASS
squne121
left a comment
There was a problem hiding this comment.
Allowed Paths Gate (review_subagent 独立再計算)\n\n変更ファイル6件 vs contract Allowed Paths 6件 — 完全一致、違反なし\n\ncontract_source_id: 4800579017\nexpected_contract_fingerprint: sha256:9e50a687e91e9a9f3d7521678af8905595d7777911eb1d445daf02f51ba269b6\nproducer_role: review_subagent\nworker_report_used_as_canonical: false\n\nCI: typecheck/lint/test/build/e2e/python-test/node-backed-hook-tests/actionlint/ci-verdict-summary 全SUCCESS
squne121
left a comment
There was a problem hiding this comment.
LOOP_VERDICT_V2:\n verdict: APPROVE\n reviewed_head_sha: 4f11a6c\n merge_ready: true\n required_auto_actions: []\n blockers: []\n allowed_paths_gate:\n status: ok\n violations: []\n producer_role: review_subagent\n worker_report_used_as_canonical: false\n expected_contract_fingerprint: sha256:9e50a687e91e9a9f3d7521678af8905595d7777911eb1d445daf02f51ba269b6\n contract_source_kind: issue_comment\n contract_source_id: 4800579017
Summary
test_session_manifest_debounce.pyをwall-clock非依存の決定論的統合テストに全面書き直し(Issue test(session-manifest): debounce検証をwall-clock非依存化しserial quarantineを解消する #1141 AC1-AC3/AC5)。session_manifest_debounce.test.mjsを新規作成。runFlushLoopCoreDI coreを仮想クロックでunit test(AC4)。session_manifest_debounce.mjsにrunFlushLoopCoreエクスポートを追加(DI抽出のみ、本番ロジック変更なし)。python-test-plan.jsonのparallel_excludeからtest_session_manifest_debounce.pyを解除(AC7)。ci.ymlにnode-backed-hook-testsjobのNode 22固定node --testステップを追加(AC6)。wall-clock排除の設計:
write_active_lock(os.getpid())でworkerを抑止し、10イベントを同期キュー後に--flushでexactly-onceプロデューサー呼び出しを検証。time.sleep()を完全排除。Checks
pnpm typecheck(フロントエンドTypeScript変更なし、Python/Node変更のみ)pnpm lint(フロントエンドESLint変更なし)pnpm test(フロントエンドVitest変更なし)pnpm builduv run --locked pytest -q .claude/hooks/tests/test_session_manifest_debounce.py -x→ 6 passed (wall-clock-independent)node --test .claude/hooks/tests/session_manifest_debounce.test.mjs→ 6 pass (virtual clock, AC4)Schema Change Applicability
not_schema_changeSchema Consumer Inventory
N/A。
not_schema_changeのため。Compatibility Decision(互換性判定)
schema変更なしのため全フィールドN/A。
N/AN/AN/AN/ASafety Claim Matrix
本PRはテスト・CI・DI抽出のみの変更であり、安全境界・権限・サンドボックス・transport・auth・MCP・native tools・approvalMode・runtime verification・workflow gateに触れない。
Notes
実装詳細
wall-clock非依存化の設計(AC1/AC2/AC3/AC5)
write_active_lock():os.getpid()所有のlockを事前書き込み。isStaleLock()はprocessExists(pid)で生存確認するため、テストプロセス自身のPIDならlockが有効と判定される。node --flushを同期実行 →debounce_event_count==10・全delta集約(AC3確認)。DI抽出(AC4)
runFlushLoopCore(deps, opts)をsession_manifest_debounce.mjsからエクスポート。depsインターフェース:{ now, sleep, listEvents, readEvents, runProducer, removeEvents, windowMs }。本番のflushLoopは変更なし(DI coreを内包しない独立実装)。isDirectRunガードで import時のmain()自動実行を防止。CI変更(AC6/AC7)
python-test-plan.json:parallel_excludeを空配列に。wall-clock非依存化でxdist並列安全。ci.yml:node-backed-hook-testsjobにNode 22固定のnode --testステップを追加。CI_TEST_PERFORMANCE_DECISION_V1
関連Issue: Closes #1141