@remnic/core 9.3.580 → 9.3.582

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 (31) hide show
  1. package/dist/access-http.js +2 -2
  2. package/dist/access-mcp.js +1 -1
  3. package/dist/access-schema.d.ts +34 -34
  4. package/dist/{chunk-HLAVGJ62.js → chunk-35NN3ZFA.js} +25 -3
  5. package/dist/chunk-35NN3ZFA.js.map +1 -0
  6. package/dist/{chunk-YR7XMOWK.js → chunk-6GMPIJAZ.js} +2 -2
  7. package/dist/{chunk-WP5OWVLZ.js → chunk-LAL7WBLY.js} +5 -5
  8. package/dist/{chunk-QNXFFUWA.js → chunk-QRWZOCJN.js} +7 -7
  9. package/dist/{chunk-XSQ4SGM5.js → chunk-R3PQUPQ4.js} +2 -2
  10. package/dist/{chunk-5WB4C7KM.js → chunk-ZY6UPHNY.js} +6 -6
  11. package/dist/cli.js +3 -3
  12. package/dist/contradiction/index.js +3 -3
  13. package/dist/{contradiction-review-6V2LXXK6.js → contradiction-review-QKJH5DKD.js} +2 -2
  14. package/dist/{contradiction-scan-GIRVC4C7.js → contradiction-scan-GD7KUFWS.js} +3 -3
  15. package/dist/index.js +6 -6
  16. package/dist/{resolution-ZY7VM6WS.js → resolution-3SAP4SH2.js} +3 -3
  17. package/dist/schemas.d.ts +64 -64
  18. package/dist/shared-context/manager.d.ts +2 -2
  19. package/dist/transfer/types.d.ts +12 -12
  20. package/package.json +1 -1
  21. package/src/contradiction/contradiction-review.ts +33 -2
  22. package/src/contradiction/contradiction.test.ts +28 -3
  23. package/dist/chunk-HLAVGJ62.js.map +0 -1
  24. /package/dist/{chunk-YR7XMOWK.js.map → chunk-6GMPIJAZ.js.map} +0 -0
  25. /package/dist/{chunk-WP5OWVLZ.js.map → chunk-LAL7WBLY.js.map} +0 -0
  26. /package/dist/{chunk-QNXFFUWA.js.map → chunk-QRWZOCJN.js.map} +0 -0
  27. /package/dist/{chunk-XSQ4SGM5.js.map → chunk-R3PQUPQ4.js.map} +0 -0
  28. /package/dist/{chunk-5WB4C7KM.js.map → chunk-ZY6UPHNY.js.map} +0 -0
  29. /package/dist/{contradiction-review-6V2LXXK6.js.map → contradiction-review-QKJH5DKD.js.map} +0 -0
  30. /package/dist/{contradiction-scan-GIRVC4C7.js.map → contradiction-scan-GD7KUFWS.js.map} +0 -0
  31. /package/dist/{resolution-ZY7VM6WS.js.map → resolution-3SAP4SH2.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EngramAccessHttpServer
3
- } from "./chunk-5WB4C7KM.js";
3
+ } from "./chunk-ZY6UPHNY.js";
4
4
  import "./chunk-SEDEKFYQ.js";
5
5
  import "./chunk-AU7Q3LSC.js";
6
6
  import "./chunk-42NQ7AVG.js";
@@ -8,7 +8,7 @@ import "./chunk-TMSXWOBZ.js";
8
8
  import "./chunk-J64TK33U.js";
9
9
  import "./chunk-RSUYKGGZ.js";
10
10
  import "./chunk-7RXCMVFQ.js";
11
- import "./chunk-WP5OWVLZ.js";
11
+ import "./chunk-LAL7WBLY.js";
12
12
  import "./chunk-EAZGEEG2.js";
13
13
  import "./chunk-D24OXEPB.js";
14
14
  import "./chunk-VFB2G5YL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  EngramMcpServer
3
- } from "./chunk-WP5OWVLZ.js";
3
+ } from "./chunk-LAL7WBLY.js";
4
4
  import "./chunk-EAZGEEG2.js";
5
5
  import "./chunk-D24OXEPB.js";
6
6
  import "./chunk-VFB2G5YL.js";
