@edihasaj/recall 0.9.0 → 0.9.2

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.
Files changed (45) hide show
  1. package/dist/{chunk-OADI5XD2.js → chunk-57OKXD4B.js} +6 -6
  2. package/dist/{chunk-SISLEKTR.js → chunk-CYQPEGXG.js} +55 -20
  3. package/dist/{chunk-SISLEKTR.js.map → chunk-CYQPEGXG.js.map} +1 -1
  4. package/dist/{chunk-A27AP4NR.js → chunk-HGZOF7YH.js} +16 -7
  5. package/dist/chunk-HGZOF7YH.js.map +1 -0
  6. package/dist/{chunk-5K2LTXNW.js → chunk-IBNDQXUB.js} +98 -32
  7. package/dist/chunk-IBNDQXUB.js.map +1 -0
  8. package/dist/{chunk-YDSCPOIJ.js → chunk-K5PIUKRM.js} +2 -2
  9. package/dist/{chunk-XRWHIL74.js → chunk-OGZO2WKA.js} +8 -6
  10. package/dist/{chunk-XRWHIL74.js.map → chunk-OGZO2WKA.js.map} +1 -1
  11. package/dist/{chunk-FPZ3GBXP.js → chunk-PLOL3UCO.js} +14 -108
  12. package/dist/chunk-PLOL3UCO.js.map +1 -0
  13. package/dist/chunk-QLAFLCY4.js +112 -0
  14. package/dist/chunk-QLAFLCY4.js.map +1 -0
  15. package/dist/{chunk-DRAOZ2RN.js → chunk-UPSMHCTY.js} +2 -2
  16. package/dist/{cleanup-3JDS7MHX.js → cleanup-62AZROOV.js} +4 -3
  17. package/dist/cli.js +17 -16
  18. package/dist/cli.js.map +1 -1
  19. package/dist/daemon.js +9 -8
  20. package/dist/daemon.js.map +1 -1
  21. package/dist/{dispatcher-LV6WGHR2.js → dispatcher-GJNTZX2I.js} +4 -3
  22. package/dist/{ingest-7FAOX7YV.js → ingest-BLMXKKGP.js} +2 -2
  23. package/dist/mcp.js +7 -6
  24. package/dist/mcp.js.map +1 -1
  25. package/dist/{memory-value-V4MH2DYO.js → memory-value-B3AQW4IE.js} +4 -3
  26. package/dist/{quality-5SB4S5G2.js → quality-MIDMOC3L.js} +5 -4
  27. package/dist/{retrieval-YU2PLBUS.js → retrieval-FHCKFVXX.js} +3 -3
  28. package/dist/{tasks-DT6QPIKV.js → tasks-6CDIKOIR.js} +4 -3
  29. package/dist/webui/assets/{index-DAoAhOb4.js → index-2DR_ysOm.js} +391 -267
  30. package/dist/webui/assets/{index-DAoAhOb4.js.map → index-2DR_ysOm.js.map} +1 -1
  31. package/dist/webui/index.html +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunk-5K2LTXNW.js.map +0 -1
  34. package/dist/chunk-A27AP4NR.js.map +0 -1
  35. package/dist/chunk-FPZ3GBXP.js.map +0 -1
  36. /package/dist/{chunk-OADI5XD2.js.map → chunk-57OKXD4B.js.map} +0 -0
  37. /package/dist/{chunk-YDSCPOIJ.js.map → chunk-K5PIUKRM.js.map} +0 -0
  38. /package/dist/{chunk-DRAOZ2RN.js.map → chunk-UPSMHCTY.js.map} +0 -0
  39. /package/dist/{cleanup-3JDS7MHX.js.map → cleanup-62AZROOV.js.map} +0 -0
  40. /package/dist/{dispatcher-LV6WGHR2.js.map → dispatcher-GJNTZX2I.js.map} +0 -0
  41. /package/dist/{ingest-7FAOX7YV.js.map → ingest-BLMXKKGP.js.map} +0 -0
  42. /package/dist/{memory-value-V4MH2DYO.js.map → memory-value-B3AQW4IE.js.map} +0 -0
  43. /package/dist/{quality-5SB4S5G2.js.map → quality-MIDMOC3L.js.map} +0 -0
  44. /package/dist/{retrieval-YU2PLBUS.js.map → retrieval-FHCKFVXX.js.map} +0 -0
  45. /package/dist/{tasks-DT6QPIKV.js.map → tasks-6CDIKOIR.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  graphQuery
3
- } from "./chunk-YDSCPOIJ.js";
3
+ } from "./chunk-K5PIUKRM.js";
4
4
  import {
5
5
  captureCorrectionFallback,
6
6
  compileContext,
@@ -26,7 +26,7 @@ import {
26
26
  scanAndStore,
27
27
  sessionEndFallback,
28
28
  signalOutcomeFallback
29
- } from "./chunk-SISLEKTR.js";
29
+ } from "./chunk-CYQPEGXG.js";
30
30
  import {
31
31
  DEFAULT_LEASE_SECONDS,
32
32
  TaskClaimConflictError,
@@ -47,17 +47,17 @@ import {
47
47
  releaseTask,
48
48
  rollbackMemory,
49
49
  submitTask
50
- } from "./chunk-5K2LTXNW.js";
50
+ } from "./chunk-IBNDQXUB.js";
51
51
  import {
52
52
  recordCompletionUseValueEventsSemantic
53
- } from "./chunk-FPZ3GBXP.js";
53
+ } from "./chunk-PLOL3UCO.js";
54
54
  import {
55
55
  confirmMemory,
56
56
  demoteGlobalMemory,
57
57
  getMemory,
58
58
  queryMemories,
59
59
  rejectMemory
60
- } from "./chunk-A27AP4NR.js";
60
+ } from "./chunk-HGZOF7YH.js";
61
61
  import {
62
62
  loadEmbeddingConfigFromEnv,
63
63
  tagActivitySource
@@ -1197,4 +1197,4 @@ function createRecallMcpServer(db = initDb()) {
1197
1197
  export {
1198
1198
  createRecallMcpServer
1199
1199
  };
1200
- //# sourceMappingURL=chunk-OADI5XD2.js.map
1200
+ //# sourceMappingURL=chunk-57OKXD4B.js.map
@@ -6,14 +6,16 @@ import {
6
6
  recordAudit,
7
7
  redactSensitiveValue,
8
8
  seedScannedConfidence
9
- } from "./chunk-5K2LTXNW.js";
9
+ } from "./chunk-IBNDQXUB.js";
10
10
  import {
11
11
  recordInjectionValueEvents,
12
12
  recordMemoryInjections,
13
13
  recordOutcomeValueEvent,
14
- resolveMemoryInjectionOutcome,
14
+ resolveMemoryInjectionOutcome
15
+ } from "./chunk-PLOL3UCO.js";
16
+ import {
15
17
  textMatchScore
16
- } from "./chunk-FPZ3GBXP.js";
18
+ } from "./chunk-QLAFLCY4.js";
17
19
  import {
18
20
  asc,
19
21
  desc
@@ -32,7 +34,7 @@ import {
32
34
  recordFeedback,
33
35
  rejectMemory,
34
36
  statusFromConfidence
35
- } from "./chunk-A27AP4NR.js";
37
+ } from "./chunk-HGZOF7YH.js";
36
38
  import {
37
39
  CONFIDENCE,
38
40
  RetrievalEvalCase,
@@ -4856,11 +4858,13 @@ var DEFAULT_CONFIG = {
4856
4858
  token_budget: 2e3,
4857
4859
  include_candidates: false
4858
4860
  };
4859
- var QUERY_RESULT_LIMIT = 2;
4861
+ var QUERY_RESULT_LIMIT = 8;
4862
+ var QUERY_SELECTION_LIMIT = 2;
4860
4863
  var QUERY_VECTOR_RELEVANCE_FLOOR = 0.7;
4861
4864
  var QUERY_TEXT_MATCH_FLOOR = 0.45;
4862
4865
  var HISTORY_VECTOR_RELEVANCE_FLOOR = 0.7;
4863
4866
  var HISTORY_LEXICAL_RELEVANCE_FLOOR = 0.01;
4867
+ var CONFIDENCE_EPSILON = 1e-9;
4864
4868
  function normalizeQueryForRetrieval(text) {
4865
4869
  if (!text) return "";
4866
4870
  let out = text;
@@ -4892,10 +4896,10 @@ function compileContext(db, req) {
4892
4896
  const allActive = dedupeById([...repoActive, ...globalActive]);
4893
4897
  const scoped = req.path ? allActive.filter((m) => pathMatches(m, req.path)) : allActive;
4894
4898
  const passing = scoped.filter(
4895
- (m) => m.confidence >= config.confidence_threshold
4899
+ (m) => m.confidence + CONFIDENCE_EPSILON >= config.confidence_threshold
4896
4900
  );
4897
4901
  const dropped = scoped.filter(
4898
- (m) => m.confidence < config.confidence_threshold
4902
+ (m) => m.confidence + CONFIDENCE_EPSILON < config.confidence_threshold
4899
4903
  );
4900
4904
  if (passing.length === 0 && selectedHistory.length === 0) {
4901
4905
  return {
@@ -4993,7 +4997,7 @@ async function compileContextHybrid(db, req) {
4993
4997
  const candidateConfidenceFloor = Math.min(config.confidence_threshold, 0.45);
4994
4998
  const passing = scoped.filter((memory) => {
4995
4999
  if (memory.status === "active") {
4996
- return memory.confidence >= config.confidence_threshold;
5000
+ return memory.confidence + CONFIDENCE_EPSILON >= config.confidence_threshold;
4997
5001
  }
4998
5002
  if (memory.status === "candidate" && config.include_candidates) {
4999
5003
  return memory.confidence >= candidateConfidenceFloor;
@@ -5019,15 +5023,22 @@ async function compileContextHybrid(db, req) {
5019
5023
  );
5020
5024
  if (effectiveQuery) {
5021
5025
  for (const memory of passing) {
5022
- if (retrievalById.has(memory.id)) continue;
5023
5026
  const lexical = textMatchScore(effectiveQuery, memory.text);
5024
5027
  if (lexical.score < QUERY_TEXT_MATCH_FLOOR) continue;
5025
- retrievalById.set(memory.id, {
5026
- memory,
5027
- score: lexical.score,
5028
- similarity: 0,
5029
- lexical_score: lexical.score
5030
- });
5028
+ const existing = retrievalById.get(memory.id);
5029
+ retrievalById.set(
5030
+ memory.id,
5031
+ existing ? {
5032
+ ...existing,
5033
+ score: Math.max(existing.score, lexical.score),
5034
+ lexical_score: Math.max(existing.lexical_score, lexical.score)
5035
+ } : {
5036
+ memory,
5037
+ score: lexical.score,
5038
+ similarity: 0,
5039
+ lexical_score: lexical.score
5040
+ }
5041
+ );
5031
5042
  }
5032
5043
  }
5033
5044
  const summaries = getMemoryFeedbackSummaries(db, passing.map((m) => m.id));
@@ -5057,6 +5068,7 @@ async function compileContextHybrid(db, req) {
5057
5068
  let gotchaCount = 0;
5058
5069
  let lineCount = 0;
5059
5070
  for (const item of dedupedRanked) {
5071
+ if (effectiveQuery && selected.length >= QUERY_SELECTION_LIMIT) break;
5060
5072
  const memory = item.memory;
5061
5073
  const memLines = renderMemoryText(memory).split("\n").length;
5062
5074
  if (lineCount + memLines > config.max_lines) continue;
@@ -5763,16 +5775,29 @@ async function runRetrievalEval(db, input, options = {}) {
5763
5775
  }
5764
5776
  async function runValueRetrievalEval(db, options = {}) {
5765
5777
  const since = options.sinceIso ?? new Date(Date.now() - 14 * 864e5).toISOString();
5778
+ const caseLimit = options.limit ?? 50;
5766
5779
  const conditions = [
5767
5780
  gte(memoryValueEvents.created_at, since),
5768
- inArray(memoryValueEvents.event_type, ["retrieval_miss", "used"])
5781
+ inArray(memoryValueEvents.event_type, ["retrieval_miss", "used"]),
5782
+ eq(memories.auto_inject, true),
5783
+ or(
5784
+ and(
5785
+ eq(memoryValueEvents.event_type, "retrieval_miss"),
5786
+ inArray(memories.status, ["active", "candidate"])
5787
+ ),
5788
+ and(
5789
+ eq(memoryValueEvents.event_type, "used"),
5790
+ eq(memories.status, "active")
5791
+ )
5792
+ )
5769
5793
  ];
5770
5794
  if (options.repo) conditions.push(eq(memoryValueEvents.repo, options.repo));
5771
- const rows = db.select().from(memoryValueEvents).where(and(...conditions)).orderBy(desc(memoryValueEvents.created_at)).limit(options.limit ?? 50).all();
5795
+ const rows = db.select({ ...getTableColumns(memoryValueEvents) }).from(memoryValueEvents).innerJoin(memories, eq(memoryValueEvents.memory_id, memories.id)).where(and(...conditions)).orderBy(desc(memoryValueEvents.created_at)).limit(Math.max(caseLimit * 10, 500)).all();
5772
5796
  let skippedEvents = 0;
5773
5797
  const sourceEvents = { retrieval_miss: 0, used: 0 };
5774
5798
  const cases = [];
5775
5799
  for (const row of rows) {
5800
+ if (cases.length >= caseLimit) break;
5776
5801
  if (row.event_type === "retrieval_miss") sourceEvents.retrieval_miss += 1;
5777
5802
  if (row.event_type === "used") sourceEvents.used += 1;
5778
5803
  const memory = row.memory_id ? getMemory(db, row.memory_id) : null;
@@ -5780,12 +5805,22 @@ async function runValueRetrievalEval(db, options = {}) {
5780
5805
  skippedEvents += 1;
5781
5806
  continue;
5782
5807
  }
5808
+ const includeCandidates = row.event_type === "retrieval_miss";
5809
+ const currentlyRetrievable = memory.auto_inject && (memory.status === "active" || includeCandidates && memory.status === "candidate");
5810
+ if (!currentlyRetrievable) {
5811
+ skippedEvents += 1;
5812
+ continue;
5813
+ }
5783
5814
  const evidence = normalizeEvidence(row.evidence);
5784
- const queryText = row.event_type === "retrieval_miss" ? firstNonEmpty(evidence.query_text, evidence.correction_text) : firstNonEmpty(evidence.completion_excerpt, evidence.context);
5815
+ const queryText = row.event_type === "retrieval_miss" ? firstNonEmpty(evidence.correction_text, evidence.query_text) : firstNonEmpty(evidence.completion_excerpt, evidence.context);
5785
5816
  if (!queryText) {
5786
5817
  skippedEvents += 1;
5787
5818
  continue;
5788
5819
  }
5820
+ if (row.event_type === "used" && textMatchScore(queryText, memory.text).score < 0.45 && !(typeof evidence.semantic_similarity === "number" && evidence.semantic_similarity >= 0.78)) {
5821
+ skippedEvents += 1;
5822
+ continue;
5823
+ }
5789
5824
  const repo = memory.repo ?? row.repo;
5790
5825
  if (!repo) {
5791
5826
  skippedEvents += 1;
@@ -5796,7 +5831,7 @@ async function runValueRetrievalEval(db, options = {}) {
5796
5831
  repo,
5797
5832
  path: typeof evidence.prompt_path === "string" ? evidence.prompt_path : void 0,
5798
5833
  query_text: queryText,
5799
- include_candidates: row.event_type === "retrieval_miss",
5834
+ include_candidates: includeCandidates,
5800
5835
  max_lines: 3,
5801
5836
  max_commands: 2,
5802
5837
  max_gotchas: 2,
@@ -6487,4 +6522,4 @@ export {
6487
6522
  pruneMemories,
6488
6523
  formatPruneReport
6489
6524
  };
6490
- //# sourceMappingURL=chunk-SISLEKTR.js.map
6525
+ //# sourceMappingURL=chunk-CYQPEGXG.js.map