mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): migrate trajectory cache to incremental SQLite ledger
- Add short-connection WAL trajectory_store.sqlite (and remote ssh-*.sqlite) with transactional .json-to-.bak migration, O(delta) step UPSERTs, undo tail truncation, and ledger_epoch/write_seq cross-process sync - Split steps into string-interned compact accounting tuples (retaining anomaly and step account owners) and lazy detail_json with an explicit 24-session hot LRU and precomputed O(1) cold metadata flags - Archive deleted source conversations permanently across cache rebuilds and skip redundant 404 trajectory RPCs while un-archiving automatically if sources reappear
This commit is contained in:
@@ -18,7 +18,10 @@ import {
|
||||
} from './endpoint-registry.mjs';
|
||||
import { isLocalHostRequest, readLocalAsync } from './http-helpers.mjs';
|
||||
import { revealLocalExportFile, writeLocalExportFile } from './file-exporter.mjs';
|
||||
import { clearScannerRuntimeMemos } from './local-scanner.mjs';
|
||||
import {
|
||||
clearScannerRuntimeMemos,
|
||||
collectAuthoritativeLiveCascadeIds,
|
||||
} from './local-scanner.mjs';
|
||||
import {
|
||||
SETTINGS_FILE,
|
||||
clearRuntimeCaches,
|
||||
@@ -556,9 +559,12 @@ export function executeRebuildCacheAction(data = undefined, opts = {}) {
|
||||
if (!epCtx.ok) {
|
||||
return buildEndpointErrorResponse(epCtx);
|
||||
}
|
||||
const liveCascadeIds = collectAuthoritativeLiveCascadeIds(
|
||||
epCtx.isRemote ? epCtx.endpoint : null
|
||||
);
|
||||
const ok = epCtx.isRemote
|
||||
? clearRemoteEndpointCaches(epCtx.id)
|
||||
: clearRuntimeCaches();
|
||||
? clearRemoteEndpointCaches(epCtx.id, { liveCascadeIds })
|
||||
: clearRuntimeCaches({ liveCascadeIds });
|
||||
if (!ok) {
|
||||
return {
|
||||
ok: false,
|
||||
|
||||
Reference in New Issue
Block a user