@@ -104,9 +104,9 @@ declare const recallRequestSchema: z.ZodObject<{
104
104
  includeLowConfidence: z.ZodOptional<z.ZodBoolean>;
105
105
  }, "strip", z.ZodTypeAny, {
106
106
  query: string;
107
- namespace?: string | undefined;
108
107
  sessionKey?: string | undefined;
109
108
  tags?: string[] | undefined;
109
+ namespace?: string | undefined;
110
110
  topK?: number | undefined;
111
111
  mode?: "no_recall" | "minimal" | "full" | "graph_mode" | "auto" | undefined;
112
112
  cwd?: string | undefined;
@@ -125,9 +125,9 @@ declare const recallRequestSchema: z.ZodObject<{
125
125
  tagMatch?: "all" | "any" | undefined;
126
126
  }, {
127
127
  query: string;
128
- namespace?: string | undefined;
129
128
  sessionKey?: string | undefined;
130
129
  tags?: string[] | undefined;
130
+ namespace?: string | undefined;
131
131
  topK?: number | undefined;
132
132
  mode?: "no_recall" | "minimal" | "full" | "graph_mode" | "auto" | undefined;
133
133
  cwd?: string | undefined;
@@ -149,11 +149,11 @@ declare const recallExplainRequestSchema: z.ZodObject<{
149
149
  sessionKey: z.ZodOptional<z.ZodString>;
150
150
  namespace: z.ZodOptional<z.ZodString>;
151
151
  }, "strip", z.ZodTypeAny, {
152
- namespace?: string | undefined;
153
152
  sessionKey?: string | undefined;
154
- }, {
155
153
  namespace?: string | undefined;
154
+ }, {
156
155
  sessionKey?: string | undefined;
156
+ namespace?: string | undefined;
157
157
  }>;
158
158
  /**
159
159
  * Standalone "set coding context" request. Used by the HTTP endpoint
@@ -363,28 +363,28 @@ declare const memoryStoreRequestSchema: z.ZodObject<{
363
363
  sourceReason: z.ZodOptional<z.ZodString>;
364
364
  }, "strip", z.ZodTypeAny, {
365
365
  content: string;
366
- namespace?: string | undefined;
367
- category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
368
- confidence?: number | undefined;
369
- ttl?: string | undefined;
370
366
  schemaVersion?: number | undefined;
371
367
  sessionKey?: string | undefined;
372
368
  tags?: string[] | undefined;
373
369
  dryRun?: boolean | undefined;
370
+ namespace?: string | undefined;
371
+ category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
372
+ confidence?: number | undefined;
374
373
  entityRef?: string | undefined;
374
+ ttl?: string | undefined;
375
375
  sourceReason?: string | undefined;
376
376
  idempotencyKey?: string | undefined;
377
377
  }, {
378
378
  content: string;
379
- namespace?: string | undefined;
380
- category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
381
- confidence?: number | undefined;
382
- ttl?: string | undefined;
383
379
  schemaVersion?: number | undefined;
384
380
  sessionKey?: string | undefined;
385
381
  tags?: string[] | undefined;
386
382
  dryRun?: boolean | undefined;
383
+ namespace?: string | undefined;
384
+ category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
385
+ confidence?: number | undefined;
387
386
  entityRef?: string | undefined;
387
+ ttl?: string | undefined;
388
388
  sourceReason?: string | undefined;
389
389
  idempotencyKey?: string | undefined;
390
390
  }>;
@@ -403,28 +403,28 @@ declare const suggestionSubmitRequestSchema: z.ZodObject<{
403
403
  sourceReason: z.ZodOptional<z.ZodString>;
404
404
  }, "strip", z.ZodTypeAny, {
405
405
  content: string;
406
- namespace?: string | undefined;
407
- category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
408
- confidence?: number | undefined;
409
- ttl?: string | undefined;
410
406
  schemaVersion?: number | undefined;
411
407
  sessionKey?: string | undefined;
412
408
  tags?: string[] | undefined;
413
409
  dryRun?: boolean | undefined;
410
+ namespace?: string | undefined;
411
+ category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
412
+ confidence?: number | undefined;
414
413
  entityRef?: string | undefined;
414
+ ttl?: string | undefined;
415
415
  sourceReason?: string | undefined;
416
416
  idempotencyKey?: string | undefined;
417
417
  }, {
418
418
  content: string;
419
- namespace?: string | undefined;
420
- category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
421
- confidence?: number | undefined;
422
- ttl?: string | undefined;
423
419
  schemaVersion?: number | undefined;
424
420
  sessionKey?: string | undefined;
425
421
  tags?: string[] | undefined;
426
422
  dryRun?: boolean | undefined;
423
+ namespace?: string | undefined;
424
+ category?: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace" | undefined;
425
+ confidence?: number | undefined;
427
426
  entityRef?: string | undefined;
427
+ ttl?: string | undefined;
428
428
  sourceReason?: string | undefined;
429
429
  idempotencyKey?: string | undefined;
430
430
  }>;
@@ -456,18 +456,18 @@ declare const trustZonePromoteRequestSchema: z.ZodObject<{
456
456
  recordId: string;
457
457
  targetZone: "working" | "trusted";
458
458
  promotionReason: string;
459
- namespace?: string | undefined;
460
459
  recordedAt?: string | undefined;
461
460
  summary?: string | undefined;
462
461
  dryRun?: boolean | undefined;
462
+ namespace?: string | undefined;
463
463
  }, {
464
464
  recordId: string;
465
465
  targetZone: "working" | "trusted";
466
466
  promotionReason: string;
467
- namespace?: string | undefined;
468
467
  recordedAt?: string | undefined;
469
468
  summary?: string | undefined;
470
469
  dryRun?: boolean | undefined;
470
+ namespace?: string | undefined;
471
471
  }>;
472
472
  declare const trustZoneDemoSeedRequestSchema: z.ZodObject<{
473
473
  scenario: z.ZodOptional<z.ZodString>;
@@ -475,14 +475,14 @@ declare const trustZoneDemoSeedRequestSchema: z.ZodObject<{
475
475
  dryRun: z.ZodOptional<z.ZodBoolean>;
476
476
  namespace: z.ZodOptional<z.ZodString>;
477
477
  }, "strip", z.ZodTypeAny, {
478
- namespace?: string | undefined;
479
478
  recordedAt?: string | undefined;
480
479
  dryRun?: boolean | undefined;
480
+ namespace?: string | undefined;
481
481
  scenario?: string | undefined;
482
482
  }, {
483
- namespace?: string | undefined;
484
483
  recordedAt?: string | undefined;
485
484
  dryRun?: boolean | undefined;
485
+ namespace?: string | undefined;
486
486
  scenario?: string | undefined;
487
487
  }>;
488
488
  declare const lcmSearchRequestSchema: z.ZodObject<{
@@ -493,15 +493,15 @@ declare const lcmSearchRequestSchema: z.ZodObject<{
493
493
  limit: z.ZodOptional<z.ZodNumber>;
494
494
  }, "strip", z.ZodTypeAny, {
495
495
  query: string;
496
+ sessionKey?: string | undefined;
496
497
  namespace?: string | undefined;
497
498
  limit?: number | undefined;
498
- sessionKey?: string | undefined;
499
499
  sessionPrefix?: string | undefined;
500
500
  }, {
501
501
  query: string;
502
+ sessionKey?: string | undefined;
502
503
  namespace?: string | undefined;
503
504
  limit?: number | undefined;
504
- sessionKey?: string | undefined;
505
505
  sessionPrefix?: string | undefined;
506
506
  }>;
507
507
  declare const lcmCompactionFlushRequestSchema: z.ZodObject<{
@@ -535,12 +535,12 @@ declare const daySummaryRequestSchema: z.ZodObject<{
535
535
  sessionKey: z.ZodOptional<z.ZodString>;
536
536
  namespace: z.ZodOptional<z.ZodString>;
537
537
  }, "strip", z.ZodTypeAny, {
538
- namespace?: string | undefined;
539
538
  sessionKey?: string | undefined;
539
+ namespace?: string | undefined;
540
540
  memories?: string | undefined;
541
541
  }, {
542
- namespace?: string | undefined;
543
542
  sessionKey?: string | undefined;
543
+ namespace?: string | undefined;
544
544
  memories?: string | undefined;
545
545
  }>;
546
546
  declare const capsuleExportRequestSchema: z.ZodObject<{
@@ -730,11 +730,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
730
730
  safety: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodEnum<["safe", "requires-review", "blocked"]>>>, NonNullable<"safe" | "requires-review" | "blocked"> | undefined, "safe" | "requires-review" | "blocked" | null | undefined>;
731
731
  safetyReasons: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>, string[] | undefined, string[] | null | undefined>;
732
732
  }, "strict", z.ZodTypeAny, {
733
- confidence?: number | undefined;
734
733
  source?: string | undefined;
735
734
  stale?: boolean | undefined;
736
735
  created?: string | undefined;
737
736
  updated?: string | undefined;
737
+ confidence?: number | undefined;
738
738
  scope?: string | undefined;
739
739
  retrievalReason?: string | undefined;
740
740
  safety?: NonNullable<"safe" | "requires-review" | "blocked"> | undefined;
@@ -744,11 +744,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
744
744
  safetyReasons?: string[] | undefined;
745
745
  userContextScopes?: string[] | undefined;
746
746
  }, {
747
- confidence?: number | null | undefined;
748
747
  source?: string | null | undefined;
749
748
  stale?: boolean | null | undefined;
750
749
  created?: string | null | undefined;
751
750
  updated?: string | null | undefined;
751
+ confidence?: number | null | undefined;
752
752
  scope?: string | null | undefined;
753
753
  retrievalReason?: string | null | undefined;
754
754
  safety?: "safe" | "requires-review" | "blocked" | null | undefined;
@@ -758,11 +758,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
758
758
  safetyReasons?: string[] | null | undefined;
759
759
  userContextScopes?: string[] | null | undefined;
760
760
  }>, "many">>>, {
761
- confidence?: number | undefined;
762
761
  source?: string | undefined;
763
762
  stale?: boolean | undefined;
764
763
  created?: string | undefined;
765
764
  updated?: string | undefined;
765
+ confidence?: number | undefined;
766
766
  scope?: string | undefined;
767
767
  retrievalReason?: string | undefined;
768
768
  safety?: NonNullable<"safe" | "requires-review" | "blocked"> | undefined;
@@ -772,11 +772,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
772
772
  safetyReasons?: string[] | undefined;
773
773
  userContextScopes?: string[] | undefined;
774
774
  }[] | undefined, {
775
- confidence?: number | null | undefined;
776
775
  source?: string | null | undefined;
777
776
  stale?: boolean | null | undefined;
778
777
  created?: string | null | undefined;
779
778
  updated?: string | null | undefined;
779
+ confidence?: number | null | undefined;
780
780
  scope?: string | null | undefined;
781
781
  retrievalReason?: string | null | undefined;
782
782
  safety?: "safe" | "requires-review" | "blocked" | null | undefined;
@@ -798,11 +798,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
798
798
  matched?: boolean | undefined;
799
799
  }[] | undefined;
800
800
  retrievedMemories?: {
801
- confidence?: number | undefined;
802
801
  source?: string | undefined;
803
802
  stale?: boolean | undefined;
804
803
  created?: string | undefined;
805
804
  updated?: string | undefined;
805
+ confidence?: number | undefined;
806
806
  scope?: string | undefined;
807
807
  retrievalReason?: string | undefined;
808
808
  safety?: NonNullable<"safe" | "requires-review" | "blocked"> | undefined;
@@ -824,11 +824,11 @@ declare const actionConfidenceRequestSchema: z.ZodObject<{
824
824
  matched?: boolean | null | undefined;
825
825
  }[] | null | undefined;
826
826
  retrievedMemories?: {
827
- confidence?: number | null | undefined;
828
827
  source?: string | null | undefined;
829
828
  stale?: boolean | null | undefined;
830
829
  created?: string | null | undefined;
831
830
  updated?: string | null | undefined;
831
+ confidence?: number | null | undefined;
832
832
  scope?: string | null | undefined;
833
833
  retrievalReason?: string | null | undefined;
834
834
  safety?: "safe" | "requires-review" | "blocked" | null | undefined;
@@ -62,6 +62,22 @@ function isDeferralActive(pair) {
62
62
  const deferredUntil = deferralUntilMillis(pair);
63
63
  return deferredUntil !== null && Date.now() < deferredUntil;
64
64
  }
65
+ function isReviewActionable(pair) {
66
+ return !isTerminalResolution(pair.resolution) && !isDeferralActive(pair) && pair.resolution !== "both-valid" && pair.verdict !== "independent";
67
+ }
68
+ function compareReviewPairs(a, b) {
69
+ const aActionable = isReviewActionable(a);
70
+ const bActionable = isReviewActionable(b);
71
+ if (aActionable !== bActionable) return aActionable ? -1 : 1;
72
+ const aDetectedAt = parseIsoMillis(a.detectedAt) ?? Number.POSITIVE_INFINITY;
73
+ const bDetectedAt = parseIsoMillis(b.detectedAt) ?? Number.POSITIVE_INFINITY;
74
+ if (aDetectedAt !== bDetectedAt) return aDetectedAt < bDetectedAt ? -1 : 1;
75
+ const aPairId = typeof a.pairId === "string" ? a.pairId : "";
76
+ const bPairId = typeof b.pairId === "string" ? b.pairId : "";
77
+ const pairIdOrder = aPairId.localeCompare(bPairId);
78
+ if (pairIdOrder !== 0) return pairIdOrder;
79
+ return a.memoryIds.join("\0").localeCompare(b.memoryIds.join("\0"));
80
+ }
65
81
  function reviewStateMillis(pair) {
66
82
  return Math.max(
67
83
  parseIsoMillis(pair.deferredUntil) ?? Number.NEGATIVE_INFINITY,
@@ -223,7 +239,7 @@ function listPairs(memoryDir, options) {
223
239
  const startTime = Date.now();
224
240
  const dir = reviewDir(memoryDir);
225
241
  const { filter = "all", namespace, includeUnscopedForNamespace = false, limit = 50 } = options ?? {};
226
- const pairs = [];
242
+ const matchingPairs = [];
227
243
  let total = 0;
228
244
  if (!fs.existsSync(dir)) {
229
245
  return { pairs: [], total: 0, durationMs: Date.now() - startTime };
@@ -247,11 +263,17 @@ function listPairs(memoryDir, options) {
247
263
  continue;
248
264
  }
249
265
  total++;
250
- if (pairs.length < limit) pairs.push(pair);
266
+ matchingPairs.push(pair);
251
267
  } catch {
252
268
  continue;
253
269
  }
254
270
  }
271
+ matchingPairs.sort(compareReviewPairs);
272
+ const pairs = [];
273
+ for (const pair of matchingPairs) {
274
+ if (!(pairs.length < limit)) break;
275
+ pairs.push(pair);
276
+ }
255
277
  return { pairs, total, durationMs: Date.now() - startTime };
256
278
  }
257
279
  function migrateUnscopedPairsToNamespace(memoryDir, namespace, options = {}) {
@@ -380,4 +402,4 @@ export {
380
402
  deferPair,
381
403
  memoryHashesChanged
382
404
  };
383
- //# sourceMappingURL=chunk-HLAVGJ62.js.map
405
+ //# sourceMappingURL=chunk-35NN3ZFA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contradiction/contradiction-review.ts"],"sourcesContent":["/**\n * Contradiction Review Queue — storage for detected contradiction pairs (issue #520).\n *\n * Stores candidate pairs as JSON files under `memoryDir/.review/contradictions/`.\n * Pair IDs are deterministic (sha256 of sorted memory IDs plus namespace when scoped) so reruns are idempotent.\n *\n * Lifecycle:\n * - `contradicts` → awaiting user review\n * - `duplicates` → auto-flagged for dedup (still needs user approval)\n * - `independent` / `both-valid` → dormant with cooldown\n */\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport type { ContradictionVerdict } from \"./contradiction-judge.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────────\n\nexport type ResolutionVerb = \"keep-a\" | \"keep-b\" | \"merge\" | \"both-valid\" | \"needs-more-context\";\n\nconst VALID_RESOLUTION_VERBS: readonly ResolutionVerb[] = [\n \"keep-a\",\n \"keep-b\",\n \"merge\",\n \"both-valid\",\n \"needs-more-context\",\n];\n\nexport interface ContradictionPair {\n /** Deterministic pair ID: sha256(sorted(memoryIdA, memoryIdB) plus namespace when scoped). */\n pairId: string;\n /** Memory IDs (sorted). */\n memoryIds: [string, string];\n /** Judge verdict. */\n verdict: ContradictionVerdict;\n /** Judge rationale. */\n rationale: string;\n /** Judge confidence in [0, 1]. */\n confidence: number;\n /** ISO timestamp when detected. */\n detectedAt: string;\n /** ISO timestamp when last reviewed by user. */\n lastReviewedAt?: string;\n /** Resolution verb applied by user. */\n resolution?: ResolutionVerb;\n /** ISO timestamp until which a non-terminal deferral remains hidden from review. */\n deferredUntil?: string;\n /** Content hashes captured for each referenced memory when this pair was judged. */\n memoryContentHashes?: Record<string, string>;\n /** Namespace scope. */\n namespace?: string;\n}\n\nexport interface ContradictionListResult {\n pairs: ContradictionPair[];\n total: number;\n durationMs: number;\n}\n\nexport type ContradictionFilter = ContradictionVerdict | \"all\" | \"unresolved\";\nexport interface WritePairOptions {\n /** Cooldown used by scan callers to preserve still-dormant reviewed pairs. */\n cooldownDays?: number;\n}\nconst NEEDS_MORE_CONTEXT_COOLDOWN_MS = 24 * 60 * 60 * 1000;\nconst UNSCOPED_MIGRATION_MARKER_PREFIX = \".unscoped-migrated-\";\nconst UNSCOPED_MIGRATION_MARKER_SUFFIX = \".done\";\n\n// ── Helpers ────────────────────────────────────────────────────────────────────\n\nexport function computePairId(memoryIdA: string, memoryIdB: string, namespace?: string): string {\n const sorted = [memoryIdA, memoryIdB].sort();\n const normalizedNamespace = namespace?.trim();\n const scope = normalizedNamespace ? `ns:${normalizedNamespace}::` : \"\";\n return createHash(\"sha256\").update(`${scope}${sorted.join(\"::\")}`).digest(\"hex\").slice(0, 24);\n}\n\nexport function isDefaultReviewNamespace(\n defaultNamespace: string,\n requestedNamespace: string | undefined,\n resolvedNamespace: string,\n): boolean {\n const requested = requestedNamespace?.trim();\n return !requested || requested === defaultNamespace || resolvedNamespace === defaultNamespace;\n}\n\nfunction isTerminalResolution(resolution: ResolutionVerb | undefined): boolean {\n return resolution === \"keep-a\" || resolution === \"keep-b\" || resolution === \"merge\";\n}\n\nfunction preservesDirectResolution(resolution: ResolutionVerb | undefined): boolean {\n return isTerminalResolution(resolution) || resolution === \"both-valid\";\n}\n\nfunction isDormantReviewedPair(pair: ContradictionPair): boolean {\n return pair.verdict === \"independent\" || pair.resolution === \"both-valid\";\n}\n\nfunction reviewStateRank(pair: ContradictionPair, cooldownDays?: number): number {\n if (isTerminalResolution(pair.resolution)) return 5;\n if (pair.resolution === \"both-valid\") return 4;\n if (isDeferralActive(pair)) return 3;\n if (isDormantReviewedPair(pair)) {\n if (cooldownDays === undefined) return 2;\n return isCoolingDown(pair, cooldownDays) ? 2 : 0;\n }\n return 1;\n}\n\nfunction parseIsoMillis(value: string | undefined): number | null {\n if (!value) return null;\n const millis = new Date(value).getTime();\n return Number.isFinite(millis) ? millis : null;\n}\n\nfunction isDeferred(pair: Pick<ContradictionPair, \"resolution\" | \"deferredUntil\">): boolean {\n return pair.resolution === \"needs-more-context\" || Boolean(pair.deferredUntil);\n}\n\nfunction deferralUntilMillis(pair: ContradictionPair): number | null {\n const deferredUntil = parseIsoMillis(pair.deferredUntil);\n if (deferredUntil !== null) return deferredUntil;\n\n if (pair.resolution === \"needs-more-context\") {\n const lastReviewed = parseIsoMillis(pair.lastReviewedAt);\n return lastReviewed === null ? null : lastReviewed + NEEDS_MORE_CONTEXT_COOLDOWN_MS;\n }\n\n return null;\n}\n\nfunction isDeferralActive(pair: ContradictionPair): boolean {\n const deferredUntil = deferralUntilMillis(pair);\n return deferredUntil !== null && Date.now() < deferredUntil;\n}\n\nfunction isReviewActionable(pair: ContradictionPair): boolean {\n return !isTerminalResolution(pair.resolution)\n && !isDeferralActive(pair)\n && pair.resolution !== \"both-valid\"\n && pair.verdict !== \"independent\";\n}\n\nfunction compareReviewPairs(a: ContradictionPair, b: ContradictionPair): number {\n const aActionable = isReviewActionable(a);\n const bActionable = isReviewActionable(b);\n if (aActionable !== bActionable) return aActionable ? -1 : 1;\n\n const aDetectedAt = parseIsoMillis(a.detectedAt) ?? Number.POSITIVE_INFINITY;\n const bDetectedAt = parseIsoMillis(b.detectedAt) ?? Number.POSITIVE_INFINITY;\n if (aDetectedAt !== bDetectedAt) return aDetectedAt < bDetectedAt ? -1 : 1;\n\n const aPairId = typeof a.pairId === \"string\" ? a.pairId : \"\";\n const bPairId = typeof b.pairId === \"string\" ? b.pairId : \"\";\n const pairIdOrder = aPairId.localeCompare(bPairId);\n if (pairIdOrder !== 0) return pairIdOrder;\n\n return a.memoryIds.join(\"\\0\").localeCompare(b.memoryIds.join(\"\\0\"));\n}\n\nfunction reviewStateMillis(pair: ContradictionPair): number {\n return Math.max(\n parseIsoMillis(pair.deferredUntil) ?? Number.NEGATIVE_INFINITY,\n parseIsoMillis(pair.lastReviewedAt) ?? Number.NEGATIVE_INFINITY,\n parseIsoMillis(pair.detectedAt) ?? Number.NEGATIVE_INFINITY,\n );\n}\n\nfunction mergeMigratedPair(existing: ContradictionPair, migrated: ContradictionPair, options: WritePairOptions): ContradictionPair {\n const existingRank = reviewStateRank(existing, options.cooldownDays);\n const migratedRank = reviewStateRank(migrated, options.cooldownDays);\n const selected = migratedRank > existingRank\n ? migrated\n : migratedRank < existingRank\n ? existing\n : reviewStateMillis(migrated) > reviewStateMillis(existing)\n ? migrated\n : existing;\n\n return {\n ...selected,\n pairId: migrated.pairId,\n namespace: migrated.namespace,\n };\n}\n\nfunction reviewDir(memoryDir: string): string {\n return path.join(memoryDir, \".review\", \"contradictions\");\n}\n\nfunction migrationMarkerPath(memoryDir: string, namespace: string): string {\n const namespaceKey = createHash(\"sha256\").update(namespace).digest(\"hex\").slice(0, 16);\n return path.join(reviewDir(memoryDir), `${UNSCOPED_MIGRATION_MARKER_PREFIX}${namespaceKey}${UNSCOPED_MIGRATION_MARKER_SUFFIX}`);\n}\n\nfunction clearUnscopedMigrationMarkers(memoryDir: string): void {\n const dir = reviewDir(memoryDir);\n if (!fs.existsSync(dir)) return;\n\n try {\n for (const entry of fs.readdirSync(dir)) {\n if (entry.startsWith(UNSCOPED_MIGRATION_MARKER_PREFIX) && entry.endsWith(UNSCOPED_MIGRATION_MARKER_SUFFIX)) {\n fs.rmSync(path.join(dir, entry), { force: true });\n }\n }\n } catch {\n // Marker cleanup is best-effort. The next migration/list call can recover.\n }\n}\n\nfunction pairPath(memoryDir: string, pairId: string): string {\n if (pairId.includes(\"/\") || pairId.includes(\"\\\\\") || pairId.includes(\"..\")) {\n throw new Error(`Invalid pairId: ${pairId}`);\n }\n return path.join(reviewDir(memoryDir), `${pairId}.json`);\n}\n\nfunction isSafeReviewJsonFile(memoryDir: string, filePath: string): boolean {\n const root = path.resolve(reviewDir(memoryDir));\n const resolved = path.resolve(filePath);\n const relative = path.relative(root, resolved);\n if (relative === \"\" || relative.startsWith(\"..\") || path.isAbsolute(relative)) {\n return false;\n }\n\n try {\n return fs.lstatSync(resolved).isFile();\n } catch {\n return false;\n }\n}\n\nfunction ensureDir(memoryDir: string): void {\n const dir = reviewDir(memoryDir);\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n}\n\nfunction uniqueTempPath(filePath: string): string {\n return `${filePath}.${process.pid}.${Date.now()}.${randomUUID()}.tmp`;\n}\n\nfunction writePairFile(filePath: string, pair: ContradictionPair): void {\n const tmpPath = uniqueTempPath(filePath);\n try {\n fs.writeFileSync(tmpPath, JSON.stringify(pair, null, 2), \"utf-8\");\n fs.renameSync(tmpPath, filePath);\n } catch (error) {\n try {\n fs.rmSync(tmpPath, { force: true });\n } catch {\n // Best-effort cleanup only; preserve the original write failure.\n }\n throw error;\n }\n}\n\nexport function computeMemoryContentHash(content: string, category?: string): string {\n const normalized = JSON.stringify({\n content: content.trim(),\n category: (category ?? \"\").trim(),\n });\n return createHash(\"sha256\").update(normalized).digest(\"hex\").slice(0, 16);\n}\n\nfunction suppliedMemoryHashesChanged(\n existing: ContradictionPair,\n pair: Omit<ContradictionPair, \"pairId\"> & { memoryIds: [string, string] },\n): boolean {\n if (!existing.memoryContentHashes || !pair.memoryContentHashes) return false;\n return pair.memoryIds.some((memoryId) => {\n const current = pair.memoryContentHashes?.[memoryId];\n return typeof current === \"string\" && existing.memoryContentHashes?.[memoryId] !== current;\n });\n}\n\n// ── Write ──────────────────────────────────────────────────────────────────────\n\n/**\n * Write a contradiction pair to the review queue.\n * Idempotent: if the pair already exists with a higher or equal confidence,\n * the existing entry is preserved.\n */\nexport function writePair(\n memoryDir: string,\n pair: Omit<ContradictionPair, \"pairId\"> & { memoryIds: [string, string] },\n options: WritePairOptions = {},\n): ContradictionPair {\n ensureDir(memoryDir);\n if (pair.namespace === undefined) {\n clearUnscopedMigrationMarkers(memoryDir);\n }\n const pairId = computePairId(pair.memoryIds[0], pair.memoryIds[1], pair.namespace);\n const existing = readPair(memoryDir, pairId);\n\n // Preserve terminal user resolutions if already reviewed.\n if (isTerminalResolution(existing?.resolution)) {\n return existing!;\n }\n const contentChanged = Boolean(existing && suppliedMemoryHashesChanged(existing, pair));\n if (existing?.resolution === \"both-valid\" && options.cooldownDays === undefined && !contentChanged) {\n return existing;\n }\n\n // Preserve active deferrals, but allow expired deferrals to be refreshed.\n const existingDeferralExpired = Boolean(existing && isDeferred(existing) && !isDeferralActive(existing));\n if (existing && isDeferralActive(existing) && !contentChanged) {\n return existing;\n }\n\n // Preserve same-verdict or still-cooling entries, but let expired dormant\n // verdicts refresh when the judge now finds an actionable conflict.\n const existingDormantCooldownActive = Boolean(\n existing\n && isDormantReviewedPair(existing)\n && options.cooldownDays !== undefined\n && isCoolingDown(existing, options.cooldownDays),\n );\n const dormantContentChanged = Boolean(\n existing\n && existingDormantCooldownActive\n && contentChanged,\n );\n const existingDormantExpired = Boolean(\n existing\n && isDormantReviewedPair(existing)\n && options.cooldownDays !== undefined\n && !existingDormantCooldownActive,\n );\n if (\n existing\n && !existingDeferralExpired\n && (\n (existingDormantCooldownActive && !dormantContentChanged)\n || (!existingDormantExpired && !contentChanged && existing.confidence >= pair.confidence)\n )\n ) {\n return existing;\n }\n\n const full: ContradictionPair = {\n ...pair,\n pairId,\n lastReviewedAt: (existingDeferralExpired || existingDormantExpired || contentChanged)\n ? pair.lastReviewedAt\n : (existing?.lastReviewedAt ?? pair.lastReviewedAt),\n resolution: undefined,\n deferredUntil: (existingDeferralExpired || existingDormantExpired || contentChanged)\n ? undefined\n : existing?.deferredUntil,\n };\n\n const filePath = pairPath(memoryDir, pairId);\n writePairFile(filePath, full);\n\n return full;\n}\n\n/**\n * Write multiple pairs, deduplicating inputs first (rule 49).\n */\nexport function writePairs(\n memoryDir: string,\n pairs: Array<Omit<ContradictionPair, \"pairId\"> & { memoryIds: [string, string] }>,\n options: WritePairOptions = {},\n): ContradictionPair[] {\n const seen = new Set<string>();\n const results: ContradictionPair[] = [];\n\n for (const pair of pairs) {\n const key = computePairId(pair.memoryIds[0], pair.memoryIds[1], pair.namespace);\n if (seen.has(key)) continue;\n seen.add(key);\n results.push(writePair(memoryDir, pair, options));\n }\n\n return results;\n}\n\n// ── Read ───────────────────────────────────────────────────────────────────────\n\n/**\n * Read a single pair by ID. Returns null if not found.\n */\nexport function readPair(memoryDir: string, pairId: string): ContradictionPair | null {\n const filePath = pairPath(memoryDir, pairId);\n try {\n if (!isSafeReviewJsonFile(memoryDir, filePath)) return null;\n const raw = fs.readFileSync(filePath, \"utf-8\");\n const parsed = JSON.parse(raw);\n if (typeof parsed === \"object\" && parsed !== null && Array.isArray(parsed.memoryIds)) {\n return parsed as ContradictionPair;\n }\n return null;\n } catch {\n return null;\n }\n}\n\n/**\n * List pairs in the review queue, optionally filtered by verdict.\n */\nexport function listPairs(\n memoryDir: string,\n options?: {\n filter?: ContradictionFilter;\n namespace?: string;\n includeUnscopedForNamespace?: boolean;\n limit?: number;\n },\n): ContradictionListResult {\n const startTime = Date.now();\n const dir = reviewDir(memoryDir);\n const { filter = \"all\", namespace, includeUnscopedForNamespace = false, limit = 50 } = options ?? {};\n const matchingPairs: ContradictionPair[] = [];\n let total = 0;\n\n if (!fs.existsSync(dir)) {\n return { pairs: [], total: 0, durationMs: Date.now() - startTime };\n }\n\n for (const entry of fs.readdirSync(dir)) {\n if (!entry.endsWith(\".json\")) continue;\n\n try {\n const filePath = path.join(dir, entry);\n if (!isSafeReviewJsonFile(memoryDir, filePath)) continue;\n const raw = fs.readFileSync(filePath, \"utf-8\");\n const pair = JSON.parse(raw) as ContradictionPair;\n\n if (typeof pair !== \"object\" || pair === null) continue;\n if (!Array.isArray(pair.memoryIds)) continue;\n\n // Namespace filter\n if (namespace && pair.namespace !== namespace && !(includeUnscopedForNamespace && pair.namespace === undefined)) continue;\n\n // Verdict filter\n if (filter === \"unresolved\") {\n if (isTerminalResolution(pair.resolution)) continue;\n if (isDeferralActive(pair)) continue;\n if (pair.resolution === \"both-valid\") continue;\n if (pair.verdict === \"independent\") continue;\n } else if (filter !== \"all\" && pair.verdict !== filter) {\n continue;\n }\n\n total++;\n matchingPairs.push(pair);\n } catch {\n continue;\n }\n }\n\n matchingPairs.sort(compareReviewPairs);\n const pairs: ContradictionPair[] = [];\n for (const pair of matchingPairs) {\n if (!(pairs.length < limit)) break;\n pairs.push(pair);\n }\n\n return { pairs, total, durationMs: Date.now() - startTime };\n}\n\nexport function migrateUnscopedPairsToNamespace(memoryDir: string, namespace: string, options: WritePairOptions = {}): number {\n const resolvedNamespace = namespace.trim();\n if (!resolvedNamespace) return 0;\n\n const dir = reviewDir(memoryDir);\n if (!fs.existsSync(dir)) return 0;\n const markerPath = migrationMarkerPath(memoryDir, resolvedNamespace);\n if (fs.existsSync(markerPath)) return 0;\n\n let migrated = 0;\n let hadMigrationFailure = false;\n for (const entry of fs.readdirSync(dir)) {\n if (!entry.endsWith(\".json\")) continue;\n const filePath = path.join(dir, entry);\n\n try {\n if (!isSafeReviewJsonFile(memoryDir, filePath)) continue;\n const raw = fs.readFileSync(filePath, \"utf-8\");\n const pair = JSON.parse(raw) as ContradictionPair;\n if (typeof pair !== \"object\" || pair === null) continue;\n if (!Array.isArray(pair.memoryIds)) continue;\n if (pair.namespace !== undefined) continue;\n\n const pairId = computePairId(pair.memoryIds[0], pair.memoryIds[1], resolvedNamespace);\n const migratedPair = { ...pair, namespace: resolvedNamespace, pairId };\n const targetPath = pairPath(memoryDir, pairId);\n try {\n if (targetPath === filePath) {\n writePairFile(filePath, migratedPair);\n } else if (!fs.existsSync(targetPath)) {\n writePairFile(targetPath, migratedPair);\n fs.rmSync(filePath, { force: true });\n } else {\n if (!isSafeReviewJsonFile(memoryDir, targetPath)) {\n hadMigrationFailure = true;\n continue;\n }\n const existing = readPair(memoryDir, pairId);\n writePairFile(targetPath, existing ? mergeMigratedPair(existing, migratedPair, options) : migratedPair);\n fs.rmSync(filePath, { force: true });\n }\n migrated += 1;\n } catch {\n hadMigrationFailure = true;\n continue;\n }\n } catch {\n continue;\n }\n }\n\n if (!hadMigrationFailure) {\n try {\n fs.writeFileSync(markerPath, `${new Date().toISOString()}\\n`, { encoding: \"utf-8\", flag: \"wx\" });\n } catch {\n // Another caller may have completed the same one-shot migration first.\n }\n }\n\n return migrated;\n}\n\n// ── Cooldown ───────────────────────────────────────────────────────────────────\n\n/**\n * Check if a pair is within its cooldown window.\n * Returns true if the pair should be SKIPPED (still cooling down).\n */\nexport function isCoolingDown(pair: ContradictionPair, cooldownDays: number): boolean {\n if (cooldownDays <= 0) return false; // rule 27: guard against 0\n\n const deferredUntil = deferralUntilMillis(pair);\n if (deferredUntil !== null) {\n return Date.now() < deferredUntil;\n }\n\n if (!pair.lastReviewedAt) return false;\n\n const lastReviewed = parseIsoMillis(pair.lastReviewedAt);\n if (lastReviewed === null) return false;\n\n const cooldownMs = cooldownDays * 24 * 60 * 60 * 1000;\n return Date.now() < lastReviewed + cooldownMs;\n}\n\n/**\n * Mark a pair as reviewed (sets lastReviewedAt and, for terminal verbs, resolution).\n */\nexport function resolvePair(\n memoryDir: string,\n pairId: string,\n verb: ResolutionVerb,\n): ContradictionPair | null {\n if (typeof verb !== \"string\" || !VALID_RESOLUTION_VERBS.includes(verb)) {\n throw new Error(`Invalid contradiction resolution verb: ${String(verb)}`);\n }\n\n if (verb === \"needs-more-context\") {\n return deferPair(memoryDir, pairId);\n }\n\n const existing = readPair(memoryDir, pairId);\n if (!existing) return null;\n if (preservesDirectResolution(existing.resolution)) return existing;\n\n const updated: ContradictionPair = {\n ...existing,\n lastReviewedAt: new Date().toISOString(),\n resolution: verb,\n deferredUntil: undefined,\n };\n\n const filePath = pairPath(memoryDir, pairId);\n writePairFile(filePath, updated);\n\n return updated;\n}\n\n/**\n * Defer a pair without terminally resolving it.\n */\nexport function deferPair(\n memoryDir: string,\n pairId: string,\n deferredUntil = new Date(Date.now() + NEEDS_MORE_CONTEXT_COOLDOWN_MS).toISOString(),\n): ContradictionPair | null {\n const existing = readPair(memoryDir, pairId);\n if (!existing) return null;\n if (preservesDirectResolution(existing.resolution)) return existing;\n\n const updated: ContradictionPair = {\n ...existing,\n lastReviewedAt: new Date().toISOString(),\n resolution: undefined,\n deferredUntil,\n };\n\n const filePath = pairPath(memoryDir, pairId);\n writePairFile(filePath, updated);\n\n return updated;\n}\n\n/**\n * Check whether a pair's referenced memories have changed since detection,\n * which should override cooldown.\n */\nexport function memoryHashesChanged(\n _memoryDir: string,\n pair: ContradictionPair,\n getCurrentHash: (memoryId: string) => string | null,\n): boolean {\n if (!pair.memoryContentHashes) return false;\n\n for (const memoryId of pair.memoryIds) {\n const previousHash = pair.memoryContentHashes[memoryId];\n if (typeof previousHash !== \"string\") continue;\n\n const currentHash = getCurrentHash(memoryId);\n if (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GAAG;AAAA,IACH,iBAAgB,oBAAI,KAAK,GAAE,YAAY;AAAA,IACvC,YAAY;AAAA,IACZ,eAAe;AAAA,EACjB;AAEA,QAAM,WAAW,SAAS,WAAW,MAAM;AAC3C,gBAAc,UAAU,OAAO;AAE/B,SAAO;AACT;AAKO,SAAS,UACd,WACA,QACA,gBAAgB,IAAI,KAAK,KAAK,IAAI,IAAI,8BAA8B,EAAE,YAAY,GACxD;AAC1B,QAAM,WAAW,SAAS,WAAW,MAAM;AAC3C,MAAI,CAAC,SAAU,QAAO;AACtB,MAAI,0BAA0B,SAAS,UAAU,EAAG,QAAO;AAE3D,QAAM,UAA6B;AAAA,IACjC,GAAG;AAAA,IACH,iBAAgB,oBAAI,KAAK,GAAE,YAAY;AAAA,IACvC,YAAY;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,SAAS,WAAW,MAAM;AAC3C,gBAAc,UAAU,OAAO;AAE/B,SAAO;AACT;AAMO,SAAS,oBACd,YACA,MACA,gBACS;AACT,MAAI,CAAC,KAAK,oBAAqB,QAAO;AAEtC,aAAW,YAAY,KAAK,WAAW;AACrC,UAAM,eAAe,KAAK,oBAAoB,QAAQ;AACtD,QAAI,OAAO,iBAAiB,SAAU;AAEtC,UAAM,cAAc,eAAe,QAAQ;AAC3C,QAAI,gBAAgB,QAAQ,gBAAgB,aAAc,QAAO;AAAA,EACnE;AAEA,SAAO;AACT;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  migrateUnscopedPairsToNamespace,
7
7
  readPair,
8
8
  writePairs
9
- } from "./chunk-HLAVGJ62.js";
9
+ } from "./chunk-35NN3ZFA.js";
10
10
  import {
11
11
  extractJsonCandidates
12
12
  } from "./chunk-UZB5KHKX.js";
