Files
goodbuddy/scripts/supervision-production-audit.cjs
mesalogo db5e43d7d5 fix: complete supervisor review coverage and execution workflow
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: 监督回顾支持完整分页、分批保存和暂停后继续,可配置并发、超时及响应容量;修复实体引用、汇总校验和长摘要报错,并重新组织自动监督与活动记录入口。
2026-09-25 22:32:43 +08:00

24 lines
1.3 KiB
JavaScript

/* global require, process, console */
/* eslint-disable @typescript-eslint/no-require-imports */
const { DatabaseSync } = require('node:sqlite')
const db = new DatabaseSync(process.argv[2], { readOnly: true })
try {
db.exec('PRAGMA query_only = ON')
console.log(JSON.stringify({
runs: db.prepare('SELECT status, error FROM supervision_runs').all(),
coverage: db.prepare(`SELECT COUNT(*) AS sources, SUM(length) AS totalCodePoints,
SUM(processed_offset - initial_offset) AS savedCodePoints,
SUM(processed_offset = length) AS completeSources, SUM(processed_offset < length) AS remainingSources
FROM supervision_review_sources`).get(),
batches: db.prepare(`SELECT COUNT(*) AS batches,
SUM(json_array_length(evidence_json)) AS spans,
SUM(json_array_length(output_json, '$.events')) AS events,
SUM(json_array_length(output_json, '$.entities')) AS entities,
SUM(json_array_length(output_json, '$.entityChanges')) AS changes,
SUM(json_array_length(output_json, '$.relations')) AS relations FROM supervision_review_batches`).get(),
checkpoints: db.prepare('SELECT COUNT(*) AS count FROM review_checkpoints').get(),
results: db.prepare('SELECT COUNT(*) AS count FROM supervision_results').get(),
integrity: db.prepare('PRAGMA integrity_check').get()
}, null, 2))
} finally { db.close() }