From 55c5ac4942756bce65dbcaac51eaa91963289be5 Mon Sep 17 00:00:00 2001 From: Hare Date: Wed, 20 May 2026 04:53:33 +0900 Subject: [PATCH] =?UTF-8?q?update:=20=E6=97=A7=E7=94=A8=E8=AA=9E=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=81=AE=E6=8E=83=E9=99=A4=E3=81=A8?= =?UTF-8?q?=20KNOWN=5FISSUES=20=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 残存していた head_hash / SessionHead 言及コメントを 3 箇所更新 - FsStore::read_entry_count の O(n) 計測コストを KNOWN_ISSUES に登録 --- KNOWN_ISSUES.md | 1 + crates/pod/tests/compact_events_test.rs | 14 +++++++------- crates/pod/tests/restore_test.rs | 2 +- crates/session-store/src/lib.rs | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/KNOWN_ISSUES.md b/KNOWN_ISSUES.md index b884dd58..507b3fc4 100644 --- a/KNOWN_ISSUES.md +++ b/KNOWN_ISSUES.md @@ -14,3 +14,4 @@ Ticket を切るほどではないが、次に近所を触るときに合わせ - `crates/tui/src/app.rs:478-485` — bad workflow slug を含む `Method::Run` 送信時、`Event::UserMessage` の早期 broadcast で `turn_index += 1` されターンヘッダだけ残る ("ghost turn header")。次に TUI のターンヘッダ / エラー表示周りを触るときに整理。→ [tickets/pod-input-validate-internalize.md] の review 由来。 - `crates/pod/src/controller.rs:944` — `worker_error_code` で `PodError::WorkflowResolve(_) => InvalidRequest` が post-commit な resolve エラー (`KnowledgeNotFound` 等) にも適用される。意味論的には妥当方向だが、resolve 系のエラー粒度を分けたくなったタイミングで再評価。 - `crates/pod/tests/controller_test.rs` — `double_run_returns_error` がたまに失敗する flakiness を観測。`pod-interrupt-prep-internalize` 以前から存在する別件。次に controller_test の Run 連投系のタイミングを触るときに併せて原因を切り分け。 +- `crates/session-store/src/fs_store.rs:117-122` — `FsStore::read_entry_count` が `fs::read_to_string` で全文ロードしてから行数カウントするため O(n)。`ensure_head_or_fork` は run-start でしか呼ばれず現状は許容範囲だが、長期セッションが普通になった時点で `\n` バイト数の cheap count か末尾 seek に置き換える。→ [tickets/entry-hash-abolish.review.md] follow-up。 diff --git a/crates/pod/tests/compact_events_test.rs b/crates/pod/tests/compact_events_test.rs index 5611816c..eeea8873 100644 --- a/crates/pod/tests/compact_events_test.rs +++ b/crates/pod/tests/compact_events_test.rs @@ -520,9 +520,9 @@ async fn pre_run_compact_failure_broadcasts_start_and_failed() { // --------------------------------------------------------------------------- // Detached post-run memory jobs (`spawn_post_run_memory_jobs` / // `wait_for_memory_jobs`). Covers the detach round-trip and the structural -// invariant that the cloned memory-task Pod shares `SessionHead` with the +// invariant that the cloned memory-task Pod shares `SessionState` with the // source Pod, so that `save_extension` from the background extract does not -// leave the next turn's `save_user_input` looking at a stale head_hash. +// leave the next turn's `save_user_input` looking at a stale session pointer. const EXTRACT_NO_COMPACT_MANIFEST: &str = r#" [pod] @@ -570,9 +570,9 @@ async fn spawn_and_wait_drives_extract_to_completion() { #[tokio::test] async fn detached_extract_does_not_fork_session_log() { - // Source pod and the cloned memory-task pod share `SessionHead` via - // `Arc>`. The detached extract advances head_hash through - // `save_extension`; the next `run` must see that same head_hash so + // Source pod and the cloned memory-task pod share `SessionState` via + // `Arc<_>`. The detached extract advances the entry tally through + // `save_extension`; the next `run` must see that same tally so // `ensure_head_or_fork` does not spawn a new session. let client = MockClient::new(vec![ text_events_with_usage("hi", 1000), @@ -594,7 +594,7 @@ async fn detached_extract_does_not_fork_session_log() { assert_eq!( session_before, session_after, "detached extract's save_extension and the next turn's save_user_input \ - must share head_hash through SessionHead — a fork here means the clone \ - carried its own head_hash" + must share the entry tally through SessionState — a fork here means the \ + clone carried its own counter" ); } diff --git a/crates/pod/tests/restore_test.rs b/crates/pod/tests/restore_test.rs index 5283c9cf..ff49e7ba 100644 --- a/crates/pod/tests/restore_test.rs +++ b/crates/pod/tests/restore_test.rs @@ -63,7 +63,7 @@ async fn restore_from_manifest_rejects_empty_session_log() { let manifest = pod::PodManifest::from_toml(MINIMAL_MANIFEST_TOML).unwrap(); // Pre-create an empty `.jsonl` so `read_all` succeeds with no - // entries. `collect_state` returns `head_hash = None`, which + // entries. `collect_state` returns `entries_count = 0`, which // `restore_from_manifest` rejects with `SessionEmpty` *before* it // gets as far as building the LLM client — so the test does not // need credentials or a runtime sandbox. diff --git a/crates/session-store/src/lib.rs b/crates/session-store/src/lib.rs index 9979c691..d00f376c 100644 --- a/crates/session-store/src/lib.rs +++ b/crates/session-store/src/lib.rs @@ -18,12 +18,12 @@ //! ```ignore //! use session_store::{create_session, restore, save_delta, FsStore, SessionStartState}; //! -//! let store = FsStore::new("./sessions").await?; -//! let (session_id, head_hash) = create_session(&store, SessionStartState { +//! let store = FsStore::new("./sessions")?; +//! let session_id = create_session(&store, SessionStartState { //! system_prompt: None, //! config: &config, //! history: &[], -//! }).await?; +//! })?; //! ``` pub mod event_trace;