ticket: close file mutation serialization

This commit is contained in:
Keisuke Hirata 2026-06-10 18:40:43 +09:00
parent 29960c1589
commit e4dd08f8b6
No known key found for this signature in database
3 changed files with 106 additions and 2 deletions

View File

@ -1,8 +1,8 @@
--- ---
title: 'Edit/Writeの同一ファイル変更をToolExecutionContextで直列化する' title: 'Edit/Writeの同一ファイル変更をToolExecutionContextで直列化する'
state: 'inprogress' state: 'closed'
created_at: '2026-06-10T07:49:10Z' created_at: '2026-06-10T07:49:10Z'
updated_at: '2026-06-10T09:37:59Z' updated_at: '2026-06-10T09:40:36Z'
assignee: null assignee: null
queued_by: 'workspace-panel' queued_by: 'workspace-panel'
queued_at: '2026-06-10T08:10:58Z' queued_at: '2026-06-10T08:10:58Z'

View File

@ -0,0 +1,26 @@
完了しました。
実施内容:
- `Tracker``Write` / `Edit` 共有の per-target-file mutation guard を追加しました。
- `Write``Edit` は read/verify/write/record の critical section を同一ファイル単位で直列化します。
- Worker/provider の parallel tool execution は維持し、Worker-wide scheduler は導入していません。
- guard key は canonical target / canonical parent / lexical fallback で同一ファイル相当を寄せ、異なるファイルは別 mutex で扱います。
- `ToolExecutionContext``batch_id` / `call_index` は guard acquisition の diagnostics/correlation に使っています。
- same-file write→edit ordering、failed mutation release、equivalent path guard、different-file non-blocking の tests を追加しました。
Merge:
- Branch: `serialize-file-mutations`
- Merge commit: `29960c15 merge: serialize file mutations`
確認:
- Branch-local reviewer `reviewer-serialize-file-mutations` が approve。
- `cargo fmt --check` passed。
- `git diff --check` passed。
- `cargo test -p tools --lib` passed99 passed
- `cargo check -p tools` passed。
- `target/debug/yoi ticket doctor` passed。
- typed `TicketDoctor` は 0 errors / 3 pre-existing diagnostics。
- `nix build .#yoi` passed。
残作業:
- なし。将来 `Write` / `Edit` が guard acquisition 前に await を増やす場合は、同一 response 内の call order 保証を再確認してください。

View File

@ -126,3 +126,81 @@ Non-blocking note:
This is branch-local review evidence; final main-branch approval/close belongs to merge-completion. This is branch-local review evidence; final main-branch approval/close belongs to merge-completion.
--- ---
<!-- event: review author: orchestrator at: 2026-06-10T09:40:23Z status: approve -->
## Review: approve
Main-branch review/merge-completion approval.
Verified before merge:
- Branch-local reviewer approved with no blockers.
- Merge target matched branch `serialize-file-mutations` / worktree `.worktree/serialize-file-mutations` and commit `40130143`.
- Implementation is limited to `crates/tools`; Worker-wide scheduler semantics were not changed.
Merged:
- `git merge --no-ff serialize-file-mutations -m "merge: serialize file mutations"`
- Merge commit: `29960c15 merge: serialize file mutations`
Post-merge validation:
- `cargo fmt --check` passed.
- `git diff --check` passed.
- `cargo test -p tools --lib` passed (99 passed).
- `cargo check -p tools` passed.
- `target/debug/yoi ticket doctor` passed.
- typed `TicketDoctor` reported 0 errors and 3 pre-existing diagnostics.
- `nix build .#yoi` passed.
Result: approve.
---
<!-- event: state_changed author: orchestrator at: 2026-06-10T09:40:23Z from: inprogress to: done reason: merged_and_validated field: state -->
## State changed
Merged branch `serialize-file-mutations` with merge commit `29960c15`; branch-local review approved and post-merge validation passed (`cargo fmt --check`, `git diff --check`, `cargo test -p tools --lib`, `cargo check -p tools`, `target/debug/yoi ticket doctor`, `nix build .#yoi`).
---
<!-- event: state_changed author: hare at: 2026-06-10T09:40:36Z from: done to: closed reason: closed field: state -->
## State changed
Ticket を closed にしました。
---
<!-- event: close author: hare at: 2026-06-10T09:40:36Z status: closed -->
## 完了
完了しました。
実施内容:
- `Tracker``Write` / `Edit` 共有の per-target-file mutation guard を追加しました。
- `Write``Edit` は read/verify/write/record の critical section を同一ファイル単位で直列化します。
- Worker/provider の parallel tool execution は維持し、Worker-wide scheduler は導入していません。
- guard key は canonical target / canonical parent / lexical fallback で同一ファイル相当を寄せ、異なるファイルは別 mutex で扱います。
- `ToolExecutionContext``batch_id` / `call_index` は guard acquisition の diagnostics/correlation に使っています。
- same-file write→edit ordering、failed mutation release、equivalent path guard、different-file non-blocking の tests を追加しました。
Merge:
- Branch: `serialize-file-mutations`
- Merge commit: `29960c15 merge: serialize file mutations`
確認:
- Branch-local reviewer `reviewer-serialize-file-mutations` が approve。
- `cargo fmt --check` passed。
- `git diff --check` passed。
- `cargo test -p tools --lib` passed99 passed
- `cargo check -p tools` passed。
- `target/debug/yoi ticket doctor` passed。
- typed `TicketDoctor` は 0 errors / 3 pre-existing diagnostics。
- `nix build .#yoi` passed。
残作業:
- なし。将来 `Write` / `Edit` が guard acquisition 前に await を増やす場合は、同一 response 内の call order 保証を再確認してください。
---