Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[Bug] tools/TrendingAnalysis.ts missing from release — RatingCapture silently fails to update trending signals

Open rikitikitavi2012-debug opened this issue 9 months ago • 1 comments

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 script
  • tools/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:

  1. Read MEMORY/LEARNING/SIGNALS/*.jsonl files
  2. Compute trends (moving averages, topic frequency)
  3. Write updated trending summary

Environment

  • PAI v3.0
  • Claude Code 2.1.50

rikitikitavi2012-debug avatar Feb 22 '26 17:02 rikitikitavi2012-debug

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!

kaimagnus avatar Mar 01 '26 02:03 kaimagnus