[Bug] tools/TrendingAnalysis.ts missing from release — RatingCapture silently fails to update trending signals
Summary
RatingCapture.hook.ts references tools/TrendingAnalysis.ts (at ~/.claude/tools/TrendingAnalysis.ts) but this file is not included in the PAI v3.0 release. Every rating capture silently fails to update trending signal analysis.
Affected Files
hooks/RatingCapture.hook.ts— references the missing scripttools/TrendingAnalysis.ts— missing from repository
Reference in RatingCapture
// hooks/RatingCapture.hook.ts
const TRENDING_SCRIPT = join(BASE_DIR, 'tools', 'TrendingAnalysis.ts');
// ...
if (existsSync(TRENDING_SCRIPT)) {
Bun.spawn(['bun', 'run', TRENDING_SCRIPT, ...], { ... });
console.error('[RatingCapture] Triggered TrendingAnalysis update');
}
The hook uses existsSync as a guard (so no crash), but the feature silently doesn't work.
Impact
- Trending signal analysis never runs
MEMORY/LEARNING/SIGNALS/trending data is never computed- No error is thrown — users have no indication the feature is broken
Expected Behavior
After each rating capture, TrendingAnalysis.ts runs to update trending signals in MEMORY/LEARNING/SIGNALS/.
Actual Behavior
existsSync(TRENDING_SCRIPT) returns false, the spawn is skipped silently, trending analysis never runs.
Workaround
The file needs to be created at ~/.claude/tools/TrendingAnalysis.ts with logic to:
- Read
MEMORY/LEARNING/SIGNALS/*.jsonlfiles - Compute trends (moving averages, topic frequency)
- Write updated trending summary
Environment
- PAI v3.0
- Claude Code 2.1.50
Fixed in v4.0.2 — removed dead TrendingAnalysis.ts reference, the TRENDING_SCRIPT constant, the triggerTrending() function, and all 4 call sites from RatingCapture.hook.ts. The file never existed in the shipped system. Thanks for reporting!