Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 21 additions & 2 deletions docs/adr/adr-065-ci-matrix-cross-os-regression.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,27 @@ Actions は無料・無制限なので、現状の余剰コストは CPU 時間
Windows の 1,881 との差 174 は `#[cfg(windows)]` 群であり、両 OS の実行本数差が
想定どおりであることも併せて確認した (差が説明できない = どちらかの leg が主題を
検証していない、の検知)。
- **未観測**: GitHub Actions 上での実行は本 workflow を含む PR の run が初回であり、
run 時間・cache 効率・flake の有無は未観測。§ 決定 5 の段階分けはこの事実に基づく。
- **未観測 (起票時点)**: GitHub Actions 上での実行は本 workflow を含む PR の run が初回で、
起票時点では run 時間・cache 効率・flake の有無は未観測だった。§ 決定 5 の段階分けは
この事実に基づく。実走の結果は次項「実走観測」を参照。

### 実走観測 (2026-08-02 追記)

初回観測期間 (2026-08-01〜08-02) の 6 run (PR イベント 4 + master push 2) の実績:

- **success 5 / failure 1**。run 時間は 2.4〜4.4 分 (2 leg 並列の wall clock)。
- failure 1 件 (windows leg の `cargo test`) は flake ではなく **master に潜在していた
実バグ**だった: `lib-jj-helpers` pipeline_lock の reclaim 自己修復で、除去前に読んだ
stale sentinel content を cache した出遅れスレッドが、勝者の marker 除去後に同一 gate を
再作成して fresh sentinel を強奪し、同時 `Acquired` が 2 つ発生する競合 (詳細と修正は
PR #344)。多コアの開発機では 12,800 回試行 + affinity 2 コア固定でも再現できず、
2 vCPU runner の preemption 条件でのみ顕在化した。決定論再現テスト (修正前 red →
修正後 green) で機構を証明して修正し、rebase 後の本 workflow で両 leg 緑 (2 コア
runner 上での 32 threads × 400 rounds 高競合 stress 含む) を実地検証した。
- § コンテキストの「片 OS でしか検出できない欠陥」に、**matrix 自身が初回観測期間内に
3 例目を追加した**形になる。§ 決定 5 の観測フェーズ先行の判断も同時に裏づけられた
(最初から required check にしていれば、この競合の解明までの間、全 PR が確率的に
ブロックされ得た)。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

pipeline_lock の障害を OS 固有と分類しないでください。

Lines 152-155 describe reproduction under a 2-vCPU runner の preemption 条件です。Windows leg で検出された事実だけでは、Linux では検出できないとはいえません。

この記述は、pipeline_lock の問題を「片 OS でしか検出できない欠陥」の 3 例目と誤って分類します。runner の CPU / preemption 条件で顕在化した欠陥 と記録し、required check 化を遅らせる根拠は環境依存の再現リスクとして残してください。

修正例
-§ コンテキストの「片 OS でしか検出できない欠陥」に、**matrix 自身が初回観測期間内に
-3 例目を追加した**形になる。
+§ コンテキストに列挙した OS 差の欠陥に加え、**matrix 自身が初回観測期間内に、
+2 vCPU runner の preemption 条件で顕在化する 3 例目の欠陥を追加した**形になる。
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- § コンテキストの「片 OS でしか検出できない欠陥」に、**matrix 自身が初回観測期間内に
3 例目を追加した**形になる。§ 決定 5 の観測フェーズ先行の判断も同時に裏づけられた
(最初から required check にしていれば、この競合の解明までの間、全 PR が確率的に
ブロックされ得た)。
- § コンテキストに列挙した OS 差の欠陥に加え、**matrix 自身が初回観測期間内に、
2 vCPU runner の preemption 条件で顕在化する 3 例目の欠陥を追加した**形になる。§ 決定 5 の観測フェーズ先行の判断も同時に裏づけられた
(最初から required check にしていれば、この競合の解明までの間、全 PR が確率的に
ブロックされ得た)。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/adr-065-ci-matrix-cross-os-regression.md` around lines 156 - 159,
Update the ADR passage around the “片 OS でしか検出できない欠陥” classification to describe
pipeline_lock as a defect exposed by runner CPU/preemption conditions, not as an
OS-specific third example. Preserve the conclusion that required-check adoption
was deferred because reproduction risk depends on the execution environment,
while removing the claim that Windows-only detection establishes OS exclusivity.


## 帰結

Expand Down
7 changes: 4 additions & 3 deletions docs/harness-improvement-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Anthropic 公式のハーネスエンジニアリング指針(決定論的基
| WP-13 | 3 | EXE_SUFFIX 抽象化 | M | なし | 完了([ADR-005](adr/adr-005-hooks-path-resolution-with-template.md) amendment。launcher 経路の実走確認済) |
| WP-14 | 3 | PowerShell 3 本の Rust 化 | S-M ×2 | なし | 完了(新規 ADR 不要判断 = 決定は各 crate doc + commit message に記録。実走確認済) |
| WP-15 | 3 | Linux バイナリビルド + クラウド setup script | M | WP-13, 14 | 完了([ADR-063](adr/adr-063-linux-portability-release-binaries.md)。クラウド実測は [ADR-060](adr/adr-060-cloud-harness-sessionstart-dispatcher.md) dogfood で達成、以降は ADR-060 の bounded lifetime で管理。追補の陽性証拠設計は [ADR-064](adr/adr-064-monitor-success-positive-evidence.md) → park 実観測は § 残作業) |
| WP-16 | 3 | CI matrix(移植退行防止) | S | WP-13, 14 | 観測中([ADR-065](adr/adr-065-ci-matrix-cross-os-regression.md)。windows-latest + ubuntu-latest の 2 leg を新設。required check 化と GitHub Actions 実走の安定性確認は → § 残作業) |
| WP-16 | 3 | CI matrix(移植退行防止) | S | WP-13, 14 | 観測中([ADR-065](adr/adr-065-ci-matrix-cross-os-regression.md)。2 OS matrix は PR #342 でマージ済・master 稼働中、初回観測期間に実バグ 1 件捕捉(PR #344 で修正)。観測継続と required check 化は → § 残作業) |
| WP-17 | 4 | イベント駆動バックボーン完成(Phase B + routines 移行) | M | WP-09, 10, 11 | 未着手 |
| WP-18 | 4 | 夜間 todo 消化ループ | M-L | WP-15, 17 | 未着手 |
| WP-19 | 4 | 常時性ガード(kill-switch / 自主減速 / 監査ループ) | M | WP-18 | 未着手 |
Expand All @@ -94,9 +94,10 @@ Anthropic 公式のハーネスエンジニアリング指針(決定論的基

### WP-16 残: CI matrix の実走観測と required check 化

- 現状: `.github/workflows/ci.yml` に windows-latest + ubuntu-latest の 2 leg を新設し、各 leg で clippy / `cargo test` / hooks smoke test / `--ignored` 統合テスト(jj 0.42.0 を導入)を実行する([ADR-065](adr/adr-065-ci-matrix-cross-os-regression.md))。jj 取得 step は両 OS で実 URL・実 asset を用いて実走確認済、テスト自体もローカル Windows で全 pass。
- 現状: PR #342 で `.github/workflows/ci.yml`(windows-latest + ubuntu-latest の 2 leg。各 leg で clippy / `cargo test` / hooks smoke test / `--ignored` 統合テスト、jj 0.42.0 導入)をマージ済み(2026-08-02、[ADR-065](adr/adr-065-ci-matrix-cross-os-regression.md))。master 稼働中。
- 初回観測期間(2026-08-01〜08-02)の実績(詳細は ADR-065 の「実走観測」追記): **6 run で success 5 / failure 1、run 時間 2.4〜4.4 分**。failure 1 は flake ではなく master 潜在の pipeline_lock reclaim レース(多コアのローカルでは再現不能、2 vCPU runner でのみ顕在化)で、PR #344 で修正し、rebase 後の CI で両 leg 緑(2 コア runner 上の高競合 stress 含む)を実地検証済み。**matrix は初回観測期間内に実バグを 1 件捕捉した**。
- 残作業:
1. **GitHub Actions 上での実走は本 WP の PR が初回**。run 時間・cache 効率・flake の有無を数 run 観測する。
1. 観測継続: cache 効率(2 回目以降の run 時間短縮)と flake の有無を引き続き数 run 分確認する。
2. 安定を確認したら Branch Protection の Required status checks に登録(todo 順位 6 の Branch Protection 整備と連動。ADR-065 § 決定 5 が段階を分ける根拠)。
3. ADR-063 の残課題のうち「Linux 上で pump_child_io の deadlock 保護 / run_cmd_capture の stdout/stderr 分離が無検証」は matrix では閉じない(該当テストは cmd.exe / PowerShell 依存で module ごと Windows 限定)。POSIX 版テストの追加は ADR-065 の残課題として追跡。

Expand Down
Loading