bookworm-smart-assistant/scripts/patches/debug-evolution-log-line55.js

20 lines
688 B
JavaScript
Raw Permalink Normal View History

#!/usr/bin/env node
// 诊断 evolution-log line 55-58 实际内容
const fs = require('fs');
const lines = fs.readFileSync(__dirname + '/../../evolution-log.jsonl', 'utf8').split('\n');
for (const n of [54, 55, 56, 57, 58, 59]) {
const line = lines[n - 1] || '';
console.log(`--- line ${n} (length=${line.length}) ---`);
try {
JSON.parse(line);
console.log(' PARSE OK');
} catch (e) {
console.log(' PARSE FAIL: ' + e.message);
}
console.log(' head: ' + JSON.stringify(line.slice(0, 80)));
console.log(' tail: ' + JSON.stringify(line.slice(-80)));
// 找 }{ 边界
const idx = line.indexOf('}{');
if (idx >= 0) console.log(' has }{ at idx=' + idx);
}