@remnic/core 10.0.171 → 10.0.173

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 (32) hide show
  1. package/dist/access-admin-ops-surface.js +1 -1
  2. package/dist/access-cli.js +1 -1
  3. package/dist/access-extraction-force-flush-preempt.js +1 -1
  4. package/dist/access-extraction-force-flush.js +1 -1
  5. package/dist/access-http-briefing.js +1 -1
  6. package/dist/access-http-query.js +1 -1
  7. package/dist/access-http.js +1 -1
  8. package/dist/access-identity-continuity-surface.js +1 -1
  9. package/dist/access-lcm-surface.js +1 -1
  10. package/dist/access-mcp.js +1 -1
  11. package/dist/access-observe-write-surface.js +1 -1
  12. package/dist/access-operations-batch.js +1 -1
  13. package/dist/access-operations.js +1 -1
  14. package/dist/access-recall-concurrency.js +1 -1
  15. package/dist/access-recall-response.js +1 -1
  16. package/dist/access-recall-surface.d.ts.map +1 -1
  17. package/dist/access-recall-surface.js +1 -1
  18. package/dist/access-service.js +1 -1
  19. package/dist/{chunk-SLWD7TB6.js → chunk-3MOL7YE7.js} +2 -2
  20. package/dist/{chunk-T2KCROPA.js → chunk-KSIDZDW3.js} +22 -16
  21. package/dist/{chunk-T2KCROPA.js.map → chunk-KSIDZDW3.js.map} +1 -1
  22. package/dist/cli.js +1 -1
  23. package/dist/explicit-capture.js +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/orchestration/backlog-scheduler.js +2 -2
  26. package/dist/orchestration/buffer-drain-runner.js +2 -2
  27. package/dist/orchestrator.js +1 -1
  28. package/dist/recall-navigation.js +1 -1
  29. package/package.json +2 -2
  30. package/src/access-recall-surface.ts +25 -24
  31. package/src/access-service-raw-excerpt-read-gate.test.ts +84 -2
  32. /package/dist/{chunk-SLWD7TB6.js.map → chunk-3MOL7YE7.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  runWorkProductStatusCliCommand,
92
92
  runWorkProjectCliCommand,
93
93
  runWorkTaskCliCommand
94
- } from "./chunk-T2KCROPA.js";
94
+ } from "./chunk-KSIDZDW3.js";
95
95
  import "./chunk-RK7SE3BL.js";
96
96
  import "./chunk-GOZXQNIM.js";
97
97
  import "./chunk-PQM3B54K.js";
@@ -8,7 +8,7 @@ import {
8
8
  shouldSkipImplicitExtraction,
9
9
  stripInlineExplicitCaptureNotes,
10
10
  validateExplicitCaptureInput
11
- } from "./chunk-T2KCROPA.js";
11
+ } from "./chunk-KSIDZDW3.js";
12
12
  import "./chunk-RK7SE3BL.js";
13
13
  import "./chunk-GOZXQNIM.js";
14
14
  import "./chunk-PQM3B54K.js";
package/dist/index.js CHANGED
@@ -259,7 +259,7 @@ import {
259
259
  writeManifest,
260
260
  writeMeetingEpisodeMemory,
261
261
  writeTimelineState
262
- } from "./chunk-T2KCROPA.js";
262
+ } from "./chunk-KSIDZDW3.js";
263
263
  import {
264
264
  WEARABLE_SOURCE_PREFIX,
265
265
  WearablesInputError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BufferDrainRunner
3
- } from "../chunk-SLWD7TB6.js";
4
- import "../chunk-T2KCROPA.js";
3
+ } from "../chunk-3MOL7YE7.js";
4
+ import "../chunk-KSIDZDW3.js";
5
5
  import "../chunk-RK7SE3BL.js";
6
6
  import "../chunk-GOZXQNIM.js";
7
7
  import "../chunk-PQM3B54K.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  BufferDrainRunner,
3
3
  ClaimBufferStorage
4
- } from "../chunk-SLWD7TB6.js";
5
- import "../chunk-T2KCROPA.js";
4
+ } from "../chunk-3MOL7YE7.js";
5
+ import "../chunk-KSIDZDW3.js";
6
6
  import "../chunk-RK7SE3BL.js";