@@ -543,4 +543,4 @@ export {
543
543
  ACTIVE_STATUSES,
544
544
  runContradictionScan
545
545
  };
546
- //# sourceMappingURL=chunk-YR7XMOWK.js.map
546
+ //# sourceMappingURL=chunk-6GMPIJAZ.js.map
@@ -2628,7 +2628,7 @@ ${body}`;
2628
2628
  const {
2629
2629
  isDefaultReviewNamespace,
2630
2630
  listPairs
2631
- } = await import("./contradiction-review-6V2LXXK6.js");
2631
+ } = await import("./contradiction-review-QKJH5DKD.js");
2632
2632
  const VALID_REVIEW_FILTERS = /* @__PURE__ */ new Set(["all", "unresolved", "contradicts", "independent", "duplicates", "needs-user"]);
2633
2633
  const rawFilter = typeof args.filter === "string" ? args.filter : "unresolved";
2634
2634
  if (!VALID_REVIEW_FILTERS.has(rawFilter)) {
@@ -2655,9 +2655,9 @@ ${body}`;
2655
2655
  const verb = typeof args.verb === "string" ? args.verb : "";
2656
2656
  if (!pairId) throw new Error("pairId is required");
2657
2657
  if (!verb) throw new Error("verb is required");
2658
- const { isValidResolutionVerb } = await import("./resolution-ZY7VM6WS.js");
2658
+ const { isValidResolutionVerb } = await import("./resolution-3SAP4SH2.js");
2659
2659
  if (!isValidResolutionVerb(verb)) throw new Error(`Invalid verb: ${verb}. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context`);
