@remnic/core 10.0.134 → 10.0.135

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 (52) hide show
  1. package/dist/access-admin-ops-surface.js +3 -3
  2. package/dist/access-cli.js +3 -3
  3. package/dist/access-extraction-force-flush.js +3 -3
  4. package/dist/access-http-briefing.js +3 -3
  5. package/dist/access-http-query.js +3 -3
  6. package/dist/access-http.d.ts.map +1 -1
  7. package/dist/access-http.js +3 -3
  8. package/dist/access-identity-continuity-surface.js +3 -3
  9. package/dist/access-lcm-surface.js +3 -3
  10. package/dist/access-mcp.js +3 -3
  11. package/dist/access-observe-write-surface.js +3 -3
  12. package/dist/access-operations-batch.js +3 -3
  13. package/dist/access-operations.js +3 -3
  14. package/dist/access-recall-concurrency.js +3 -3
  15. package/dist/access-recall-response.d.ts.map +1 -1
  16. package/dist/access-recall-response.js +3 -3
  17. package/dist/access-recall-surface.d.ts.map +1 -1
  18. package/dist/access-recall-surface.js +3 -3
  19. package/dist/access-service.d.ts +2 -0
  20. package/dist/access-service.d.ts.map +1 -1
  21. package/dist/access-service.js +3 -3
  22. package/dist/{chunk-CEN6DW6X.js → chunk-G4NKURT4.js} +7 -2
  23. package/dist/{chunk-CEN6DW6X.js.map → chunk-G4NKURT4.js.map} +1 -1
  24. package/dist/{chunk-5A6HGHTU.js → chunk-IDMIRW7C.js} +2 -2
  25. package/dist/{chunk-D4LXRZVD.js → chunk-KW3FFIIG.js} +28 -5
  26. package/dist/{chunk-D4LXRZVD.js.map → chunk-KW3FFIIG.js.map} +1 -1
  27. package/dist/{chunk-MUHGYV2V.js → chunk-VT75USBD.js} +2 -1
  28. package/dist/chunk-VT75USBD.js.map +1 -0
  29. package/dist/cli.js +3 -3
  30. package/dist/explicit-capture.js +3 -3
  31. package/dist/index.js +3 -3
  32. package/dist/orchestration/backlog-scheduler.js +4 -4
  33. package/dist/orchestration/buffer-drain-runner.js +4 -4
  34. package/dist/orchestration/recall-internal.d.ts.map +1 -1
  35. package/dist/orchestrator.js +3 -3
  36. package/dist/recall-navigation.js +3 -3
  37. package/dist/recall-state.d.ts +10 -0
  38. package/dist/recall-state.d.ts.map +1 -1
  39. package/dist/recall-state.js +1 -1
  40. package/dist/recall-timings.d.ts +15 -0
  41. package/dist/recall-timings.d.ts.map +1 -1
  42. package/dist/recall-timings.js +3 -1
  43. package/package.json +2 -2
  44. package/src/access-http.ts +28 -0
  45. package/src/access-recall-response.ts +1 -0
  46. package/src/access-recall-surface.ts +5 -4
  47. package/src/access-service.ts +2 -0
  48. package/src/orchestration/recall-internal.ts +2 -0
  49. package/src/recall-state.ts +11 -0
  50. package/src/recall-timings.ts +15 -0
  51. package/dist/chunk-MUHGYV2V.js.map +0 -1
  52. /package/dist/{chunk-5A6HGHTU.js.map → chunk-IDMIRW7C.js.map} +0 -0
