From 15daadd0155d7e1f3111531944c9d496b2811381 Mon Sep 17 00:00:00 2001 From: Hare Date: Wed, 10 Jun 2026 18:29:12 +0900 Subject: [PATCH] ticket: report file mutation serialization --- .yoi/tickets/00001KTR83D6E/item.md | 2 +- .yoi/tickets/00001KTR83D6E/thread.md | 31 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.yoi/tickets/00001KTR83D6E/item.md b/.yoi/tickets/00001KTR83D6E/item.md index c040996c..885cbaf9 100644 --- a/.yoi/tickets/00001KTR83D6E/item.md +++ b/.yoi/tickets/00001KTR83D6E/item.md @@ -2,7 +2,7 @@ title: 'Edit/Writeの同一ファイル変更をToolExecutionContextで直列化する' state: 'inprogress' created_at: '2026-06-10T07:49:10Z' -updated_at: '2026-06-10T09:19:09Z' +updated_at: '2026-06-10T09:29:06Z' assignee: null queued_by: 'workspace-panel' queued_at: '2026-06-10T08:10:58Z' diff --git a/.yoi/tickets/00001KTR83D6E/thread.md b/.yoi/tickets/00001KTR83D6E/thread.md index cee5d1e7..ea5d7659 100644 --- a/.yoi/tickets/00001KTR83D6E/thread.md +++ b/.yoi/tickets/00001KTR83D6E/thread.md @@ -66,3 +66,34 @@ IntentPacket: - Validation: `cargo fmt`, `cargo test -p tools mutation`, focused `cargo test -p tools`, `git diff --check`, `target/debug/yoi ticket doctor`, and broader build before merge if touched surfaces require it. --- + + + +## Implementation report + +Implementation report + +Branch/worktree: `serialize-file-mutations` / `.worktree/serialize-file-mutations` +Commit: +- `40130143 fix: serialize same-file mutations` + +Summary: +- Added a shared per-target-file mutation guard to `Tracker`, keyed by canonical target path where possible. +- `Edit` and `Write` acquire this guard around their critical read/verify/write/record sections, so same-file mutations serialize while Worker-level parallel tool execution remains intact. +- Different files use different guards and are not globally serialized. +- The guard uses `ToolExecutionContext` for response-local diagnostics/correlation (`batch_id`, `call_index`) without making it a Worker/session authority handle. +- Added tests for equivalent-path guard blocking, different-file non-blocking, same-batch `Write` then `Edit` order, and failed mutation guard release. + +Validation run in branch: +- `cargo fmt` +- `cargo test -p tools --lib` passed. +- `cargo test -p tools mutation_guard --lib` passed. +- `cargo test -p tools write_then_edit_same_file_same_batch_uses_call_order --lib` passed. +- `cargo test -p tools failed_same_file_mutation_releases_guard_for_followup --lib` passed. +- `cargo check -p tools` passed. +- `git diff --check` passed. + +Notes: +- `nix build .#yoi` not yet run on this branch; Orchestrator should run it before/after merge because this changes tool runtime code and crate feature configuration. + +---