2660
- const { executeResolution } = await import("./resolution-ZY7VM6WS.js");
2660
+ const { executeResolution } = await import("./resolution-3SAP4SH2.js");
2661
2661
  return executeResolution(this.service.memoryDir, this.service.storageRef, pairId, verb, {
2662
2662
  mergedMemoryId: typeof args.mergedMemoryId === "string" ? args.mergedMemoryId : void 0,
2663
2663
  mergedContent: typeof args.mergedContent === "string" ? args.mergedContent : void 0,
@@ -2669,7 +2669,7 @@ ${body}`;
2669
2669
  }
2670
2670
  case "engram.contradiction_scan_run":
2671
2671
  case "remnic.contradiction_scan_run": {
2672
- const { runContradictionScan } = await import("./contradiction-scan-GIRVC4C7.js");
2672
+ const { runContradictionScan } = await import("./contradiction-scan-GD7KUFWS.js");
2673
2673
  return runContradictionScan({
2674
2674
  storage: this.service.storageRef,
2675
2675
  config: this.service.configRef,
@@ -2860,4 +2860,4 @@ ${body}`;
2860
2860
  export {
2861
2861
  EngramMcpServer
2862
2862
  };
2863
- //# sourceMappingURL=chunk-WP5OWVLZ.js.map
2863
+ //# sourceMappingURL=chunk-LAL7WBLY.js.map
@@ -209,10 +209,10 @@ import {
209
209
  } from "./chunk-OADWQ5CR.js";
210
210
  import {
211
211
  EngramAccessHttpServer
212
- } from "./chunk-5WB4C7KM.js";
212
+ } from "./chunk-ZY6UPHNY.js";
213
213
  import {
214
214
  EngramMcpServer
215
- } from "./chunk-WP5OWVLZ.js";
215
+ } from "./chunk-LAL7WBLY.js";
216
216
  import {
217
217
  EngramAccessService
218
218
  } from "./chunk-VFB2G5YL.js";
