summaryrefslogtreecommitdiff
path: root/docs/Design.md
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-29 09:15:24 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-29 09:15:24 +0900
commit5b063df8868ef8cdc2a6aab7a670f911bc0ea9a4 (patch)
treead42c80733be664ccee5dcf3211ba3bb63328acf /docs/Design.md
parentd57577637c1c1a16176d63d5a89e9eec3c1e4d7c (diff)
feat: read_messagesに本文範囲取得viewを追加HEADv0.1.2main
大きなメッセージをMCPホストのtool result上限に触れず取得できるよう、read_messagesへcontent viewを追加する。UTF-8 byte単位のcontent_offset/content_limitとnext_content_offsetにより、文字境界を壊さず反復取得できる。 各chunkにrevisionとtotal_bytesを返し、expected_revisionで取得途中の更新をCONFLICTとして検出する。未知または削除済みmessageはNOT_FOUND、不正な範囲はVALIDATION_ERRORとする。読み取りには既存memory indexを利用し、永続data、revision、I/O counterを変更しない。 新規MCP toolは増やさず、従来の7 tool構成とhistory/context/sessionsの契約を維持する。storage recordとsnapshot形式も変更しないためmigrationとrebuildは不要。 README、設計書、MCPリファレンスを更新し、多言語UTF-8本文の完全再構成、境界・limit・revision・削除済みmessage、read-only I/O、既存view回帰をprotocol testで検証する。 Tests: ctest --test-dir build/range-read-test -C Release --output-on-failure (20/20 passed)
Diffstat (limited to 'docs/Design.md')
-rw-r--r--docs/Design.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/Design.md b/docs/Design.md
index f370b74..b9a05c7 100644
--- a/docs/Design.md
+++ b/docs/Design.md
@@ -96,12 +96,24 @@ content または metadata を部分更新する。`expected_revision` が一致
次の view を持つ。
- `history`: session の時系列ページ。安定 cursor を返す
+- `content`: message contentをUTF-8 byte offsetとbounded limitで分割取得する
- `context`: target の前後メッセージと incoming/outgoing relation を返す。relation depth は 0~2
- `sessions`: session ごとの件数、kind 集計、代表 summary、最終時刻を返す
- `export`: versioned JSONL をページ出力する互換 view
レスポンスは 8 MiB budget を超えない位置でページを区切る。
+`content` viewは既定4096 bytes、最大65536 bytesを返す。offsetは0、末尾、またはUTF-8
+code point境界だけを受理し、limit位置がcode point途中なら直前の境界まで戻す。limitが
+1 code pointより小さい場合だけ、そのcode pointを完全に返して進捗を保証する。各responseの
+`revision`と`total_bytes`を返し、2回目以降の`expected_revision`で途中更新を`CONFLICT`として
+検出する。このviewは永続data、access履歴、revisionを変更しない。message検索に必要な既存の
+in-memory indexは、他のread viewと同様に必要時だけ構築する。
+
+このview追加は既存toolへのadditive schema changeだけである。既存viewのinput、response、
+cursor semanticsと、保存recordおよびsnapshotのformat versionは変更しないため、data migration
+とrebuildは不要であり、旧binaryと新binaryは同じdataを読み込める。
+
### `search_messages`
content、summary、tags を対象に検索する。session、kind、tier、tag、minimum importance で絞り込める。matched fields、score と field 別 score 内訳、任意の前後 context を返す。