worker: reuse session reference for compaction reads
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: 'Compactionのsession探索toolsをSessionReferenceViewへ移行する'
|
||||
state: 'closed'
|
||||
created_at: '2026-07-17T23:54:22Z'
|
||||
updated_at: '2026-07-18T00:02:34Z'
|
||||
assignee: null
|
||||
---
|
||||
|
||||
## 背景
|
||||
|
||||
`SessionReferenceView` は extract / compact の共通基盤として導入されたが、直後の実装では compaction の `search_session_log` のみが view を使い、`read_session_items` は旧 compact 専用 formatter / direct item traversal のままだった。
|
||||
|
||||
既存 compact も explore tool 群を利用するものに寄せるため、この Ticket では compaction の session read/search tools を `SessionReferenceView` へ統合する。
|
||||
|
||||
## 実装要件
|
||||
|
||||
- compaction の `search_session_log` は `SessionReferenceView::search` を使う。
|
||||
- compaction の `read_session_items` は `SessionReferenceView::read` を使う。
|
||||
- `read_session_items` の existing `mode = compact | full` semantics は維持する。
|
||||
- compact: tool arguments / tool result content を omitted にする。
|
||||
- full: bounded に tool arguments / tool result content を読める。
|
||||
- 旧 compact 専用の session search / format helper を削除する。
|
||||
- `SessionReferenceView` 側に read detail mode を追加し、compact / full を表現できるようにする。
|
||||
- 既存 compact tests を維持または更新する。
|
||||
|
||||
## 非目標
|
||||
|
||||
- compaction prompt を大きく変えない。
|
||||
- compact worker の tool 名を変更しない。
|
||||
- extract の `session-explore` feature 本体はこの Ticket では実装しない。
|
||||
|
||||
## 受け入れ条件
|
||||
|
||||
- `search_session_log` と `read_session_items` がどちらも `SessionReferenceView` を経由する。
|
||||
- compact mode で raw tool content が出ない。
|
||||
- full mode で bounded tool content が読める。
|
||||
- `cargo test -p worker compact::worker` が通る。
|
||||
- `cargo test -p worker` が通る。
|
||||
- code 変更として `nix build .#yoi` が通る。
|
||||
@@ -0,0 +1,11 @@
|
||||
Compaction session exploration now uses `SessionReferenceView` for both search and read paths.
|
||||
|
||||
`read_session_items` delegates to `SessionReferenceView::read`, preserving compact/full behavior through a new read detail mode. Old compact-specific search/format helpers were removed.
|
||||
|
||||
Validation passed:
|
||||
- `cargo fmt --check`
|
||||
- `cargo test -p worker compact::worker`
|
||||
- `cargo test -p worker session_reference`
|
||||
- `cargo test -p worker`
|
||||
- `cargo test -p memory`
|
||||
- `nix build .#yoi`
|
||||
@@ -0,0 +1,68 @@
|
||||
<!-- event: create author: "yoi ticket" at: 2026-07-17T23:54:22Z -->
|
||||
|
||||
## 作成
|
||||
|
||||
LocalTicketBackend によって作成されました。
|
||||
|
||||
---
|
||||
|
||||
<!-- event: implementation_report author: hare at: 2026-07-18T00:02:34Z -->
|
||||
|
||||
## Implementation report
|
||||
|
||||
Migrated compaction session exploration to `SessionReferenceView`.
|
||||
|
||||
Changes:
|
||||
- Added `ReadDetail` to `SessionReferenceView` so reads can preserve compact/full semantics.
|
||||
- Updated `read_session_items` to use `SessionReferenceView::read` with `ReadSelector::EntryRange`.
|
||||
- Kept compact mode omitting tool arguments / tool result content and full mode bounded.
|
||||
- Removed old compact-specific session search/format helpers.
|
||||
- `search_session_log` already used `SessionReferenceView::search` and remains on that path.
|
||||
|
||||
Validation:
|
||||
- `cargo fmt --check`
|
||||
- `cargo test -p worker compact::worker`
|
||||
- `cargo test -p worker session_reference`
|
||||
- `cargo test -p worker`
|
||||
- `cargo test -p memory`
|
||||
- `nix build .#yoi`
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T00:02:34Z from: inprogress to: done reason: cli_state field: state -->
|
||||
|
||||
## State changed
|
||||
|
||||
State changed to `done`.
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!-- event: state_changed author: hare at: 2026-07-18T00:02:34Z from: done to: closed reason: closed field: state -->
|
||||
|
||||
## State changed
|
||||
|
||||
Ticket を closed にしました。
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!-- event: close author: hare at: 2026-07-18T00:02:34Z status: closed -->
|
||||
|
||||
## 完了
|
||||
|
||||
Compaction session exploration now uses `SessionReferenceView` for both search and read paths.
|
||||
|
||||
`read_session_items` delegates to `SessionReferenceView::read`, preserving compact/full behavior through a new read detail mode. Old compact-specific search/format helpers were removed.
|
||||
|
||||
Validation passed:
|
||||
- `cargo fmt --check`
|
||||
- `cargo test -p worker compact::worker`
|
||||
- `cargo test -p worker session_reference`
|
||||
- `cargo test -p worker`
|
||||
- `cargo test -p memory`
|
||||
- `nix build .#yoi`
|
||||
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user