Skip to content

Make query profile scoring real, or remove the stale abstraction #71

Description

@catoncat

Review umbrella: #69

Problem

Sherlog has query profile classification, but current scoring does not actually branch on broad vs exact query kind. That makes the abstraction easy to misunderstand and risky to tune by intuition.

The paper's retrieval/query-routing module argues for evaluating routing precision explicitly. For Sherlog, that does not mean adding a natural-language planner; it means either using the existing profile in a small eval-backed scoring branch or deleting the stale abstraction.

Local Evidence

  • src/ranking.ts:classifyQueryProfile() defines broad/exact/path-like query metadata.
  • src/ranking.ts comments state that v3 scoring no longer branches on kind and primarily uses local row/session signals.
  • src/query-profile.test.ts verifies classification for broad terms, multi-term exact queries, digits, and path-like command strings.
  • src/query-session-ranking.test.ts already covers several ranking behaviors: title hit vs incidental mention, sustained broad evidence vs title-only hit, distinct sessions with collapsed titles, and path-like command query ranking.
  • docs/ROADMAP.md and AGENTS.md both identify broad/exact scoring as not fully landed.

Scope

After #70 exists, choose one of two paths:

  1. Make query profile affect scoring in a narrow, measured way.
  2. Remove or de-emphasize classifyQueryProfile() if the current heuristic ranking is intentionally profile-agnostic.

If path 1 is chosen, candidate changes should stay conservative:

  • Exact/path-like queries can reward phrase adjacency, command/path boundedness, and full term coverage.
  • Broad single-term queries can reward sustained session evidence and avoid over-weighting incidental title/cwd hits.
  • Time sorting should remain explicit through --sort ended; do not infer time scopes from free text in this issue.

Acceptance Criteria

  • P0: Strengthen retrieval eval into an evidence-level acceptance gate #70 contains eval cases that fail before and pass after any scoring change.
  • Scoring behavior either uses query profile kind meaningfully or the stale abstraction is removed.
  • Ranking docs and tests explain the chosen behavior.
  • Existing source-aware/session-level recall behavior remains stable.

Non-Goals

  • No broad natural-language planner.
  • No vector or graph retrieval.
  • No ranking changes without evidence-level eval coverage.

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