7
7
  import "../chunk-GOZXQNIM.js";
8
8
  import "../chunk-PQM3B54K.js";
@@ -6,7 +6,7 @@ import {
6
6
  mergeGraphExpandedResults,
7
7
  qmdStartupCollectionChecksWithTimeout,
8
8
  resolveEffectiveIdentityInjectionMode
9
- } from "./chunk-T2KCROPA.js";
9
+ } from "./chunk-KSIDZDW3.js";
10
10
  import "./chunk-RK7SE3BL.js";
11
11
  import "./chunk-GOZXQNIM.js";
12
12
  import "./chunk-PQM3B54K.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRecallNavigation
3
- } from "./chunk-T2KCROPA.js";
3
+ } from "./chunk-KSIDZDW3.js";
4
4
  import "./chunk-RK7SE3BL.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-PQM3B54K.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "10.0.171",
3
+ "version": "10.0.173",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3416,7 +3416,7 @@
3416
3416
  "core"
3417
3417
  ],
3418
3418
  "peerDependencies": {
3419
- "@remnic/coding-graph": "^10.0.171"
3419
+ "@remnic/coding-graph": "^10.0.173"
3420
3420
  },
3421
3421
  "peerDependenciesMeta": {
3422
3422
  "@remnic/coding-graph": {
@@ -1098,9 +1098,8 @@ export class AccessRecallSurface {
1098
1098
  },
1099
1099
  );
1100
1100
  recallStartedAt = capturedRecallStartedAt;
1101
- // Cancellation covers queueing + recall/capture. Post-capture shaping is
1102
- // intentionally not wired for mid-I/O abort in this change, but do not
1103
- // begin that work after the caller has already canceled.
1101
+ // Cancellation covers queueing, capture, and post-capture shaping:
1102
+ // a check sits at each mid-I/O boundary below (issue #3547).
1104
1103
  throwIfAborted(request.abortSignal, "recall X-ray aborted before postprocessing");
1105
1104
  // Re-check namespace after capture: the recall may have served
1106
1105
  // from a different namespace than the caller requested. Drop
@@ -1152,6 +1151,7 @@ export class AccessRecallSurface {
1152
1151
  }
1153
1152
  }),
1154
1153
  );
