Replace truncated review input with paged, resumable batches and retain extracted facts and source references through navigation summaries. Expose concurrency, timeouts, batch budgets and response capacity in supervisor settings. Separate automatic supervision from review results, activity and settings; use a standard plan modal and show execution stages with saved batch details. Fix historical entity identity mapping, navigation output validation and arbitrary summary length failures. Include focused regressions, isolated real-data validation scripts and updated design and verification records. Overall layout acceptance remains outstanding; this commit does not claim that all visual issues are resolved. Release note: 监督回顾支持完整分页、分批保存和暂停后继续,可配置并发、超时及响应容量;修复实体引用、汇总校验和长摘要报错,并重新组织自动监督与活动记录入口。
25 lines
1.5 KiB
JavaScript
25 lines
1.5 KiB
JavaScript
/* global require, process, console */
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const { DatabaseSync, backup } = require('node:sqlite')
|
|
const { mkdirSync, writeFileSync, existsSync, cpSync } = require('node:fs')
|
|
const { join, dirname } = require('node:path')
|
|
async function main() {
|
|
const [source, output, runId] = process.argv.slice(2)
|
|
if (existsSync(output)) throw new Error('Use a new private output directory')
|
|
mkdirSync(output, { recursive: true })
|
|
const db = new DatabaseSync(source, { readOnly: true })
|
|
const run = db.prepare('SELECT * FROM supervision_runs WHERE id=?').get(runId)
|
|
if (!run) throw new Error('Exact run not found')
|
|
const state = db.prepare('SELECT * FROM supervision_review_runs WHERE run_id=?').get(runId)
|
|
const sources = db.prepare('SELECT * FROM supervision_review_sources WHERE run_id=? ORDER BY project_id, conversation_id, sequence, source').all(runId)
|
|
const batches = db.prepare('SELECT * FROM supervision_review_batches WHERE run_id=?').all(runId)
|
|
const report = { source, run, state, sources, batches }
|
|
writeFileSync(join(output, 'incident.private.json'), JSON.stringify(report, null, 2))
|
|
await backup(db, join(output, 'assistant.sqlite'))
|
|
db.close()
|
|
const notes = join(dirname(source), 'notes')
|
|
if (existsSync(notes)) cpSync(notes, join(output, 'notes'), { recursive: true })
|
|
console.log(JSON.stringify({ run, state, sources: sources.length, batches: batches.length, output }))
|
|
}
|
|
main().catch(error => { console.error(error); process.exitCode = 1 })
|