@edihasaj/recall 1.4.0 → 1.4.1
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/dist/{chunk-7Q5CBVUT.js → chunk-4UHRAQFG.js} +34 -13
- package/dist/{chunk-7Q5CBVUT.js.map → chunk-4UHRAQFG.js.map} +1 -1
- package/dist/{chunk-53GKSF42.js → chunk-7CFX774S.js} +9 -9
- package/dist/{chunk-MMYLXICL.js → chunk-AFD43EOE.js} +2 -2
- package/dist/{chunk-UWERS646.js → chunk-LWY4Z626.js} +3 -3
- package/dist/{chunk-JO5LRCA2.js → chunk-NAYFAUSM.js} +149 -6
- package/dist/chunk-NAYFAUSM.js.map +1 -0
- package/dist/{chunk-6QFOCUEJ.js → chunk-T274LVWB.js} +104 -18
- package/dist/chunk-T274LVWB.js.map +1 -0
- package/dist/{chunk-65XK27KK.js → chunk-TA4WSV6A.js} +46 -155
- package/dist/chunk-TA4WSV6A.js.map +1 -0
- package/dist/{chunk-JKWK73GY.js → chunk-ZBQGZCFL.js} +3 -3
- package/dist/chunk-ZBQGZCFL.js.map +1 -0
- package/dist/{chunk-JSTZKFZR.js → chunk-ZXCKMEJA.js} +7 -7
- package/dist/{cleanup-RHNBHBNP.js → cleanup-RTL2UETA.js} +4 -4
- package/dist/cli.js +28 -28
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +17 -17
- package/dist/daemon.js.map +1 -1
- package/dist/{dispatcher-ON7LNX6X.js → dispatcher-PP5OKOLS.js} +4 -4
- package/dist/{embeddings-HDNAGCOS.js → embeddings-MILTROKW.js} +2 -2
- package/dist/{ingest-MHPMJPUA.js → ingest-HEXVIAL6.js} +4 -3
- package/dist/mcp.js +8 -8
- package/dist/{memory-value-6JUQEYJZ.js → memory-value-WXI2Q6TO.js} +4 -4
- package/dist/{quality-HVTIOIXP.js → quality-VKQUCL66.js} +5 -5
- package/dist/{retrieval-72EIHKRF.js → retrieval-4MEIABHC.js} +5 -4
- package/dist/{tasks-AJ62N26N.js → tasks-7SE6VHSQ.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-65XK27KK.js.map +0 -1
- package/dist/chunk-6QFOCUEJ.js.map +0 -1
- package/dist/chunk-JKWK73GY.js.map +0 -1
- package/dist/chunk-JO5LRCA2.js.map +0 -1
- /package/dist/{chunk-53GKSF42.js.map → chunk-7CFX774S.js.map} +0 -0
- /package/dist/{chunk-MMYLXICL.js.map → chunk-AFD43EOE.js.map} +0 -0
- /package/dist/{chunk-UWERS646.js.map → chunk-LWY4Z626.js.map} +0 -0
- /package/dist/{chunk-JSTZKFZR.js.map → chunk-ZXCKMEJA.js.map} +0 -0
- /package/dist/{cleanup-RHNBHBNP.js.map → cleanup-RTL2UETA.js.map} +0 -0
- /package/dist/{dispatcher-ON7LNX6X.js.map → dispatcher-PP5OKOLS.js.map} +0 -0
- /package/dist/{embeddings-HDNAGCOS.js.map → embeddings-MILTROKW.js.map} +0 -0
- /package/dist/{ingest-MHPMJPUA.js.map → ingest-HEXVIAL6.js.map} +0 -0
- /package/dist/{memory-value-6JUQEYJZ.js.map → memory-value-WXI2Q6TO.js.map} +0 -0
- /package/dist/{quality-HVTIOIXP.js.map → quality-VKQUCL66.js.map} +0 -0
- /package/dist/{retrieval-72EIHKRF.js.map → retrieval-4MEIABHC.js.map} +0 -0
- /package/dist/{tasks-AJ62N26N.js.map → tasks-7SE6VHSQ.js.map} +0 -0
|
@@ -2,9 +2,6 @@ import {
|
|
|
2
2
|
matchTokens,
|
|
3
3
|
textMatchScore
|
|
4
4
|
} from "./chunk-FHEH6QDU.js";
|
|
5
|
-
import {
|
|
6
|
-
desc
|
|
7
|
-
} from "./chunk-CW3XJDH7.js";
|
|
8
5
|
import {
|
|
9
6
|
appendEvidence,
|
|
10
7
|
countDistinctCorrectionSessions,
|
|
@@ -18,9 +15,14 @@ import {
|
|
|
18
15
|
normalizeDedupeText,
|
|
19
16
|
promoteMemory,
|
|
20
17
|
queryMemories,
|
|
18
|
+
recordAudit,
|
|
19
|
+
recordAuditWithSnapshot,
|
|
21
20
|
restoreAutoInject,
|
|
22
21
|
updateMemoryCaptureContext
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NAYFAUSM.js";
|
|
23
|
+
import {
|
|
24
|
+
desc
|
|
25
|
+
} from "./chunk-CW3XJDH7.js";
|
|
24
26
|
import {
|
|
25
27
|
CONFIDENCE,
|
|
26
28
|
LlmCredentialError,
|
|
@@ -30,7 +32,7 @@ import {
|
|
|
30
32
|
findSimilarRejectedExemplar,
|
|
31
33
|
loadEmbeddingConfigFromEnv,
|
|
32
34
|
queueMemoryEmbeddingSync
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ZBQGZCFL.js";
|
|
34
36
|
import {
|
|
35
37
|
hasProviderConfigured,
|
|
36
38
|
init_keychain
|
|
@@ -58,123 +60,11 @@ import {
|
|
|
58
60
|
} from "./chunk-LUIYWYOT.js";
|
|
59
61
|
|
|
60
62
|
// src/maintenance/tasks.ts
|
|
61
|
-
import { randomUUID as
|
|
63
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
62
64
|
import { z } from "zod";
|
|
63
65
|
|
|
64
66
|
// src/maintenance/appliers.ts
|
|
65
|
-
import { randomUUID as
|
|
66
|
-
|
|
67
|
-
// src/audit/trail.ts
|
|
68
|
-
import { randomUUID } from "crypto";
|
|
69
|
-
function recordAudit(db, memoryId, action, actor, reason, beforeSnapshot, afterSnapshot) {
|
|
70
|
-
const id = randomUUID();
|
|
71
|
-
if (afterSnapshot === void 0) {
|
|
72
|
-
const mem = getMemory(db, memoryId);
|
|
73
|
-
if (mem) {
|
|
74
|
-
afterSnapshot = JSON.stringify(mem);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
db.insert(auditTrail).values({
|
|
78
|
-
id,
|
|
79
|
-
memory_id: memoryId,
|
|
80
|
-
action,
|
|
81
|
-
actor,
|
|
82
|
-
before_snapshot: beforeSnapshot ?? null,
|
|
83
|
-
after_snapshot: afterSnapshot ?? null,
|
|
84
|
-
reason: reason ?? null,
|
|
85
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
86
|
-
}).run();
|
|
87
|
-
return id;
|
|
88
|
-
}
|
|
89
|
-
function recordAuditWithSnapshot(db, memoryId, action, actor, reason, before, after) {
|
|
90
|
-
return recordAudit(
|
|
91
|
-
db,
|
|
92
|
-
memoryId,
|
|
93
|
-
action,
|
|
94
|
-
actor,
|
|
95
|
-
reason,
|
|
96
|
-
before ? JSON.stringify(before) : null,
|
|
97
|
-
after ? JSON.stringify(after) : null
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
function getAuditTrail(db, memoryId) {
|
|
101
|
-
return db.select().from(auditTrail).where(eq(auditTrail.memory_id, memoryId)).orderBy(desc(auditTrail.timestamp)).all().map(rowToAudit);
|
|
102
|
-
}
|
|
103
|
-
function getRecentAudit(db, limit = 50) {
|
|
104
|
-
return db.select().from(auditTrail).orderBy(desc(auditTrail.timestamp)).limit(limit).all().map(rowToAudit);
|
|
105
|
-
}
|
|
106
|
-
function diffSnapshots(before, after) {
|
|
107
|
-
if (!before || !after) return [];
|
|
108
|
-
const a = JSON.parse(before);
|
|
109
|
-
const b = JSON.parse(after);
|
|
110
|
-
const diffs = [];
|
|
111
|
-
const keys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
112
|
-
for (const key of keys) {
|
|
113
|
-
if (key === "evidence" || key === "embedding") continue;
|
|
114
|
-
const va = JSON.stringify(a[key]);
|
|
115
|
-
const vb = JSON.stringify(b[key]);
|
|
116
|
-
if (va !== vb) {
|
|
117
|
-
diffs.push({ field: key, before: a[key], after: b[key] });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return diffs;
|
|
121
|
-
}
|
|
122
|
-
function rollbackMemory(db, memoryId, auditEntryId, actor) {
|
|
123
|
-
const entry = db.select().from(auditTrail).where(eq(auditTrail.id, auditEntryId)).get();
|
|
124
|
-
if (!entry) return false;
|
|
125
|
-
const snapshot = entry.before_snapshot;
|
|
126
|
-
if (!snapshot) return false;
|
|
127
|
-
const beforeRollback = getMemory(db, memoryId);
|
|
128
|
-
const restored = JSON.parse(snapshot);
|
|
129
|
-
db.update(memories).set({
|
|
130
|
-
text: restored.text,
|
|
131
|
-
type: restored.type,
|
|
132
|
-
scope: restored.scope,
|
|
133
|
-
path_scope: restored.path_scope,
|
|
134
|
-
status: restored.status,
|
|
135
|
-
confidence: restored.confidence,
|
|
136
|
-
source: restored.source,
|
|
137
|
-
evidence: restored.evidence,
|
|
138
|
-
capture_context: restored.capture_context,
|
|
139
|
-
repetition_count: restored.repetition_count,
|
|
140
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
141
|
-
}).where(eq(memories.id, memoryId)).run();
|
|
142
|
-
queueMemoryEmbeddingSync(db, memoryId);
|
|
143
|
-
recordAuditWithSnapshot(
|
|
144
|
-
db,
|
|
145
|
-
memoryId,
|
|
146
|
-
"rolled_back",
|
|
147
|
-
actor,
|
|
148
|
-
`Rolled back to state from ${entry.timestamp}`,
|
|
149
|
-
beforeRollback ?? null,
|
|
150
|
-
getMemory(db, memoryId) ?? null
|
|
151
|
-
);
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
function formatAuditTrail(entries) {
|
|
155
|
-
if (entries.length === 0) return "No audit entries.";
|
|
156
|
-
const lines = ["# Audit Trail", ""];
|
|
157
|
-
for (const e of entries) {
|
|
158
|
-
const diffs = diffSnapshots(e.before_snapshot, e.after_snapshot);
|
|
159
|
-
const diffStr = diffs.length > 0 ? ` [${diffs.map((d) => `${d.field}: ${JSON.stringify(d.before)} \u2192 ${JSON.stringify(d.after)}`).join(", ")}]` : "";
|
|
160
|
-
lines.push(
|
|
161
|
-
`${e.timestamp.slice(0, 19)} ${e.action.padEnd(22)} by ${e.actor}${e.reason ? ` \u2014 ${e.reason}` : ""}${diffStr}`
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
return lines.join("\n");
|
|
165
|
-
}
|
|
166
|
-
function rowToAudit(row) {
|
|
167
|
-
return {
|
|
168
|
-
id: row.id,
|
|
169
|
-
memory_id: row.memory_id,
|
|
170
|
-
action: row.action,
|
|
171
|
-
actor: row.actor,
|
|
172
|
-
before_snapshot: row.before_snapshot,
|
|
173
|
-
after_snapshot: row.after_snapshot,
|
|
174
|
-
reason: row.reason,
|
|
175
|
-
timestamp: row.timestamp
|
|
176
|
-
};
|
|
177
|
-
}
|
|
67
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
178
68
|
|
|
179
69
|
// src/health/scoring.ts
|
|
180
70
|
var WEIGHTS = {
|
|
@@ -1045,10 +935,10 @@ function inferFromGitOwnership(filePath, repoPath) {
|
|
|
1045
935
|
}
|
|
1046
936
|
|
|
1047
937
|
// src/maintenance/cleanup.ts
|
|
1048
|
-
import { randomUUID as
|
|
938
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
1049
939
|
|
|
1050
940
|
// src/contradictions/detector.ts
|
|
1051
|
-
import { randomUUID
|
|
941
|
+
import { randomUUID } from "crypto";
|
|
1052
942
|
function countContradictionCandidates(db, repo) {
|
|
1053
943
|
const conditions = [inArray(memories.status, ["active", "candidate"])];
|
|
1054
944
|
if (repo) conditions.push(eq(memories.repo, repo));
|
|
@@ -1076,7 +966,7 @@ function detectContradictions(db, repo) {
|
|
|
1076
966
|
)
|
|
1077
967
|
).get();
|
|
1078
968
|
if (!existing) {
|
|
1079
|
-
const id =
|
|
969
|
+
const id = randomUUID();
|
|
1080
970
|
const now2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
1081
971
|
db.insert(contradictions).values({
|
|
1082
972
|
id,
|
|
@@ -1459,7 +1349,7 @@ var SUPPRESS_INJECTION_FLOOR = 50;
|
|
|
1459
1349
|
var GLOBALIZE_REPO_FLOOR = 3;
|
|
1460
1350
|
var DEFAULT_ACTOR = "maintenance:cleanup";
|
|
1461
1351
|
function runDeterministicCleanup(db, opts = { dryRun: true }) {
|
|
1462
|
-
const runId =
|
|
1352
|
+
const runId = randomUUID2();
|
|
1463
1353
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1464
1354
|
const plan = [];
|
|
1465
1355
|
if (!opts.only || opts.only === "dedupe_exact_merge") {
|
|
@@ -1674,7 +1564,7 @@ function applyDedupeExact(db, runId, plan) {
|
|
|
1674
1564
|
after ?? null
|
|
1675
1565
|
);
|
|
1676
1566
|
db.insert(maintenanceCleanupLog).values({
|
|
1677
|
-
id:
|
|
1567
|
+
id: randomUUID2(),
|
|
1678
1568
|
run_id: runId,
|
|
1679
1569
|
action: "dedupe_exact_merge",
|
|
1680
1570
|
memory_id: loser.id,
|
|
@@ -1870,7 +1760,7 @@ function applyRejectFragment(db, runId, plan) {
|
|
|
1870
1760
|
after ?? null
|
|
1871
1761
|
);
|
|
1872
1762
|
db.insert(maintenanceCleanupLog).values({
|
|
1873
|
-
id:
|
|
1763
|
+
id: randomUUID2(),
|
|
1874
1764
|
run_id: runId,
|
|
1875
1765
|
action: "reject_fragment_candidate",
|
|
1876
1766
|
memory_id: plan.memory_id,
|
|
@@ -1914,7 +1804,7 @@ function applyRejectTestFixtureRepo(db, runId, plan) {
|
|
|
1914
1804
|
after ?? null
|
|
1915
1805
|
);
|
|
1916
1806
|
db.insert(maintenanceCleanupLog).values({
|
|
1917
|
-
id:
|
|
1807
|
+
id: randomUUID2(),
|
|
1918
1808
|
run_id: runId,
|
|
1919
1809
|
action: "reject_test_fixture_repo",
|
|
1920
1810
|
memory_id: plan.memory_id,
|
|
@@ -1983,7 +1873,7 @@ function applyRejectInvalidScope(db, runId, plan) {
|
|
|
1983
1873
|
after ?? null
|
|
1984
1874
|
);
|
|
1985
1875
|
db.insert(maintenanceCleanupLog).values({
|
|
1986
|
-
id:
|
|
1876
|
+
id: randomUUID2(),
|
|
1987
1877
|
run_id: runId,
|
|
1988
1878
|
action: "reject_invalid_scope",
|
|
1989
1879
|
memory_id: plan.memory_id,
|
|
@@ -2042,7 +1932,7 @@ function applyRejectGenericScannedTooling(db, runId, plan) {
|
|
|
2042
1932
|
after ?? null
|
|
2043
1933
|
);
|
|
2044
1934
|
db.insert(maintenanceCleanupLog).values({
|
|
2045
|
-
id:
|
|
1935
|
+
id: randomUUID2(),
|
|
2046
1936
|
run_id: runId,
|
|
2047
1937
|
action: "reject_generic_scanned_tooling",
|
|
2048
1938
|
memory_id: plan.memory_id,
|
|
@@ -2095,7 +1985,7 @@ function applyPromoteRepeat(db, runId, plan) {
|
|
|
2095
1985
|
after ?? null
|
|
2096
1986
|
);
|
|
2097
1987
|
db.insert(maintenanceCleanupLog).values({
|
|
2098
|
-
id:
|
|
1988
|
+
id: randomUUID2(),
|
|
2099
1989
|
run_id: runId,
|
|
2100
1990
|
action: "promote_repeat_correction",
|
|
2101
1991
|
memory_id: plan.memory_id,
|
|
@@ -2153,7 +2043,7 @@ function applySuppressCommand(db, runId, plan) {
|
|
|
2153
2043
|
after ?? null
|
|
2154
2044
|
);
|
|
2155
2045
|
db.insert(maintenanceCleanupLog).values({
|
|
2156
|
-
id:
|
|
2046
|
+
id: randomUUID2(),
|
|
2157
2047
|
run_id: runId,
|
|
2158
2048
|
action: "suppress_unproductive_command",
|
|
2159
2049
|
memory_id: plan.memory_id,
|
|
@@ -2248,7 +2138,7 @@ function applyGlobalizeCrossRepo(db, runId, plan) {
|
|
|
2248
2138
|
after ?? null
|
|
2249
2139
|
);
|
|
2250
2140
|
db.insert(maintenanceCleanupLog).values({
|
|
2251
|
-
id:
|
|
2141
|
+
id: randomUUID2(),
|
|
2252
2142
|
run_id: runId,
|
|
2253
2143
|
action: "globalize_cross_repo",
|
|
2254
2144
|
memory_id: winner.id,
|
|
@@ -2275,7 +2165,7 @@ function applyGlobalizeCrossRepo(db, runId, plan) {
|
|
|
2275
2165
|
afterLoser ?? null
|
|
2276
2166
|
);
|
|
2277
2167
|
db.insert(maintenanceCleanupLog).values({
|
|
2278
|
-
id:
|
|
2168
|
+
id: randomUUID2(),
|
|
2279
2169
|
run_id: runId,
|
|
2280
2170
|
action: "globalize_cross_repo",
|
|
2281
2171
|
memory_id: loserId,
|
|
@@ -2654,7 +2544,9 @@ async function processCorrection(db, text, ctx) {
|
|
|
2654
2544
|
wakeDispatcherBestEffort();
|
|
2655
2545
|
return { ids: [], pendingTaskId: taskId ?? `dedup:${promptId}` };
|
|
2656
2546
|
}
|
|
2657
|
-
const corrections = detectCorrections(text)
|
|
2547
|
+
const corrections = detectCorrections(text).filter(
|
|
2548
|
+
(correction) => correction.type === "review_pattern" || qualityReasons(correction.text).length === 0
|
|
2549
|
+
);
|
|
2658
2550
|
if (corrections.length === 0 && ctx.force_semantic_capture) {
|
|
2659
2551
|
corrections.push({
|
|
2660
2552
|
type: "rule",
|
|
@@ -2667,12 +2559,12 @@ async function processCorrection(db, text, ctx) {
|
|
|
2667
2559
|
const profile = getRepoQualityProfile(db, ctx.repo);
|
|
2668
2560
|
const ids = [];
|
|
2669
2561
|
const captureContext = buildCaptureContext(ctx);
|
|
2562
|
+
let blockedByRejectedExemplar = 0;
|
|
2670
2563
|
for (const correction of corrections) {
|
|
2671
|
-
if (correction.
|
|
2672
|
-
|
|
2673
|
-
|
|
2564
|
+
if (await isSimilarToRejectedFragmentSemantic(db, correction.text)) {
|
|
2565
|
+
blockedByRejectedExemplar++;
|
|
2566
|
+
continue;
|
|
2674
2567
|
}
|
|
2675
|
-
if (await isSimilarToRejectedFragmentSemantic(db, correction.text)) continue;
|
|
2676
2568
|
const evidence = correction.type === "review_pattern" ? {
|
|
2677
2569
|
type: "review_feedback",
|
|
2678
2570
|
reported_by_user: true,
|
|
@@ -2754,7 +2646,7 @@ async function processCorrection(db, text, ctx) {
|
|
|
2754
2646
|
});
|
|
2755
2647
|
ids.push(id);
|
|
2756
2648
|
}
|
|
2757
|
-
return { ids };
|
|
2649
|
+
return { ids, blockedByRejectedExemplar };
|
|
2758
2650
|
}
|
|
2759
2651
|
function stablePromptId(sessionId, repo, text) {
|
|
2760
2652
|
const hash = createHash("sha256").update(`${sessionId}${repo ?? ""}${normalizeDedupeText(text)}`).digest("hex").slice(0, 16);
|
|
@@ -2848,17 +2740,16 @@ function textSimilarity(a, b) {
|
|
|
2848
2740
|
}
|
|
2849
2741
|
var REJECTED_EXEMPLAR_THRESHOLD = 0.7;
|
|
2850
2742
|
var REJECTED_EXEMPLAR_SEMANTIC_THRESHOLD = 0.85;
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
return
|
|
2743
|
+
var HUMAN_REJECTION_ACTORS = ["mcp", "cli"];
|
|
2744
|
+
function isHumanRejection(db, memoryId) {
|
|
2745
|
+
const rows = db.select({ actor: auditTrail.actor }).from(auditTrail).where(and(eq(auditTrail.memory_id, memoryId), eq(auditTrail.action, "rejected"))).all();
|
|
2746
|
+
return rows.some((row) => HUMAN_REJECTION_ACTORS.includes(row.actor));
|
|
2855
2747
|
}
|
|
2856
|
-
var MACHINE_REJECTION_ACTORS = ["auto-pruner", "cleanup_script", "maintenance:cleanup"];
|
|
2857
2748
|
function isSimilarToRejectedFragment(db, text, threshold = REJECTED_EXEMPLAR_THRESHOLD) {
|
|
2858
2749
|
const rejected = queryMemories(db, { status: "rejected" }).filter((m) => m.source === "user_correction" || m.source === "user_reported_review");
|
|
2859
2750
|
for (const exemplar of rejected) {
|
|
2860
2751
|
if (textSimilarity(text, exemplar.text) < threshold) continue;
|
|
2861
|
-
if (
|
|
2752
|
+
if (!isHumanRejection(db, exemplar.id)) continue;
|
|
2862
2753
|
return true;
|
|
2863
2754
|
}
|
|
2864
2755
|
return false;
|
|
@@ -2869,7 +2760,13 @@ async function isSimilarToRejectedFragmentSemantic(db, text, options = {}) {
|
|
|
2869
2760
|
if (isSimilarToRejectedFragment(db, text, lexicalT)) return true;
|
|
2870
2761
|
const config = loadEmbeddingConfigFromEnv();
|
|
2871
2762
|
if (!config) return false;
|
|
2872
|
-
const match = await findSimilarRejectedExemplar(
|
|
2763
|
+
const match = await findSimilarRejectedExemplar(
|
|
2764
|
+
db,
|
|
2765
|
+
text,
|
|
2766
|
+
config,
|
|
2767
|
+
semanticT,
|
|
2768
|
+
(id) => isHumanRejection(db, id)
|
|
2769
|
+
);
|
|
2873
2770
|
return match != null;
|
|
2874
2771
|
}
|
|
2875
2772
|
async function findDuplicateMemory(db, repo, type, text, threshold) {
|
|
@@ -3104,7 +3001,7 @@ function applySummarizeSession(db, task, result) {
|
|
|
3104
3001
|
const payload = task.payload;
|
|
3105
3002
|
const sessionId = payload.session_id;
|
|
3106
3003
|
if (!sessionId) throw new ApplyError("payload missing session_id", "invalid-state");
|
|
3107
|
-
const id =
|
|
3004
|
+
const id = randomUUID3();
|
|
3108
3005
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3109
3006
|
db.insert(historySnippets).values({
|
|
3110
3007
|
id,
|
|
@@ -3122,7 +3019,7 @@ function applySynthesizeRepo(db, task, result) {
|
|
|
3122
3019
|
const payload = task.payload;
|
|
3123
3020
|
const repo = payload.repo;
|
|
3124
3021
|
if (!repo) throw new ApplyError("payload missing repo", "invalid-state");
|
|
3125
|
-
const id =
|
|
3022
|
+
const id = randomUUID3();
|
|
3126
3023
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3127
3024
|
db.insert(historySnippets).values({
|
|
3128
3025
|
id,
|
|
@@ -3356,7 +3253,7 @@ function hasActiveTaskForTarget(db, kind, target) {
|
|
|
3356
3253
|
}
|
|
3357
3254
|
function insertTaskIdempotent(db, input) {
|
|
3358
3255
|
if (hasActiveTaskForTarget(db, input.kind, input.target)) return null;
|
|
3359
|
-
const id =
|
|
3256
|
+
const id = randomUUID4();
|
|
3360
3257
|
db.insert(memoryMaintenanceTasks).values({
|
|
3361
3258
|
id,
|
|
3362
3259
|
kind: input.kind,
|
|
@@ -4048,12 +3945,6 @@ export {
|
|
|
4048
3945
|
formatHealthReport,
|
|
4049
3946
|
getRepoQualityProfile,
|
|
4050
3947
|
seedScannedConfidence,
|
|
4051
|
-
recordAudit,
|
|
4052
|
-
recordAuditWithSnapshot,
|
|
4053
|
-
getAuditTrail,
|
|
4054
|
-
getRecentAudit,
|
|
4055
|
-
rollbackMemory,
|
|
4056
|
-
formatAuditTrail,
|
|
4057
3948
|
DEFAULT_LEASE_SECONDS2 as DEFAULT_LEASE_SECONDS,
|
|
4058
3949
|
DEFAULT_PRIORITIES,
|
|
4059
3950
|
DEFAULT_ENQUEUE_CONFIG,
|
|
@@ -4118,4 +4009,4 @@ export {
|
|
|
4118
4009
|
processCorrection,
|
|
4119
4010
|
processReviewFeedback
|
|
4120
4011
|
};
|
|
4121
|
-
//# sourceMappingURL=chunk-
|
|
4012
|
+
//# sourceMappingURL=chunk-TA4WSV6A.js.map
|