@@ -5836,7 +5836,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
5836
5836
  process.exit(1);
5837
5837
  }
5838
5838
  const limit = parseInt(options.limit ?? "50", 10);
5839
- const { listPairs } = await import("./contradiction-review-6V2LXXK6.js");
5839
+ const { listPairs } = await import("./contradiction-review-QKJH5DKD.js");
5840
5840
  const result = listPairs(orchestrator.config.memoryDir, {
5841
5841
  filter,
5842
5842
  namespace: options.namespace,
@@ -5863,7 +5863,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
5863
5863
  console.error("pairId is required");
5864
5864
  process.exit(1);
5865
5865
  }
5866
- const { readPair } = await import("./contradiction-review-6V2LXXK6.js");
5866
+ const { readPair } = await import("./contradiction-review-QKJH5DKD.js");
5867
5867
  const pair = readPair(orchestrator.config.memoryDir, pairId);
5868
5868
  if (!pair) {
5869
5869
  console.error(`Pair ${pairId} not found.`);
@@ -5883,7 +5883,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
5883
5883
  console.error("--verb is required. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context");
5884
5884
  process.exit(1);
5885
5885
  }
5886
- const { isValidResolutionVerb, executeResolution } = await import("./resolution-ZY7VM6WS.js");
5886
+ const { isValidResolutionVerb, executeResolution } = await import("./resolution-3SAP4SH2.js");
5887
5887
  if (!isValidResolutionVerb(verb)) {
5888
5888
  console.error(`Invalid verb: ${verb}. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context`);
5889
5889
  process.exit(1);
@@ -5909,7 +5909,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
5909
5909
  });
