@jungjaehoon/mama-core 2.2.1 → 2.2.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.
package/dist/index.d.ts CHANGED
@@ -15,9 +15,10 @@ export { createAdapter, DatabaseAdapter, SQLiteAdapter, type AdapterConfig, type
15
15
  export { traverseDecisionChain, DB_PATH, DB_DIR, LEGACY_DB_PATH, DEFAULT_DB_PATH, } from './memory-store.js';
16
16
  import mama from './mama-api.js';
17
17
  export { mama };
18
- export { MEMORY_SCOPE_KINDS, MEMORY_KINDS, MEMORY_STATUSES, MEMORY_EDGE_TYPES, createEmptyRecallBundle, type MemoryScopeKind, type MemoryKind, type MemoryStatus, type MemoryEdgeType, type MemoryScopeRef, type MemorySourceRef, type MemoryRecord, type MemoryWriteProvenance, type MemoryProvenanceRecord, type PublicSaveMemoryInput, type PublicIngestMemoryInput, type PublicIngestConversationInput, type MemorySearchResultHit, type MemoryEdge, type ProfileSnapshot, type RecallBundle, type ConversationMessage, type IngestConversationInput, type ExtractedMemoryUnit, type IngestConversationResult, } from './memory/types.js';
18
+ export { MEMORY_SCOPE_KINDS, MEMORY_KINDS, MEMORY_STATUSES, MEMORY_EDGE_TYPES, createEmptyRecallBundle, type MemoryScopeKind, type MemoryKind, type MemoryStatus, type MemoryEdgeType, type MemoryScopeRef, type MemorySourceRef, type MemoryRecord, type MemoryWriteProvenance, type MemoryProvenanceRecord, type PublicSaveMemoryInput, type PublicIngestMemoryInput, type PublicIngestConversationInput, type MemorySearchResultHit, type MemoryEdge, type ProfileSnapshot, type RecallBundle, type ConversationMessage, type IngestConversationInput, type ExtractedMemoryUnit, type IngestConversationResult, type AuditFindingRecord, } from './memory/types.js';
19
19
  export { saveMemory, saveMemoryWithTrustedProvenance, promoteMemoryStatus, recallMemory, buildProfile, ingestMemory, ingestWithTrustedProvenance, evolveMemory, buildMemoryBootstrap, createAuditAck, recordMemoryAudit, ingestConversation, ingestConversationWithTrustedProvenance, setExtractionFn, upsertChannelSummary, getChannelSummary, } from './memory/api.js';
20
20
  export { buildExtractionPrompt, parseExtractionResponse } from './memory/extraction-prompt.js';
21
+ export { createAuditFinding, listOpenAuditFindings } from './memory/finding-store.js';
21
22
  export { appendMemoryEvent, insertMemoryEventInTransaction, listMemoryEventsForMemory, listRecentMemoryEvents, } from './memory/event-store.js';
22
23
  export { createTrustedProvenanceCapability, assertTrustedProvenanceCapability, type TrustedProvenanceCapability, type TrustedMemoryWriteOptions, } from './memory/provenance.js';
23
24
  export { getMemoryProvenance, listMemoriesByEnvelopeHash, listMemoriesByGatewayCallId, listMemoriesByModelRunId, } from './memory/provenance-query.js';
package/dist/index.js CHANGED
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.createAuditAck = exports.buildMemoryBootstrap = exports.evolveMemory = exports.ingestWithTrustedProvenance = exports.ingestMemory = exports.buildProfile = exports.recallMemory = exports.promoteMemoryStatus = exports.saveMemoryWithTrustedProvenance = exports.saveMemory = exports.createEmptyRecallBundle = exports.MEMORY_EDGE_TYPES = exports.MEMORY_STATUSES = exports.MEMORY_KINDS = exports.MEMORY_SCOPE_KINDS = exports.mama = exports.DEFAULT_DB_PATH = exports.LEGACY_DB_PATH = exports.DB_DIR = exports.DB_PATH = exports.traverseDecisionChain = exports.SQLiteAdapter = exports.DatabaseAdapter = exports.createAdapter = exports.fts5Search = exports.getDbPath = exports.getPreparedStmt = exports.updateDecisionOutcome = exports.querySemanticEdges = exports.queryDecisionGraph = exports.insertDecisionWithEmbedding = exports.queryVectorSearch = exports.vectorSearch = exports.insertEmbedding = exports.closeDB = exports.getAdapter = exports.getDB = exports.initDB = exports.TIMEOUT_MS = exports.HOST = exports.DEFAULT_PORT = exports.getServerPort = exports.EmbeddingCache = exports.EMBEDDING_PREFIX_SCHEME = exports.MODEL_NAME = exports.EMBEDDING_DIM = exports.embeddingCache = exports.cosineSimilarity = exports.generateEnhancedEmbedding = exports.generateEmbedding = void 0;
30
- exports.selectTopDecisions = exports.calculateRelevance = exports.DEFAULT_CONFIG = exports.getConfigPath = exports.updateConfig = exports.getCacheDir = exports.getEmbeddingDim = exports.getModelName = exports.loadConfig = exports.CanonicalizeError = exports.targetRefHash = exports.canonicalizeJSON = exports.listVisibleTwinEdgesForRefs = exports.mapTwinEdgeRow = exports.listTwinEdgesForRefs = exports.getTwinEdge = exports.TWIN_REF_KINDS = exports.TWIN_EDGE_TYPES = exports.TWIN_EDGE_SOURCES = exports.listToolTracesForRun = exports.appendToolTrace = exports.getModelRunInAdapter = exports.getModelRun = exports.failModelRunInAdapter = exports.failModelRun = exports.commitModelRunInAdapter = exports.commitModelRun = exports.beginModelRunInAdapter = exports.beginModelRun = exports.MODEL_RUN_STATUSES = exports.listMemoryProvenanceAudit = exports.getMemoryProvenanceAudit = exports.listMemoriesByModelRunId = exports.listMemoriesByGatewayCallId = exports.listMemoriesByEnvelopeHash = exports.getMemoryProvenance = exports.assertTrustedProvenanceCapability = exports.createTrustedProvenanceCapability = exports.listRecentMemoryEvents = exports.listMemoryEventsForMemory = exports.insertMemoryEventInTransaction = exports.appendMemoryEvent = exports.parseExtractionResponse = exports.buildExtractionPrompt = exports.getChannelSummary = exports.upsertChannelSummary = exports.setExtractionFn = exports.ingestConversationWithTrustedProvenance = exports.ingestConversation = exports.recordMemoryAudit = void 0;
31
- exports.extractQuickAnswer = exports.estimateTokens = exports.ensureTokenBudget = exports.formatTrustContext = exports.formatList = exports.formatRecall = exports.formatLegacyContext = exports.formatContext = exports.isMAMAError = exports.wrapError = exports.ErrorCodes = exports.TimeoutError = exports.RateLimitError = exports.LinkError = exports.ConfigurationError = exports.EmbeddingError = exports.DatabaseError = exports.ValidationError = exports.NotFoundError = exports.MAMAError = exports.formatTimeAgo = exports.DebugLogger = exports.error = exports.warn = exports.info = exports.debug = exports.logSearching = exports.logLoading = exports.logError = exports.logFailed = exports.logComplete = exports.logProgress = exports.getTierDescription = exports.checkDatabase = exports.checkEmbeddings = exports.checkSQLite = exports.checkNodeVersion = exports.VALID_EDGE_TYPES = exports.updateConfidence = exports.createEdgesFromReasoning = exports.parseReasoningForRelationships = exports.detectRefinement = exports.calculateCombinedConfidence = exports.markSuperseded = exports.createSupersedesEdge = exports.createEdge = exports.getPreviousDecision = exports.generateDecisionId = exports.learnDecision = exports.formatTopNContext = void 0;
32
- exports.notifyInsight = exports.FALLBACK_MODEL = exports.DEFAULT_MODEL = exports.listModels = exports.isAvailable = exports.generate = exports.analyzeIntent = exports.RECENT_WINDOW_MS = exports.PARTIAL_INDICATORS = exports.SUCCESS_INDICATORS = exports.FAILURE_INDICATORS = exports.markOutcome = exports.getEvidenceImpact = exports.calculateDurationDays = exports.getRecentDecision = exports.extractFailureReason = exports.matchesPartialIndicators = exports.matchesSuccessIndicators = exports.matchesFailureIndicators = exports.analyzeOutcome = exports.extractCodeExample = void 0;
30
+ exports.DEFAULT_CONFIG = exports.getConfigPath = exports.updateConfig = exports.getCacheDir = exports.getEmbeddingDim = exports.getModelName = exports.loadConfig = exports.CanonicalizeError = exports.targetRefHash = exports.canonicalizeJSON = exports.listVisibleTwinEdgesForRefs = exports.mapTwinEdgeRow = exports.listTwinEdgesForRefs = exports.getTwinEdge = exports.TWIN_REF_KINDS = exports.TWIN_EDGE_TYPES = exports.TWIN_EDGE_SOURCES = exports.listToolTracesForRun = exports.appendToolTrace = exports.getModelRunInAdapter = exports.getModelRun = exports.failModelRunInAdapter = exports.failModelRun = exports.commitModelRunInAdapter = exports.commitModelRun = exports.beginModelRunInAdapter = exports.beginModelRun = exports.MODEL_RUN_STATUSES = exports.listMemoryProvenanceAudit = exports.getMemoryProvenanceAudit = exports.listMemoriesByModelRunId = exports.listMemoriesByGatewayCallId = exports.listMemoriesByEnvelopeHash = exports.getMemoryProvenance = exports.assertTrustedProvenanceCapability = exports.createTrustedProvenanceCapability = exports.listRecentMemoryEvents = exports.listMemoryEventsForMemory = exports.insertMemoryEventInTransaction = exports.appendMemoryEvent = exports.listOpenAuditFindings = exports.createAuditFinding = exports.parseExtractionResponse = exports.buildExtractionPrompt = exports.getChannelSummary = exports.upsertChannelSummary = exports.setExtractionFn = exports.ingestConversationWithTrustedProvenance = exports.ingestConversation = exports.recordMemoryAudit = void 0;
31
+ exports.ensureTokenBudget = exports.formatTrustContext = exports.formatList = exports.formatRecall = exports.formatLegacyContext = exports.formatContext = exports.isMAMAError = exports.wrapError = exports.ErrorCodes = exports.TimeoutError = exports.RateLimitError = exports.LinkError = exports.ConfigurationError = exports.EmbeddingError = exports.DatabaseError = exports.ValidationError = exports.NotFoundError = exports.MAMAError = exports.formatTimeAgo = exports.DebugLogger = exports.error = exports.warn = exports.info = exports.debug = exports.logSearching = exports.logLoading = exports.logError = exports.logFailed = exports.logComplete = exports.logProgress = exports.getTierDescription = exports.checkDatabase = exports.checkEmbeddings = exports.checkSQLite = exports.checkNodeVersion = exports.VALID_EDGE_TYPES = exports.updateConfidence = exports.createEdgesFromReasoning = exports.parseReasoningForRelationships = exports.detectRefinement = exports.calculateCombinedConfidence = exports.markSuperseded = exports.createSupersedesEdge = exports.createEdge = exports.getPreviousDecision = exports.generateDecisionId = exports.learnDecision = exports.formatTopNContext = exports.selectTopDecisions = exports.calculateRelevance = void 0;
32
+ exports.notifyInsight = exports.FALLBACK_MODEL = exports.DEFAULT_MODEL = exports.listModels = exports.isAvailable = exports.generate = exports.analyzeIntent = exports.RECENT_WINDOW_MS = exports.PARTIAL_INDICATORS = exports.SUCCESS_INDICATORS = exports.FAILURE_INDICATORS = exports.markOutcome = exports.getEvidenceImpact = exports.calculateDurationDays = exports.getRecentDecision = exports.extractFailureReason = exports.matchesPartialIndicators = exports.matchesSuccessIndicators = exports.matchesFailureIndicators = exports.analyzeOutcome = exports.extractCodeExample = exports.extractQuickAnswer = exports.estimateTokens = void 0;
33
33
  var embeddings_js_1 = require("./embeddings.js");
34
34
  Object.defineProperty(exports, "generateEmbedding", { enumerable: true, get: function () { return embeddings_js_1.generateEmbedding; } });
35
35
  Object.defineProperty(exports, "generateEnhancedEmbedding", { enumerable: true, get: function () { return embeddings_js_1.generateEnhancedEmbedding; } });
@@ -98,6 +98,9 @@ Object.defineProperty(exports, "getChannelSummary", { enumerable: true, get: fun
98
98
  var extraction_prompt_js_1 = require("./memory/extraction-prompt.js");
99
99
  Object.defineProperty(exports, "buildExtractionPrompt", { enumerable: true, get: function () { return extraction_prompt_js_1.buildExtractionPrompt; } });
100
100
  Object.defineProperty(exports, "parseExtractionResponse", { enumerable: true, get: function () { return extraction_prompt_js_1.parseExtractionResponse; } });
101
+ var finding_store_js_1 = require("./memory/finding-store.js");
102
+ Object.defineProperty(exports, "createAuditFinding", { enumerable: true, get: function () { return finding_store_js_1.createAuditFinding; } });
103
+ Object.defineProperty(exports, "listOpenAuditFindings", { enumerable: true, get: function () { return finding_store_js_1.listOpenAuditFindings; } });
101
104
  var event_store_js_1 = require("./memory/event-store.js");
102
105
  Object.defineProperty(exports, "appendMemoryEvent", { enumerable: true, get: function () { return event_store_js_1.appendMemoryEvent; } });
103
106
  Object.defineProperty(exports, "insertMemoryEventInTransaction", { enumerable: true, get: function () { return event_store_js_1.insertMemoryEventInTransaction; } });
@@ -20,7 +20,7 @@
20
20
  import { DecisionRecord } from './db-manager.js';
21
21
  import { SemanticEdges } from './decision-formatter.js';
22
22
  import { saveMemory, saveMemoryWithTrustedProvenance, recallMemory, buildProfile, ingestMemory, ingestWithTrustedProvenance, ingestConversation, ingestConversationWithTrustedProvenance, evolveMemory, buildMemoryBootstrap, createAuditAck, recordMemoryAudit, upsertChannelSummary, getChannelSummary } from './memory/api.js';
23
- import { listOpenAuditFindings } from './memory/finding-store.js';
23
+ import { createAuditFinding, listOpenAuditFindings } from './memory/finding-store.js';
24
24
  import { listMemoryEventsForMemory, listRecentMemoryEvents } from './memory/event-store.js';
25
25
  import type { TrustedMemoryWriteOptions } from './memory/provenance.js';
26
26
  import { getMemoryProvenance, listMemoriesByEnvelopeHash, listMemoriesByGatewayCallId, listMemoriesByModelRunId } from './memory/provenance-query.js';
@@ -1065,6 +1065,8 @@ declare const mama: {
1065
1065
  upsertChannelSummary: typeof upsertChannelSummary;
1066
1066
  getChannelSummary: typeof getChannelSummary;
1067
1067
  listAuditFindings: typeof listOpenAuditFindings;
1068
+ listOpenAuditFindings: typeof listOpenAuditFindings;
1069
+ createAuditFinding: typeof createAuditFinding;
1068
1070
  getMemoryProvenance: typeof getMemoryProvenance;
1069
1071
  listMemoriesByEnvelopeHash: typeof listMemoriesByEnvelopeHash;
1070
1072
  listMemoriesByGatewayCallId: typeof listMemoriesByGatewayCallId;
@@ -1105,6 +1107,6 @@ declare const mama: {
1105
1107
  validateCleanupResult: typeof validateCleanupResult;
1106
1108
  expandWithGraph: typeof expandWithGraph;
1107
1109
  };
1108
- export { save, saveWithTrustedProvenance, suggest, annotateTopicCurrency, saveMemory, saveMemoryWithTrustedProvenance, recallMemory, listDecisions as list, listCheckpoints, updateOutcome, buildProfile, ingestMemory, ingestWithTrustedProvenance, ingestConversation, ingestConversationWithTrustedProvenance, evolveMemory, buildMemoryBootstrap, createAuditAck, recordMemoryAudit, upsertChannelSummary, getChannelSummary, listOpenAuditFindings, getMemoryProvenance, listMemoriesByEnvelopeHash, listMemoriesByGatewayCallId, listMemoriesByModelRunId, listMemoryEventsForMemory, listRecentMemoryEvents, beginModelRun, beginModelRunInAdapter, commitModelRun, commitModelRunInAdapter, failModelRun, failModelRunInAdapter, getModelRun, getModelRunInAdapter, appendToolTrace, listToolTracesForRun, saveCheckpoint, loadCheckpoint, recall, proposeLink, approveLink, rejectLink, getPendingLinks, deprecateAutoLinks, calculateCoverage, calculateQuality, generateQualityReport, logRestartAttempt, calculateRestartSuccessRate, calculateRestartLatency, getRestartMetrics, scanAutoLinks, createLinkBackup, generatePreCleanupReport, restoreLinkBackup, verifyBackupExists, deleteAutoLinks, validateCleanupResult, expandWithGraph, };
1110
+ export { save, saveWithTrustedProvenance, suggest, annotateTopicCurrency, saveMemory, saveMemoryWithTrustedProvenance, recallMemory, listDecisions as list, listCheckpoints, updateOutcome, buildProfile, ingestMemory, ingestWithTrustedProvenance, ingestConversation, ingestConversationWithTrustedProvenance, evolveMemory, buildMemoryBootstrap, createAuditAck, recordMemoryAudit, upsertChannelSummary, getChannelSummary, listOpenAuditFindings, createAuditFinding, getMemoryProvenance, listMemoriesByEnvelopeHash, listMemoriesByGatewayCallId, listMemoriesByModelRunId, listMemoryEventsForMemory, listRecentMemoryEvents, beginModelRun, beginModelRunInAdapter, commitModelRun, commitModelRunInAdapter, failModelRun, failModelRunInAdapter, getModelRun, getModelRunInAdapter, appendToolTrace, listToolTracesForRun, saveCheckpoint, loadCheckpoint, recall, proposeLink, approveLink, rejectLink, getPendingLinks, deprecateAutoLinks, calculateCoverage, calculateQuality, generateQualityReport, logRestartAttempt, calculateRestartSuccessRate, calculateRestartLatency, getRestartMetrics, scanAutoLinks, createLinkBackup, generatePreCleanupReport, restoreLinkBackup, verifyBackupExists, deleteAutoLinks, validateCleanupResult, expandWithGraph, };
1109
1111
  export default mama;
1110
1112
  //# sourceMappingURL=mama-api.d.ts.map
package/dist/mama-api.js CHANGED
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.listToolTracesForRun = exports.appendToolTrace = exports.getModelRunInAdapter = exports.getModelRun = exports.failModelRunInAdapter = exports.failModelRun = exports.commitModelRunInAdapter = exports.commitModelRun = exports.beginModelRunInAdapter = exports.beginModelRun = exports.listRecentMemoryEvents = exports.listMemoryEventsForMemory = exports.listMemoriesByModelRunId = exports.listMemoriesByGatewayCallId = exports.listMemoriesByEnvelopeHash = exports.getMemoryProvenance = exports.listOpenAuditFindings = exports.getChannelSummary = exports.upsertChannelSummary = exports.recordMemoryAudit = exports.createAuditAck = exports.buildMemoryBootstrap = exports.evolveMemory = exports.ingestConversationWithTrustedProvenance = exports.ingestConversation = exports.ingestWithTrustedProvenance = exports.ingestMemory = exports.buildProfile = exports.recallMemory = exports.saveMemoryWithTrustedProvenance = exports.saveMemory = void 0;
25
+ exports.listToolTracesForRun = exports.appendToolTrace = exports.getModelRunInAdapter = exports.getModelRun = exports.failModelRunInAdapter = exports.failModelRun = exports.commitModelRunInAdapter = exports.commitModelRun = exports.beginModelRunInAdapter = exports.beginModelRun = exports.listRecentMemoryEvents = exports.listMemoryEventsForMemory = exports.listMemoriesByModelRunId = exports.listMemoriesByGatewayCallId = exports.listMemoriesByEnvelopeHash = exports.getMemoryProvenance = exports.createAuditFinding = exports.listOpenAuditFindings = exports.getChannelSummary = exports.upsertChannelSummary = exports.recordMemoryAudit = exports.createAuditAck = exports.buildMemoryBootstrap = exports.evolveMemory = exports.ingestConversationWithTrustedProvenance = exports.ingestConversation = exports.ingestWithTrustedProvenance = exports.ingestMemory = exports.buildProfile = exports.recallMemory = exports.saveMemoryWithTrustedProvenance = exports.saveMemory = void 0;
26
26
  exports.save = save;
27
27
  exports.saveWithTrustedProvenance = saveWithTrustedProvenance;
28
28
  exports.suggest = suggest;
@@ -84,6 +84,7 @@ Object.defineProperty(exports, "recordMemoryAudit", { enumerable: true, get: fun
84
84
  Object.defineProperty(exports, "upsertChannelSummary", { enumerable: true, get: function () { return api_js_1.upsertChannelSummary; } });
85
85
  Object.defineProperty(exports, "getChannelSummary", { enumerable: true, get: function () { return api_js_1.getChannelSummary; } });
86
86
  const finding_store_js_1 = require("./memory/finding-store.js");
87
+ Object.defineProperty(exports, "createAuditFinding", { enumerable: true, get: function () { return finding_store_js_1.createAuditFinding; } });
87
88
  Object.defineProperty(exports, "listOpenAuditFindings", { enumerable: true, get: function () { return finding_store_js_1.listOpenAuditFindings; } });
88
89
  const event_store_js_1 = require("./memory/event-store.js");
89
90
  Object.defineProperty(exports, "listMemoryEventsForMemory", { enumerable: true, get: function () { return event_store_js_1.listMemoryEventsForMemory; } });
@@ -2813,6 +2814,8 @@ const mama = {
2813
2814
  upsertChannelSummary: api_js_1.upsertChannelSummary,
2814
2815
  getChannelSummary: api_js_1.getChannelSummary,
2815
2816
  listAuditFindings: finding_store_js_1.listOpenAuditFindings,
2817
+ listOpenAuditFindings: finding_store_js_1.listOpenAuditFindings,
2818
+ createAuditFinding: finding_store_js_1.createAuditFinding,
2816
2819
  getMemoryProvenance: provenance_query_js_1.getMemoryProvenance,
2817
2820
  listMemoriesByEnvelopeHash: provenance_query_js_1.listMemoriesByEnvelopeHash,
2818
2821
  listMemoriesByGatewayCallId: provenance_query_js_1.listMemoriesByGatewayCallId,
@@ -647,6 +647,9 @@ async function saveMemoryInternal(input, options) {
647
647
  adapter
648
648
  .prepare(`UPDATE decisions SET superseded_by = ?, status = 'superseded', updated_at = ? WHERE id = ?`)
649
649
  .run(id, now, edge.to_id);
650
+ adapter
651
+ .prepare(`UPDATE memory_truth SET truth_status = 'superseded', superseded_by = ?, updated_at = ? WHERE memory_id = ?`)
652
+ .run(id, now, edge.to_id);
650
653
  }
651
654
  adapter
652
655
  .prepare(`
@@ -50,9 +50,15 @@ async function projectMemoryTruth(row) {
50
50
  memory_id, topic, truth_status, effective_summary, effective_details, trust_score,
51
51
  scope_refs, supporting_event_ids, superseded_by, contradicted_by, created_at, updated_at
52
52
  )
53
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, COALESCE((SELECT created_at FROM memory_truth WHERE memory_id = ?), ?), ?)
53
+ VALUES (
54
+ ?, ?,
55
+ COALESCE((SELECT status FROM decisions WHERE id = ?), ?),
56
+ ?, ?, ?, ?, ?,
57
+ COALESCE((SELECT superseded_by FROM decisions WHERE id = ?), ?),
58
+ ?, COALESCE((SELECT created_at FROM memory_truth WHERE memory_id = ?), ?), ?
59
+ )
54
60
  `)
55
- .run(row.memory_id, row.topic, row.truth_status, row.effective_summary, row.effective_details, row.trust_score, JSON.stringify(row.scope_refs), JSON.stringify(row.supporting_event_ids), row.superseded_by ?? null, row.contradicted_by ? JSON.stringify(row.contradicted_by) : null, row.memory_id, now, now);
61
+ .run(row.memory_id, row.topic, row.memory_id, row.truth_status, row.effective_summary, row.effective_details, row.trust_score, JSON.stringify(row.scope_refs), JSON.stringify(row.supporting_event_ids), row.memory_id, row.superseded_by ?? null, row.contradicted_by ? JSON.stringify(row.contradicted_by) : null, row.memory_id, now, now);
56
62
  }
57
63
  async function queryRelevantTruth(params) {
58
64
  await (0, db_manager_js_1.initDB)();
@@ -170,8 +170,8 @@ export interface PublicIngestMemoryInput {
170
170
  export type PublicIngestConversationInput = IngestConversationInput;
171
171
  export interface AuditFindingRecord {
172
172
  finding_id: string;
173
- kind: 'wrong_direction' | 'memory_conflict' | 'stale_memory' | 'unsupported_claim';
174
- severity: 'low' | 'medium' | 'high';
173
+ kind: 'wrong_direction' | 'memory_conflict' | 'stale_memory' | 'unsupported_claim' | 'memory_injection_suspect';
174
+ severity: 'low' | 'medium' | 'high' | 'warn';
175
175
  summary: string;
176
176
  evidence_refs: string[];
177
177
  affected_memory_ids: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jungjaehoon/mama-core",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "MAMA Core - Shared modules for Memory-Augmented MCP Assistant",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",