fix(highlights): anchor report comparison sentiment on impact_score formula (GLOOK-20)#55
Conversation
Add _v:2 versioned wrapper to cache read/write so stale pre-migration results (bare arrays) are transparently regenerated. Update tests: two cached-highlights tests use _v:2 format, add stale-cache miss test, fix deprecated system-prompt string assertion for capitalization, add avg_impact= and formula assertions. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…update snapshot - Rewrite report-highlights-system.txt to define PERFORMANCE FORMULA - Add RULES FOR SENTIMENT restricting positive/warning to impact_score movement - Add directive that complexity changes are NOT independently directional - Update snapshots: system prompt and user message reflect formula + avg_impact Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Claude Code Review
🟡 Important —
|
…nt, rank#undefined, prompt disambiguation
Summary
Changes
Prompt rewrite (
prompts/report-highlights-system.txt): adds the PERFORMANCE FORMULA definition so the LLM understandsimpact_scoreis the only authoritative measure, and restrictspositive/warningsentiment toimpact_scoremovement only. All other metrics (commits, complexity, AI%, lines) must be described neutrally.Data (
service.ts): addsavg_impactto both report totals so the LLM has the aggregate performance signal to anchor on.Cache guard (
service.ts): adds_v: 2versioning to thereport_comparisonscache. Rows stored with the old prompt (bare array format) are transparently treated as stale and regenerated on the next page load.Test plan
impact_scoremoved in that direction🤖 Generated with Claude Code