fix: preserve snapshot paths and reject malformed skill tracking rows

This commit is contained in:
haelyra
2026-10-11 06:32:21 -04:00
parent 2df7533ee4
commit a7e5c4d030
5 changed files with 97 additions and 8 deletions
+4 -1
View File
@@ -103,7 +103,10 @@ function readJsonl(filePath) {
.reduce((rows, line) => {
try {
const record = JSON.parse(line);
if (record && typeof record === 'object' && !Array.isArray(record)) {
if (record && typeof record === 'object' && !Array.isArray(record)
&& typeof record.skill_id === 'string' && record.skill_id.trim().length > 0
&& VALID_OUTCOMES.has(record.outcome)
&& typeof record.recorded_at === 'string' && !Number.isNaN(Date.parse(record.recorded_at))) {
rows.push(record);
}
} catch {