Skip to content

Chat context never includes performance review narratives — chat claims 'no performance data' while Prep Brief cites 18 items from the same DB #154

Description

@matthewod11-stack

Description

Found during v0.2.8 gate QA (2026-07-15). Asked chat to "Write a performance review for Maya" (employee with 2 full review narratives on file, no numeric ratings): chat replied "I don't have Maya's performance data in my system—no ratings, feedback, or review history." Immediately after, Prep Brief rendered ~18 grounded facts from those same reviews. The two features read different slices of the DB and the user experiences it as the assistant lying about what it knows.

Current State

src-tauri/src/context/ reads performance_ratings only (retrieval.rs:311,505,802,826; aggregates.rs:213; verification.rs:301). Zero references to performance_reviews anywhere in the context module; performance_reviews_fts is only used by the reviews module itself. people_map/context.rs (brief assembler) reads the narratives directly via get_reviews_for_employee. An employee with reviews-but-no-ratings is invisible to chat's performance context.

Suggested Fix

  • Decide inclusion shape under the existing token-budget system: full narratives for the focused employee vs. summary + "N reviews on file (latest YYYY-MM-DD)" acknowledgment vs. FTS-retrieved excerpts on performance-intent queries
  • At minimum, the context builder must tell the model reviews EXIST (count + dates) so it never claims "no review history" when there is one
  • Add a context test: employee with reviews-but-no-ratings → performance-intent query context mentions the reviews

Verification

  • cargo test --manifest-path src-tauri/Cargo.toml passes
  • Repro case: seed an employee with reviews only (see scripts/dev-seed-people-map-fixtures.sql), ask chat for a performance review → response draws on (or at least acknowledges) the narratives

Automation Hints

scope: src-tauri/src/context/
do-not-touch: src-tauri/src/people_map/, src-tauri/src/recruiting/
approach: refactor-to-config
risk: medium
max-files-changed: 5
blocked-by: none
bail-if: fix requires changing the system-prompt token budget contract or provider payload shape

Priority

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtEligible for automated overnight fixing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions