chat: huginn chat window (event id with its neighbours, from the chat index) #59

Merged
eureka merged 2 commits from gamecult-chat/chat-window into main 2026-11-11 19:49:05 +00:00
Owner

Executes cut gamecult-chat:cut_spec:cut-chat-window.r2 at main 421ace5.

  • sources::window: anchor chunk by event_ids, then same-room neighbour chunks both ways (5 per read, 6 reads max), dedupe by event id, cut to before/after, more_before/more_after. Unknown id: typed SelectionInvalid on event_id naming the three reasons. Id in two chunks: index fault. No embedder, no Synapse.
  • ChatFilter gains event_id and chunk-start bounds; chat_scroll gains ChatOrder; Found::Window/Found::Refused carry the typed answer.
  • Wire: ChatWindowQuery/ChatWindow, request and response variants, schemas regenerated. CLI: huginn chat window <EVENT_ID> [--before N] [--after N] [--json].
  • Tests (docker, scoped -p huginn-mind -p huginn-daemon -p eureka-state): all pass; cargo check --locked --workspace ok.
  • Soul follow-up: window order is (ts, chunk start, first event id, position), independent of the anchor; each read asks for the held chunks at the edge as well, so 6+ chunks at one start ms are all reached; message bodies print their line breaks as \\n in search and window output; tests for ties, caps (6 reads x 5 chunks), dedupe, unreached flag, and a forge point refused. Mutants run: 18, all caught after adding two tests (M1a, M10 had survived).
  • Not done: the F2 listing-continuation limit; the spec does not assign it (the map doc says it does), left open and noted in docs.

Expect a textual conflict with chat-ingest-core in sources/mod.rs and index files.

🤖 Generated with Claude Code

Executes cut `gamecult-chat:cut_spec:cut-chat-window.r2` at main 421ace5. - `sources::window`: anchor chunk by `event_ids`, then same-room neighbour chunks both ways (5 per read, 6 reads max), dedupe by event id, cut to before/after, `more_before`/`more_after`. Unknown id: typed `SelectionInvalid` on `event_id` naming the three reasons. Id in two chunks: index fault. No embedder, no Synapse. - `ChatFilter` gains `event_id` and chunk-start bounds; `chat_scroll` gains `ChatOrder`; `Found::Window`/`Found::Refused` carry the typed answer. - Wire: `ChatWindowQuery`/`ChatWindow`, request and response variants, schemas regenerated. CLI: `huginn chat window <EVENT_ID> [--before N] [--after N] [--json]`. - Tests (docker, scoped `-p huginn-mind -p huginn-daemon -p eureka-state`): all pass; `cargo check --locked --workspace` ok. - Soul follow-up: window order is (ts, chunk start, first event id, position), independent of the anchor; each read asks for the held chunks at the edge as well, so 6+ chunks at one start ms are all reached; message bodies print their line breaks as `\\n` in search and window output; tests for ties, caps (6 reads x 5 chunks), dedupe, unreached flag, and a forge point refused. Mutants run: 18, all caught after adding two tests (M1a, M10 had survived). - Not done: the F2 listing-continuation limit; the spec does not assign it (the map doc says it does), left open and noted in docs. Expect a textual conflict with chat-ingest-core in sources/mod.rs and index files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sources::window resolves an event id to its chunk, then walks chunks of the
same room both ways (5 per read, at most 6 reads a side), dedupes by event id
and cuts to before/after with more_before/more_after. An id the index lacks is
a typed SelectionInvalid on event_id naming the three reasons; an id in two
chunks is an index fault. No embedder, no Synapse. ChatFilter gains event_id
and chunk-start bounds, chat_scroll gains an order, the wire gains ChatWindow
request/response, the CLI gains `huginn chat window`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Order by (ts, chunk start, chunk first event id, position) so the window does
not depend on its anchor. Each read asks for the held chunks at the edge in
addition, so a run of chunks at one start ms cannot fill a read with held ones;
the no-gain early stop is gone. Search and window print a body's line breaks as
\n. Tests pin ties, caps, dedupe, the unreached flag and non-chat points.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
eureka merged commit 36dd8ce3ca into main 2026-11-11 19:49:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Huginn!59
No description provided.