#!/usr/bin/env node
// Full analysis pipeline — runs all seven steps in sequence
// Usage: node analyze-all.js [--limit=N]
//
// Steps:
// 1. LLM analyzer (semantic correction detection)
// 2. Regex tuner (LLM-driven pattern discovery)
// 3. Sensor fusion scoring (fuse-signals.js)
// 4. Meta-ratchet (self-adjusting sensor weights)
// 5. Coverage map (unknown-unknowns)
// 6. Ratchet pipeline (extract → validate → regress → migrate)
// 7. Deep sentiment analysis
const { execSync } = require('child_process')
const path = require('path')
const DIR = __dirname
const limitArg = process.argv.find(a => a.startsWith('--limit=')) || '--limit=50'
function run (label, cmd) {
console.log(`\n${'═'.repeat(60)}`)
console.log(` ${label}`)
console.log('═'.repeat(60))
try {
execSync(cmd, { cwd: DIR, encoding: 'utf8', stdio: 'inherit', timeout: 600000 })
} catch (e) {
console.error(` Failed: ${e.message.slice(0, 200)}`)
}
}
console.log(`Knowledge Ratchet — Full Analysis`)
console.log(`Started: ${new Date().toISOString()}`)
run(
'Step 1/7: LLM Semantic Analysis',
`node ${path.join(DIR, 'llm-analyzer.js')} ${limitArg}`
)
run(
'Step 2/7: Regex Tuner (LLM-driven pattern discovery)',
`node ${path.join(DIR, 'tune-regex.js')}`
)
run(
'Step 3/7: Sensor Fusion Scoring',
`node ${path.join(DIR, 'fuse-signals.js')}`
)
run(
'Step 4/7: Meta-Ratchet (weight learning)',
`node ${path.join(DIR, 'meta-ratchet.js')}`
)
run(
'Step 5/7: Coverage Map (unknown-unknowns)',
`node ${path.join(DIR, 'coverage-map.js')} --summary`
)
run(
'Step 6/7: Ratchet Pipeline (extract → validate → regress → migrate)',
`node ${path.join(DIR, 'run.js')} full`
)
run(
'Step 7/7: Deep Sentiment Analysis',
`node ${path.join(DIR, 'analyze-transcripts.js')}`
)
console.log(`\n${'═'.repeat(60)}`)
console.log(` Complete: ${new Date().toISOString()}`)
console.log('═'.repeat(60))