fix(panel): guard SQLite schema init and recover .pb sessions (#41)

- Add lock-free 100-byte SQLite header readiness check before opening local
  DBs so high-frequency scans skip 0-byte, pre-DDL, 32-byte WAL-header-only,
  and active rollback-journal DBs without triggering schema-init lock races
- Separate unready DB skips from confirmed empty-shell DBs and fall back to
  transcript.jsonl / size-capped transcript_full.jsonl with .pb + transcript
  signature tracking and subagent ref recovery
- Extract shared transcript JSONL fallback parsing reused by local-scanner
  and cli-statusline, including .pb-aware candidate ranking and root redirect
This commit is contained in:
yuhuan2498281558
2026-11-25 14:06:55 +09:00
committed by fish
parent 8a01705e6f
commit 57c298775b
8 changed files with 1149 additions and 160 deletions
@@ -24,6 +24,7 @@ import {
computeSqliteWalSig,
getNodeSqliteDatabaseSync,
hasBuiltinNodeSqlite,
isSqliteDbReadyForRead,
normalizeSqliteIsoTime,
withReadOnlySqliteDb,
} from './sqlite-client.mjs';
@@ -43,6 +44,7 @@ export {
computeSqliteWalSig,
getNodeSqliteDatabaseSync,
hasBuiltinNodeSqlite,
isSqliteDbReadyForRead,
withReadOnlySqliteDb,
};