1154
+ throwIfAborted(request.abortSignal, "recall X-ray aborted during tag filtering");
1155
1155
  const tagged = snapshot.results.map((result, index) => ({
1156
1156
  result,
1157
1157
  tags: tagsByIndex[index] ?? [],
@@ -1233,6 +1233,7 @@ export class AccessRecallSurface {
1233
1233
  authenticatedPrincipal,
1234
1234
  )
1235
1235
  : undefined;
1236
+ throwIfAborted(request.abortSignal, "recall X-ray aborted before raw-excerpt fetch");
1236
1237
  const rawExcerpts =
1237
1238
  disclosure === "raw" && !rawExcerptsSuppressed
1238
1239
  ? await this.deps.fetchRawExcerpts(disclosure, {
@@ -1262,6 +1263,7 @@ export class AccessRecallSurface {
1262
1263
  // updated, tags, entityRef) in the token estimate, so the
1263
1264
  // summary reflects real spend rather than only payload-body
1264
1265
  // spend (Cursor Low review on PR #699).
1266
+ throwIfAborted(request.abortSignal, "recall X-ray aborted before result reads");
1265
1267
  const memoryByIndex = await Promise.all(
1266
1268
  snapshot.results.map(async (result) => {
1267
1269
  try {
@@ -1272,9 +1274,11 @@ export class AccessRecallSurface {
1272
1274
  }
1273
1275
  }),
1274
1276
  );
1277
+ throwIfAborted(request.abortSignal, "recall X-ray aborted during result reads");
1275
1278
  const firstReadableIndex = memoryByIndex.findIndex((m) => m !== null);
1276
1279
  const baseDir =
1277
1280
  (await this.deps.orchestrator.getStorage(namespace)).dir;
1281
+ throwIfAborted(request.abortSignal, "recall X-ray aborted during result decoration");
1278
1282
  const decorated = snapshot.results.map((result, index) => {
1279
1283
  const memory = memoryByIndex[index];
1280
1284
  if (!memory) {
@@ -1378,28 +1382,25 @@ export class AccessRecallSurface {
1378
1382
  authenticatedPrincipal,
1379
1383
  )
1380
1384
  : undefined;
1381
- return {
1382
- ...xrayResponse,
1383
- recall: await this.deps.buildRecallResponseFromXraySnapshot({
1384
- query,
1385
- sessionKey: recallSessionKey,
1386
- snapshot: xrayResponse.snapshot,
1387
- disclosure,
1388
- startedAt: recallStartedAt,
1389
- requestedMode: request.mode,
1390
- normalizedMode: mode,
1391
- storageCorpusVersionsAtRecallStart,
1392
- ...(xrayRawExcerptNamespace
1393
- ? { rawExcerptNamespace: xrayRawExcerptNamespace }
1394
- : {}),
1395
- ...(xrayRawExcerptSessionIds !== undefined
1396
- ? { rawExcerptSessionIds: xrayRawExcerptSessionIds }
1397
- : {}),
1398
- ...(xrayRawExcerptsSuppressed
1399
- ? { rawExcerptsSuppressed: xrayRawExcerptsSuppressed }
1400
- : {}),
1401
- }),
1385
+ throwIfAborted(request.abortSignal, "recall X-ray aborted before recall response build");
1386
+ const recallArgs: Parameters<
1387
+ AccessRecallSurfaceDeps["buildRecallResponseFromXraySnapshot"]
1388
+ >[0] = {
1389
+ query,
1390
+ sessionKey: recallSessionKey,
1391
+ snapshot: xrayResponse.snapshot,
1392
+ disclosure,
1393
+ startedAt: recallStartedAt,
1394
+ requestedMode: request.mode,
1395
+ normalizedMode: mode,
1396
+ storageCorpusVersionsAtRecallStart,
1402
1397
  };
1398
+ if (xrayRawExcerptNamespace) recallArgs.rawExcerptNamespace = xrayRawExcerptNamespace;
1399
+ if (xrayRawExcerptSessionIds !== undefined) recallArgs.rawExcerptSessionIds = xrayRawExcerptSessionIds;
1400
+ if (xrayRawExcerptsSuppressed) recallArgs.rawExcerptsSuppressed = xrayRawExcerptsSuppressed;
1401
+ const recallResponse = await this.deps.buildRecallResponseFromXraySnapshot(recallArgs);
1402
+ throwIfAborted(request.abortSignal, "recall X-ray aborted after recall response build");
1403
+ return { ...xrayResponse, recall: recallResponse };
1403
1404
  }
1404
1405
  return xrayResponse;
1405
1406
  }
@@ -39,6 +39,7 @@ import {
39
39
  projectNamespaceName,
40
40
  projectTagProjectId,
41
41
  } from "./coding/coding-namespace.js";
42
+ import type { RecallXraySnapshot } from "./recall-xray.js";
42
43
  import type { StorageManager } from "./storage.js";
43
44
  import type { RecallExecResult } from "./access-recall-concurrency.js";
44
45
  import type { CodingContext, MemoryFile, PluginConfig } from "./types.js";
@@ -64,6 +65,12 @@ function makeRawExcerptProbe(options: {
64
65
  snapshotNamespace: string;
65
66
  sessionContext?: CodingContext;
66
67
  sessionKey: string;
68
+ /** Called inside the readMemoryByPath stub — used to fire a mid-I/O abort. */
69
+ onMemoryRead?: (path: string) => void;
70
+ /** Value the readMemoryByPath stub resolves. */
71
+ memoryFixture?: MemoryFile;
72
+ /** Snapshot the recallWithXrayCapture stub returns (null → empty x-ray). */
73
+ xraySnapshot?: RecallXraySnapshot | null;
67
74
  /** snapshot.memoryIds → getMemoryById fixtures (recall results path). */
68
75
  memories?: ReadonlyMap<string, MemoryFile>;
69
76
  /** Rows the LCM stub's `searchContextFull` returns. */
@@ -115,8 +122,9 @@ function makeRawExcerptProbe(options: {
115
122
 
116
123
  const storage = probeCast<StorageManager>({
117
124
  dir: "/synthetic/remnic-raw-excerpt-read-gate/store",
118
- async readMemoryByPath() {
119
- return null;
125
+ async readMemoryByPath(path: string) {
126
+ options.onMemoryRead?.(path);
127
+ return options.memoryFixture ?? null;
120
128
  },
121
129
  async getMemoryById(id: string) {
122
130
  return options.memories?.get(id) ?? null;
@@ -150,6 +158,12 @@ function makeRawExcerptProbe(options: {
150
158
  async recall() {
151
159
  return "";
152
160
  },
161
+ async recallWithXrayCapture() {
162
+ return {
163
+ snapshot: options.xraySnapshot ?? null,
164
+ recallStartedAt: Date.now(),
165
+ };
166
+ },
153
167
  lcmEngine: {
154
168
  enabled: true,
155
169
  searchContextFull: async (
@@ -680,3 +694,71 @@ test("#3546: quotes under the attribution length floor claim nothing", async ()
680
694
  "below-floor quotes keep the excerpt on the first result",
681
695
  );
682
696
  });
697
+
698
+ // ──────────────────────────────────────────────────────────────────────
699
+ // #3547: an abort that lands during post-capture shaping stops the
700
+ // pipeline — shaping must not run to completion for a canceled caller.
701
+ // ──────────────────────────────────────────────────────────────────────
702
+
703
+ test("#3547: abort during x-ray decoration reads throws AbortError instead of completing", async () => {
704
+ const controller = new AbortController();
705
+ const snapshot: RecallXraySnapshot = {
706
+ schemaVersion: "1",
707
+ query: "what database are we using?",
708
+ snapshotId: "xray-3547",
709
+ capturedAt: Date.now(),
710
+ sessionKey: SESSION_KEY,
711
+ namespace: "pi-geek",
712
+ tierExplain: null,
713
+ results: [
714
+ {
715
+ memoryId: "mem-a",
716
+ path: "facts/a.md",
717
+ servedBy: "hybrid",
718
+ scoreDecomposition: { final: 0.9 },
719
+ admittedBy: ["budget", "namespace"],
720
+ },
721
+ ],
722
+ appliedResultLimit: 10,
723
+ appliedResults: [],
724
+ headroomResults: [],
725
+ filters: [],
726
+ budget: { chars: 8000, used: 100 },
727
+ };
728
+ const probe = makeRawExcerptProbe({
729
+ config: { principalFromSessionKeyRules: [{ match: "pi-geek:", principal: "pi-geek" }] },
730
+ snapshotNamespace: "pi-geek",
731
+ sessionKey: SESSION_KEY,
732
+ xraySnapshot: snapshot,
733
+ // The cancel lands mid-I/O: the first result read aborts the caller's
734
+ // signal, then the read resolves. Post-capture shaping must notice
735
+ // before continuing the pipeline.
736
+ onMemoryRead: () => controller.abort(),
737
+ memoryFixture: {
738
+ path: "facts/a.md",
739
+ content: "synthetic memory body",
740
+ frontmatter: {
741
+ id: "mem-a",
742
+ category: "preference",
743
+ created: "2026-11-01T00:00:00Z",
744
+ updated: "2026-11-01T00:00:00Z",
745
+ source: "test",
746
+ confidence: 0.9,
747
+ confidenceTier: "explicit",
748
+ tags: [],
749
+ },
750
+ },
751
+ });
752
+
753
+ await assert.rejects(
754
+ probe.service.recallXray({
755
+ query: "what database are we using?",
756
+ sessionKey: SESSION_KEY,
757
+ authenticatedPrincipal: "pi-geek",
758
+ disclosure: "section",
759
+ abortSignal: controller.signal,
760
+ }),
761
+ (err: Error) => err.name === "AbortError",
762
+ "a cancel that lands during result decoration must abort the pipeline",
763
+ );
764
+ });