@edihasaj/recall 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/{chunk-W75S5CK3.js → chunk-3LL5S473.js} +2 -2
- package/dist/{chunk-YDVBXHX2.js → chunk-3ZA4YOFN.js} +5 -5
- package/dist/{chunk-QPOOF2GK.js → chunk-4LTGMFHN.js} +3 -3
- package/dist/{chunk-S46JVROA.js → chunk-6U7YMPBE.js} +2 -2
- package/dist/{chunk-BTD3BYVV.js → chunk-BOUMOPKD.js} +2 -2
- package/dist/{chunk-63H4ENYA.js → chunk-HYDNV5T2.js} +351 -139
- package/dist/chunk-HYDNV5T2.js.map +1 -0
- package/dist/{chunk-BJZCBMU4.js → chunk-J3F3CLWL.js} +7 -7
- package/dist/{chunk-MZTZKBRL.js → chunk-JSKYG7TC.js} +2 -2
- package/dist/{chunk-M5MPUMCJ.js → chunk-LOWPEB72.js} +3 -3
- package/dist/{chunk-DQMKYMUS.js → chunk-MD2LUEVD.js} +435 -89
- package/dist/chunk-MD2LUEVD.js.map +1 -0
- package/dist/{chunk-EX5UTOIU.js → chunk-N2ONUBXR.js} +9 -9
- package/dist/{chunk-VH3FI2X3.js → chunk-OHWHU653.js} +843 -144
- package/dist/chunk-OHWHU653.js.map +1 -0
- package/dist/{chunk-MQPMF5F3.js → chunk-PW42PFVO.js} +7 -7
- package/dist/{chunk-2WBJWKIK.js → chunk-QKGE74LD.js} +8 -5
- package/dist/chunk-QKGE74LD.js.map +1 -0
- package/dist/{chunk-FOJHR4JJ.js → chunk-QOMNHKYE.js} +2 -2
- package/dist/{chunk-AVUTQWZE.js → chunk-RSBIISGE.js} +5 -5
- package/dist/{chunk-V3MYT3AT.js → chunk-URQEUH7T.js} +3 -3
- package/dist/{chunk-EDUIDJWZ.js → chunk-VV2QPDAM.js} +2 -2
- package/dist/{chunk-EDUIDJWZ.js.map → chunk-VV2QPDAM.js.map} +1 -1
- package/dist/{cleanup-EDWLCJPH.js → cleanup-QC7EHMUB.js} +11 -11
- package/dist/cli.js +209 -162
- package/dist/cli.js.map +1 -1
- package/dist/{codex-trust-H6KNABHV.js → codex-trust-4RI6LCAI.js} +4 -4
- package/dist/daemon.js +208 -48
- package/dist/daemon.js.map +1 -1
- package/dist/dispatcher-XGATH6Q5.js +22 -0
- package/dist/{embeddings-W24SA6R3.js → embeddings-RS3GK3TS.js} +5 -5
- package/dist/ingest-RGPV5QYT.js +20 -0
- package/dist/{keychain-LVWMAS7D.js → keychain-BRWB5CL5.js} +3 -3
- package/dist/mcp.js +15 -15
- package/dist/{memory-value-GMYJ5NGO.js → memory-value-6KDRPDXE.js} +11 -11
- package/dist/{provenance-KSBMVJO5.js → provenance-NLVTH5ZK.js} +9 -9
- package/dist/quality-QPRUXM4B.js +25 -0
- package/dist/retrieval-N5FQRL2V.js +15 -0
- package/dist/{store-QYLHMBPE.js → store-DXJJ7VOQ.js} +4 -4
- package/dist/sync-server.js +2 -2
- package/dist/{tasks-7P7XOGSC.js → tasks-32RY4KNA.js} +11 -11
- package/dist/{usage-KVVZQTZA.js → usage-3EMXD6MZ.js} +4 -4
- package/dist/webui/assets/{GraphPage-DJhwG-72.js → GraphPage-BH_Mch3C.js} +2 -2
- package/dist/webui/assets/{GraphPage-DJhwG-72.js.map → GraphPage-BH_Mch3C.js.map} +1 -1
- package/dist/webui/assets/{index-Cpn2MjW0.js → index-CPFc-fiv.js} +25 -25
- package/dist/webui/assets/index-CPFc-fiv.js.map +1 -0
- package/dist/webui/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-2WBJWKIK.js.map +0 -1
- package/dist/chunk-63H4ENYA.js.map +0 -1
- package/dist/chunk-DQMKYMUS.js.map +0 -1
- package/dist/chunk-VH3FI2X3.js.map +0 -1
- package/dist/dispatcher-W3PTGEKN.js +0 -22
- package/dist/ingest-FF67DX3F.js +0 -20
- package/dist/quality-6BN2ERKC.js +0 -25
- package/dist/retrieval-QLC3DNMW.js +0 -15
- package/dist/webui/assets/index-Cpn2MjW0.js.map +0 -1
- /package/dist/{chunk-W75S5CK3.js.map → chunk-3LL5S473.js.map} +0 -0
- /package/dist/{chunk-YDVBXHX2.js.map → chunk-3ZA4YOFN.js.map} +0 -0
- /package/dist/{chunk-QPOOF2GK.js.map → chunk-4LTGMFHN.js.map} +0 -0
- /package/dist/{chunk-S46JVROA.js.map → chunk-6U7YMPBE.js.map} +0 -0
- /package/dist/{chunk-BTD3BYVV.js.map → chunk-BOUMOPKD.js.map} +0 -0
- /package/dist/{chunk-BJZCBMU4.js.map → chunk-J3F3CLWL.js.map} +0 -0
- /package/dist/{chunk-MZTZKBRL.js.map → chunk-JSKYG7TC.js.map} +0 -0
- /package/dist/{chunk-M5MPUMCJ.js.map → chunk-LOWPEB72.js.map} +0 -0
- /package/dist/{chunk-EX5UTOIU.js.map → chunk-N2ONUBXR.js.map} +0 -0
- /package/dist/{chunk-MQPMF5F3.js.map → chunk-PW42PFVO.js.map} +0 -0
- /package/dist/{chunk-FOJHR4JJ.js.map → chunk-QOMNHKYE.js.map} +0 -0
- /package/dist/{chunk-AVUTQWZE.js.map → chunk-RSBIISGE.js.map} +0 -0
- /package/dist/{chunk-V3MYT3AT.js.map → chunk-URQEUH7T.js.map} +0 -0
- /package/dist/{cleanup-EDWLCJPH.js.map → cleanup-QC7EHMUB.js.map} +0 -0
- /package/dist/{codex-trust-H6KNABHV.js.map → codex-trust-4RI6LCAI.js.map} +0 -0
- /package/dist/{dispatcher-W3PTGEKN.js.map → dispatcher-XGATH6Q5.js.map} +0 -0
- /package/dist/{embeddings-W24SA6R3.js.map → embeddings-RS3GK3TS.js.map} +0 -0
- /package/dist/{ingest-FF67DX3F.js.map → ingest-RGPV5QYT.js.map} +0 -0
- /package/dist/{keychain-LVWMAS7D.js.map → keychain-BRWB5CL5.js.map} +0 -0
- /package/dist/{memory-value-GMYJ5NGO.js.map → memory-value-6KDRPDXE.js.map} +0 -0
- /package/dist/{provenance-KSBMVJO5.js.map → provenance-NLVTH5ZK.js.map} +0 -0
- /package/dist/{quality-6BN2ERKC.js.map → quality-QPRUXM4B.js.map} +0 -0
- /package/dist/{retrieval-QLC3DNMW.js.map → retrieval-N5FQRL2V.js.map} +0 -0
- /package/dist/{store-QYLHMBPE.js.map → store-DXJJ7VOQ.js.map} +0 -0
- /package/dist/{tasks-7P7XOGSC.js.map → tasks-32RY4KNA.js.map} +0 -0
- /package/dist/{usage-KVVZQTZA.js.map → usage-3EMXD6MZ.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
computeReliabilityReport,
|
|
3
4
|
dispatchCodexNotify,
|
|
4
5
|
ensureDailyBackup,
|
|
5
6
|
executeAssistantCompletionHook,
|
|
@@ -14,6 +15,7 @@ import {
|
|
|
14
15
|
formatInjectionContext,
|
|
15
16
|
formatMaintenanceBacklogContext,
|
|
16
17
|
formatPendingConfirmationsContext,
|
|
18
|
+
formatReliabilityReport,
|
|
17
19
|
getDoctorReport,
|
|
18
20
|
getHookCallStats,
|
|
19
21
|
getLaunchAgentInfo,
|
|
@@ -53,20 +55,21 @@ import {
|
|
|
53
55
|
unregisterStrayApps,
|
|
54
56
|
verifyBackupIntegrity,
|
|
55
57
|
writeRepoContextArtifact
|
|
56
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-OHWHU653.js";
|
|
57
59
|
import {
|
|
58
60
|
hasCommand,
|
|
59
61
|
installCodexHooks,
|
|
60
62
|
resolveCodexHookTargets,
|
|
61
63
|
resolveUserHomeDir,
|
|
62
64
|
uninstallCodexHooks
|
|
63
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-4LTGMFHN.js";
|
|
64
66
|
import {
|
|
65
67
|
closeDb,
|
|
66
68
|
compileContext,
|
|
67
69
|
compileContextHybrid,
|
|
68
70
|
computeMetrics,
|
|
69
71
|
createActivityEvent,
|
|
72
|
+
createLoopCoverageCache,
|
|
70
73
|
createPolicy,
|
|
71
74
|
deletePolicy,
|
|
72
75
|
discoverLocalRepos,
|
|
@@ -86,7 +89,9 @@ import {
|
|
|
86
89
|
listHistorySnippets,
|
|
87
90
|
listPendingApprovals,
|
|
88
91
|
listPolicies,
|
|
92
|
+
loadInjectedMemoryIds,
|
|
89
93
|
loadRetrievalEvalFile,
|
|
94
|
+
loopRepoForMemory,
|
|
90
95
|
pruneMemories,
|
|
91
96
|
recordSignal,
|
|
92
97
|
requestApproval,
|
|
@@ -100,7 +105,7 @@ import {
|
|
|
100
105
|
startEvalSession,
|
|
101
106
|
summarizeValueRetrievalEval,
|
|
102
107
|
togglePolicy
|
|
103
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-HYDNV5T2.js";
|
|
104
109
|
import {
|
|
105
110
|
autoResolveContradictions,
|
|
106
111
|
computeAllHealthScores,
|
|
@@ -109,14 +114,16 @@ import {
|
|
|
109
114
|
formatHealthReport,
|
|
110
115
|
getRepoQualityProfile,
|
|
111
116
|
inferScope,
|
|
117
|
+
isHighRiskRule,
|
|
118
|
+
isNonUserCaptureContext,
|
|
112
119
|
listContradictions,
|
|
113
120
|
processCorrection,
|
|
114
121
|
processReviewFeedback,
|
|
115
122
|
resolveContradiction
|
|
116
|
-
} from "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
-
import "./chunk-
|
|
119
|
-
import "./chunk-
|
|
123
|
+
} from "./chunk-MD2LUEVD.js";
|
|
124
|
+
import "./chunk-PW42PFVO.js";
|
|
125
|
+
import "./chunk-3LL5S473.js";
|
|
126
|
+
import "./chunk-JSKYG7TC.js";
|
|
120
127
|
import {
|
|
121
128
|
confirmMemory,
|
|
122
129
|
createMemory,
|
|
@@ -124,16 +131,21 @@ import {
|
|
|
124
131
|
getAuditTrail,
|
|
125
132
|
getMemory,
|
|
126
133
|
getRecentAudit,
|
|
134
|
+
hasNonDurableProvenance,
|
|
127
135
|
listMemories,
|
|
128
136
|
listRepos,
|
|
129
137
|
queryMemories,
|
|
130
138
|
recordAudit,
|
|
139
|
+
recordAuditWithSnapshot,
|
|
131
140
|
rejectMemory,
|
|
132
141
|
rollbackMemory
|
|
133
|
-
} from "./chunk-
|
|
134
|
-
import "./chunk-V3MYT3AT.js";
|
|
135
|
-
import "./chunk-S46JVROA.js";
|
|
142
|
+
} from "./chunk-J3F3CLWL.js";
|
|
136
143
|
import {
|
|
144
|
+
desc
|
|
145
|
+
} from "./chunk-URQEUH7T.js";
|
|
146
|
+
import "./chunk-6U7YMPBE.js";
|
|
147
|
+
import {
|
|
148
|
+
CONFIDENCE,
|
|
137
149
|
bootstrapEmbeddings,
|
|
138
150
|
ensureEmbeddingProviderReady,
|
|
139
151
|
flushEmbeddingJobs,
|
|
@@ -145,29 +157,26 @@ import {
|
|
|
145
157
|
searchMemoryFtsIndex,
|
|
146
158
|
semanticSearch,
|
|
147
159
|
verifyEmbeddings
|
|
148
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-QKGE74LD.js";
|
|
149
161
|
import {
|
|
150
162
|
deleteApiKey,
|
|
151
163
|
hasKeychainApiKey,
|
|
152
164
|
init_keychain,
|
|
153
165
|
init_outbound_url,
|
|
154
166
|
normalizeSyncRemoteUrl
|
|
155
|
-
} from "./chunk-
|
|
156
|
-
import "./chunk-
|
|
167
|
+
} from "./chunk-QOMNHKYE.js";
|
|
168
|
+
import "./chunk-LOWPEB72.js";
|
|
157
169
|
import {
|
|
158
|
-
|
|
159
|
-
and,
|
|
170
|
+
auditTrail,
|
|
160
171
|
eq,
|
|
161
172
|
gt,
|
|
162
|
-
gte,
|
|
163
173
|
memories,
|
|
164
|
-
|
|
165
|
-
memoryValueEvents,
|
|
174
|
+
sql,
|
|
166
175
|
syncState
|
|
167
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-BOUMOPKD.js";
|
|
168
177
|
import {
|
|
169
178
|
init_define_RECALL_BUILD_INFO
|
|
170
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-VV2QPDAM.js";
|
|
171
180
|
|
|
172
181
|
// src/cli.ts
|
|
173
182
|
init_define_RECALL_BUILD_INFO();
|
|
@@ -532,129 +541,147 @@ async function joinTeam(config, teamId) {
|
|
|
532
541
|
if (!resp.ok) throw new Error(`Failed to join team: ${resp.statusText}`);
|
|
533
542
|
}
|
|
534
543
|
|
|
535
|
-
// src/
|
|
544
|
+
// src/pruning/restore.ts
|
|
536
545
|
init_define_RECALL_BUILD_INFO();
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
const
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
546
|
+
var DAY_MS = 864e5;
|
|
547
|
+
var CONFIDENCE_EPSILON = 1e-9;
|
|
548
|
+
var RESTORE_ACTOR = "auto-pruner";
|
|
549
|
+
var RESTORE_REASON_PREFIX = "Restored to auto-injection: demoted while the injection loop was inactive";
|
|
550
|
+
function isRiskyToRestore(memory) {
|
|
551
|
+
if (isHighRiskRule(memory.text) || isNonUserCaptureContext(memory.text) || hasNonDurableProvenance(memory)) return true;
|
|
552
|
+
const contexts = memory.evidence.filter((entry) => entry.type === "session_correction" || entry.type === "review_feedback").map((entry) => entry.context?.trim()).filter((context) => Boolean(context));
|
|
553
|
+
return contexts.length > 0 && contexts.every(isNonUserCaptureContext);
|
|
554
|
+
}
|
|
555
|
+
function prunerArchivalAt(db, memory) {
|
|
556
|
+
const latest = db.select().from(auditTrail).where(eq(auditTrail.memory_id, memory.id)).orderBy(desc(auditTrail.timestamp), sql`rowid DESC`).limit(1).get();
|
|
557
|
+
if (!latest || latest.action !== "demoted" || latest.actor !== RESTORE_ACTOR || !/^Archived (?:unconfirmed candidate after \d+(?:\.\d+)?d without selection or repetition|from auto-injection: no activity since )/.test(latest.reason ?? "") || !latest.after_snapshot) return null;
|
|
558
|
+
try {
|
|
559
|
+
const after = JSON.parse(latest.after_snapshot);
|
|
560
|
+
if (!after || typeof after !== "object" || Array.isArray(after)) return null;
|
|
561
|
+
const fields = [
|
|
562
|
+
"id",
|
|
563
|
+
"type",
|
|
564
|
+
"text",
|
|
565
|
+
"scope",
|
|
566
|
+
"repo",
|
|
567
|
+
"path_scope",
|
|
568
|
+
"status",
|
|
569
|
+
"confidence",
|
|
570
|
+
"source",
|
|
571
|
+
"created_at",
|
|
572
|
+
"updated_at",
|
|
573
|
+
"last_validated_at",
|
|
574
|
+
"last_injected_at",
|
|
575
|
+
"injection_count",
|
|
576
|
+
"override_count",
|
|
577
|
+
"repetition_count",
|
|
578
|
+
"auto_inject",
|
|
579
|
+
"evidence",
|
|
580
|
+
"capture_context",
|
|
581
|
+
"supersedes"
|
|
582
|
+
];
|
|
583
|
+
if (fields.some(
|
|
584
|
+
(field) => JSON.stringify(after[field]) !== JSON.stringify(memory[field])
|
|
585
|
+
) || (after.note ?? null) !== (memory.note ?? null)) return null;
|
|
586
|
+
if (latest.before_snapshot) {
|
|
587
|
+
const before = JSON.parse(latest.before_snapshot);
|
|
588
|
+
if (!before || before.auto_inject !== true) return null;
|
|
589
|
+
}
|
|
590
|
+
return typeof after.updated_at === "string" && Number.isFinite(Date.parse(after.updated_at)) ? after.updated_at : null;
|
|
591
|
+
} catch {
|
|
592
|
+
return null;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function restoreUnmeasuredCandidates(db, options = {}) {
|
|
596
|
+
const minConfidence = options.minConfidence ?? CONFIDENCE.ACTIVE_MIN;
|
|
597
|
+
const lookbackDays = options.lookbackDays ?? 30;
|
|
598
|
+
const dryRun = options.dryRun ?? false;
|
|
599
|
+
if (!Number.isFinite(minConfidence) || minConfidence < 0 || minConfidence > 1) {
|
|
600
|
+
throw new RangeError("minConfidence must be a number between 0 and 1");
|
|
601
|
+
}
|
|
602
|
+
if (!Number.isFinite(lookbackDays) || lookbackDays <= 0) {
|
|
603
|
+
throw new RangeError("lookbackDays must be a positive number");
|
|
604
|
+
}
|
|
605
|
+
const now = options.now ?? Date.now();
|
|
606
|
+
const nowIso = new Date(now).toISOString();
|
|
607
|
+
const sinceIso = new Date(now - lookbackDays * DAY_MS).toISOString();
|
|
608
|
+
const loopCovered = createLoopCoverageCache(db);
|
|
609
|
+
const result = {
|
|
610
|
+
restored: [],
|
|
611
|
+
skipped_below_gate: 0,
|
|
612
|
+
skipped_loop_active: 0,
|
|
613
|
+
skipped_risky: 0,
|
|
614
|
+
skipped_not_pruner_archived: 0,
|
|
615
|
+
min_confidence: minConfidence,
|
|
616
|
+
lookback_days: lookbackDays,
|
|
617
|
+
dry_run: dryRun
|
|
618
|
+
};
|
|
619
|
+
const restore = () => {
|
|
620
|
+
const selected = loadInjectedMemoryIds(db);
|
|
621
|
+
const archived = queryMemories(db, {
|
|
622
|
+
repo: options.repo,
|
|
623
|
+
status: "candidate",
|
|
624
|
+
auto_inject: false
|
|
625
|
+
}).filter((memory) => memory.injection_count === 0 && !selected.has(memory.id));
|
|
626
|
+
for (const before of archived) {
|
|
627
|
+
if (before.confidence + CONFIDENCE_EPSILON < minConfidence) {
|
|
628
|
+
result.skipped_below_gate++;
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
if (isRiskyToRestore(before)) {
|
|
632
|
+
result.skipped_risky++;
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
const archivedAt = prunerArchivalAt(db, before);
|
|
636
|
+
if (!archivedAt) {
|
|
637
|
+
result.skipped_not_pruner_archived++;
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
const archiveWindowStart = new Date(Date.parse(archivedAt) - lookbackDays * DAY_MS).toISOString();
|
|
641
|
+
const repo = loopRepoForMemory(before);
|
|
642
|
+
if (loopCovered(repo, archiveWindowStart, archivedAt) || loopCovered(repo, sinceIso, nowIso)) {
|
|
643
|
+
result.skipped_loop_active++;
|
|
644
|
+
continue;
|
|
645
|
+
}
|
|
646
|
+
result.restored.push(before.id);
|
|
647
|
+
if (dryRun) continue;
|
|
648
|
+
db.update(memories).set({ auto_inject: true, updated_at: nowIso }).where(eq(memories.id, before.id)).run();
|
|
649
|
+
const reason = `${RESTORE_REASON_PREFIX} (no injection coverage in ${lookbackDays}d; archival ${archivedAt})`;
|
|
650
|
+
recordAuditWithSnapshot(
|
|
651
|
+
db,
|
|
652
|
+
before.id,
|
|
653
|
+
"policy_applied",
|
|
654
|
+
RESTORE_ACTOR,
|
|
655
|
+
reason,
|
|
656
|
+
before,
|
|
657
|
+
getMemory(db, before.id) ?? null
|
|
658
|
+
);
|
|
659
|
+
}
|
|
628
660
|
};
|
|
661
|
+
const transaction = db.$client.transaction(restore);
|
|
662
|
+
if (dryRun) transaction();
|
|
663
|
+
else transaction.immediate();
|
|
664
|
+
return result;
|
|
629
665
|
}
|
|
630
|
-
function
|
|
631
|
-
const
|
|
666
|
+
function formatRestoreReport(result) {
|
|
667
|
+
const prefix = result.dry_run ? "[DRY RUN] " : "";
|
|
632
668
|
const lines = [
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
`
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
`
|
|
639
|
-
`
|
|
640
|
-
`
|
|
641
|
-
`Retrieval: ${report.retrieval_observations} observations, ${report.retrieval_misses} misses`,
|
|
642
|
-
`Memory: ${report.active_memories} active, ${report.candidate_injectable_total} injectable candidates total, ${report.candidate_backlog} max in one repo, ${report.candidate_total} total candidates`,
|
|
643
|
-
"",
|
|
644
|
-
"## Checks"
|
|
669
|
+
`${prefix}Restore Unmeasured Candidates`,
|
|
670
|
+
``,
|
|
671
|
+
`Gate: confidence >= ${result.min_confidence.toFixed(2)}, loop window ${result.lookback_days}d`,
|
|
672
|
+
`${result.dry_run ? "Would restore" : "Restored"}: ${result.restored.length}`,
|
|
673
|
+
`Below gate: ${result.skipped_below_gate}`,
|
|
674
|
+
`Loop active: ${result.skipped_loop_active}`,
|
|
675
|
+
`Risky (confirm): ${result.skipped_risky}`,
|
|
676
|
+
`No pruner proof: ${result.skipped_not_pruner_archived}`
|
|
645
677
|
];
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
678
|
+
if (result.restored.length > 0) {
|
|
679
|
+
lines.push("", result.dry_run ? "Would restore:" : "Restored:");
|
|
680
|
+
for (const id of result.restored.slice(0, 10)) lines.push(` ${id.slice(0, 8)}`);
|
|
681
|
+
if (result.restored.length > 10) lines.push(` ... and ${result.restored.length - 10} more`);
|
|
649
682
|
}
|
|
650
683
|
return lines.join("\n");
|
|
651
684
|
}
|
|
652
|
-
function repoAttributionExpected(repoPath) {
|
|
653
|
-
const normalized = repoPath.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
654
|
-
if (/\/(?:private\/)?(?:var\/folders\/[^/]+\/[^/]+\/T|tmp)(?:\/|$)/.test(normalized)) return false;
|
|
655
|
-
if (/\/Projects$/i.test(normalized)) return false;
|
|
656
|
-
return true;
|
|
657
|
-
}
|
|
658
685
|
|
|
659
686
|
// src/reliability/canary.ts
|
|
660
687
|
init_define_RECALL_BUILD_INFO();
|
|
@@ -1469,7 +1496,7 @@ program.command("doctor").description("Show local Recall runtime, DB, embedding,
|
|
|
1469
1496
|
const finalReport = opts.fix ? getDoctorReport() : report;
|
|
1470
1497
|
const codexEntry = finalReport.agents.find((agent) => agent.agent === "codex" && agent.detected);
|
|
1471
1498
|
if (codexEntry) {
|
|
1472
|
-
const { inspectCodexTrust } = await import("./codex-trust-
|
|
1499
|
+
const { inspectCodexTrust } = await import("./codex-trust-4RI6LCAI.js");
|
|
1473
1500
|
codexEntry.hook_trust = await inspectCodexTrust();
|
|
1474
1501
|
}
|
|
1475
1502
|
if (opts.json) {
|
|
@@ -2196,7 +2223,7 @@ evalCmd.command("value-retrieval").description("Run retrieval eval cases synthes
|
|
|
2196
2223
|
});
|
|
2197
2224
|
let snapshot = null;
|
|
2198
2225
|
if (opts.snapshot) {
|
|
2199
|
-
const { computeQualityReport, recordQualitySnapshot } = await import("./quality-
|
|
2226
|
+
const { computeQualityReport, recordQualitySnapshot } = await import("./quality-QPRUXM4B.js");
|
|
2200
2227
|
const qualityReport = computeQualityReport(db, { sinceIso: report.since });
|
|
2201
2228
|
snapshot = recordQualitySnapshot(
|
|
2202
2229
|
db,
|
|
@@ -2481,7 +2508,27 @@ contradictCmd.command("auto-resolve").description("Auto-resolve contradictions (
|
|
|
2481
2508
|
const count = autoResolveContradictions(db, opts.repo);
|
|
2482
2509
|
console.log(`Auto-resolved ${count} contradiction(s).`);
|
|
2483
2510
|
});
|
|
2484
|
-
program.command("prune").description("Auto-prune stale and unhealthy memories").option("-r, --repo <repo>", "Limit pruning to one repo").option("--candidate-days <n>", "Days before archiving an unconfirmed, never-selected candidate", "30").option("--stale-days <n>", "Days before rejecting stale memories", "90").option("--rejected-days <n>", "Days before deleting rejected memories", "30").option("--transient-days <n>", "Days before deleting transient memories", "7").option("--min-health <n>", "Min health score for active memories", "0.2").option("--dry-run", "Preview without making changes").action((opts) => {
|
|
2511
|
+
program.command("prune").description("Auto-prune stale and unhealthy memories").option("-r, --repo <repo>", "Limit pruning to one repo").option("--candidate-days <n>", "Days before archiving an unconfirmed, never-selected candidate", "30").option("--stale-days <n>", "Days before rejecting stale memories", "90").option("--rejected-days <n>", "Days before deleting rejected memories", "30").option("--transient-days <n>", "Days before deleting transient memories", "7").option("--min-health <n>", "Min health score for active memories", "0.2").option("--dry-run", "Preview without making changes").option("--restore-unmeasured", "Restore candidates with audited auto-pruner archival during an inactive injection loop (runs instead of pruning)").option("--min-confidence <n>", "With --restore-unmeasured: lowest confidence to restore (default: 0.60)").option("--lookback-days <n>", "With --restore-unmeasured: injection-coverage window in days", "30").action((opts) => {
|
|
2512
|
+
if (opts.restoreUnmeasured) {
|
|
2513
|
+
const minConfidence = opts.minConfidence === void 0 ? void 0 : Number(opts.minConfidence);
|
|
2514
|
+
const lookbackDays = Number(opts.lookbackDays);
|
|
2515
|
+
if (minConfidence !== void 0 && !(Number.isFinite(minConfidence) && minConfidence >= 0 && minConfidence <= 1)) {
|
|
2516
|
+
console.error("--min-confidence must be a number between 0 and 1.");
|
|
2517
|
+
process.exit(1);
|
|
2518
|
+
}
|
|
2519
|
+
if (!(Number.isFinite(lookbackDays) && lookbackDays > 0)) {
|
|
2520
|
+
console.error("--lookback-days must be a positive number.");
|
|
2521
|
+
process.exit(1);
|
|
2522
|
+
}
|
|
2523
|
+
const restored = restoreUnmeasuredCandidates(initDb(), {
|
|
2524
|
+
repo: opts.repo,
|
|
2525
|
+
minConfidence,
|
|
2526
|
+
lookbackDays,
|
|
2527
|
+
dryRun: opts.dryRun ?? false
|
|
2528
|
+
});
|
|
2529
|
+
console.log(formatRestoreReport(restored));
|
|
2530
|
+
return;
|
|
2531
|
+
}
|
|
2485
2532
|
const db = initDb();
|
|
2486
2533
|
const result = pruneMemories(db, {
|
|
2487
2534
|
repo: opts.repo,
|
|
@@ -2614,27 +2661,27 @@ daemonCmd.command("install").description("Install and start the user service").o
|
|
|
2614
2661
|
nodePath: opts.nodePath,
|
|
2615
2662
|
daemonScript: opts.daemonScript
|
|
2616
2663
|
});
|
|
2617
|
-
console.log(getServiceInfo(
|
|
2664
|
+
console.log(getServiceInfo(opts.label));
|
|
2618
2665
|
});
|
|
2619
2666
|
daemonCmd.command("start").description("Start the installed service").option("--label <label>", "Service label", defaultLabel).action((opts) => {
|
|
2620
2667
|
const status = startService(opts.label);
|
|
2621
|
-
console.log(getServiceInfo(
|
|
2668
|
+
console.log(getServiceInfo(opts.label));
|
|
2622
2669
|
});
|
|
2623
2670
|
daemonCmd.command("stop").description("Stop the service").option("--label <label>", "Service label", defaultLabel).action((opts) => {
|
|
2624
2671
|
const status = stopService(opts.label);
|
|
2625
|
-
console.log(getServiceInfo(
|
|
2672
|
+
console.log(getServiceInfo(opts.label));
|
|
2626
2673
|
});
|
|
2627
2674
|
daemonCmd.command("restart").description("Restart the service").option("--label <label>", "Service label", defaultLabel).action((opts) => {
|
|
2628
2675
|
stopService(opts.label);
|
|
2629
2676
|
const status = startService(opts.label);
|
|
2630
|
-
console.log(getServiceInfo(
|
|
2677
|
+
console.log(getServiceInfo(opts.label));
|
|
2631
2678
|
});
|
|
2632
2679
|
daemonCmd.command("status").description("Show service status").option("--label <label>", "Service label", defaultLabel).action((opts) => {
|
|
2633
2680
|
console.log(getServiceInfo(opts.label));
|
|
2634
2681
|
});
|
|
2635
2682
|
daemonCmd.command("uninstall").description("Remove the service").option("--label <label>", "Service label", defaultLabel).action((opts) => {
|
|
2636
2683
|
const status = uninstallService(opts.label);
|
|
2637
|
-
console.log(getServiceInfo(
|
|
2684
|
+
console.log(getServiceInfo(opts.label));
|
|
2638
2685
|
});
|
|
2639
2686
|
var uiCmd = program.command("ui").description("Control the Recall WebUI dashboard (browser-based view of memories, graph, sessions)");
|
|
2640
2687
|
uiCmd.command("start", { isDefault: true }).description("Start the WebUI and open it in your default browser").option("--port <port>", "WebUI port", "7891").option("--daemon-port <port>", "Daemon port", "7890").option("--no-open", "Do not open the browser automatically").action(async (opts) => {
|
|
@@ -2705,15 +2752,15 @@ uiCmd.command("status").description("Show WebUI status").option("--daemon-port <
|
|
|
2705
2752
|
var graphCmd = program.command("graph").description("Inspect and rebuild the knowledge graph (entities + relations)");
|
|
2706
2753
|
graphCmd.command("stats").description("Show entity/relation counts").action(async () => {
|
|
2707
2754
|
const db = initDb();
|
|
2708
|
-
const { countEntities, countRelations } = await import("./store-
|
|
2755
|
+
const { countEntities, countRelations } = await import("./store-DXJJ7VOQ.js");
|
|
2709
2756
|
console.log(`entities: ${countEntities(db)}`);
|
|
2710
2757
|
console.log(`relations: ${countRelations(db)}`);
|
|
2711
2758
|
});
|
|
2712
2759
|
graphCmd.command("backfill").description("Run the heuristic extractor over every active memory (idempotent)").option("--repo <repo>", "Limit to a single repo").option("--limit <n>", "Cap rows processed", "10000").option("--rebuild", "Clear all existing entities/relations first, then re-extract").action(async (opts) => {
|
|
2713
2760
|
const db = initDb();
|
|
2714
|
-
const { ingestMemoryHeuristic } = await import("./ingest-
|
|
2761
|
+
const { ingestMemoryHeuristic } = await import("./ingest-RGPV5QYT.js");
|
|
2715
2762
|
if (opts.rebuild) {
|
|
2716
|
-
const { clearGraph } = await import("./store-
|
|
2763
|
+
const { clearGraph } = await import("./store-DXJJ7VOQ.js");
|
|
2717
2764
|
clearGraph(db);
|
|
2718
2765
|
console.log("Cleared existing graph entities and relations.");
|
|
2719
2766
|
}
|
|
@@ -2735,7 +2782,7 @@ graphCmd.command("backfill").description("Run the heuristic extractor over every
|
|
|
2735
2782
|
});
|
|
2736
2783
|
graphCmd.command("entities").description("List entities").option("--repo <repo>", "Filter by repo").option("--kind <kind>", "Filter by entity kind").option("--search <q>", "Substring filter on name").option("--limit <n>", "Max rows", "50").action(async (opts) => {
|
|
2737
2784
|
const db = initDb();
|
|
2738
|
-
const { listEntities } = await import("./store-
|
|
2785
|
+
const { listEntities } = await import("./store-DXJJ7VOQ.js");
|
|
2739
2786
|
const rows = listEntities(db, {
|
|
2740
2787
|
repo: opts.repo,
|
|
2741
2788
|
kind: opts.kind,
|
|
@@ -2754,8 +2801,8 @@ graphCmd.command("entities").description("List entities").option("--repo <repo>"
|
|
|
2754
2801
|
});
|
|
2755
2802
|
graphCmd.command("query <query...>").description("Run graph-aware retrieval for a query").option("--repo <repo>", "Restrict to repo").option("--hops <n>", "Graph hops", "2").option("--limit <n>", "Max hits", "10").action(async (queryTokens, opts) => {
|
|
2756
2803
|
const db = initDb();
|
|
2757
|
-
const { graphQuery } = await import("./retrieval-
|
|
2758
|
-
const { loadEmbeddingConfigFromEnv: loadEmbeddingConfigFromEnv2 } = await import("./embeddings-
|
|
2804
|
+
const { graphQuery } = await import("./retrieval-N5FQRL2V.js");
|
|
2805
|
+
const { loadEmbeddingConfigFromEnv: loadEmbeddingConfigFromEnv2 } = await import("./embeddings-RS3GK3TS.js");
|
|
2759
2806
|
const embeddingConfig = loadEmbeddingConfigFromEnv2();
|
|
2760
2807
|
const result = await graphQuery(db, queryTokens.join(" "), embeddingConfig, {
|
|
2761
2808
|
repo: opts.repo,
|
|
@@ -2771,7 +2818,7 @@ graphCmd.command("query <query...>").description("Run graph-aware retrieval for
|
|
|
2771
2818
|
});
|
|
2772
2819
|
var maintenanceCmd = program.command("maintenance").description("Inspect and manage the delegated maintenance task queue");
|
|
2773
2820
|
maintenanceCmd.command("stats").description("Show backlog counts, completion stats, and mean latency").action(async () => {
|
|
2774
|
-
const { getTaskStats } = await import("./tasks-
|
|
2821
|
+
const { getTaskStats } = await import("./tasks-32RY4KNA.js");
|
|
2775
2822
|
const db = initDb();
|
|
2776
2823
|
const stats = getTaskStats(db);
|
|
2777
2824
|
console.log(`Total tasks: ${stats.total}`);
|
|
@@ -2797,7 +2844,7 @@ maintenanceCmd.command("stats").description("Show backlog counts, completion sta
|
|
|
2797
2844
|
}
|
|
2798
2845
|
});
|
|
2799
2846
|
maintenanceCmd.command("list").description("List tasks (default: pending)").option("-s, --status <status>", "pending|claimed|completed|abandoned", "pending").option("-k, --kind <kind>", "Filter by kind").option("-r, --repo <repo>", "Filter by repo").option("-n, --limit <n>", "Max entries", "20").action(async (opts) => {
|
|
2800
|
-
const { listTasks } = await import("./tasks-
|
|
2847
|
+
const { listTasks } = await import("./tasks-32RY4KNA.js");
|
|
2801
2848
|
const db = initDb();
|
|
2802
2849
|
const tasks = listTasks(db, {
|
|
2803
2850
|
status: opts.status,
|
|
@@ -2819,7 +2866,7 @@ maintenanceCmd.command("list").description("List tasks (default: pending)").opti
|
|
|
2819
2866
|
}
|
|
2820
2867
|
});
|
|
2821
2868
|
maintenanceCmd.command("drop").description("Delete a task by id (or id prefix)").argument("<task-id>", "Task id or prefix").action(async (taskIdArg) => {
|
|
2822
|
-
const { deleteTask, listTasks } = await import("./tasks-
|
|
2869
|
+
const { deleteTask, listTasks } = await import("./tasks-32RY4KNA.js");
|
|
2823
2870
|
const db = initDb();
|
|
2824
2871
|
const all = listTasks(db, { limit: 1e4 });
|
|
2825
2872
|
const matches = all.filter((t) => t.id === taskIdArg || t.id.startsWith(taskIdArg));
|
|
@@ -2838,7 +2885,7 @@ maintenanceCmd.command("drop").description("Delete a task by id (or id prefix)")
|
|
|
2838
2885
|
});
|
|
2839
2886
|
var credentialsCmd = maintenanceCmd.command("credentials").description("Manage LLM provider API keys in macOS Keychain (env fallback on other platforms)");
|
|
2840
2887
|
credentialsCmd.command("list", { isDefault: true }).description("Show which providers have credentials available").action(async () => {
|
|
2841
|
-
const { listCredentials } = await import("./keychain-
|
|
2888
|
+
const { listCredentials } = await import("./keychain-BRWB5CL5.js");
|
|
2842
2889
|
const creds = listCredentials();
|
|
2843
2890
|
if (creds.length === 0) {
|
|
2844
2891
|
console.log("No API keys configured. Set one with:");
|
|
@@ -2852,7 +2899,7 @@ credentialsCmd.command("list", { isDefault: true }).description("Show which prov
|
|
|
2852
2899
|
}
|
|
2853
2900
|
});
|
|
2854
2901
|
credentialsCmd.command("set").description("Store credentials for an LLM provider in the macOS Keychain").argument("<provider>", "openai|anthropic|azure").argument("[key]", "API key (prompts via stdin if omitted; required for openai/anthropic and for azure unless --stdin-json is used)").option("--endpoint <url>", "Azure OpenAI resource endpoint (e.g. https://myresource.openai.azure.com)").option("--deployment <name>", "Azure OpenAI deployment name").option("--api-version <version>", "Azure OpenAI api-version (e.g. 2024-10-21)").option("--stdin-json", "Read the azure config (endpoint/deployment/api_version/key) as a JSON object from stdin").action(async (providerArg, keyArg, opts) => {
|
|
2855
|
-
const { setApiKey, setAzureConfig } = await import("./keychain-
|
|
2902
|
+
const { setApiKey, setAzureConfig } = await import("./keychain-BRWB5CL5.js");
|
|
2856
2903
|
const provider = providerArg === "azure" ? "azure-openai" : providerArg;
|
|
2857
2904
|
if (provider === "openai" || provider === "anthropic") {
|
|
2858
2905
|
const key = keyArg ?? await readStdinKey();
|
|
@@ -2914,7 +2961,7 @@ credentialsCmd.command("set").description("Store credentials for an LLM provider
|
|
|
2914
2961
|
process.exit(1);
|
|
2915
2962
|
});
|
|
2916
2963
|
credentialsCmd.command("clear").description("Remove provider credentials from the macOS Keychain").argument("<provider>", "openai|anthropic|azure").action(async (providerArg) => {
|
|
2917
|
-
const { deleteApiKey: deleteApiKey2 } = await import("./keychain-
|
|
2964
|
+
const { deleteApiKey: deleteApiKey2 } = await import("./keychain-BRWB5CL5.js");
|
|
2918
2965
|
const provider = providerArg === "azure" ? "azure-openai" : providerArg;
|
|
2919
2966
|
if (provider !== "openai" && provider !== "anthropic" && provider !== "azure-openai") {
|
|
2920
2967
|
console.error(`Provider must be "openai", "anthropic", or "azure", got "${providerArg}".`);
|
|
@@ -2925,8 +2972,8 @@ credentialsCmd.command("clear").description("Remove provider credentials from th
|
|
|
2925
2972
|
else console.log(`No ${provider} credentials found in Keychain.`);
|
|
2926
2973
|
});
|
|
2927
2974
|
maintenanceCmd.command("dispatch").description("Run the daemon-owned dispatcher once against pending maintenance tasks (requires a configured LLM provider)").option("--provider <provider>", "openai|anthropic|azure-openai (defaults to whichever is configured)").option("--model <model>", "Model override").option("--kind <kind>", "Restrict to a single task kind (repeatable)", (value, acc = []) => [...acc, value], []).option("--repo <repo>", "Restrict to a single repo").option("--max <n>", "Max tasks to run this round", "5").option("--dry-run", "Show which tasks would be dispatched; do not call the LLM").option("--preview", "Show the actual prompts that would be sent (no provider needed; no LLM call)").option("--json", "Emit the raw JSON report").action(async (opts) => {
|
|
2928
|
-
const { dispatchPendingTasks, formatDispatchReport, buildPrompt } = await import("./dispatcher-
|
|
2929
|
-
const { listTasks } = await import("./tasks-
|
|
2975
|
+
const { dispatchPendingTasks, formatDispatchReport, buildPrompt } = await import("./dispatcher-XGATH6Q5.js");
|
|
2976
|
+
const { listTasks } = await import("./tasks-32RY4KNA.js");
|
|
2930
2977
|
const db = initDb();
|
|
2931
2978
|
if (opts.preview) {
|
|
2932
2979
|
const pending = listTasks(db, {
|
|
@@ -2983,12 +3030,12 @@ ${p.prompt.max_output_tokens}
|
|
|
2983
3030
|
console.log(formatDispatchReport(report));
|
|
2984
3031
|
});
|
|
2985
3032
|
maintenanceCmd.command("quarantine-generated").description("Preview memories supported only by generated messages; preserve them outside injection").option("--apply", "Quarantine matching memories with reversible audit snapshots").action(async (opts) => {
|
|
2986
|
-
const { quarantineGeneratedMemories } = await import("./provenance-
|
|
3033
|
+
const { quarantineGeneratedMemories } = await import("./provenance-NLVTH5ZK.js");
|
|
2987
3034
|
const ids = quarantineGeneratedMemories(initDb(), Boolean(opts.apply));
|
|
2988
3035
|
console.log(JSON.stringify({ applied: Boolean(opts.apply), count: ids.length, memory_ids: ids }, null, 2));
|
|
2989
3036
|
});
|
|
2990
3037
|
maintenanceCmd.command("cleanup").description("Run deterministic, LLM-free cleanup for duplicate, low-quality, stale, and mis-scoped memories").option("--apply", "Persist changes (default is dry-run)").option("--only <action>", "Restrict to one action: dedupe_exact_merge|reject_fragment_candidate|promote_repeat_correction|suppress_unproductive_command|globalize_cross_repo|reject_test_fixture_repo|reject_invalid_scope|reject_generic_scanned_tooling").option("--revert <run-id>", "Revert a previous cleanup run (id or 8-char prefix)").option("--list", "List recent cleanup runs").option("--json", "Emit the raw JSON report").action(async (opts) => {
|
|
2991
|
-
const { runDeterministicCleanup, formatCleanupReport, revertCleanupRun, listCleanupRuns } = await import("./cleanup-
|
|
3038
|
+
const { runDeterministicCleanup, formatCleanupReport, revertCleanupRun, listCleanupRuns } = await import("./cleanup-QC7EHMUB.js");
|
|
2992
3039
|
const db = initDb();
|
|
2993
3040
|
if (opts.list) {
|
|
2994
3041
|
const runs = listCleanupRuns(db);
|
|
@@ -3042,7 +3089,7 @@ maintenanceCmd.command("quality").description("Show injection outcome distributi
|
|
|
3042
3089
|
recordQualitySnapshot,
|
|
3043
3090
|
listQualitySnapshots,
|
|
3044
3091
|
diffQualitySnapshots
|
|
3045
|
-
} = await import("./quality-
|
|
3092
|
+
} = await import("./quality-QPRUXM4B.js");
|
|
3046
3093
|
const db = initDb();
|
|
3047
3094
|
if (opts.history) {
|
|
3048
3095
|
const snaps = listQualitySnapshots(db);
|
|
@@ -3103,7 +3150,7 @@ maintenanceCmd.command("value-backfill").description("Backfill memory value even
|
|
|
3103
3150
|
const {
|
|
3104
3151
|
backfillMemoryValueEvents,
|
|
3105
3152
|
formatMemoryValueBackfillReport
|
|
3106
|
-
} = await import("./memory-value-
|
|
3153
|
+
} = await import("./memory-value-6KDRPDXE.js");
|
|
3107
3154
|
const db = initDb();
|
|
3108
3155
|
const report = backfillMemoryValueEvents(db, {
|
|
3109
3156
|
sinceIso: opts.since,
|
|
@@ -3116,7 +3163,7 @@ maintenanceCmd.command("value-backfill").description("Backfill memory value even
|
|
|
3116
3163
|
console.log(formatMemoryValueBackfillReport(report));
|
|
3117
3164
|
});
|
|
3118
3165
|
maintenanceCmd.command("usage").description("Summarize LLM API usage (tokens, cost) across recent maintenance runs").option("--since <iso>", "Window start (default: last 30 days)").option("--limit <n>", "Recent-call rows to show", "10").option("--json", "Emit raw JSON summary").action(async (opts) => {
|
|
3119
|
-
const { summarizeUsage, formatUsageReport } = await import("./usage-
|
|
3166
|
+
const { summarizeUsage, formatUsageReport } = await import("./usage-3EMXD6MZ.js");
|
|
3120
3167
|
const db = initDb();
|
|
3121
3168
|
const summary = summarizeUsage(db, {
|
|
3122
3169
|
sinceIso: opts.since,
|