5910
5910
  reviewCmd.command("scan").description("Run an on-demand contradiction scan").option("--namespace <ns>", "Namespace to scan").action(async (...args) => {
5911
5911
  const options = args[0] ?? {};
5912
- const { runContradictionScan } = await import("./contradiction-scan-GIRVC4C7.js");
5912
+ const { runContradictionScan } = await import("./contradiction-scan-GD7KUFWS.js");
5913
5913
  console.log("Running contradiction scan...");
5914
5914
  const result = await runContradictionScan({
5915
5915
  storage: orchestrator.storage,
@@ -6616,4 +6616,4 @@ export {
6616
6616
  resolveMemoryDirForNamespace,
6617
6617
  registerCli
6618
6618
  };
6619
- //# sourceMappingURL=chunk-QNXFFUWA.js.map
6619
+ //# sourceMappingURL=chunk-QRWZOCJN.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readPair,
3
3
  resolvePair
4
- } from "./chunk-HLAVGJ62.js";
4
+ } from "./chunk-35NN3ZFA.js";
5
5
  import {
6
6
  log
7
7
  } from "./chunk-2ODBA7MQ.js";
@@ -299,4 +299,4 @@ export {
299
299
  isValidResolutionVerb,
300
300
  executeResolution
301
301
  };
302
- //# sourceMappingURL=chunk-XSQ4SGM5.js.map
302
+ //# sourceMappingURL=chunk-R3PQUPQ4.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AU7Q3LSC.js";
4
4
  import {
5
5
  EngramMcpServer
6
- } from "./chunk-WP5OWVLZ.js";
6
+ } from "./chunk-LAL7WBLY.js";
7
7
  import {
8
8
  EngramAccessInputError
9
9
  } from "./chunk-VFB2G5YL.js";
@@ -1115,7 +1115,7 @@ var EngramAccessHttpServer = class {
1115
1115
  const {
1116
1116
  isDefaultReviewNamespace,
1117
1117
  listPairs
1118
- } = await import("./contradiction-review-6V2LXXK6.js");
1118
+ } = await import("./contradiction-review-QKJH5DKD.js");
1119
1119
  const principal = this.resolveRequestPrincipal(req);
1120
1120
  const resolved = await this.service.getReadableStorageForNamespace(namespace, principal);
1121
1121
  const reviewNamespace = this.service.configRef.namespacesEnabled ? resolved.namespace : void 0;
@@ -1133,7 +1133,7 @@ var EngramAccessHttpServer = class {
1133
1133
  }
1134
1134
  if (req.method === "GET" && pathname.startsWith("/engram/v1/review/contradictions/")) {
1135
1135
  const pairId = pathname.split("/").pop() ?? "";
1136
- const { readPair } = await import("./contradiction-review-6V2LXXK6.js");
1136
+ const { readPair } = await import("./contradiction-review-QKJH5DKD.js");
1137
1137
  const pair = readPair(this.service.memoryDir, pairId);
1138
1138
  if (!pair) {
1139
1139
  this.respondJson(res, 404, { error: "pair_not_found" });
@@ -1156,7 +1156,7 @@ var EngramAccessHttpServer = class {
1156
1156
  this.respondJson(res, 400, { error: "pairId and verb are required" });
1157
1157
  return;
1158
1158
  }
1159
- const { isValidResolutionVerb, executeResolution } = await import("./resolution-ZY7VM6WS.js");
1159
+ const { isValidResolutionVerb, executeResolution } = await import("./resolution-3SAP4SH2.js");
1160
1160
  if (!isValidResolutionVerb(verb)) {
1161
1161
  this.respondJson(res, 400, { error: `Invalid verb: ${verb}. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context` });
1162
1162
  return;
@@ -1249,7 +1249,7 @@ var EngramAccessHttpServer = class {
1249
1249
  }
1250
1250
  if (req.method === "POST" && pathname === "/engram/v1/contradiction-scan") {
1251
1251
  const body = await this.readJsonBody(req);
1252
- const { runContradictionScan } = await import("./contradiction-scan-GIRVC4C7.js");
1252
+ const { runContradictionScan } = await import("./contradiction-scan-GD7KUFWS.js");
1253
1253
  const principal = this.resolveRequestPrincipal(req);
1254
1254
  const result = await runContradictionScan({
1255
1255
  storage: this.service.storageRef,
@@ -1846,4 +1846,4 @@ var EngramAccessHttpServer = class {
1846
1846
  export {
1847
1847
  EngramAccessHttpServer
1848
1848
  };
1849
- //# sourceMappingURL=chunk-5WB4C7KM.js.map
1849
+ //# sourceMappingURL=chunk-ZY6UPHNY.js.map
package/dist/cli.js CHANGED
@@ -89,7 +89,7 @@ import {
89
89
  runWorkProductStatusCliCommand,
90
90
  runWorkProjectCliCommand,
91
91
  runWorkTaskCliCommand
92
- } from "./chunk-QNXFFUWA.js";
92
+ } from "./chunk-QRWZOCJN.js";
93
93
  import "./chunk-LQHDIS7L.js";
94
94
  import "./chunk-7F7Z6MOS.js";
95
95
  import "./chunk-4RR6ROTB.js";
@@ -182,7 +182,7 @@ import "./chunk-6HZ6AO2P.js";
182
182
  import "./chunk-HQ6NIBL6.js";
183
183
  import "./chunk-PVGDJXVK.js";
184
184
  import "./chunk-OADWQ5CR.js";
185
- import "./chunk-5WB4C7KM.js";
185
+ import "./chunk-ZY6UPHNY.js";
186
186
  import "./chunk-SEDEKFYQ.js";
187
187
  import "./chunk-AU7Q3LSC.js";
188
188
  import "./chunk-42NQ7AVG.js";
@@ -190,7 +190,7 @@ import "./chunk-TMSXWOBZ.js";
190
190
  import "./chunk-J64TK33U.js";
191
191
  import "./chunk-RSUYKGGZ.js";
192
192
  import "./chunk-7RXCMVFQ.js";
193
- import "./chunk-WP5OWVLZ.js";
193
+ import "./chunk-LAL7WBLY.js";
194
194
  import "./chunk-EAZGEEG2.js";
195
195
  import "./chunk-D24OXEPB.js";
196
196
  import "./chunk-VFB2G5YL.js";
@@ -2,7 +2,7 @@ import "../chunk-V5OCT34X.js";
2
2
  import {
3
3
  executeResolution,
4
4
  isValidResolutionVerb
5
- } from "../chunk-XSQ4SGM5.js";
5
+ } from "../chunk-R3PQUPQ4.js";
6
6
  import {
7
7
  ACTIVE_STATUSES,
8
8
  clearVerdictCache,
@@ -10,7 +10,7 @@ import {
10
10
  judgeContradictionPairs,
11
11
  runContradictionScan,
12
12
  verdictCacheSize
13
- } from "../chunk-YR7XMOWK.js";
13
+ } from "../chunk-6GMPIJAZ.js";
14
14
  import {
15
15
  computePairId,
16
16
  isCoolingDown,
@@ -19,7 +19,7 @@ import {
19
19
  resolvePair,
20
20
  writePair,
21
21
  writePairs
22
- } from "../chunk-HLAVGJ62.js";
22
+ } from "../chunk-35NN3ZFA.js";
23
23
  import "../chunk-UZB5KHKX.js";
24
24
  import "../chunk-2ODBA7MQ.js";
25
25
  import "../chunk-PZ5AY32C.js";