@@ -193,6 +193,7 @@ var LastRecallStore = class {
193
193
  sourcesUsed: opts.sourcesUsed,
194
194
  budgetsApplied: opts.budgetsApplied,
195
195
  latencyMs: opts.latencyMs,
196
+ timings: opts.timings ? { ...opts.timings } : void 0,
196
197
  policyVersion: opts.policyVersion,
197
198
  identityInjectionMode: opts.identityInjection?.mode,
198
199
  identityInjectedChars: opts.identityInjection?.injectedChars,
@@ -689,4 +690,4 @@ export {
689
690
  TierMigrationStatusStore,
690
691
  RecallHandleHistoryStore
691
692
  };
692
- //# sourceMappingURL=chunk-MUHGYV2V.js.map
693
+ //# sourceMappingURL=chunk-VT75USBD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/recall-state.ts"],"sourcesContent":["import { appendFile, mkdir, readFile, rename, rm, stat, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { log } from \"./logger.js\";\nimport { writeFileAtomically } from \"./maintenance/atomic-file.js\";\nimport { isErrnoCode } from \"./utils/errno.js\";\nimport { withHeldFileLock, type HeldFileLockOptions } from \"./utils/serialize-mutations.js\";\nimport { ensureContainedSpillDir, listContainedSpillFiles } from \"./utils/path-containment.js\";\nimport type { SearchDegradation } from \"./search/port.js\";\nimport type {\n IdentityInjectionMode,\n RecallPlanMode,\n RecallTierExplain,\n} from \"./types.js\";\nimport {\n coerceIncludedMemories,\n type IncludedMemory,\n} from \"./included-memories.js\";\n\nexport type { IncludedMemory } from \"./included-memories.js\";\nexport { coerceIncludedMemories } from \"./included-memories.js\";\n\n// Session keys are caller-supplied (host session IDs) and land in indexed\n// assignments on plain-object state. A key matching one of these would\n// pollute Object.prototype (or read junk off it), so every read/write\n// through this module rejects them — same contract load() already enforced.\nfunction isUnsafeStateKey(key: string): boolean {\n return key === \"__proto__\" || key === \"constructor\" || key === \"prototype\";\n}\n\n\nexport interface LastRecallBudgetSummary {\n requestedTopK?: number;\n appliedTopK: number;\n recallBudgetChars: number;\n maxMemoryTokens: number;\n qmdFetchLimit?: number;\n qmdHybridFetchLimit?: number;\n finalContextChars?: number;\n truncated?: boolean;\n includedSections?: string[];\n omittedSections?: string[];\n includedMemoryIds?: string[];\n includedMemoryPaths?: string[];\n includedMemoryNamespaces?: Array<string | undefined>;\n omittedMemoryIds?: string[];\n}\n\nexport interface LastRecallSnapshot {\n sessionKey: string;\n recordedAt: string;\n queryHash: string;\n queryLen: number;\n memoryIds: string[];\n includedMemories?: IncludedMemory[];\n namespace?: string;\n recallNamespaces?: string[];\n traceId?: string;\n plannerMode?: RecallPlanMode;\n requestedMode?: RecallPlanMode;\n source?: string;\n fallbackUsed?: boolean;\n sourcesUsed?: string[];\n budgetsApplied?: LastRecallBudgetSummary;\n latencyMs?: number;\n /**\n * Per-section wall-clock timings recorded during the recall pipeline\n * (same map as the `recall timings:` log line and the timings ring\n * buffer). Values are formatted strings — e.g. \"4746ms\", \"skip\",\n * \"12ms-cache\" — so callers render them verbatim. Added so recall\n * responses can name the slow section instead of exposing only\n * `latencyMs`.\n */\n timings?: Record<string, string>;\n resultPaths?: string[];\n resultNamespaces?: Array<string | undefined>;\n policyVersion?: string;\n identityInjectionMode?: IdentityInjectionMode | \"none\";\n identityInjectedChars?: number;\n identityInjectionTruncated?: boolean;\n /**\n * Collision-safe write nonce. Random UUID set on every `record()`\n * call so the observation-mode direct-answer hook can detect stale\n * snapshots and avoid annotating a snapshot that a subsequent recall\n * already replaced (issue #518).\n */\n writeNonce?: string;\n /**\n * Optional tier-level explanation of how recall was served\n * (issue #518). Populated by orchestrator call sites that can\n * identify a concrete tier; surfaces expose the block via\n * `engram query --explain`, the `?explain=1` HTTP flag, and the\n * `remnic_recall_explain` MCP tool. Orthogonal to the existing\n * graph-path `recallExplain` operation.\n */\n tierExplain?: RecallTierExplain;\n /**\n * Backend degradations observed while serving this recall (issue #1536).\n * Present only when a search backend reported unavailable/loading/timeout\n * during the recall — distinguishing \"no matches\" from \"backend could not\n * answer\" (CLAUDE.md rule 34). Deliberately independent of `tierExplain`,\n * which is gated behind `recallDirectAnswerEnabled`.\n */\n backendDegradations?: SearchDegradation[];\n}\n\nexport interface GraphRecallExpandedEntry {\n path: string;\n score: number;\n namespace: string;\n seed: string;\n hopDepth: number;\n decayedWeight: number;\n graphType: \"entity\" | \"time\" | \"causal\";\n /**\n * Issue #681 PR 3/3 — confidence of the edge that produced this entry's\n * recorded provenance (strongest edge along the chosen entry path).\n * Range `[0, 1]`. Optional so persisted snapshots from older builds\n * round-trip through `clampGraphRecallExpandedEntries` without dropping.\n */\n edgeConfidence?: number;\n /** Graph-relative activation path node ids when provenance is enabled. */\n pathNodeIds?: string[];\n /** True when a graph path penalty was applied. */\n pathPenaltyApplied?: boolean;\n}\n\nexport function clampGraphRecallExpandedEntries(\n entries: unknown,\n maxEntries: number = 64,\n): GraphRecallExpandedEntry[] {\n const limit = Math.max(1, Math.floor(maxEntries));\n if (!Array.isArray(entries)) return [];\n return entries\n .filter((item): item is Record<string, unknown> => !!item && typeof item === \"object\")\n .map((item) => {\n const graphType: \"entity\" | \"time\" | \"causal\" =\n item.graphType === \"entity\" || item.graphType === \"time\" || item.graphType === \"causal\"\n ? item.graphType\n : \"entity\";\n const out: GraphRecallExpandedEntry = {\n path: typeof item.path === \"string\" ? item.path : \"\",\n score: typeof item.score === \"number\" && Number.isFinite(item.score) ? item.score : 0,\n namespace: typeof item.namespace === \"string\" ? item.namespace : \"\",\n seed: typeof item.seed === \"string\" ? item.seed : \"\",\n hopDepth:\n typeof item.hopDepth === \"number\" && Number.isFinite(item.hopDepth)\n ? Math.max(0, Math.floor(item.hopDepth))\n : 0,\n decayedWeight:\n typeof item.decayedWeight === \"number\" && Number.isFinite(item.decayedWeight)\n ? Math.max(0, item.decayedWeight)\n : 0,\n graphType,\n };\n // Issue #681 PR 3/3: clamp `edgeConfidence` into [0, 1] when present.\n // Older snapshots without the field round-trip cleanly via the\n // optional shape; legacy callers always rendered as 1.0.\n if (\n typeof item.edgeConfidence === \"number\" &&\n Number.isFinite(item.edgeConfidence)\n ) {\n out.edgeConfidence = Math.min(1, Math.max(0, item.edgeConfidence));\n }\n if (\n Array.isArray(item.pathNodeIds) &&\n item.pathNodeIds.every((value): value is string => typeof value === \"string\")\n ) {\n out.pathNodeIds = item.pathNodeIds.slice(0, 64);\n }\n if (typeof item.pathPenaltyApplied === \"boolean\") {\n out.pathPenaltyApplied = item.pathPenaltyApplied;\n }\n return out;\n })\n .filter((item) => item.path.length > 0 && item.namespace.length > 0)\n .slice(0, limit);\n}\n\ntype LastRecallState = Record<string, LastRecallSnapshot>;\ntype StateFileWriter = (filePath: string, content: string) => Promise<void>;\n\n/**\n * Deep-copy a RecallTierExplain block. Used by both the write path\n * (so caller mutation after `record()` cannot tear the persisted\n * snapshot) and the read path (so caller mutation after `get()` /\n * `getMostRecent()` cannot tear the in-memory store).\n *\n * Uses structuredClone so future additions to RecallTierExplain do\n * not silently share references through hand-enumerated fields —\n * matching the pattern used elsewhere in the codebase (e.g.,\n * qmd-recall-cache.ts). The payload is pure JSON-shaped data, so\n * structuredClone is both safe and complete here.\n */\n/**\n * Stale-snapshot identity guard shared by the annotate methods (issue #518):\n * a writeNonce match wins outright; otherwise traceId (when expected) and\n * recordedAt are compared. Extracted so every annotation surface applies\n * identical guards (CLAUDE.md rule 22).\n */\nfunction cloneTierExplain(\n tierExplain: RecallTierExplain | undefined,\n): RecallTierExplain | undefined {\n if (!tierExplain) return undefined;\n return structuredClone(tierExplain);\n}\n\nfunction snapshotMatchesExpectedIdentity(\n current: LastRecallSnapshot,\n expected?: { writeNonce?: string; traceId?: string; recordedAt?: string },\n): boolean {\n if (!expected) return true;\n if (typeof expected.writeNonce === \"string\" && expected.writeNonce.length > 0) {\n return current.writeNonce === expected.writeNonce;\n }\n const hasExpectedTraceId =\n typeof expected.traceId === \"string\" && expected.traceId.length > 0;\n if (hasExpectedTraceId && current.traceId !== expected.traceId) return false;\n if (typeof expected.recordedAt === \"string\" && expected.recordedAt.length > 0) {\n return current.recordedAt === expected.recordedAt;\n }\n return true;\n}\n\nfunction hydrateLastRecallSnapshot(snapshot: LastRecallSnapshot): LastRecallSnapshot {\n const includedMemories = coerceIncludedMemories(snapshot);\n const budgets = snapshot.budgetsApplied\n ? {\n ...snapshot.budgetsApplied,\n includedMemoryIds: includedMemories.map((memory) => memory.id),\n includedMemoryPaths: includedMemories.map((memory) => memory.path),\n includedMemoryNamespaces: includedMemories.map((memory) => memory.namespace),\n }\n : undefined;\n return {\n ...snapshot,\n includedMemories,\n memoryIds: includedMemories.map((memory) => memory.id),\n resultPaths: includedMemories.map((memory) => memory.path),\n resultNamespaces: includedMemories.map((memory) => memory.namespace),\n ...(budgets ? { budgetsApplied: budgets } : {}),\n };\n}\n\nfunction cloneLastRecallSnapshot(\n snapshot: LastRecallSnapshot | null,\n): LastRecallSnapshot | null {\n if (!snapshot) return null;\n return structuredClone(hydrateLastRecallSnapshot(snapshot));\n}\n\n\n\nexport interface TierMigrationCycleSummary {\n trigger: \"extraction\" | \"maintenance\" | \"manual\";\n scanned: number;\n migrated: number;\n promoted: number;\n demoted: number;\n limit: number;\n dryRun: boolean;\n skipped?: string;\n errorCount?: number;\n}\n\nexport interface TierMigrationStatusSnapshot {\n updatedAt: string;\n lastCycle: TierMigrationCycleSummary | null;\n totals: {\n cycles: number;\n scanned: number;\n migrated: number;\n promoted: number;\n demoted: number;\n errors: number;\n };\n}\n\nconst DEFAULT_TIER_MIGRATION_STATUS: TierMigrationStatusSnapshot = {\n updatedAt: new Date(0).toISOString(),\n lastCycle: null,\n totals: {\n cycles: 0,\n scanned: 0,\n migrated: 0,\n promoted: 0,\n demoted: 0,\n errors: 0,\n },\n};\n\n/**\n * Suffix marking an impression spill CLAIMED for commit but not yet deleted.\n * The crash-safe drain renames `<uuid>.jsonl` -> `<uuid>.jsonl.claimed` before\n * committing its rows, mirroring the lifecycle ledger's claim/commit protocol\n * (#2033).\n */\nconst CLAIMED_IMPRESSION_SPILL_SUFFIX = \".claimed\";\n\n/**\n * Outcome of {@link LastRecallStore.drainPendingImpressions}. Distinguishes a\n * completed drain (or nothing pending) from a DEFERRED drain that left durable\n * spills in the offline-sync-EXCLUDED queue, so the caller can tell the\n * data-safe cases apart from the one where an offline-sync snapshot would\n * silently omit recorded impressions (#2033).\n */\nexport interface DrainPendingImpressionsResult {\n /** Pending spill rows were folded into the synced active file this call. */\n folded: boolean;\n /**\n * Durable spill rows remain in the offline-sync-EXCLUDED pending queue after\n * this drain: the rotation lock could not be acquired, a spill could not be\n * claimed, or the drain-only fold left rows that would only fit by rotating\n * into a sync-excluded archive. A snapshot taken now would silently omit them\n * (#2033): the caller MUST treat the active file as INCOMPLETE and retry or\n * abort the snapshot rather than report success. `false` means the active file\n * is complete — every pending row was folded or nothing was pending.\n */\n pendingDeferred: boolean;\n}\n\nexport class LastRecallStore {\n private readonly statePath: string;\n private readonly impressionsPath: string;\n private readonly writeStateFile: StateFileWriter;\n private readonly impressionsRotateBytes: number;\n private readonly impressionsRotateKeep: number;\n // Lock-acquisition timing for the cross-process impression rotation lock.\n // Only tests set this (small maxWaitMs) to force the acquisition-timeout\n // (`acquired=false`) branch deterministically; production uses the defaults.\n private readonly impressionsLockOptions?: Pick<HeldFileLockOptions, \"maxWaitMs\" | \"pollMs\">;\n private state: LastRecallState = {};\n private stateWriteChain: Promise<void> = Promise.resolve();\n // Serializes the rotate-then-append critical section so concurrent record()\n // calls never interleave rotation renames with each other's appends (#1910).\n private impressionsWriteChain: Promise<void> = Promise.resolve();\n\n constructor(\n memoryDir: string,\n options: {\n writeStateFile?: StateFileWriter;\n impressionsRotateBytes?: number;\n impressionsRotateKeep?: number;\n impressionsLockOptions?: Pick<HeldFileLockOptions, \"maxWaitMs\" | \"pollMs\">;\n } = {},\n ) {\n this.statePath = path.join(memoryDir, \"state\", \"last_recall.json\");\n this.impressionsPath = path.join(memoryDir, \"state\", \"recall_impressions.jsonl\");\n // 0 disables rotation (never coerced to a default); keep floors at 1.\n this.impressionsRotateBytes = Math.max(0, Math.floor(options.impressionsRotateBytes ?? 0));\n this.impressionsRotateKeep = Math.max(1, Math.floor(options.impressionsRotateKeep ?? 5));\n this.impressionsLockOptions = options.impressionsLockOptions;\n this.writeStateFile =\n options.writeStateFile ??\n (async (filePath, content) => {\n await writeFileAtomically(filePath, content);\n });\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed: unknown = JSON.parse(raw);\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n this.state = {};\n return;\n }\n const next: LastRecallState = {};\n for (const [sessionKey, snapshot] of Object.entries(parsed)) {\n if (sessionKey === \"__proto__\" || sessionKey === \"constructor\" || sessionKey === \"prototype\") {\n continue;\n }\n if (!snapshot || typeof snapshot !== \"object\" || Array.isArray(snapshot)) {\n continue;\n }\n next[sessionKey] = hydrateLastRecallSnapshot(snapshot as LastRecallSnapshot);\n }\n this.state = next;\n } catch {\n this.state = {};\n }\n }\n\n get(sessionKey: string): LastRecallSnapshot | null {\n // Defensive copy: callers must not be able to mutate internal state\n // by reaching into array/object fields on the returned snapshot.\n if (isUnsafeStateKey(sessionKey)) return null;\n return cloneLastRecallSnapshot(this.state[sessionKey] ?? null);\n }\n\n getMostRecent(): LastRecallSnapshot | null {\n const snapshots = Object.values(this.state);\n if (snapshots.length === 0) return null;\n // Secondary key on sessionKey keeps the sort stable when two\n // snapshots share a recordedAt timestamp (CLAUDE.md rule 19).\n snapshots.sort((a, b) => {\n const byTime = b.recordedAt.localeCompare(a.recordedAt);\n if (byTime !== 0) return byTime;\n return a.sessionKey.localeCompare(b.sessionKey);\n });\n return cloneLastRecallSnapshot(snapshots[0] ?? null);\n }\n\n /**\n * Persist last-recall snapshot and append an impression log entry.\n * Does not store raw query text; uses a stable hash for correlation.\n */\n async record(opts: {\n sessionKey: string;\n query: string;\n memoryIds?: string[];\n includedMemories?: IncludedMemory[];\n namespace?: string;\n recallNamespaces?: string[];\n traceId?: string;\n plannerMode?: RecallPlanMode;\n requestedMode?: RecallPlanMode;\n source?: string;\n fallbackUsed?: boolean;\n sourcesUsed?: string[];\n budgetsApplied?: LastRecallBudgetSummary;\n latencyMs?: number;\n timings?: Record<string, string>;\n resultPaths?: string[];\n resultNamespaces?: Array<string | undefined>;\n policyVersion?: string;\n appendImpression?: boolean;\n identityInjection?: {\n mode: IdentityInjectionMode | \"none\";\n injectedChars: number;\n truncated: boolean;\n };\n /**\n * Per-tier explain annotation (issue #518). When supplied, the\n * snapshot carries it so downstream surfaces (CLI / HTTP / MCP)\n * can render which retrieval tier served the query.\n */\n tierExplain?: RecallTierExplain;\n /**\n * Backend degradations observed while serving this recall (issue #1536).\n * Passed at record time so the published snapshot is born annotated —\n * a post-record annotation would leave a window where readers see the\n * snapshot without them (codex review on #1544).\n */\n backendDegradations?: SearchDegradation[];\n }): Promise<void> {\n if (isUnsafeStateKey(opts.sessionKey)) {\n log.debug(\"last recall record skipped: unsafe session key\");\n return;\n }\n const now = new Date().toISOString();\n const queryHash = createHash(\"sha256\").update(opts.query).digest(\"hex\");\n\n // Build the snapshot from opts, then deep-copy it via\n // cloneLastRecallSnapshot so caller arrays/objects passed in\n // `opts` cannot retain a live reference to the persisted state and\n // tear it after `record()` returns.\n const includedMemories = coerceIncludedMemories(opts);\n const liveSnapshot: LastRecallSnapshot = {\n sessionKey: opts.sessionKey,\n recordedAt: now,\n queryHash,\n writeNonce: randomUUID(),\n queryLen: opts.query.length,\n includedMemories,\n memoryIds: includedMemories.map((memory) => memory.id),\n namespace: opts.namespace,\n recallNamespaces: opts.recallNamespaces,\n traceId: opts.traceId,\n plannerMode: opts.plannerMode,\n requestedMode: opts.requestedMode,\n source: opts.source,\n fallbackUsed: opts.fallbackUsed,\n sourcesUsed: opts.sourcesUsed,\n budgetsApplied: opts.budgetsApplied,\n latencyMs: opts.latencyMs,\n timings: opts.timings ? { ...opts.timings } : undefined,\n policyVersion: opts.policyVersion,\n identityInjectionMode: opts.identityInjection?.mode,\n identityInjectedChars: opts.identityInjection?.injectedChars,\n identityInjectionTruncated: opts.identityInjection?.truncated,\n tierExplain: opts.tierExplain,\n backendDegradations:\n opts.backendDegradations && opts.backendDegradations.length > 0\n ? opts.backendDegradations\n : undefined,\n };\n // `cloneLastRecallSnapshot` handles `null` but that never applies\n // at this call site — the non-null assertion keeps the type\n // checker honest.\n const snapshot = cloneLastRecallSnapshot(liveSnapshot)!;\n\n this.state[opts.sessionKey] = snapshot;\n\n // Keep the state bounded; the impression log is append-only.\n const keys = Object.keys(this.state);\n if (keys.length > 50) {\n const ordered = keys\n .map((k) => ({ k, at: this.state[k]?.recordedAt ?? \"\" }))\n .sort((a, b) => b.at.localeCompare(a.at));\n for (const doomed of ordered.slice(50)) {\n delete this.state[doomed.k];\n }\n }\n\n try {\n await this.flushState();\n } catch (err) {\n log.debug(`last recall store write failed: ${err}`);\n }\n\n if (opts.appendImpression !== false) {\n const line = JSON.stringify(snapshot) + \"\\n\";\n // Chain onto the previous impression write so rotation + append run as one\n // serialized critical section — concurrent record() calls can never\n // interleave a rename with another call's append (#1910). `.catch` before\n // the link keeps a prior failure from poisoning the chain.\n const chained = this.impressionsWriteChain\n .catch(() => {})\n .then(() => this.appendImpressionSerialized(line));\n this.impressionsWriteChain = chained;\n try {\n await chained;\n } catch (err) {\n log.debug(`recall impressions append failed: ${err}`);\n }\n }\n }\n\n /**\n * Drain pending spills, rotate (best-effort, sized to the projected payload),\n * then append one impression line under ONE shared cross-process lock (#1910,\n * #2033). Both the archive-shift renames AND the append run inside the same\n * held lock so a peer process holding the lock can never rename the active\n * inode to `.1` between our open and write — which would land the impression in\n * a rotated archive that offline-sync excludes, silently dropping it from\n * active-state/sync consumers.\n *\n * On lock-acquisition timeout the impression is NEVER written to the active\n * file unlocked (#2033): a peer holding the lock is likely mid-rotation, so an\n * unlocked append can land in the inode it is about to rename to `.1` — the\n * exact silent-drop this lock prevents. Instead the row is spilled to a\n * durable node-local per-event file under `<impressions>.pending.d/` and\n * folded back into the active file by the next append that DOES hold the lock,\n * preserving durability without racing rotation. Rotation failure under the\n * held lock is logged and the append still runs. Callers invoke this only\n * through `impressionsWriteChain` so the sequence is serialized in-process.\n */\n private get impressionsPendingDir(): string {\n return `${this.impressionsPath}.pending.d`;\n }\n\n private async spillImpression(line: string): Promise<void> {\n await ensureContainedSpillDir(this.impressionsPendingDir);\n // Write to a temp name the drain's `.jsonl` lister ignores, then atomically\n // rename to the final `<uuid>.jsonl` (#2033). writeFile creates the path\n // before its bytes are durable, so writing straight to the final name lets a\n // concurrent lock holder's drain read/rename/delete a partial spill and\n // append malformed JSON — permanently losing that impression. The temp lives\n // in the SAME contained dir, so the rename is atomic and stays symlink-safe.\n const id = randomUUID();\n const tempPath = path.join(this.impressionsPendingDir, `${id}.jsonl.tmp`);\n const finalPath = path.join(this.impressionsPendingDir, `${id}.jsonl`);\n await writeFile(tempPath, line, \"utf-8\");\n await rename(tempPath, finalPath);\n }\n\n /**\n * Recover a claim a crashed drain left mid-flight (#2033): the crash-safe\n * drain renames `<uuid>.jsonl` -> `<uuid>.jsonl.claimed` BEFORE committing, so\n * a `.claimed` file with no matching commit is the ONLY durable copy of those\n * rows. Rename each orphan back to `<uuid>.jsonl` so it re-enters the normal\n * collect+claim+commit flow. MUST run under the held rotation lock, before\n * collecting. listContainedSpillFiles skips symlinked/escaping entries.\n */\n private async recoverOrphanedImpressionClaims(): Promise<void> {\n const orphans = await listContainedSpillFiles(\n this.impressionsPendingDir,\n `.jsonl${CLAIMED_IMPRESSION_SPILL_SUFFIX}`,\n );\n for (const claimedPath of orphans) {\n const original = claimedPath.slice(0, -CLAIMED_IMPRESSION_SPILL_SUFFIX.length);\n await rename(claimedPath, original).catch(() => undefined);\n }\n }\n\n /**\n * Recover a crash-orphaned spill temp after its write completed but before\n * the atomic `.tmp` → `.jsonl` rename. Valid JSONL temps are promoted back\n * into the normal queue; incomplete temps remain pending and keep offline sync\n * deferred rather than being discarded.\n */\n private async recoverOrphanedImpressionTemps(): Promise<void> {\n const temps = await listContainedSpillFiles(this.impressionsPendingDir, \".jsonl.tmp\");\n for (const tempPath of temps) {\n let content: string;\n try {\n content = await readFile(tempPath, \"utf-8\");\n for (const line of content.split(\"\\n\")) {\n if (line.trim().length > 0) JSON.parse(line);\n }\n } catch {\n continue;\n }\n const finalPath = tempPath.slice(0, -\".tmp\".length);\n await rename(tempPath, finalPath).catch(() => undefined);\n }\n }\n\n private async appendImpressionSerialized(line: string): Promise<void> {\n await mkdir(path.dirname(this.impressionsPath), { recursive: true });\n // Every active-file write goes under the shared cross-process rotation lock,\n // even when THIS writer's local rotation is disabled (`impressionsRotateBytes\n // <= 0`). A peer process with rotation enabled shares this lock and may\n // rename the active inode to `.1` at any moment, so an unlocked append could\n // land in an offline-sync-excluded archive and be silently dropped (#2033).\n // Only the local rotate DECISION is disabled — the bounded fold skips\n // rotation when this writer's limit is 0 — the lock itself is not.\n const lockPath = `${this.impressionsPath}.lock`;\n await withHeldFileLock(\n lockPath,\n { staleMs: 30_000, ...this.impressionsLockOptions },\n async (acquired) => {\n // withHeldFileLock falls back to task(false) when it cannot acquire the\n // lock within the budget. Do NOT append to the active file unlocked: a\n // peer holding the lock may be mid-rotation, so an unlocked append could\n // land in the inode it renames to `.1` (an offline-sync-excluded\n // archive), silently dropping the impression. Spill it to the durable\n // pending queue instead — the next lock holder folds it back in (#2033).\n if (!acquired) {\n log.debug(\"recall impressions rotation lock not acquired; spilling impression to the durable pending queue\");\n await this.spillImpression(line);\n return;\n }\n await this.foldPendingImpressionsAndAppend(line);\n },\n );\n }\n\n /**\n * Fold any durable pending recall-impression spills into the synced active\n * `recall_impressions.jsonl` WITHOUT recording a new impression (#2033).\n *\n * The pending spill dir is offline-sync-excluded, so an impression that a\n * lock-timed-out `record()` spilled there is absent from an offline-sync\n * snapshot and lost if this node is discarded before the next `record()`\n * folds it back. Offline sync calls this before building a snapshot so a\n * recorded impression always reaches the remote. Fast no-op — no lock and no\n * dir/lock-file creation — when nothing is pending.\n *\n * Returns a {@link DrainPendingImpressionsResult}: `folded` is true when rows\n * were folded into the active file; `pendingDeferred` is true when durable\n * spills still remain in the offline-sync-EXCLUDED queue after this call —\n * because the rotation lock could not be acquired, a spill could not be\n * claimed, or the drain-only fold deferred rows that would only fit by\n * rotating into a sync-excluded archive (#2033). A snapshot taken while\n * `pendingDeferred` is true would silently drop those rows, so the caller MUST\n * NOT report a clean snapshot — it either retries or aborts.\n */\n async drainPendingImpressions(): Promise<DrainPendingImpressionsResult> {\n if (!(await this.pendingSpillsRemain())) {\n return { folded: false, pendingDeferred: false };\n }\n const lockPath = `${this.impressionsPath}.lock`;\n let folded = false;\n let acquiredLock = false;\n let spillsRemain = false;\n await withHeldFileLock(\n lockPath,\n { staleMs: 30_000, ...this.impressionsLockOptions },\n async (acquired) => {\n // A peer holds the lock (mid-rotation or mid-append). We MUST NOT touch\n // the active file unlocked (#2033), so the spills stay in the\n // offline-sync-EXCLUDED pending queue. Report the drain as DEFERRED\n // (pendingDeferred=true) so the caller does not build a snapshot that\n // silently omits them; the next lock holder — or a caller retry — folds\n // them in.\n if (!acquired) return;\n acquiredLock = true;\n folded = await this.foldPendingImpressionsAndAppend(null);\n // Even WITH the lock, a spill the fold could not claim or a `.claimed`\n // orphan a failed commit left behind keeps durable rows in the excluded\n // queue. Treat that as an incomplete drain so the caller retries/aborts\n // rather than snapshotting an active file that omits them (#2033).\n spillsRemain = await this.pendingSpillsRemain();\n },\n );\n return { folded, pendingDeferred: !acquiredLock || spillsRemain };\n }\n\n /**\n * Claim/commit fold of durable pending impression spills into the active file\n * under the held rotation lock (#2033). `line` is a new impression to append\n * after the drained rows, or null for a drain-only pre-sync fold.\n *\n * Each spill is folded as an INDEPENDENT claim -> append -> finalize unit\n * rather than materializing the whole queue as one joined payload and\n * splitting it in a single synchronous pass (#2033). A multi-hundred-MB drain\n * done as one join/split blocks the event loop long enough for\n * `withHeldFileLock`'s ownership-refresh timer to miss its window, so a peer\n * stale-breaks the 30s lock and rotates/appends concurrently — defeating the\n * rotation lock this drain relies on. The per-file `await`s keep the payload\n * bounded to one spill at a time and let the refresh timer fire between files.\n *\n * The DRAIN-ONLY path (`line === null`, run before an offline-sync snapshot)\n * NEVER rotates a drained row into an archive. `recall_impressions.jsonl.*`\n * is offline-sync-EXCLUDED, so rotating a just-drained row into `.1`/`.2` and\n * then deleting its spill would leave that row only in a path sync omits —\n * silently lost when the node is discarded after a \"successful\" sync (#2033).\n * It folds only the rows that fit the synced active file under the cap and\n * leaves the rest durable in the pending queue; {@link drainPendingImpressions}\n * then reports the drain DEFERRED so the caller retries or aborts. The\n * record() path (`line !== null`) keeps rotating normally — its archives stay\n * on a live node that is not being discarded.\n *\n * Recovers any crash-orphaned claim first. Each impression carries a unique\n * writeNonce, so a crash-recovered re-commit is a collapsible duplicate, never\n * a lost row. listContainedSpillFiles rejects symlinked/escaping entries; a\n * spill that cannot be claimed is skipped this pass. An append failure rolls\n * that spill's claim back so the row retries on the next lock holder's drain.\n * Returns true when the active file was written. MUST run under the held\n * rotation lock.\n */\n private async foldPendingImpressionsAndAppend(line: string | null): Promise<boolean> {\n await this.recoverOrphanedImpressionTemps();\n await this.recoverOrphanedImpressionClaims();\n const spillFiles = await listContainedSpillFiles(this.impressionsPendingDir);\n const drainOnly = line === null;\n const cap = this.impressionsRotateBytes;\n let activeSize = 0;\n if (cap > 0) {\n try {\n activeSize = (await stat(this.impressionsPath)).size;\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n let wrote = false;\n for (const filePath of spillFiles) {\n const content = await readFile(filePath, \"utf-8\");\n const unit = content.length === 0 || content.endsWith(\"\\n\") ? content : `${content}\\n`;\n const unitBytes = Buffer.byteLength(unit, \"utf-8\");\n // Drain-only fold must never push a drained row into a sync-excluded\n // archive (#2033). Once the active file cannot take this spill under the\n // cap without rotating, stop: the remaining spills stay durable in the\n // pending queue and the drain reports itself deferred. A lone spill larger\n // than the cap on an empty active file is still folded whole (it cannot be\n // split without corrupting JSONL) so it reaches sync rather than stranding.\n if (drainOnly && cap > 0 && activeSize > 0 && activeSize + unitBytes >= cap) break;\n const claimedPath = `${filePath}${CLAIMED_IMPRESSION_SPILL_SUFFIX}`;\n try {\n await rename(filePath, claimedPath);\n } catch {\n continue; // could not claim → do not commit; a later drain retries it.\n }\n try {\n activeSize = await this.appendImpressionUnit(unit, activeSize, drainOnly);\n } catch (err) {\n // Commit failed: roll this spill's claim back so it retries on the next\n // lock holder's drain instead of being lost.\n await rename(claimedPath, filePath).catch(() => undefined);\n throw err;\n }\n // Commit is durable: delete the claimed file. A delete that fails leaves a\n // `.claimed` orphan the next drain recovers and re-commits — a\n // writeNonce-collapsible duplicate, never a lost row (#2033).\n await unlink(claimedPath).catch(() => undefined);\n wrote = true;\n }\n if (line !== null) {\n activeSize = await this.appendImpressionUnit(line, activeSize, false);\n wrote = true;\n }\n return wrote;\n }\n\n /**\n * Append one whole JSONL unit (a claimed spill's rows or a fresh impression\n * line) to the active impressions file, returning the resulting active-file\n * byte size. On the rotating (record) path, when the unit would push the\n * current active generation to/over `impressionsRotateBytes`, the full active\n * file is rotated aside FIRST so no generation exceeds the cap (#2033); a lone\n * unit larger than the cap on an empty active file is written whole because\n * splitting a JSONL row would corrupt it. `drainOnly` and disabled rotation\n * (`impressionsRotateBytes <= 0`) both skip rotation — drain-only defers its\n * overflow in {@link foldPendingImpressionsAndAppend} rather than rotating into\n * a sync-excluded archive. A rotation error is logged and the append still\n * runs so a row is never lost; an append failure propagates so the caller\n * rolls its claim back. MUST run under the held rotation lock.\n */\n private async appendImpressionUnit(\n unit: string,\n activeSize: number,\n drainOnly: boolean,\n ): Promise<number> {\n const cap = this.impressionsRotateBytes;\n const unitBytes = Buffer.byteLength(unit, \"utf-8\");\n if (cap > 0 && !drainOnly && activeSize > 0 && activeSize + unitBytes >= cap) {\n try {\n await this.shiftImpressionArchives();\n activeSize = 0;\n } catch (err) {\n log.debug(`recall impressions rotation failed (append preserved): ${err}`);\n }\n }\n await appendFile(this.impressionsPath, unit, \"utf-8\");\n return activeSize + unitBytes;\n }\n\n /**\n * True when any live `<uuid>.jsonl` spill, crash-orphaned `.claimed` file,\n * or crash-orphaned `.jsonl.tmp` spill remains in the offline-sync-EXCLUDED\n * pending queue (#2033). After a drain acquires the rotation lock, a spill\n * the fold could not claim (rename race / read-only dir) or a `.claimed`\n * orphan a failed commit left behind means durable rows are STILL excluded\n * from a snapshot — the drain must report itself INCOMPLETE so the caller\n * retries or aborts rather than snapshotting an active file that omits them.\n */\n private async pendingSpillsRemain(): Promise<boolean> {\n if ((await listContainedSpillFiles(this.impressionsPendingDir, \".jsonl.tmp\")).length > 0) {\n return true;\n }\n const liveSpills = await listContainedSpillFiles(this.impressionsPendingDir);\n if (liveSpills.length > 0) return true;\n const claimed = await listContainedSpillFiles(\n this.impressionsPendingDir,\n `.jsonl${CLAIMED_IMPRESSION_SPILL_SUFFIX}`,\n );\n return claimed.length > 0;\n }\n\n /**\n * Shift `.1..N` archives down one slot and move the active file to `.1`,\n * dropping anything beyond `keep`. Callers invoke this only while holding the\n * cross-process rotation lock (issue #1910).\n */\n private async shiftImpressionArchives(): Promise<void> {\n const keep = this.impressionsRotateKeep;\n // Drop the archive that would fall off the end, then shift down: .(keep-1)\n // -> .keep, ..., .1 -> .2, active -> .1.\n try {\n await rm(`${this.impressionsPath}.${keep}`, { force: true });\n } catch {\n // best-effort cleanup of the oldest archive\n }\n for (let i = keep - 1; i >= 1; i -= 1) {\n try {\n await rename(`${this.impressionsPath}.${i}`, `${this.impressionsPath}.${i + 1}`);\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n try {\n await rename(this.impressionsPath, `${this.impressionsPath}.1`);\n } catch (err) {\n if (!isErrnoCode(err, \"ENOENT\")) throw err;\n }\n }\n\n /**\n * Attach a RecallTierExplain block to the existing snapshot for a\n * session without rewriting the entire snapshot. Used by the\n * post-recall direct-answer annotation path (issue #518 slice 3c):\n * recallInternal records the snapshot first, then the orchestrator\n * fires the direct-answer tier in observation mode and annotates\n * the stored snapshot with whichever tier served the query.\n *\n * No-op when no snapshot exists for the given session; callers do\n * not need to guard on existence.\n */\n async annotateTierExplain(\n sessionKey: string,\n tierExplain: RecallTierExplain,\n expected?: { writeNonce?: string; traceId?: string; recordedAt?: string },\n ): Promise<void> {\n if (isUnsafeStateKey(sessionKey)) return;\n const current = this.state[sessionKey];\n if (!current) return;\n if (!snapshotMatchesExpectedIdentity(current, expected)) return;\n this.state[sessionKey] = {\n ...current,\n tierExplain: cloneTierExplain(tierExplain),\n };\n try {\n await this.flushState();\n } catch (err) {\n log.debug(`last recall tier-explain annotate failed: ${err}`);\n }\n }\n\n\n private flushState(): Promise<void> {\n const run = this.stateWriteChain.catch(() => undefined).then(async () => {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await this.writeStateFile(this.statePath, JSON.stringify(this.state, null, 2));\n });\n this.stateWriteChain = run.then(\n () => undefined,\n () => undefined,\n );\n return run;\n }\n}\n\nexport class TierMigrationStatusStore {\n private readonly statePath: string;\n private state: TierMigrationStatusSnapshot = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n\n constructor(memoryDir: string) {\n this.statePath = path.join(memoryDir, \"state\", \"tier-migration-status.json\");\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw) as Partial<TierMigrationStatusSnapshot> | null;\n if (!parsed || typeof parsed !== \"object\") {\n this.state = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n return;\n }\n const totals = parsed.totals && typeof parsed.totals === \"object\"\n ? parsed.totals\n : DEFAULT_TIER_MIGRATION_STATUS.totals;\n this.state = {\n updatedAt:\n typeof parsed.updatedAt === \"string\" && parsed.updatedAt.length > 0\n ? parsed.updatedAt\n : DEFAULT_TIER_MIGRATION_STATUS.updatedAt,\n lastCycle:\n parsed.lastCycle && typeof parsed.lastCycle === \"object\"\n ? (parsed.lastCycle as TierMigrationCycleSummary)\n : null,\n totals: {\n cycles: typeof totals.cycles === \"number\" && Number.isFinite(totals.cycles) ? totals.cycles : 0,\n scanned: typeof totals.scanned === \"number\" && Number.isFinite(totals.scanned) ? totals.scanned : 0,\n migrated: typeof totals.migrated === \"number\" && Number.isFinite(totals.migrated) ? totals.migrated : 0,\n promoted: typeof totals.promoted === \"number\" && Number.isFinite(totals.promoted) ? totals.promoted : 0,\n demoted: typeof totals.demoted === \"number\" && Number.isFinite(totals.demoted) ? totals.demoted : 0,\n errors: typeof totals.errors === \"number\" && Number.isFinite(totals.errors) ? totals.errors : 0,\n },\n };\n } catch {\n this.state = structuredClone(DEFAULT_TIER_MIGRATION_STATUS);\n }\n }\n\n get(): TierMigrationStatusSnapshot {\n return {\n updatedAt: this.state.updatedAt,\n lastCycle: this.state.lastCycle ? { ...this.state.lastCycle } : null,\n totals: { ...this.state.totals },\n };\n }\n\n async recordCycle(summary: TierMigrationCycleSummary): Promise<void> {\n const now = new Date().toISOString();\n const migratedDelta = summary.dryRun ? 0 : Math.max(0, summary.migrated);\n const promotedDelta = summary.dryRun ? 0 : Math.max(0, summary.promoted);\n const demotedDelta = summary.dryRun ? 0 : Math.max(0, summary.demoted);\n const next: TierMigrationStatusSnapshot = {\n updatedAt: now,\n lastCycle: { ...summary },\n totals: {\n cycles: this.state.totals.cycles + 1,\n scanned: this.state.totals.scanned + Math.max(0, summary.scanned),\n migrated: this.state.totals.migrated + migratedDelta,\n promoted: this.state.totals.promoted + promotedDelta,\n demoted: this.state.totals.demoted + demotedDelta,\n errors: this.state.totals.errors + Math.max(0, summary.errorCount ?? 0),\n },\n };\n this.state = next;\n try {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await writeFile(this.statePath, JSON.stringify(next, null, 2), \"utf-8\");\n } catch (err) {\n log.debug(`tier migration status write failed: ${err}`);\n }\n }\n}\n\n\n/**\n * Per-session bounded history of recent recall memory-id sets, used ONLY by\n * handle resolution (issue #1582). Distinct from {@link LastRecallStore} —\n * that keeps ONE last snapshot per session; this keeps a small ring (depth N)\n * of the memory-id arrays a session has recalled, newest first, so a handle\n * cited in a later turn still resolves even after a newer recall displaced the\n * \"last\" snapshot.\n *\n * Deliberately lightweight: stores only `string[]` per entry (no full\n * snapshot), capped at `depth` per session and 50 sessions total (rule 27\n * slice/cap guards). Misses are acceptable and tagged at resolution time.\n */\nexport class RecallHandleHistoryStore {\n private readonly statePath: string;\n private readonly writeStateFile: StateFileWriter;\n private state: Record<string, Array<{ at: string; ids: string[] }>> = {};\n private writeChain: Promise<void> = Promise.resolve();\n private readonly maxDepth: number;\n\n constructor(memoryDir: string, options: { writeStateFile?: StateFileWriter; maxDepth?: number } = {}) {\n this.statePath = path.join(memoryDir, \"state\", \"handle_history.json\");\n this.writeStateFile =\n options.writeStateFile ??\n (async (filePath, content) => {\n await writeFileAtomically(filePath, content);\n });\n this.maxDepth =\n typeof options.maxDepth === \"number\" && Number.isFinite(options.maxDepth)\n ? Math.max(1, Math.min(50, Math.floor(options.maxDepth)))\n : 5;\n }\n\n async load(): Promise<void> {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n const next: Record<string, Array<{ at: string; ids: string[] }>> = {};\n for (const [sessionKey, entries] of Object.entries(parsed)) {\n if (isUnsafeStateKey(sessionKey)) continue;\n if (!Array.isArray(entries)) continue;\n next[sessionKey] = entries;\n }\n this.state = next;\n }\n } catch {\n this.state = {};\n }\n }\n\n /**\n * Record one recall's admitted memory ids for a session, newest first.\n * The ring is capped at {@link maxDepth}; older entries drop off the tail.\n */\n async record(sessionKey: string, memoryIds: readonly string[]): Promise<void> {\n if (!sessionKey || isUnsafeStateKey(sessionKey)) return;\n const ids = memoryIds.filter((id): id is string => typeof id === \"string\" && id.length > 0);\n const entry = { at: new Date().toISOString(), ids };\n const prior = this.state[sessionKey] ?? [];\n const next = [entry, ...prior].slice(0, this.maxDepth);\n this.state[sessionKey] = next;\n this.capSessions();\n try {\n await this.flush();\n } catch (err) {\n log.debug(`recall handle history write failed: ${err}`);\n }\n }\n\n /**\n * Return the memory-id arrays for a session, newest first, capped at `depth`.\n * Empty array when the session has no recorded history.\n */\n recent(sessionKey: string, depth: number = this.maxDepth): Array<readonly string[]> {\n if (isUnsafeStateKey(sessionKey)) return [];\n const entries = this.state[sessionKey];\n if (!entries || entries.length === 0) return [];\n const limit = Math.max(0, Math.min(depth, entries.length));\n return entries.slice(0, limit).map((e) => e.ids);\n }\n\n /** Test seam: drop all history (used by the corpus-scan hygiene test). */\n clearForTest(): void {\n this.state = {};\n }\n\n private capSessions(): void {\n const keys = Object.keys(this.state);\n if (keys.length <= 50) return;\n const ordered = keys\n .map((k) => ({ k, at: this.state[k]?.[0]?.at ?? \"\" }))\n .sort((a, b) => b.at.localeCompare(a.at));\n for (const doomed of ordered.slice(50)) {\n delete this.state[doomed.k];\n }\n }\n\n private flush(): Promise<void> {\n const run = this.writeChain.catch(() => undefined).then(async () => {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await this.writeStateFile(this.statePath, JSON.stringify(this.state, null, 2));\n });\n this.writeChain = run.then(() => undefined, () => undefined);\n return run;\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AAE,CAAC;AAC1C,eAAW,UAAU,QAAQ,MAAM,EAAE,GAAG;AACtC,aAAO,KAAK,MAAM,OAAO,CAAC;AAAA,IAC5B;AAAA,EACF;AAAA,EAEQ,QAAuB;AAC7B,UAAM,MAAM,KAAK,WAAW,MAAM,MAAM,MAAS,EAAE,KAAK,YAAY;AAClE,YAAM,MAAM,KAAK,QAAQ,KAAK,SAAS,GAAG,EAAE,WAAW,KAAK,CAAC;AAC7D,YAAM,KAAK,eAAe,KAAK,WAAW,KAAK,UAAU,KAAK,OAAO,MAAM,CAAC,CAAC;AAAA,IAC/E,CAAC;AACD,SAAK,aAAa,IAAI,KAAK,MAAM,QAAW,MAAM,MAAS;AAC3D,WAAO;AAAA,EACT;AACF;","names":[]}
package/dist/cli.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  runWorkProductStatusCliCommand,
92
92
  runWorkProjectCliCommand,
93
93
  runWorkTaskCliCommand
94
- } from "./chunk-D4LXRZVD.js";
94
+ } from "./chunk-KW3FFIIG.js";
95
95
  import "./chunk-B3DR2JBZ.js";
96
96
  import "./chunk-GOZXQNIM.js";
97
97
  import "./chunk-H4CKS5B2.js";
@@ -209,12 +209,12 @@ import "./chunk-ZOKZIR5K.js";
209
209
  import "./chunk-5IZL4DCV.js";
210
210
  import "./chunk-X7XN6YU4.js";
211
211
  import "./chunk-X7J56GPG.js";
212
- import "./chunk-CEN6DW6X.js";
212
+ import "./chunk-G4NKURT4.js";
213
213
  import "./chunk-2KHIBLO5.js";
214
214
  import "./chunk-SPHBQTWE.js";
215
215
  import "./chunk-5HFVWYHL.js";
216
216
  import "./chunk-MFPPRA4F.js";
217
- import "./chunk-MUHGYV2V.js";
217
+ import "./chunk-VT75USBD.js";
218
218
  import "./chunk-DUTLMAUC.js";
219
219
  import "./chunk-DBB5JPSL.js";
220
220
  import "./chunk-3D75XIYO.js";
@@ -8,7 +8,7 @@ import {
8
8
  shouldSkipImplicitExtraction,
9
9
  stripInlineExplicitCaptureNotes,
10
10
  validateExplicitCaptureInput
11
- } from "./chunk-D4LXRZVD.js";
11
+ } from "./chunk-KW3FFIIG.js";
12
12
  import "./chunk-B3DR2JBZ.js";
13
13
  import "./chunk-GOZXQNIM.js";
14
14
  import "./chunk-H4CKS5B2.js";
@@ -126,12 +126,12 @@ import "./chunk-ZOKZIR5K.js";
126
126
  import "./chunk-5IZL4DCV.js";
127
127
  import "./chunk-X7XN6YU4.js";
128
128
  import "./chunk-X7J56GPG.js";
129
- import "./chunk-CEN6DW6X.js";
129
+ import "./chunk-G4NKURT4.js";
130
130
  import "./chunk-2KHIBLO5.js";
131
131
  import "./chunk-SPHBQTWE.js";
132
132
  import "./chunk-5HFVWYHL.js";
133
133
  import "./chunk-MFPPRA4F.js";
134
- import "./chunk-MUHGYV2V.js";
134
+ import "./chunk-VT75USBD.js";
135
135
  import "./chunk-DUTLMAUC.js";
136
136
  import "./chunk-DBB5JPSL.js";
137
137
  import "./chunk-3D75XIYO.js";
package/dist/index.js CHANGED
@@ -259,7 +259,7 @@ import {
259
259
  writeManifest,
260
260
  writeMeetingEpisodeMemory,
261
261
  writeTimelineState
262
- } from "./chunk-D4LXRZVD.js";
262
+ } from "./chunk-KW3FFIIG.js";
263
263
  import {
264
264
  WEARABLE_SOURCE_PREFIX,
265
265
  WearablesInputError,
@@ -558,7 +558,7 @@ import "./chunk-ZOKZIR5K.js";
558
558
  import "./chunk-5IZL4DCV.js";
559
559
  import "./chunk-X7XN6YU4.js";
560
560
  import "./chunk-X7J56GPG.js";
561
- import "./chunk-CEN6DW6X.js";
561
+ import "./chunk-G4NKURT4.js";
562
562
  import {
563
563
  parseWhyCliOptions
564
564
  } from "./chunk-2KHIBLO5.js";
@@ -577,7 +577,7 @@ import {
577
577
  parseXrayBudgetFlag,
578
578
  parseXrayCliOptions
579
579
  } from "./chunk-MFPPRA4F.js";
580
- import "./chunk-MUHGYV2V.js";
580
+ import "./chunk-VT75USBD.js";
581
581
  import "./chunk-DUTLMAUC.js";
582
582
  import "./chunk-DBB5JPSL.js";
583
583
  import "./chunk-3D75XIYO.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BufferDrainRunner
3
- } from "../chunk-5A6HGHTU.js";
4
- import "../chunk-D4LXRZVD.js";
3
+ } from "../chunk-IDMIRW7C.js";
4
+ import "../chunk-KW3FFIIG.js";
5
5
  import "../chunk-B3DR2JBZ.js";
6
6
  import "../chunk-GOZXQNIM.js";
7
7
  import "../chunk-H4CKS5B2.js";
@@ -119,12 +119,12 @@ import "../chunk-ZOKZIR5K.js";
119
119
  import "../chunk-5IZL4DCV.js";
120
120
  import "../chunk-X7XN6YU4.js";
121
121
  import "../chunk-X7J56GPG.js";
122
- import "../chunk-CEN6DW6X.js";
122
+ import "../chunk-G4NKURT4.js";
123
123
  import "../chunk-2KHIBLO5.js";
124
124
  import "../chunk-SPHBQTWE.js";
125
125
  import "../chunk-5HFVWYHL.js";
126
126
  import "../chunk-MFPPRA4F.js";
127
- import "../chunk-MUHGYV2V.js";
127
+ import "../chunk-VT75USBD.js";
128
128
  import "../chunk-DUTLMAUC.js";
129
129
  import "../chunk-DBB5JPSL.js";
130
130
  import "../chunk-3D75XIYO.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  BufferDrainRunner,
3
3
  ClaimBufferStorage
4
- } from "../chunk-5A6HGHTU.js";
5
- import "../chunk-D4LXRZVD.js";
4
+ } from "../chunk-IDMIRW7C.js";
5
+ import "../chunk-KW3FFIIG.js";
6
6
  import "../chunk-B3DR2JBZ.js";
7
7
  import "../chunk-GOZXQNIM.js";
8
8
  import "../chunk-H4CKS5B2.js";
@@ -120,12 +120,12 @@ import "../chunk-ZOKZIR5K.js";
120
120
  import "../chunk-5IZL4DCV.js";
121
121
  import "../chunk-X7XN6YU4.js";
122
122
  import "../chunk-X7J56GPG.js";
123
- import "../chunk-CEN6DW6X.js";
123
+ import "../chunk-G4NKURT4.js";
124
124
  import "../chunk-2KHIBLO5.js";
125
125
  import "../chunk-SPHBQTWE.js";
126
126
  import "../chunk-5HFVWYHL.js";
127
127
  import "../chunk-MFPPRA4F.js";
128
- import "../chunk-MUHGYV2V.js";
128
+ import "../chunk-VT75USBD.js";
129
129
  import "../chunk-DUTLMAUC.js";
130
130
  import "../chunk-DBB5JPSL.js";
131
131
  import "../chunk-3D75XIYO.js";
@@ -1 +1 @@
1
- {"version":3,"file":"recall-internal.d.ts","sourceRoot":"","sources":["../../src/orchestration/recall-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,8BAA8B,EAAE,KAAK,4BAA4B,EAAslB,MAAM,oBAAoB,CAAC;AA6DptB,OAAO,EAiBL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAU5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,qBAAa,yBAAyB;IAExB,OAAO,CAAC,QAAQ,CAAC,IAAI;IADjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAwB;gBAChC,IAAI,EAAE,kBAAkB;IAE/C,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,uBAA4B,EACrC,IAAI,GAAE,aAAqD,EAC3D,SAAS,GAAE,8BAAuF,EAClG,aAAa,GAAE,4BAAmF,GACjG,OAAO,CAAC,MAAM,CAAC;CA0lKnB"}
1
+ {"version":3,"file":"recall-internal.d.ts","sourceRoot":"","sources":["../../src/orchestration/recall-internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,8BAA8B,EAAE,KAAK,4BAA4B,EAAslB,MAAM,oBAAoB,CAAC;AA6DptB,OAAO,EAiBL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAU5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAKpE,qBAAa,yBAAyB;IAExB,OAAO,CAAC,QAAQ,CAAC,IAAI;IADjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAwB;gBAChC,IAAI,EAAE,kBAAkB;IAE/C,cAAc,CAClB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,uBAA4B,EACrC,IAAI,GAAE,aAAqD,EAC3D,SAAS,GAAE,8BAAuF,EAClG,aAAa,GAAE,4BAAmF,GACjG,OAAO,CAAC,MAAM,CAAC;CA4lKnB"}
@@ -6,7 +6,7 @@ import {
6
6
  mergeGraphExpandedResults,
7
7
  qmdStartupCollectionChecksWithTimeout,
8
8
  resolveEffectiveIdentityInjectionMode
9
- } from "./chunk-D4LXRZVD.js";
9
+ } from "./chunk-KW3FFIIG.js";
10
10
  import "./chunk-B3DR2JBZ.js";
11
11
  import "./chunk-GOZXQNIM.js";
12
12
  import "./chunk-H4CKS5B2.js";
@@ -126,12 +126,12 @@ import "./chunk-ZOKZIR5K.js";
126
126
  import "./chunk-5IZL4DCV.js";
127
127
  import "./chunk-X7XN6YU4.js";
128
128
  import "./chunk-X7J56GPG.js";
129
- import "./chunk-CEN6DW6X.js";
129
+ import "./chunk-G4NKURT4.js";
130
130
  import "./chunk-2KHIBLO5.js";
131
131
  import "./chunk-SPHBQTWE.js";
132
132
  import "./chunk-5HFVWYHL.js";
133
133
  import "./chunk-MFPPRA4F.js";
134
- import "./chunk-MUHGYV2V.js";
134
+ import "./chunk-VT75USBD.js";
135
135
  import "./chunk-DUTLMAUC.js";
136
136
  import "./chunk-DBB5JPSL.js";
137
137
  import "./chunk-3D75XIYO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRecallNavigation
3
- } from "./chunk-D4LXRZVD.js";
3
+ } from "./chunk-KW3FFIIG.js";
4
4
  import "./chunk-B3DR2JBZ.js";
