Skip to content

Assemble evidence for session-only recall hits without adding a top-level command #72

Description

@catoncat

Review umbrella: #69

Problem

Session-level recall is implemented and useful, but a session-only hit does not have a message sequence anchor. That makes the next evidence-read step weaker than message hits.

The earlier find --bundle idea should be reframed around this concrete gap: when find returns a session-level hit from title/summary/compact/reasoning text, Sherlog should help the agent reach raw supporting transcript context without adding a new top-level command.

This maps to the paper's retrieval fidelity and long-horizon stability questions: recall should not stop at a derived summary if the answer depends on raw chronological evidence.

Local Evidence

  • src/query/search.ts:searchSessionHits() and session FTS return session-level hits with matchSource = "session" and matchSeq = null.
  • src/query-session-fields.test.ts verifies title-only and compact/reasoning session recall, including matchSeq = null.
  • src/query/read.ts:getMessageRange() can anchor by explicit seq or by searching messages inside a session.
  • src/query/read.ts:searchTopHitInSession() currently searches message hits, not session fields.
  • eval/dogfood-eval-core.ts:desiredContextMode() already treats session-only hits as read-page candidates.
  • AGENTS.md fixes the accepted command surface, so this should not create gather or another top-level command.

Scope

Design an opt-in evidence assembly path on the existing find surface, or improve follow-up read guidance for session-only hits.

Possible implementation shape:

  • For message hits, keep using bounded read-range around matchSeq.
  • For session-only hits, return a bounded read-page fallback plus clear follow-up command.
  • Optionally group multiple top hits into a compact evidence bundle behind a find flag.
  • Deduplicate overlapping ranges within the same session.
  • Keep output tied to raw messages and session refs.

Acceptance Criteria

  • No new top-level command is added.
  • Session-only hits have an explicit, tested path to raw transcript context.
  • JSON output includes enough fields for another agent to read the evidence deterministically.
  • P0: Strengthen retrieval eval into an evidence-level acceptance gate #70 includes fixture coverage for session-only evidence assembly.
  • Normal find output remains stable unless the new opt-in flag is used.

Non-Goals

  • Do not replace raw reads with generated summaries.
  • Do not implement duplicate-family collapse or heavy diversity control beyond the minimum needed for a compact bundle.
  • Do not build vector/graph retrieval for this issue.

Trace

  • deep review request: cxs_deep_review_correction_20260626T040901Z_api_append
  • issue update request: cxs_update_issues_after_review_20260626T044426Z_api_append

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions