OverviewFilesCommitsIssuesDocsReleasesPeers

knowledge-ratchet commits / 21f0ab1

Add analyze-all.js, fix noise filtering and LLM pipeline
- analyze-all.js: single command runs LLM analysis → pipeline → sentiment - analyze-transcripts.js: filter skill-loading and system messages from sentiment - detect-correction.js: skip LLM analyzer prompts (prevent feedback loop), use correct field name (prompt not user_prompt) - llm-analyzer.js: send all messages to LLM (not just regex-unclassified), track regex disagreements, dedup cursor fix, batch limit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
21f0ab19c599b2843859414d7b9e3f8c34fe9eed
by plankatron <fleeky@gmail.com> · 2026-04-07T01:37:18.000Z

Changed files (2) +58 -0

analyze-all.js +48 -0
……@@ -0,0 +1,48 @@
1#!/usr/bin/env node
2
3// Full analysis pipeline — runs all three steps in sequence
4// Usage: node analyze-all.js [--limit=N]
5//
6// Steps:
7// 1. LLM analyzer (semantic correction detection)
8// 2. Full ratchet pipeline (extract → validate → regress → migrate)
9// 3. Deep sentiment analysis
10
11const { execSync } = require('child_process')
12const path = require('path')
13
14const DIR = __dirname
15const limitArg = process.argv.find(a => a.startsWith('--limit=')) || '--limit=50'
16
17function run (label, cmd) {
18 console.log(`\n${'═'.repeat(60)}`)
19 console.log(` ${label}`)
20 console.log('═'.repeat(60))
21 try {
22 execSync(cmd, { cwd: DIR, encoding: 'utf8', stdio: 'inherit', timeout: 600000 })
23 } catch (e) {
24 console.error(` Failed: ${e.message.slice(0, 200)}`)
25 }
26}
27
28console.log(`Knowledge Ratchet — Full Analysis`)
29console.log(`Started: ${new Date().toISOString()}`)
30
31run(
32 'Step 1/3: LLM Semantic Analysis',
33 `node ${path.join(DIR, 'llm-analyzer.js')} ${limitArg}`
34)
35
36run(
37 'Step 2/3: Ratchet Pipeline (extract → validate → regress → migrate)',
38 `node ${path.join(DIR, 'run.js')} full`
39)
40
41run(
42 'Step 3/3: Deep Sentiment Analysis',
43 `node ${path.join(DIR, 'analyze-transcripts.js')}`
44)
45
46console.log(`\n${'═'.repeat(60)}`)
47console.log(` Complete: ${new Date().toISOString()}`)
48console.log('═'.repeat(60))
analyze-transcripts.js +10 -0
……@@ -164,6 +164,16 @@ async function analyzeSession (filePath) {
164164 if (!text || text.length < 2) continue
165165 if (text.startsWith('!') || text.startsWith('/') || text.startsWith('<')) continue
166166
167 // Filter system noise — these are NOT user messages
168 if (text.startsWith('Base directory for this skill')) continue
169 if (text.startsWith('Implement the following plan')) continue
170 if (text.startsWith('This session is being continued')) continue
171 if (text.startsWith('Service Unavailable')) continue
172 if (/^Godot Engine v|^Vulkan \d/.test(text)) continue
173 if (/^fleeky@\w+\s/.test(text)) continue
174 if (/tool_use_id|tool_result/.test(text)) continue
175 if (/^\[Request interrupted/.test(text)) continue
176
167177 userMessages.push(text)
168178
169179 // Score frustration