5
5
  import "./chunk-GOZXQNIM.js";
6
6
  import "./chunk-H4CKS5B2.js";
@@ -118,12 +118,12 @@ import "./chunk-ZOKZIR5K.js";
118
118
  import "./chunk-5IZL4DCV.js";
119
119
  import "./chunk-X7XN6YU4.js";
120
120
  import "./chunk-X7J56GPG.js";
121
- import "./chunk-CEN6DW6X.js";
121
+ import "./chunk-G4NKURT4.js";
122
122
  import "./chunk-2KHIBLO5.js";
123
123
  import "./chunk-SPHBQTWE.js";
124
124
  import "./chunk-5HFVWYHL.js";
125
125
  import "./chunk-MFPPRA4F.js";
126
- import "./chunk-MUHGYV2V.js";
126
+ import "./chunk-VT75USBD.js";
127
127
  import "./chunk-DUTLMAUC.js";
128
128
  import "./chunk-DBB5JPSL.js";
129
129
  import "./chunk-3D75XIYO.js";
@@ -37,6 +37,15 @@ export interface LastRecallSnapshot {
37
37
  sourcesUsed?: string[];
38
38
  budgetsApplied?: LastRecallBudgetSummary;
39
39
  latencyMs?: number;
40
+ /**
41
+ * Per-section wall-clock timings recorded during the recall pipeline
42
+ * (same map as the `recall timings:` log line and the timings ring
43
+ * buffer). Values are formatted strings — e.g. "4746ms", "skip",
44
+ * "12ms-cache" — so callers render them verbatim. Added so recall
45
+ * responses can name the slow section instead of exposing only
46
+ * `latencyMs`.
47
+ */
48
+ timings?: Record<string, string>;
40
49
  resultPaths?: string[];
41
50
  resultNamespaces?: Array<string | undefined>;
42
51
  policyVersion?: string;
@@ -172,6 +181,7 @@ export declare class LastRecallStore {
172
181
  sourcesUsed?: string[];
173
182
  budgetsApplied?: LastRecallBudgetSummary;
174
183
  latencyMs?: number;
184
+ timings?: Record<string, string>;
175
185
  resultPaths?: string[];
176
186
  resultNamespaces?: Array<string | undefined>;
177
187
  policyVersion?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"recall-state.d.ts","sourceRoot":"","sources":["../src/recall-state.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA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AC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,KAAK,CAA4D;IACzE,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,cAAc,CAAC,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IAa9F,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3B;;;OAGG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAe7E;;;OAGG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAsB,GAAG,KAAK,CAAC,SAAS,MAAM,EAAE,CAAC;IAQnF,0EAA0E;IAC1E,YAAY,IAAI,IAAI;IAIpB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,KAAK;CAQd"}
@@ -3,7 +3,7 @@ import {
3
3
  RecallHandleHistoryStore,
4
4
  TierMigrationStatusStore,
5
5
  clampGraphRecallExpandedEntries
6
- } from "./chunk-MUHGYV2V.js";
6
+ } from "./chunk-VT75USBD.js";
7
7
  import {
8
8
  coerceIncludedMemories
9
9
  } from "./chunk-2YA5N2BY.js";
@@ -26,4 +26,19 @@ export declare function resolveRecallTimingsOperatorPrincipal(config: PluginConf
26
26
  export declare function isRecallTimingsOperator(config: PluginConfig, authenticatedPrincipal?: string, transportPrincipal?: string): boolean;
27
27
  export declare function getRecallTimings(config: PluginConfig): RecallTimingRecord[];
28
28
  export declare function getRecallTimingStatus(config: PluginConfig): RecallTimingStatus;
29
+ /**
30
+ * Read the section-timing map the last-recall store kept for the recall that
31
+ * produced `traceId`. The traceId match pins the record to that run so an
32
+ * interleaved same-session recall cannot lend its timings to the wrong reply.
33
+ */
34
+ export declare function lastRecallTimingsFor(store: {
35
+ get(sessionKey: string): {
36
+ traceId?: string;
37
+ timings?: Record<string, string>;
38
+ } | null;
39
+ getMostRecent(): {
40
+ traceId?: string;
41
+ timings?: Record<string, string>;
42
+ } | null;
43
+ }, sessionKey: string | undefined, traceId: string | undefined): Record<string, string> | undefined;
29
44
  //# sourceMappingURL=recall-timings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recall-timings.d.ts","sourceRoot":"","sources":["../src/recall-timings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC;CACxC;AAwED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMhF;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAKN;AAED,wBAAgB,q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,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,IAAI,CAKN;AAED,wBAAgB,qCAAqC,CACnD,MAAM,EAAE,YAAY,EACpB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,MAAM,GAAG,SAAS,CAIpB;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,EACpB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAUT;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAM3E;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,kBAAkB,CAU9E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IAAE,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACvF,aAAa,IAAI;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAA;CAAE,EACzF,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAGpC"}
@@ -3,15 +3,17 @@ import {
3
3
  getRecallTimingStatus,
4
4
  getRecallTimings,
5
5
  isRecallTimingsOperator,
6
+ lastRecallTimingsFor,
6
7
  recordRecallTiming,
7
8
  resolveRecallTimingsOperatorPrincipal
8
- } from "./chunk-CEN6DW6X.js";
9
+ } from "./chunk-G4NKURT4.js";
9
10
  import "./chunk-PZ5AY32C.js";
10
11
  export {
11
12
  foldQueueWaitTiming,
12
13
  getRecallTimingStatus,
13
14
  getRecallTimings,
14
15
  isRecallTimingsOperator,
16
+ lastRecallTimingsFor,
15
17
  recordRecallTiming,
16
18
  resolveRecallTimingsOperatorPrincipal
17
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/core",
3
- "version": "10.0.134",
3
+ "version": "10.0.135",
4
4
  "description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -3396,7 +3396,7 @@
3396
3396
  "core"
3397
3397
  ],
3398
3398
  "peerDependencies": {
3399
- "@remnic/coding-graph": "^10.0.134"
3399
+ "@remnic/coding-graph": "^10.0.135"
3400
3400
  },
3401
3401
  "peerDependenciesMeta": {
3402
3402
  "@remnic/coding-graph": {
@@ -263,6 +263,26 @@ function rejectBlankRelayNamespace(value: string | null | undefined): void {
263
263
  }
264
264
  }
265
265
 
266
+ const PRINCIPAL_HEADER_MAX_CHARS = 128;
267
+ // Principals are durable identity strings (sessionOwnerPrincipal, scope-group
268
+ // keys, derived namespaces): no whitespace, control characters, or path
269
+ // separators; `..` is refused so a value can never collide with traversal
270
+ // shapes anywhere downstream.
271
+ const INVALID_PRINCIPAL_HEADER_CHARS = /[\s\/\\]|\.{2}/;
272
+
273
+ function isValidPrincipalHeaderValue(value: string): boolean {
274
+ if (value.length === 0 || Array.from(value).length > PRINCIPAL_HEADER_MAX_CHARS) return false;
275
+ if (INVALID_PRINCIPAL_HEADER_CHARS.test(value)) return false;
276
+ // Control characters are refused: C0 (<0x20) plus DEL and the C1 range
277
+ // (0x7f-0x9f, which \s does not cover — e.g. U+0085 NEL). Printable/unicode
278
+ // otherwise fine.
279
+ for (const ch of value) {
280
+ const code = ch.codePointAt(0) ?? 0;
281
+ if (code < 0x20 || (code >= 0x7f && code <= 0x9f)) return false;
282
+ }
283
+ return true;
284
+ }
285
+
266
286
  function codingContextFromProjectTag(projectTag: string): {
267
287
  projectId: string;
268
288
  branch: string | null;
@@ -610,6 +630,14 @@ export class EngramAccessHttpServer extends ReviewDeckAccessHttpBase {
610
630
  if (typeof raw === "string") {
611
631
  const trimmed = raw.trim();
612
632
  if (trimmed.length > 0) {
633
+ // Trust boundary (issue #3460): once the header is honored, a client
634
+ // could stamp any value as sessionOwnerPrincipal on durable records.
635
+ // Reject malformed identities instead of storing them verbatim.
636
+ if (!isValidPrincipalHeaderValue(trimmed)) {
637
+ throw new EngramAccessInputError(
638
+ `invalid x-engram-principal header value: must be 1-128 chars with no whitespace, control chars, or path separators`,
639
+ );
640
+ }
613
641
  principal = trimmed;
614
642
  }
615
643
  }
@@ -342,6 +342,7 @@ export async function assembleRecallResponse(
342
342
  auditAnomalies,
343
343
  budgetWarning: toBudgetWarning(budgetDecision),
344
344
  latencyMs: snapshot?.latencyMs ?? (Date.now() - startedAt),
345
+ timings: snapshot?.timings,
345
346
  debug: safeDebug,
346
347
  },
347
348
  // Non-null when this recall reserved a cross-namespace budget event at
@@ -32,6 +32,7 @@ import { coerceIncludedMemories, type LastRecallSnapshot } from "./recall-state.
32
32
  import type { RecallContextComposition } from "./recall-context-composition.js";
33
33
  import { type TagMatchMode, applyTagFilter, normalizeTags, parseTagMatch } from "./recall-tag-filter.js";
34
34
  import { type RecallXraySnapshot, estimateRecallTokens } from "./recall-xray.js";
35
+ import { lastRecallTimingsFor } from "./recall-timings.js";
35
36
  import { SecureStoreLockedError } from "./secure-store/index.js";
36
37
  import { StorageManager } from "./index.js";
37
38
  import { DEFAULT_RECALL_DISCLOSURE, type MemoryFile, type RecallDisclosure, type RecallPlanMode, isRecallDisclosure } from "./types.js";
@@ -237,10 +238,7 @@ export class AccessRecallSurface {
237
238
  recallNamespaces: [namespace],
238
239
  traceId: options.snapshot.traceId,
239
240
  plannerMode: options.normalizedMode,
240
- requestedMode:
241
- options.requestedMode && options.requestedMode !== "auto"
242
- ? options.requestedMode
243
- : undefined,
241
+ requestedMode: options.requestedMode !== "auto" ? options.requestedMode : undefined,
244
242
  sourcesUsed,
245
243
  budgetsApplied: {
246
244
  appliedTopK: memoryIds.length,
@@ -249,6 +247,8 @@ export class AccessRecallSurface {
249
247
  finalContextChars: options.snapshot.budget.used,
250
248
  },
251
249
  latencyMs: Date.now() - options.startedAt,
250
+ // The record the capture's own recall wrote carries the section timings (traceId-pinned).
251
+ timings: lastRecallTimingsFor(this.deps.orchestrator.lastRecall, options.sessionKey, options.snapshot.traceId),
252
252
  includedMemories,
253
253
  };
254
254
  const results = await this.deps.serializeRecallResults(
@@ -296,6 +296,7 @@ export class AccessRecallSurface {
296
296
  budgetsApplied: snapshotForSerialization.budgetsApplied,
297
297
  storageCorpusVersionsAtRecallStart: options.storageCorpusVersionsAtRecallStart,
298
298
  latencyMs: snapshotForSerialization.latencyMs,
299
+ timings: snapshotForSerialization.timings,
299
300
  };
300
301
  }
301
302
 
@@ -469,6 +469,8 @@ export interface EngramAccessRecallResponse {
469
469
  auditAnomalies?: AnomalyDetectorResult;
470
470
  budgetWarning?: BudgetWarning;
471
471
  latencyMs?: number;
472
+ /** Per-section timings from the recall snapshot (see `LastRecallSnapshot.timings`). */
473
+ timings?: Record<string, string>;
472
474
  debug?: {
473
475
  snapshot?: LastRecallSnapshot;
474
476
  intent?: IntentDebugSnapshot | null;
@@ -619,6 +619,7 @@ export class RecallInternalCoordinator {
619
619
  qmdHybridFetchLimit,
620
620
  }),
621
621
  latencyMs: Date.now() - recallStart,
622
+ timings: { ...timings },
622
623
  includedMemories: [],
623
624
  policyVersion,
624
625
  appendImpression: this.deps.config.recordEmptyRecallImpressions,
@@ -5240,6 +5241,7 @@ export class RecallInternalCoordinator {
5240
5241
  sourcesUsed,
5241
5242
  budgetsApplied,
5242
5243
  latencyMs: Date.now() - recallStart,
5244
+ timings: { ...timings },
5243
5245
  includedMemories: assembledRecall.includedMemories,
5244
5246
  policyVersion,
5245
5247
  appendImpression:
@@ -63,6 +63,15 @@ export interface LastRecallSnapshot {
63
63
  sourcesUsed?: string[];
64
64
  budgetsApplied?: LastRecallBudgetSummary;
65
65
  latencyMs?: number;
66
+ /**
67
+ * Per-section wall-clock timings recorded during the recall pipeline
68
+ * (same map as the `recall timings:` log line and the timings ring
69
+ * buffer). Values are formatted strings — e.g. "4746ms", "skip",
70
+ * "12ms-cache" — so callers render them verbatim. Added so recall
71
+ * responses can name the slow section instead of exposing only
72
+ * `latencyMs`.
73
+ */
74
+ timings?: Record<string, string>;
66
75
  resultPaths?: string[];
67
76
  resultNamespaces?: Array<string | undefined>;
68
77
  policyVersion?: string;
@@ -411,6 +420,7 @@ export class LastRecallStore {
411
420
  sourcesUsed?: string[];
412
421
  budgetsApplied?: LastRecallBudgetSummary;
413
422
  latencyMs?: number;
423
+ timings?: Record<string, string>;
414
424
  resultPaths?: string[];
415
425
  resultNamespaces?: Array<string | undefined>;
416
426
  policyVersion?: string;
@@ -464,6 +474,7 @@ export class LastRecallStore {
464
474
  sourcesUsed: opts.sourcesUsed,
465
475
  budgetsApplied: opts.budgetsApplied,
466
476
  latencyMs: opts.latencyMs,
477
+ timings: opts.timings ? { ...opts.timings } : undefined,
467
478
  policyVersion: opts.policyVersion,
468
479
  identityInjectionMode: opts.identityInjection?.mode,
469
480
  identityInjectedChars: opts.identityInjection?.injectedChars,