@remnic/core 9.3.660 → 9.3.662
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-cli.js +10 -10
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +10 -10
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +9 -9
- package/dist/{access-service-D_nbpexW.d.ts → access-service-D0SLB4MH.d.ts} +2 -2
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +8 -8
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +3 -3
- package/dist/briefing.d.ts +1 -1
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/{chunk-7H7J3ZWN.js → chunk-2KDQI363.js} +2 -2
- package/dist/{chunk-R2EBP6CM.js → chunk-35HP3TGR.js} +5 -5
- package/dist/{chunk-FWIROLS6.js → chunk-44VFF3BB.js} +18 -16
- package/dist/chunk-44VFF3BB.js.map +1 -0
- package/dist/{chunk-OYXVENIS.js → chunk-4KDLCMLK.js} +3 -3
- package/dist/{chunk-MO77TWPS.js → chunk-5AYAZN45.js} +2 -2
- package/dist/{chunk-7PCZGNG2.js → chunk-6RHNCKHG.js} +113 -24
- package/dist/chunk-6RHNCKHG.js.map +1 -0
- package/dist/{chunk-RP2U54GG.js → chunk-DFAXGZKI.js} +2 -2
- package/dist/{chunk-6G5JEN55.js → chunk-FZC2WSDB.js} +2 -2
- package/dist/{chunk-2EVZ5EN6.js → chunk-HSCJYHYV.js} +6 -6
- package/dist/{chunk-B57QYSWN.js → chunk-TGOOJCGA.js} +109 -16
- package/dist/chunk-TGOOJCGA.js.map +1 -0
- package/dist/{chunk-UNLHHTKN.js → chunk-WOQIHC67.js} +10 -2
- package/dist/chunk-WOQIHC67.js.map +1 -0
- package/dist/{chunk-5PLUC5OB.js → chunk-WSQG37DV.js} +2 -2
- package/dist/{chunk-M3VYPE2H.js → chunk-YNQ6DFSV.js} +1 -1
- package/dist/chunk-YNQ6DFSV.js.map +1 -0
- package/dist/{chunk-256W7AXC.js → chunk-YYQRVNSV.js} +2 -2
- package/dist/{chunk-GRYAECRV.js → chunk-ZJH723NM.js} +2 -2
- package/dist/{cli-aYxSuPvP.d.ts → cli-C6twwe84.d.ts} +3 -3
- package/dist/cli.d.ts +5 -5
- package/dist/cli.js +13 -13
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +3 -3
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +15 -15
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +1 -1
- package/dist/namespaces/migrate.js +8 -8
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +7 -7
- package/dist/namespaces/storage.d.ts +1 -1
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +9 -9
- package/dist/{orchestrator-D1wcmPNj.d.ts → orchestrator-Cg1UkvmO.d.ts} +2 -2
- package/dist/orchestrator.d.ts +3 -3
- package/dist/orchestrator.js +9 -9
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +50 -2
- package/dist/qmd.js +8 -2
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +17 -1
- package/dist/recall-state.js +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/retrieval-agents.d.ts +1 -1
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +6 -6
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +21 -2
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-MWOdNtSE.d.ts → semantic-consolidation-BICZvQ3C.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +1 -1
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/{types-CgcCpUrf.d.ts → types-D96bCB3C.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/package.json +3 -2
- package/scripts/build-with-heap.mjs +25 -0
- package/src/namespaces/search.ts +16 -0
- package/src/orchestrator.ts +144 -3
- package/src/qmd.ts +137 -18
- package/src/recall-state.ts +47 -21
- package/src/search/port.ts +25 -0
- package/dist/chunk-7PCZGNG2.js.map +0 -1
- package/dist/chunk-B57QYSWN.js.map +0 -1
- package/dist/chunk-FWIROLS6.js.map +0 -1
- package/dist/chunk-M3VYPE2H.js.map +0 -1
- package/dist/chunk-UNLHHTKN.js.map +0 -1
- /package/dist/{chunk-7H7J3ZWN.js.map → chunk-2KDQI363.js.map} +0 -0
- /package/dist/{chunk-R2EBP6CM.js.map → chunk-35HP3TGR.js.map} +0 -0
- /package/dist/{chunk-OYXVENIS.js.map → chunk-4KDLCMLK.js.map} +0 -0
- /package/dist/{chunk-MO77TWPS.js.map → chunk-5AYAZN45.js.map} +0 -0
- /package/dist/{chunk-RP2U54GG.js.map → chunk-DFAXGZKI.js.map} +0 -0
- /package/dist/{chunk-6G5JEN55.js.map → chunk-FZC2WSDB.js.map} +0 -0
- /package/dist/{chunk-2EVZ5EN6.js.map → chunk-HSCJYHYV.js.map} +0 -0
- /package/dist/{chunk-5PLUC5OB.js.map → chunk-WSQG37DV.js.map} +0 -0
- /package/dist/{chunk-256W7AXC.js.map → chunk-YYQRVNSV.js.map} +0 -0
- /package/dist/{chunk-GRYAECRV.js.map → chunk-ZJH723NM.js.map} +0 -0
|
@@ -3245,4 +3245,4 @@ interface HourlySummary {
|
|
|
3245
3245
|
generatedAt: string;
|
|
3246
3246
|
}
|
|
3247
3247
|
|
|
3248
|
-
export { type Checkpoint as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CompressionGuidelineOptimizerState as C, type MemorySummary as D, type EntityStructuredSection as E, type FileHygieneConfig as F, type GatewayConfig as G, type RecallPlanMode as H, type ImportanceScore as I, type IdentityInjectionMode as J, type RecallDisclosure as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type BriefingSections as N, type BriefingFollowup as O, type PluginConfig as P, type
|
|
3248
|
+
export { type Checkpoint as $, type ActiveRecallChatType as A, type BehaviorSignalEvent as B, type CompressionGuidelineOptimizerState as C, type MemorySummary as D, type EntityStructuredSection as E, type FileHygieneConfig as F, type GatewayConfig as G, type RecallPlanMode as H, type ImportanceScore as I, type IdentityInjectionMode as J, type RecallDisclosure as K, type LiveConnectorsConfig as L, type MemoryCategory as M, type BriefingSections as N, type BriefingFollowup as O, type PluginConfig as P, type QmdSearchResult as Q, type RecallTierExplain as R, type BriefingFocus as S, type TopicScore as T, type CalendarSource as U, type CalendarEvent as V, type BriefingActiveThread as W, type BriefingResult as X, type BriefingRecentEntity as Y, type BufferTurn as Z, type TranscriptEntry as _, type ActiveRecallQueryMode as a, type WearableFetchOptions as a$, type HourlySummary as a0, type SessionObserverBandConfig as a1, type LifecycleState as a2, type VerificationState as a3, type PolicyClass as a4, type ImportanceLevel as a5, type SecretRef as a6, type AgentAccessAuthToken as a7, type CompressionGuidelineOptimizerEventCounts as a8, type CompressionGuidelineOptimizerActionSummary as a9, type WearableNativeMemory as aA, type WearableMemoryMode as aB, type WearableSourceConnector as aC, type WearablesConfig as aD, type WearableSyncSummary as aE, type WearableSourceStatus as aF, type WearableDayTranscript as aG, type WearableCorrectionRule as aH, type CodingContext as aI, type BootstrapOptions as aJ, type BootstrapResult as aK, type ConsolidationObservation as aL, type EntityTimelineEntry as aM, type CodingModeConfig as aN, type WearableCleanupSettings as aO, type WearableDayTranscriptMeta as aP, type BriefingConfig as aQ, type BriefingOpenCommitment as aR, type BriefingWindow as aS, type CodexCompatConfig as aT, DEFAULT_RECALL_DISCLOSURE as aU, type ExtractedFact as aV, type MemoryActionEligibilitySource as aW, type MemoryObservation as aX, type MemoryScope as aY, RECALL_DISCLOSURE_LEVELS as aZ, type WearableAuthCheck as a_, type CompressionGuidelineOptimizerRuleUpdate as aa, type MemoryActionType as ab, type EntityMention as ac, type EntitySchemaDefinition as ad, type EntitySchemaSectionDefinition as ae, type ExtractionResult as af, type ConsolidationResult as ag, type DaySummaryResult as ah, type MemoryIntent as ai, type QmdSearchExplain as aj, type MemoryActionEligibilityContext as ak, type MemoryActionPolicyResult as al, type MemoryLifecycleEventType as am, type MemoryLifecycleStateSummary as an, type ModelProviderConfig as ao, type NativeKnowledgeConfig as ap, type RetrievalTier as aq, type SignalScanResult as ar, type ConversationThread as as, type ScopeProfileLayerId as at, type ScopeProfilePromotionTarget as au, type DreamsStatusResult as av, type DreamsPhase as aw, type DreamsRunResult as ax, type WearableConversation as ay, type WearableSourceSettings as az, type ActiveRecallPromptStyle as b, type ProceduralConfig as b$, type WearableFetchPage as b0, type WearableNativeMemoryPage as b1, type WearableTranscriptSegment as b2, isRecallDisclosure as b3, type AgentAccessHttpConfig as b4, type AgentDefaultsConfig as b5, type AgentPersona as b6, type BehaviorLoopAdjustment as b7, type BehaviorSignalDirection as b8, type BehaviorSignalType as b9, type ExtractedQuestion as bA, type ExtractedReasoningTrace as bB, type ExtractedReasoningTraceStep as bC, type ExtractedRelationship as bD, type ExtractionPassSource as bE, type GitHubLiveConnectorConfig as bF, type GmailLiveConnectorConfig as bG, type GoogleDriveLiveConnectorConfig as bH, type HeartbeatConfig as bI, type HeartbeatDetectionMode as bJ, type LlmTraceCallback as bK, type LlmTraceEvent as bL, type MemoryActionOutcome as bM, type MemoryActionPolicyDecision as bN, type MemoryActionStatus as bO, type MemoryLinkType as bP, type MemoryOsPresetName as bQ, type ModelApi as bR, type ModelDefinitionConfig as bS, type ModelProviderAuthMode as bT, type NamespacePolicy as bU, type NativeKnowledgeFolderRuleConfig as bV, type NativeKnowledgeObsidianVaultConfig as bW, type NativeKnowledgeOpenClawWorkspaceConfig as bX, type NotionLiveConnectorConfig as bY, type PrincipalFromSessionKeyMode as bZ, type PrincipalRule as b_, type BriefingCalendarSourceError as ba, type BufferEntryState as bb, type CaptureMode as bc, type CodexCliReasoningEffort as bd, type CodexCompactionFlushMode as be, type CodexConnectorConfig as bf, type CompressionGuidelineActivationState as bg, type CompressionGuidelineOptimizerSourceWindow as bh, type ConfidenceTier as bi, type ConsolidationAction as bj, type ConsolidationItem as bk, type ContinuityIncidentState as bl, type ContinuityLoopCadence as bm, type ContinuityLoopStatus as bn, type ContradictionScanConfig as bo, type CronConversationRecallMode as bp, type CronRecallMode as bq, type DreamingConfig as br, type DreamingNarrativePromptStyle as bs, type DreamsDeepSleepConfig as bt, type DreamsLightSleepConfig as bu, type DreamsPhaseStatus as bv, type DreamsPhasesConfig as bw, type DreamsRemConfig as bx, type EngramTraceEvent as by, type ExtractedProcedureStep as bz, type ActiveRecallThinking as c, type QuestionEntry as c0, type ReasoningEffort as c1, type RecallPipelineConfig as c2, type RecallSectionConfig as c3, type RecallTraceEvent as c4, type RelevanceFeedback as c5, SPECULATIVE_TTL_DAYS as c6, type ScopeProfileAutoPromoteConfig as c7, type ScopeProfileConfig as c8, type ScopeProfileTeamProjectConfig as c9, type ScopeTeamConfig as ca, type ScoredEntity as cb, type SemanticChunkingConfigShape as cc, type SignalLevel as cd, type SlotBehaviorConfig as ce, type SlotMismatchMode as cf, type TriggerMode as cg, confidenceTier as ch, type ActiveRecallModelFallbackPolicy as d, type BehaviorLoopPolicyState as e, type AgentPersonaModelConfig as f, type MemoryFile as g, type MemoryStatus as h, type MemoryLink as i, type MemoryFrontmatter as j, type BufferState as k, type MetaState as l, type MemoryActionEvent as m, type MemoryLifecycleEvent as n, type BufferSurpriseEvent as o, type ContinuityIncidentOpenInput as p, type ContinuityIncidentRecord as q, type ContinuityIncidentCloseInput as r, type ContinuityImprovementLoop as s, type ContinuityLoopUpsertInput as t, type ContinuityLoopReviewInput as u, type EntityRelationship as v, type EntityActivityEntry as w, type EntityFile as x, type AccessTrackingEntry as y, type MemoryProjectionCurrentState as z };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './types-ByK7T3L6.js';
|
|
2
2
|
import './index-DJ9QWMw-.js';
|
|
3
|
-
export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken, b4 as AgentAccessHttpConfig, b5 as AgentDefaultsConfig, b6 as AgentPersona, f as AgentPersonaModelConfig, b7 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, b8 as BehaviorSignalDirection, B as BehaviorSignalEvent, b9 as BehaviorSignalType, aJ as BootstrapOptions, aK as BootstrapResult,
|
|
3
|
+
export { y as AccessTrackingEntry, A as ActiveRecallChatType, d as ActiveRecallModelFallbackPolicy, b as ActiveRecallPromptStyle, a as ActiveRecallQueryMode, c as ActiveRecallThinking, a7 as AgentAccessAuthToken, b4 as AgentAccessHttpConfig, b5 as AgentDefaultsConfig, b6 as AgentPersona, f as AgentPersonaModelConfig, b7 as BehaviorLoopAdjustment, e as BehaviorLoopPolicyState, b8 as BehaviorSignalDirection, B as BehaviorSignalEvent, b9 as BehaviorSignalType, aJ as BootstrapOptions, aK as BootstrapResult, W as BriefingActiveThread, ba as BriefingCalendarSourceError, aQ as BriefingConfig, S as BriefingFocus, O as BriefingFollowup, aR as BriefingOpenCommitment, Y as BriefingRecentEntity, X as BriefingResult, N as BriefingSections, aS as BriefingWindow, bb as BufferEntryState, k as BufferState, o as BufferSurpriseEvent, Z as BufferTurn, V as CalendarEvent, U as CalendarSource, bc as CaptureMode, $ as Checkpoint, bd as CodexCliReasoningEffort, be as CodexCompactionFlushMode, aT as CodexCompatConfig, bf as CodexConnectorConfig, aI as CodingContext, aN as CodingModeConfig, bg as CompressionGuidelineActivationState, a9 as CompressionGuidelineOptimizerActionSummary, a8 as CompressionGuidelineOptimizerEventCounts, aa as CompressionGuidelineOptimizerRuleUpdate, bh as CompressionGuidelineOptimizerSourceWindow, C as CompressionGuidelineOptimizerState, bi as ConfidenceTier, bj as ConsolidationAction, bk as ConsolidationItem, aL as ConsolidationObservation, ag as ConsolidationResult, s as ContinuityImprovementLoop, r as ContinuityIncidentCloseInput, p as ContinuityIncidentOpenInput, q as ContinuityIncidentRecord, bl as ContinuityIncidentState, bm as ContinuityLoopCadence, u as ContinuityLoopReviewInput, bn as ContinuityLoopStatus, t as ContinuityLoopUpsertInput, bo as ContradictionScanConfig, as as ConversationThread, bp as CronConversationRecallMode, bq as CronRecallMode, aU as DEFAULT_RECALL_DISCLOSURE, ah as DaySummaryResult, br as DreamingConfig, bs as DreamingNarrativePromptStyle, bt as DreamsDeepSleepConfig, bu as DreamsLightSleepConfig, aw as DreamsPhase, bv as DreamsPhaseStatus, bw as DreamsPhasesConfig, bx as DreamsRemConfig, ax as DreamsRunResult, av as DreamsStatusResult, by as EngramTraceEvent, w as EntityActivityEntry, x as EntityFile, ac as EntityMention, v as EntityRelationship, ad as EntitySchemaDefinition, ae as EntitySchemaSectionDefinition, E as EntityStructuredSection, aM as EntityTimelineEntry, aV as ExtractedFact, bz as ExtractedProcedureStep, bA as ExtractedQuestion, bB as ExtractedReasoningTrace, bC as ExtractedReasoningTraceStep, bD as ExtractedRelationship, bE as ExtractionPassSource, af as ExtractionResult, F as FileHygieneConfig, G as GatewayConfig, bF as GitHubLiveConnectorConfig, bG as GmailLiveConnectorConfig, bH as GoogleDriveLiveConnectorConfig, bI as HeartbeatConfig, bJ as HeartbeatDetectionMode, a0 as HourlySummary, J as IdentityInjectionMode, a5 as ImportanceLevel, I as ImportanceScore, a2 as LifecycleState, L as LiveConnectorsConfig, bK as LlmTraceCallback, bL as LlmTraceEvent, ak as MemoryActionEligibilityContext, aW as MemoryActionEligibilitySource, m as MemoryActionEvent, bM as MemoryActionOutcome, bN as MemoryActionPolicyDecision, al as MemoryActionPolicyResult, bO as MemoryActionStatus, ab as MemoryActionType, M as MemoryCategory, g as MemoryFile, j as MemoryFrontmatter, ai as MemoryIntent, n as MemoryLifecycleEvent, am as MemoryLifecycleEventType, an as MemoryLifecycleStateSummary, i as MemoryLink, bP as MemoryLinkType, aX as MemoryObservation, bQ as MemoryOsPresetName, z as MemoryProjectionCurrentState, aY as MemoryScope, h as MemoryStatus, D as MemorySummary, l as MetaState, bR as ModelApi, bS as ModelDefinitionConfig, bT as ModelProviderAuthMode, ao as ModelProviderConfig, bU as NamespacePolicy, ap as NativeKnowledgeConfig, bV as NativeKnowledgeFolderRuleConfig, bW as NativeKnowledgeObsidianVaultConfig, bX as NativeKnowledgeOpenClawWorkspaceConfig, bY as NotionLiveConnectorConfig, P as PluginConfig, a4 as PolicyClass, bZ as PrincipalFromSessionKeyMode, b_ as PrincipalRule, b$ as ProceduralConfig, aj as QmdSearchExplain, Q as QmdSearchResult, c0 as QuestionEntry, aZ as RECALL_DISCLOSURE_LEVELS, c1 as ReasoningEffort, K as RecallDisclosure, c2 as RecallPipelineConfig, H as RecallPlanMode, c3 as RecallSectionConfig, R as RecallTierExplain, c4 as RecallTraceEvent, c5 as RelevanceFeedback, aq as RetrievalTier, c6 as SPECULATIVE_TTL_DAYS, c7 as ScopeProfileAutoPromoteConfig, c8 as ScopeProfileConfig, at as ScopeProfileLayerId, au as ScopeProfilePromotionTarget, c9 as ScopeProfileTeamProjectConfig, ca as ScopeTeamConfig, cb as ScoredEntity, a6 as SecretRef, cc as SemanticChunkingConfigShape, a1 as SessionObserverBandConfig, cd as SignalLevel, ar as SignalScanResult, ce as SlotBehaviorConfig, cf as SlotMismatchMode, T as TopicScore, _ as TranscriptEntry, cg as TriggerMode, a3 as VerificationState, ch as confidenceTier, b3 as isRecallDisclosure } from './types-D96bCB3C.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.3.
|
|
3
|
+
"version": "9.3.662",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -2856,6 +2856,7 @@
|
|
|
2856
2856
|
"src",
|
|
2857
2857
|
"dist",
|
|
2858
2858
|
"skills",
|
|
2859
|
+
"scripts/build-with-heap.mjs",
|
|
2859
2860
|
"scripts/ensure-better-sqlite3.mjs",
|
|
2860
2861
|
"scripts/faiss_index.py",
|
|
2861
2862
|
"scripts/faiss_requirements.txt"
|
|
@@ -2905,7 +2906,7 @@
|
|
|
2905
2906
|
"core"
|
|
2906
2907
|
],
|
|
2907
2908
|
"scripts": {
|
|
2908
|
-
"build": "
|
|
2909
|
+
"build": "node ./scripts/build-with-heap.mjs",
|
|
2909
2910
|
"check-types": "tsc --noEmit",
|
|
2910
2911
|
"test": "tsx --test 'src/**/*.test.ts'",
|
|
2911
2912
|
"postinstall": "node ./scripts/ensure-better-sqlite3.mjs"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs tsup with deterministic heap headroom for its DTS worker.
|
|
3
|
+
// The DTS build sits near the default V8 heap cliff (see PR #1562):
|
|
4
|
+
// unrelated lockfile refreshes flipped it to ERR_WORKER_OUT_OF_MEMORY.
|
|
5
|
+
// A Node wrapper (not a NODE_OPTIONS= shell prefix) keeps the build
|
|
6
|
+
// script portable to Windows' cmd.exe script shell.
|
|
7
|
+
import { spawnSync } from "node:child_process";
|
|
8
|
+
|
|
9
|
+
const HEAP_DEFAULT = "--max-old-space-size=8192";
|
|
10
|
+
const existing = process.env.NODE_OPTIONS?.trim();
|
|
11
|
+
// Caller-supplied NODE_OPTIONS goes last so V8's last-wins parsing lets
|
|
12
|
+
// callers override the default heap limit.
|
|
13
|
+
const nodeOptions = existing ? `${HEAP_DEFAULT} ${existing}` : HEAP_DEFAULT;
|
|
14
|
+
|
|
15
|
+
const result = spawnSync("tsup", process.argv.slice(2), {
|
|
16
|
+
stdio: "inherit",
|
|
17
|
+
env: { ...process.env, NODE_OPTIONS: nodeOptions },
|
|
18
|
+
// .bin shims are .cmd files on Windows and need a shell to execute.
|
|
19
|
+
shell: process.platform === "win32",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (result.error) {
|
|
23
|
+
console.error(`[build-with-heap] failed to launch tsup: ${result.error.message}`);
|
|
24
|
+
}
|
|
25
|
+
process.exit(result.status ?? 1);
|
package/src/namespaces/search.ts
CHANGED
|
@@ -109,6 +109,22 @@ export class NamespaceSearchRouter {
|
|
|
109
109
|
namespaces.map(async (namespace) => {
|
|
110
110
|
const record = await this.backendRecordFor(namespace);
|
|
111
111
|
if (!record.available || record.collectionState === "missing") {
|
|
112
|
+
// A per-namespace backend that is unavailable (or missing its
|
|
113
|
+
// collection) must report like any other QMD skip (#1536): its
|
|
114
|
+
// empty contribution is otherwise indistinguishable from a true
|
|
115
|
+
// no-matches for that namespace (codex round-5 review on #1544).
|
|
116
|
+
try {
|
|
117
|
+
options.execution?.onDegradation?.({
|
|
118
|
+
backend: "qmd",
|
|
119
|
+
code: "backend_unavailable",
|
|
120
|
+
detail:
|
|
121
|
+
record.collectionState === "missing"
|
|
122
|
+
? `namespace collection missing: ${namespace}`
|
|
123
|
+
: `namespace backend unavailable: ${namespace}`,
|
|
124
|
+
});
|
|
125
|
+
} catch {
|
|
126
|
+
// Observers must never break search.
|
|
127
|
+
}
|
|
112
128
|
return { namespace, results: [] as QmdSearchResult[] };
|
|
113
129
|
}
|
|
114
130
|
const backendLimit = backendSearchLimit(record, maxResults);
|
package/src/orchestrator.ts
CHANGED
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
import { findUnresolvedEntityRefs } from "./reconstruct.js";
|
|
53
53
|
import type {
|
|
54
54
|
SearchBackend,
|
|
55
|
+
SearchDegradation,
|
|
55
56
|
SearchExecutionOptions,
|
|
56
57
|
SearchQueryOptions,
|
|
57
58
|
} from "./search/port.js";
|
|
@@ -6392,6 +6393,8 @@ export class Orchestrator {
|
|
|
6392
6393
|
queryAwarePrefilter?: QueryAwarePrefilter;
|
|
6393
6394
|
searchOptions?: SearchQueryOptions;
|
|
6394
6395
|
onDebugSnapshot?: (snapshot: QmdRecallSnapshot) => Promise<void>;
|
|
6396
|
+
/** Backend degradation observer, threaded into every QMD call (#1536). */
|
|
6397
|
+
onDegradation?: (degradation: SearchDegradation) => void;
|
|
6395
6398
|
abortSignal?: AbortSignal;
|
|
6396
6399
|
},
|
|
6397
6400
|
): Promise<QmdSearchResult[]> {
|
|
@@ -6497,6 +6500,7 @@ export class Orchestrator {
|
|
|
6497
6500
|
primarySearchOptions,
|
|
6498
6501
|
{
|
|
6499
6502
|
signal: options.abortSignal,
|
|
6503
|
+
onDegradation: options.onDegradation,
|
|
6500
6504
|
},
|
|
6501
6505
|
)
|
|
6502
6506
|
: await this.qmd.search(
|
|
@@ -6504,6 +6508,7 @@ export class Orchestrator {
|
|
|
6504
6508
|
options.collection,
|
|
6505
6509
|
fetchLimit,
|
|
6506
6510
|
primarySearchOptions,
|
|
6511
|
+
{ onDegradation: options.onDegradation },
|
|
6507
6512
|
)
|
|
6508
6513
|
: await this.searchAcrossNamespaces({
|
|
6509
6514
|
query: prompt,
|
|
@@ -6513,7 +6518,10 @@ export class Orchestrator {
|
|
|
6513
6518
|
maxResults: fetchLimit,
|
|
6514
6519
|
mode: "search",
|
|
6515
6520
|
searchOptions: primarySearchOptions,
|
|
6516
|
-
execution: {
|
|
6521
|
+
execution: {
|
|
6522
|
+
signal: options.abortSignal,
|
|
6523
|
+
onDegradation: options.onDegradation,
|
|
6524
|
+
},
|
|
6517
6525
|
});
|
|
6518
6526
|
lastPrimaryResultCount = primaryResults.length;
|
|
6519
6527
|
lastHybridResultCount = 0;
|
|
@@ -6543,6 +6551,7 @@ export class Orchestrator {
|
|
|
6543
6551
|
fetchLimit,
|
|
6544
6552
|
{
|
|
6545
6553
|
signal: options.abortSignal,
|
|
6554
|
+
onDegradation: options.onDegradation,
|
|
6546
6555
|
},
|
|
6547
6556
|
)
|
|
6548
6557
|
: await this.searchAcrossNamespaces({
|
|
@@ -6552,7 +6561,10 @@ export class Orchestrator {
|
|
|
6552
6561
|
: undefined,
|
|
6553
6562
|
maxResults: fetchLimit,
|
|
6554
6563
|
mode: "hybrid",
|
|
6555
|
-
execution: {
|
|
6564
|
+
execution: {
|
|
6565
|
+
signal: options.abortSignal,
|
|
6566
|
+
onDegradation: options.onDegradation,
|
|
6567
|
+
},
|
|
6556
6568
|
});
|
|
6557
6569
|
lastHybridResultCount = hybridResults.length;
|
|
6558
6570
|
lastHybridTopUpUsed = hybridResults.length > 0;
|
|
@@ -7241,6 +7253,11 @@ export class Orchestrator {
|
|
|
7241
7253
|
options: RecallInvocationOptions = {},
|
|
7242
7254
|
): Promise<string> {
|
|
7243
7255
|
const recallStart = Date.now();
|
|
7256
|
+
// Backend degradations observed by this recall's QMD searches (#1536):
|
|
7257
|
+
// collected via the execution-options observer and attached to the
|
|
7258
|
+
// LastRecallSnapshot after it is recorded, so surfaces can distinguish
|
|
7259
|
+
// "no matches" from "backend could not answer" (CLAUDE.md rule 34).
|
|
7260
|
+
const backendDegradations: SearchDegradation[] = [];
|
|
7244
7261
|
// Issue #680 — historical recall. Parse `options.asOf` once at the
|
|
7245
7262
|
// top of the recall so each boost-pass uses identical filter logic.
|
|
7246
7263
|
// Invalid values are rejected at input boundaries (CLI / HTTP / MCP)
|
|
@@ -9230,12 +9247,39 @@ export class Orchestrator {
|
|
|
9230
9247
|
* an exact entity-name match) are not discarded just because the QMD
|
|
9231
9248
|
* contextual pass returned a weak result. */
|
|
9232
9249
|
maxSpecializedScore: number;
|
|
9250
|
+
/**
|
|
9251
|
+
* Degradations observed while producing this phase result (#1536).
|
|
9252
|
+
* Cached WITH the result so cache hits replay them — a served-from-
|
|
9253
|
+
* cache partial result must still explain why it is partial (codex
|
|
9254
|
+
* round-4 review on #1544).
|
|
9255
|
+
*/
|
|
9256
|
+
degradations?: SearchDegradation[];
|
|
9233
9257
|
} | null;
|
|
9234
9258
|
|
|
9235
9259
|
const qmdEnrichmentAbort = createEnrichmentAbortHandle(options.abortSignal);
|
|
9236
9260
|
const qmdPromise = observeEnrichmentPromise(
|
|
9237
9261
|
(async (): Promise<QmdPhaseResult> => {
|
|
9238
9262
|
const t0 = Date.now();
|
|
9263
|
+
// Degradation accounting for this phase (#1536): everything pushed
|
|
9264
|
+
// after this mark belongs to this phase and is cached with its
|
|
9265
|
+
// result; cache hits and stale fallbacks replay stored degradations
|
|
9266
|
+
// so served-from-cache results still explain their gaps, and every
|
|
9267
|
+
// path that skips QMD entirely reports backend_unavailable.
|
|
9268
|
+
const phaseDegradationsStart = backendDegradations.length;
|
|
9269
|
+
const replayCachedDegradations = (value: {
|
|
9270
|
+
degradations?: SearchDegradation[];
|
|
9271
|
+
}) => {
|
|
9272
|
+
for (const degradation of value.degradations ?? []) {
|
|
9273
|
+
backendDegradations.push(degradation);
|
|
9274
|
+
}
|
|
9275
|
+
};
|
|
9276
|
+
const reportRecallQmdUnavailable = (detail: string) => {
|
|
9277
|
+
backendDegradations.push({
|
|
9278
|
+
backend: "qmd",
|
|
9279
|
+
code: "backend_unavailable",
|
|
9280
|
+
detail,
|
|
9281
|
+
});
|
|
9282
|
+
};
|
|
9239
9283
|
if (recallResultLimit <= 0) {
|
|
9240
9284
|
recordRecallSectionMetric({
|
|
9241
9285
|
section: "qmd",
|
|
@@ -9287,6 +9331,7 @@ export class Orchestrator {
|
|
|
9287
9331
|
success: true,
|
|
9288
9332
|
timing: `${Math.max(0, Math.round(cachedQmd.ageMs))}ms-cache`,
|
|
9289
9333
|
});
|
|
9334
|
+
replayCachedDegradations(cachedQmd.value);
|
|
9290
9335
|
if (queryAwarePrefilterIsEmpty) {
|
|
9291
9336
|
return emptyQueryAwareQmdResult;
|
|
9292
9337
|
}
|
|
@@ -9310,6 +9355,8 @@ export class Orchestrator {
|
|
|
9310
9355
|
success: true,
|
|
9311
9356
|
timing: `stale-cache(reprobe-cooldown:${Math.max(0, Math.round(staleQmdFallback.ageMs))}ms)`,
|
|
9312
9357
|
});
|
|
9358
|
+
reportRecallQmdUnavailable("served stale recall cache (reprobe cooldown)");
|
|
9359
|
+
replayCachedDegradations(staleQmdFallback.value);
|
|
9313
9360
|
if (queryAwarePrefilterIsEmpty) {
|
|
9314
9361
|
return emptyQueryAwareQmdResult;
|
|
9315
9362
|
}
|
|
@@ -9324,6 +9371,7 @@ export class Orchestrator {
|
|
|
9324
9371
|
success: true,
|
|
9325
9372
|
timing: "skip(reprobe-cooldown)",
|
|
9326
9373
|
});
|
|
9374
|
+
reportRecallQmdUnavailable("recall skipped QMD (reprobe cooldown)");
|
|
9327
9375
|
return null;
|
|
9328
9376
|
}
|
|
9329
9377
|
this.lastQmdReprobeAtMs = now;
|
|
@@ -9339,6 +9387,8 @@ export class Orchestrator {
|
|
|
9339
9387
|
success: true,
|
|
9340
9388
|
timing: `stale-cache(reprobe-failed:${Math.max(0, Math.round(staleQmdFallback.ageMs))}ms)`,
|
|
9341
9389
|
});
|
|
9390
|
+
reportRecallQmdUnavailable("served stale recall cache (reprobe failed)");
|
|
9391
|
+
replayCachedDegradations(staleQmdFallback.value);
|
|
9342
9392
|
if (queryAwarePrefilterIsEmpty) {
|
|
9343
9393
|
return emptyQueryAwareQmdResult;
|
|
9344
9394
|
}
|
|
@@ -9356,6 +9406,7 @@ export class Orchestrator {
|
|
|
9356
9406
|
log.debug(
|
|
9357
9407
|
`Search skip (re-probe failed): ${this.qmd.debugStatus()}`,
|
|
9358
9408
|
);
|
|
9409
|
+
reportRecallQmdUnavailable("recall skipped QMD (reprobe failed)");
|
|
9359
9410
|
return null;
|
|
9360
9411
|
}
|
|
9361
9412
|
log.info(`QMD re-probe succeeded: ${this.qmd.debugStatus()}`);
|
|
@@ -9437,6 +9488,9 @@ export class Orchestrator {
|
|
|
9437
9488
|
queryAwarePrefilter,
|
|
9438
9489
|
searchOptions: qmdSearchOptions,
|
|
9439
9490
|
abortSignal: qmdEnrichmentAbort.signal,
|
|
9491
|
+
onDegradation: (degradation) => {
|
|
9492
|
+
backendDegradations.push(degradation);
|
|
9493
|
+
},
|
|
9440
9494
|
onDebugSnapshot: async (snapshot) => {
|
|
9441
9495
|
await this.recordLastQmdRecallSnapshot({
|
|
9442
9496
|
storage: profileStorage,
|
|
@@ -9487,11 +9541,17 @@ export class Orchestrator {
|
|
|
9487
9541
|
}
|
|
9488
9542
|
}
|
|
9489
9543
|
|
|
9544
|
+
const phaseDegradations = backendDegradations.slice(
|
|
9545
|
+
phaseDegradationsStart,
|
|
9546
|
+
);
|
|
9490
9547
|
const result = {
|
|
9491
9548
|
memoryResultsLists: [augmentedResults],
|
|
9492
9549
|
globalResults: [],
|
|
9493
9550
|
preAugmentTopScore,
|
|
9494
9551
|
maxSpecializedScore,
|
|
9552
|
+
...(phaseDegradations.length > 0
|
|
9553
|
+
? { degradations: phaseDegradations }
|
|
9554
|
+
: {}),
|
|
9495
9555
|
};
|
|
9496
9556
|
if (
|
|
9497
9557
|
augmentedResults.length > 0 ||
|
|
@@ -9521,6 +9581,8 @@ export class Orchestrator {
|
|
|
9521
9581
|
success: true,
|
|
9522
9582
|
timing: `stale-cache(${err instanceof Error ? err.message : String(err)})`,
|
|
9523
9583
|
});
|
|
9584
|
+
reportRecallQmdUnavailable("served stale recall cache (qmd phase error)");
|
|
9585
|
+
replayCachedDegradations(staleQmdFallback.value);
|
|
9524
9586
|
if (queryAwarePrefilterIsEmpty) {
|
|
9525
9587
|
return emptyQueryAwareQmdResult;
|
|
9526
9588
|
}
|
|
@@ -9542,7 +9604,23 @@ export class Orchestrator {
|
|
|
9542
9604
|
return null;
|
|
9543
9605
|
})
|
|
9544
9606
|
.finally(() => qmdEnrichmentAbort.dispose()),
|
|
9545
|
-
() =>
|
|
9607
|
+
() => {
|
|
9608
|
+
// The enrichment budget abandoned the hot QMD phase mid-flight
|
|
9609
|
+
// (#1536, codex round-7 on #1544): QmdClient treats this abort as
|
|
9610
|
+
// caller cancellation and never reports, so report the abandonment
|
|
9611
|
+
// deterministically here — the exact mirror of the cold-tier
|
|
9612
|
+
// deadline gate. Guarded: a CALLER abort also routes through this
|
|
9613
|
+
// cancel callback, and an aborted recall is not a backend
|
|
9614
|
+
// degradation (no snapshot is recorded for it anyway).
|
|
9615
|
+
if (!options.abortSignal?.aborted) {
|
|
9616
|
+
backendDegradations.push({
|
|
9617
|
+
backend: "qmd",
|
|
9618
|
+
code: "deadline_exceeded",
|
|
9619
|
+
detail: "hot qmd enrichment abandoned (enrichment deadline)",
|
|
9620
|
+
});
|
|
9621
|
+
}
|
|
9622
|
+
qmdEnrichmentAbort.cancel();
|
|
9623
|
+
},
|
|
9546
9624
|
);
|
|
9547
9625
|
|
|
9548
9626
|
const transcriptPromise = (async (): Promise<string | null> => {
|
|
@@ -11329,6 +11407,9 @@ export class Orchestrator {
|
|
|
11329
11407
|
recallMode,
|
|
11330
11408
|
queryAwarePrefilter,
|
|
11331
11409
|
abortSignal: options.abortSignal,
|
|
11410
|
+
onDegradation: (degradation) => {
|
|
11411
|
+
backendDegradations.push(degradation);
|
|
11412
|
+
},
|
|
11332
11413
|
xrayPoolSizeSink: xrayColdPoolSink,
|
|
11333
11414
|
deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
|
|
11334
11415
|
asOfMs,
|
|
@@ -11551,6 +11632,9 @@ export class Orchestrator {
|
|
|
11551
11632
|
recallMode,
|
|
11552
11633
|
queryAwarePrefilter,
|
|
11553
11634
|
abortSignal: options.abortSignal,
|
|
11635
|
+
onDegradation: (degradation) => {
|
|
11636
|
+
backendDegradations.push(degradation);
|
|
11637
|
+
},
|
|
11554
11638
|
xrayPoolSizeSink: xrayColdPoolSink,
|
|
11555
11639
|
deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
|
|
11556
11640
|
asOfMs,
|
|
@@ -11660,6 +11744,9 @@ export class Orchestrator {
|
|
|
11660
11744
|
recallMode,
|
|
11661
11745
|
queryAwarePrefilter,
|
|
11662
11746
|
abortSignal: options.abortSignal,
|
|
11747
|
+
onDegradation: (degradation) => {
|
|
11748
|
+
backendDegradations.push(degradation);
|
|
11749
|
+
},
|
|
11663
11750
|
xrayPoolSizeSink: xrayColdPoolSink,
|
|
11664
11751
|
deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
|
|
11665
11752
|
asOfMs,
|
|
@@ -11704,6 +11791,9 @@ export class Orchestrator {
|
|
|
11704
11791
|
recallMode,
|
|
11705
11792
|
queryAwarePrefilter,
|
|
11706
11793
|
abortSignal: options.abortSignal,
|
|
11794
|
+
onDegradation: (degradation) => {
|
|
11795
|
+
backendDegradations.push(degradation);
|
|
11796
|
+
},
|
|
11707
11797
|
xrayPoolSizeSink: xrayColdPoolSink,
|
|
11708
11798
|
deadlineAtMs: enrichmentAssemblyDeadlineAtMs,
|
|
11709
11799
|
asOfMs,
|
|
@@ -12105,6 +12195,13 @@ export class Orchestrator {
|
|
|
12105
12195
|
injectedChars: identityInjectedChars,
|
|
12106
12196
|
truncated: identityInjectionTruncated,
|
|
12107
12197
|
},
|
|
12198
|
+
// Included at record time so the published snapshot is born
|
|
12199
|
+
// annotated — a post-record annotation leaves a window where
|
|
12200
|
+
// readers see the snapshot without degradations, and a concurrent
|
|
12201
|
+
// same-session recall could drop them entirely (codex + cursor
|
|
12202
|
+
// reviews on #1544).
|
|
12203
|
+
backendDegradations:
|
|
12204
|
+
backendDegradations.length > 0 ? backendDegradations : undefined,
|
|
12108
12205
|
})
|
|
12109
12206
|
.catch((err) => log.debug(`last recall record failed: ${err}`));
|
|
12110
12207
|
}
|
|
@@ -18577,6 +18674,8 @@ export class Orchestrator {
|
|
|
18577
18674
|
recallMode: RecallPlanMode;
|
|
18578
18675
|
queryAwarePrefilter?: QueryAwarePrefilter;
|
|
18579
18676
|
abortSignal?: AbortSignal;
|
|
18677
|
+
/** Backend degradation observer — cold-tier QMD must report like hot (#1536). */
|
|
18678
|
+
onDegradation?: (degradation: SearchDegradation) => void;
|
|
18580
18679
|
/** Issue #680 — historical recall point in ms-since-epoch. */
|
|
18581
18680
|
asOfMs?: number;
|
|
18582
18681
|
/**
|
|
@@ -18604,10 +18703,19 @@ export class Orchestrator {
|
|
|
18604
18703
|
label: string,
|
|
18605
18704
|
fallback: T,
|
|
18606
18705
|
task: () => Promise<T>,
|
|
18706
|
+
// Invoked when the deadline abandons this step (before it started or
|
|
18707
|
+
// while it runs), so callers can report the abandonment and gate off
|
|
18708
|
+
// late observer callbacks (#1536, cursor round-6 on #1544).
|
|
18709
|
+
onDeadline?: () => void,
|
|
18607
18710
|
): Promise<T> => {
|
|
18608
18711
|
throwIfRecallAborted(options.abortSignal);
|
|
18609
18712
|
const remainingMs = deadlineRemainingMs();
|
|
18610
18713
|
if (remainingMs === 0) {
|
|
18714
|
+
try {
|
|
18715
|
+
onDeadline?.();
|
|
18716
|
+
} catch {
|
|
18717
|
+
// Observers must never break recall.
|
|
18718
|
+
}
|
|
18611
18719
|
log.debug(`cold-tier recall ${label} skipped: shared assembly deadline expired`);
|
|
18612
18720
|
return fallback;
|
|
18613
18721
|
}
|
|
@@ -18629,6 +18737,11 @@ export class Orchestrator {
|
|
|
18629
18737
|
new Promise<T>((resolve) => {
|
|
18630
18738
|
timeoutHandle = setTimeout(() => {
|
|
18631
18739
|
timedOut = true;
|
|
18740
|
+
try {
|
|
18741
|
+
onDeadline?.();
|
|
18742
|
+
} catch {
|
|
18743
|
+
// Observers must never break recall.
|
|
18744
|
+
}
|
|
18632
18745
|
log.debug(
|
|
18633
18746
|
`cold-tier recall ${label} skipped: shared assembly deadline expired`,
|
|
18634
18747
|
);
|
|
@@ -18659,6 +18772,24 @@ export class Orchestrator {
|
|
|
18659
18772
|
false,
|
|
18660
18773
|
0,
|
|
18661
18774
|
);
|
|
18775
|
+
// Deadline-gated observer (#1536, cursor round-6 on #1544): when the
|
|
18776
|
+
// shared assembly deadline abandons this lookup, the still-running
|
|
18777
|
+
// fetch's LATE reports must not land after the recall snapshot has
|
|
18778
|
+
// been recorded — gate them off and report the abandonment itself
|
|
18779
|
+
// deterministically at resolution time instead.
|
|
18780
|
+
let coldQmdObserverActive = true;
|
|
18781
|
+
const reportColdQmdDeadline = () => {
|
|
18782
|
+
coldQmdObserverActive = false;
|
|
18783
|
+
try {
|
|
18784
|
+
options.onDegradation?.({
|
|
18785
|
+
backend: "qmd",
|
|
18786
|
+
code: "deadline_exceeded",
|
|
18787
|
+
detail: "cold-tier qmd lookup abandoned (assembly deadline)",
|
|
18788
|
+
});
|
|
18789
|
+
} catch {
|
|
18790
|
+
// Observers must never break recall.
|
|
18791
|
+
}
|
|
18792
|
+
};
|
|
18662
18793
|
longTerm = await runColdStepWithinDeadline(
|
|
18663
18794
|
"qmd lookup",
|
|
18664
18795
|
[],
|
|
@@ -18675,9 +18806,19 @@ export class Orchestrator {
|
|
|
18675
18806
|
queryAwarePrefilter: options.queryAwarePrefilter,
|
|
18676
18807
|
searchOptions: this.buildConfiguredQmdSearchOptions(options.prompt),
|
|
18677
18808
|
abortSignal: options.abortSignal,
|
|
18809
|
+
onDegradation: (degradation) => {
|
|
18810
|
+
if (coldQmdObserverActive) {
|
|
18811
|
+
options.onDegradation?.(degradation);
|
|
18812
|
+
}
|
|
18813
|
+
},
|
|
18678
18814
|
},
|
|
18679
18815
|
),
|
|
18816
|
+
reportColdQmdDeadline,
|
|
18680
18817
|
);
|
|
18818
|
+
// Normal completion also closes the gate: a deadline that fires
|
|
18819
|
+
// after this await has nothing left to suppress, and a fetch that
|
|
18820
|
+
// limps home later cannot mutate a recorded recall's collector.
|
|
18821
|
+
coldQmdObserverActive = false;
|
|
18681
18822
|
if (longTerm.length > 0) {
|
|
18682
18823
|
log.debug(
|
|
18683
18824
|
`cold-tier recall source=cold-qmd collection=${coldCollection} hits=${longTerm.length}`,
|