@remnic/core 1.0.3 → 1.1.0
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/abort-error.d.ts +32 -0
- package/dist/abort-error.js +11 -0
- package/dist/access-cli.js +41 -40
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +3 -2
- package/dist/access-http.js +11 -11
- package/dist/access-mcp.d.ts +3 -2
- package/dist/access-mcp.js +7 -7
- package/dist/access-schema.d.ts +16 -16
- package/dist/access-service-HmO1Trrx.d.ts +732 -0
- package/dist/access-service.d.ts +11 -658
- package/dist/access-service.js +9 -9
- package/dist/bootstrap.d.ts +1 -1
- package/dist/briefing.js +6 -6
- package/dist/calibration.js +3 -3
- package/dist/causal-consolidation.js +10 -10
- package/dist/{chunk-PMB3WGDL.js → chunk-37UIFYWO.js} +64 -3
- package/dist/chunk-37UIFYWO.js.map +1 -0
- package/dist/{chunk-X4WESCKA.js → chunk-3QHL5ABG.js} +5 -5
- package/dist/{chunk-2VFW5K5U.js → chunk-3SV6CQHO.js} +10 -8
- package/dist/chunk-3SV6CQHO.js.map +1 -0
- package/dist/{chunk-U2IQTSBY.js → chunk-3WHVNEN7.js} +1 -1
- package/dist/chunk-3WHVNEN7.js.map +1 -0
- package/dist/{chunk-QKAH5B6E.js → chunk-44ICJRF3.js} +97 -9
- package/dist/chunk-44ICJRF3.js.map +1 -0
- package/dist/{chunk-S4LX5EBI.js → chunk-47UU5PU2.js} +48 -9
- package/dist/chunk-47UU5PU2.js.map +1 -0
- package/dist/{chunk-ECKDIK5F.js → chunk-4LACOVZX.js} +2 -2
- package/dist/{chunk-AYPYCLR7.js → chunk-6LX5ORAS.js} +2 -2
- package/dist/{chunk-GJQPH5G3.js → chunk-6UJ47TVX.js} +2 -2
- package/dist/{chunk-KWP7T3DP.js → chunk-7ECD5ATE.js} +2 -2
- package/dist/{chunk-74JR4N5J.js → chunk-7WQ6SLIE.js} +2 -2
- package/dist/{chunk-7PA4OZEU.js → chunk-BLKTA7MM.js} +6 -14
- package/dist/chunk-BLKTA7MM.js.map +1 -0
- package/dist/{chunk-XMGSSBFX.js → chunk-DEPL3635.js} +172 -100
- package/dist/chunk-DEPL3635.js.map +1 -0
- package/dist/{chunk-JROGC36Y.js → chunk-DHHP2Z4X.js} +2 -2
- package/dist/{chunk-BKQJBXXX.js → chunk-GGD5W7TB.js} +2 -2
- package/dist/chunk-GGD5W7TB.js.map +1 -0
- package/dist/{chunk-POMSFKTB.js → chunk-GV6NLQ4X.js} +14 -14
- package/dist/{chunk-AAI7JARD.js → chunk-HMDCOMYU.js} +8 -11
- package/dist/chunk-HMDCOMYU.js.map +1 -0
- package/dist/{chunk-POBPGDWI.js → chunk-ITRLGI2T.js} +2 -2
- package/dist/{chunk-MYQWXITD.js → chunk-JIU55F3X.js} +2 -2
- package/dist/{chunk-UPMD5XND.js → chunk-JL2PU6AI.js} +16 -5
- package/dist/chunk-JL2PU6AI.js.map +1 -0
- package/dist/{chunk-OJFGVJS6.js → chunk-MBJHSA7F.js} +65 -9
- package/dist/chunk-MBJHSA7F.js.map +1 -0
- package/dist/{chunk-V7XCAHIB.js → chunk-MVTHXUBX.js} +46 -23
- package/dist/chunk-MVTHXUBX.js.map +1 -0
- package/dist/{chunk-BTY5RRRF.js → chunk-N42IWANG.js} +5 -5
- package/dist/{chunk-NSB3WSYS.js → chunk-NQEVYWX6.js} +74 -3
- package/dist/chunk-NQEVYWX6.js.map +1 -0
- package/dist/chunk-OIT5QGG4.js +80 -0
- package/dist/chunk-OIT5QGG4.js.map +1 -0
- package/dist/chunk-PVGDJXVK.js +21 -0
- package/dist/chunk-PVGDJXVK.js.map +1 -0
- package/dist/{chunk-RCICHSHL.js → chunk-SYUK3VLY.js} +2 -2
- package/dist/{chunk-YFYL2SIJ.js → chunk-WBSAYXVI.js} +127 -39
- package/dist/chunk-WBSAYXVI.js.map +1 -0
- package/dist/{chunk-KEG4GNGI.js → chunk-XZ2TIKGC.js} +38 -8
- package/dist/chunk-XZ2TIKGC.js.map +1 -0
- package/dist/chunk-Y4FHOFJ2.js +140 -0
- package/dist/chunk-Y4FHOFJ2.js.map +1 -0
- package/dist/chunk-YNB73F22.js +137 -0
- package/dist/chunk-YNB73F22.js.map +1 -0
- package/dist/{chunk-HITJFT7E.js → chunk-ZVBB3T7V.js} +10 -5
- package/dist/chunk-ZVBB3T7V.js.map +1 -0
- package/dist/{cli-DwIBnp2g.d.ts → cli-BneVIEvh.d.ts} +2 -2
- package/dist/cli.d.ts +4 -3
- package/dist/cli.js +25 -24
- package/dist/config.js +1 -1
- package/dist/contradiction-review-WIUBAR52.js +21 -0
- package/dist/contradiction-review-WIUBAR52.js.map +1 -0
- package/dist/contradiction-scan-GR33PONM.js +376 -0
- package/dist/contradiction-scan-GR33PONM.js.map +1 -0
- package/dist/direct-answer-wiring.d.ts +77 -0
- package/dist/direct-answer-wiring.js +75 -0
- package/dist/direct-answer-wiring.js.map +1 -0
- package/dist/direct-answer.d.ts +106 -0
- package/dist/direct-answer.js +10 -0
- package/dist/direct-answer.js.map +1 -0
- package/dist/{engine-X7X3AAG3.js → engine-5TIQBYZR.js} +7 -7
- package/dist/engine-5TIQBYZR.js.map +1 -0
- package/dist/entity-retrieval.js +6 -6
- package/dist/explicit-capture.d.ts +1 -1
- package/dist/extraction.js +6 -6
- package/dist/fallback-llm.d.ts +11 -2
- package/dist/fallback-llm.js +3 -3
- package/dist/harmonic-retrieval.js +2 -1
- package/dist/index.d.ts +10 -124
- package/dist/index.js +74 -137
- package/dist/index.js.map +1 -1
- package/dist/intent.js +1 -1
- package/dist/local-llm.d.ts +10 -3
- package/dist/local-llm.js +1 -1
- package/dist/operator-toolkit.js +12 -11
- package/dist/{orchestrator-B9kwlCep.d.ts → orchestrator-DRYA6_lW.d.ts} +21 -2
- package/dist/orchestrator.d.ts +1 -1
- package/dist/orchestrator.js +36 -35
- package/dist/qmd.js +2 -1
- package/dist/recall-state.d.ts +28 -1
- package/dist/recall-state.js +1 -1
- package/dist/resolution-QBTDHTG7.js +100 -0
- package/dist/resolution-QBTDHTG7.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +24 -1
- package/dist/resolve-provider-secret.js +3 -1
- package/dist/resume-bundles.js +3 -3
- package/dist/schemas.d.ts +14 -14
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +6 -6
- package/dist/semantic-rule-verifier.js +6 -6
- package/dist/storage.js +5 -5
- package/dist/summarizer.js +5 -5
- package/dist/types-DJhqDJUV.d.ts +50 -0
- package/dist/types.d.ts +34 -2
- package/dist/types.js +1 -1
- package/dist/verified-recall.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-2VFW5K5U.js.map +0 -1
- package/dist/chunk-7PA4OZEU.js.map +0 -1
- package/dist/chunk-AAI7JARD.js.map +0 -1
- package/dist/chunk-BKQJBXXX.js.map +0 -1
- package/dist/chunk-HITJFT7E.js.map +0 -1
- package/dist/chunk-KEG4GNGI.js.map +0 -1
- package/dist/chunk-NSB3WSYS.js.map +0 -1
- package/dist/chunk-OJFGVJS6.js.map +0 -1
- package/dist/chunk-PMB3WGDL.js.map +0 -1
- package/dist/chunk-QKAH5B6E.js.map +0 -1
- package/dist/chunk-S4LX5EBI.js.map +0 -1
- package/dist/chunk-U2IQTSBY.js.map +0 -1
- package/dist/chunk-UPMD5XND.js.map +0 -1
- package/dist/chunk-V7XCAHIB.js.map +0 -1
- package/dist/chunk-XMGSSBFX.js.map +0 -1
- package/dist/chunk-YFYL2SIJ.js.map +0 -1
- /package/dist/{engine-X7X3AAG3.js.map → abort-error.js.map} +0 -0
- /package/dist/{chunk-X4WESCKA.js.map → chunk-3QHL5ABG.js.map} +0 -0
- /package/dist/{chunk-ECKDIK5F.js.map → chunk-4LACOVZX.js.map} +0 -0
- /package/dist/{chunk-AYPYCLR7.js.map → chunk-6LX5ORAS.js.map} +0 -0
- /package/dist/{chunk-GJQPH5G3.js.map → chunk-6UJ47TVX.js.map} +0 -0
- /package/dist/{chunk-KWP7T3DP.js.map → chunk-7ECD5ATE.js.map} +0 -0
- /package/dist/{chunk-74JR4N5J.js.map → chunk-7WQ6SLIE.js.map} +0 -0
- /package/dist/{chunk-JROGC36Y.js.map → chunk-DHHP2Z4X.js.map} +0 -0
- /package/dist/{chunk-POMSFKTB.js.map → chunk-GV6NLQ4X.js.map} +0 -0
- /package/dist/{chunk-POBPGDWI.js.map → chunk-ITRLGI2T.js.map} +0 -0
- /package/dist/{chunk-MYQWXITD.js.map → chunk-JIU55F3X.js.map} +0 -0
- /package/dist/{chunk-BTY5RRRF.js.map → chunk-N42IWANG.js.map} +0 -0
- /package/dist/{chunk-RCICHSHL.js.map → chunk-SYUK3VLY.js.map} +0 -0
|
@@ -2,12 +2,18 @@ import {
|
|
|
2
2
|
CompoundingEngine,
|
|
3
3
|
SharedContextManager,
|
|
4
4
|
defaultTierMigrationCycleBudget
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DHHP2Z4X.js";
|
|
6
|
+
import {
|
|
7
|
+
extractTopics
|
|
8
|
+
} from "./chunk-UHGBNIOS.js";
|
|
6
9
|
import {
|
|
7
10
|
applyUtilityPromotionRuntimePolicy,
|
|
8
11
|
applyUtilityRankingRuntimeDelta,
|
|
9
12
|
loadUtilityRuntimeValues
|
|
10
13
|
} from "./chunk-FSFEQI74.js";
|
|
14
|
+
import {
|
|
15
|
+
HourlySummarizer
|
|
16
|
+
} from "./chunk-N42IWANG.js";
|
|
11
17
|
import {
|
|
12
18
|
applyTemporalSupersession,
|
|
13
19
|
normalizeSupersessionKey,
|
|
@@ -23,17 +29,17 @@ import {
|
|
|
23
29
|
TmtBuilder
|
|
24
30
|
} from "./chunk-TPB3I2AC.js";
|
|
25
31
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import {
|
|
29
|
-
HourlySummarizer
|
|
30
|
-
} from "./chunk-BTY5RRRF.js";
|
|
32
|
+
SessionObserverState
|
|
33
|
+
} from "./chunk-JR4ZC3G4.js";
|
|
31
34
|
import {
|
|
32
35
|
semanticChunkContent
|
|
33
36
|
} from "./chunk-KVE7R4CG.js";
|
|
34
37
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
findUnresolvedEntityRefs
|
|
39
|
+
} from "./chunk-X7XN6YU4.js";
|
|
40
|
+
import {
|
|
41
|
+
RelevanceStore
|
|
42
|
+
} from "./chunk-5NPGSAVB.js";
|
|
37
43
|
import {
|
|
38
44
|
RerankCache,
|
|
39
45
|
rerankLocalOrNoop
|
|
@@ -59,6 +65,11 @@ import {
|
|
|
59
65
|
import {
|
|
60
66
|
applyRuntimeRetrievalPolicy
|
|
61
67
|
} from "./chunk-5IZL4DCV.js";
|
|
68
|
+
import {
|
|
69
|
+
buildQmdRecallCacheKey,
|
|
70
|
+
getCachedQmdRecall,
|
|
71
|
+
setCachedQmdRecall
|
|
72
|
+
} from "./chunk-YCN4BVDK.js";
|
|
62
73
|
import {
|
|
63
74
|
reorderRecallResultsWithMmr
|
|
64
75
|
} from "./chunk-YDBIWGNI.js";
|
|
@@ -69,42 +80,23 @@ import {
|
|
|
69
80
|
LastRecallStore,
|
|
70
81
|
TierMigrationStatusStore,
|
|
71
82
|
clampGraphRecallExpandedEntries
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import {
|
|
74
|
-
findUnresolvedEntityRefs
|
|
75
|
-
} from "./chunk-X7XN6YU4.js";
|
|
76
|
-
import {
|
|
77
|
-
RelevanceStore
|
|
78
|
-
} from "./chunk-5NPGSAVB.js";
|
|
79
|
-
import {
|
|
80
|
-
buildQmdRecallCacheKey,
|
|
81
|
-
getCachedQmdRecall,
|
|
82
|
-
setCachedQmdRecall
|
|
83
|
-
} from "./chunk-YCN4BVDK.js";
|
|
83
|
+
} from "./chunk-47UU5PU2.js";
|
|
84
84
|
import {
|
|
85
85
|
NegativeExampleStore
|
|
86
86
|
} from "./chunk-D654IBA6.js";
|
|
87
87
|
import {
|
|
88
88
|
evaluateMemoryActionPolicy
|
|
89
89
|
} from "./chunk-H63EDPFJ.js";
|
|
90
|
+
import {
|
|
91
|
+
classifyMemoryKind
|
|
92
|
+
} from "./chunk-YAZNBMNF.js";
|
|
90
93
|
import {
|
|
91
94
|
hasBroadGraphIntent,
|
|
92
95
|
inferIntentFromText,
|
|
93
96
|
intentCompatibilityScore,
|
|
94
97
|
isTaskInitiationIntent,
|
|
95
98
|
planRecallMode
|
|
96
|
-
} from "./chunk-
|
|
97
|
-
import {
|
|
98
|
-
classifyMemoryKind
|
|
99
|
-
} from "./chunk-YAZNBMNF.js";
|
|
100
|
-
import {
|
|
101
|
-
EmbeddingFallback
|
|
102
|
-
} from "./chunk-ALXMCZEU.js";
|
|
103
|
-
import {
|
|
104
|
-
buildEntityRecallSection,
|
|
105
|
-
entityRecentTranscriptLookbackHours,
|
|
106
|
-
readRecentEntityTranscriptEntries
|
|
107
|
-
} from "./chunk-74JR4N5J.js";
|
|
99
|
+
} from "./chunk-GGD5W7TB.js";
|
|
108
100
|
import {
|
|
109
101
|
createVerdictCache,
|
|
110
102
|
judgeFactDurability,
|
|
@@ -112,44 +104,49 @@ import {
|
|
|
112
104
|
} from "./chunk-LAYN4LDC.js";
|
|
113
105
|
import {
|
|
114
106
|
ExtractionEngine
|
|
115
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-3SV6CQHO.js";
|
|
116
108
|
import {
|
|
117
109
|
parseMemoryActionEligibilityContext
|
|
118
110
|
} from "./chunk-UEYA6UC7.js";
|
|
119
111
|
import {
|
|
120
112
|
ProfilingCollector
|
|
121
113
|
} from "./chunk-NBNN5GOB.js";
|
|
122
|
-
import {
|
|
123
|
-
LocalLlmClient
|
|
124
|
-
} from "./chunk-UPMD5XND.js";
|
|
125
114
|
import {
|
|
126
115
|
ModelRegistry
|
|
127
116
|
} from "./chunk-FEMOX5AD.js";
|
|
117
|
+
import {
|
|
118
|
+
LocalLlmClient
|
|
119
|
+
} from "./chunk-JL2PU6AI.js";
|
|
120
|
+
import {
|
|
121
|
+
formatDaySummaryMemories
|
|
122
|
+
} from "./chunk-GZCUW5IC.js";
|
|
123
|
+
import {
|
|
124
|
+
EmbeddingFallback
|
|
125
|
+
} from "./chunk-ALXMCZEU.js";
|
|
126
|
+
import {
|
|
127
|
+
buildEntityRecallSection,
|
|
128
|
+
entityRecentTranscriptLookbackHours,
|
|
129
|
+
readRecentEntityTranscriptEntries
|
|
130
|
+
} from "./chunk-7WQ6SLIE.js";
|
|
128
131
|
import {
|
|
129
132
|
RoutingRulesStore,
|
|
130
133
|
normalizeReplaySessionKey
|
|
131
134
|
} from "./chunk-PAORGQRI.js";
|
|
132
135
|
import {
|
|
133
136
|
searchVerifiedEpisodes
|
|
134
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-6UJ47TVX.js";
|
|
135
138
|
import {
|
|
136
139
|
ThreadingManager
|
|
137
140
|
} from "./chunk-JRNQ3RNA.js";
|
|
138
141
|
import {
|
|
139
142
|
searchVerifiedSemanticRules
|
|
140
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-JIU55F3X.js";
|
|
141
144
|
import {
|
|
142
145
|
searchWorkProductLedgerEntries
|
|
143
146
|
} from "./chunk-CULXMQJH.js";
|
|
144
147
|
import {
|
|
145
148
|
TranscriptManager
|
|
146
149
|
} from "./chunk-E6K4NIEU.js";
|
|
147
|
-
import {
|
|
148
|
-
PolicyRuntimeManager
|
|
149
|
-
} from "./chunk-EABGC2TL.js";
|
|
150
|
-
import {
|
|
151
|
-
searchObjectiveStateSnapshots
|
|
152
|
-
} from "./chunk-LOBRX7VD.js";
|
|
153
150
|
import {
|
|
154
151
|
NamespaceSearchRouter,
|
|
155
152
|
NamespaceStorageRouter,
|
|
@@ -157,17 +154,23 @@ import {
|
|
|
157
154
|
createConversationIndexRuntime,
|
|
158
155
|
createSearchBackend,
|
|
159
156
|
writeConversationChunks
|
|
160
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-ZVBB3T7V.js";
|
|
161
158
|
import {
|
|
162
159
|
parseQmdExplain
|
|
163
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-BLKTA7MM.js";
|
|
161
|
+
import {
|
|
162
|
+
PolicyRuntimeManager
|
|
163
|
+
} from "./chunk-EABGC2TL.js";
|
|
164
|
+
import {
|
|
165
|
+
searchObjectiveStateSnapshots
|
|
166
|
+
} from "./chunk-LOBRX7VD.js";
|
|
167
|
+
import {
|
|
168
|
+
searchHarmonicRetrieval
|
|
169
|
+
} from "./chunk-HMDCOMYU.js";
|
|
164
170
|
import {
|
|
165
171
|
isAboveImportanceThreshold,
|
|
166
172
|
scoreImportance
|
|
167
173
|
} from "./chunk-J4IYOZZ5.js";
|
|
168
|
-
import {
|
|
169
|
-
searchHarmonicRetrieval
|
|
170
|
-
} from "./chunk-AAI7JARD.js";
|
|
171
174
|
import {
|
|
172
175
|
collectNativeKnowledgeChunks,
|
|
173
176
|
formatNativeKnowledgeSection,
|
|
@@ -188,16 +191,16 @@ import {
|
|
|
188
191
|
refineCompressionGuidelineCandidateSemantically,
|
|
189
192
|
renderCompressionGuidelinesMarkdown
|
|
190
193
|
} from "./chunk-2NMMFZ5T.js";
|
|
191
|
-
import {
|
|
192
|
-
formatDaySummaryMemories
|
|
193
|
-
} from "./chunk-GZCUW5IC.js";
|
|
194
194
|
import {
|
|
195
195
|
buildConsolidationPrompt,
|
|
196
196
|
buildExtensionsBlockForConsolidation,
|
|
197
197
|
findSimilarClusters,
|
|
198
198
|
materializeAfterSemanticConsolidation,
|
|
199
199
|
parseConsolidationResponse
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-SYUK3VLY.js";
|
|
201
|
+
import {
|
|
202
|
+
FallbackLlmClient
|
|
203
|
+
} from "./chunk-44ICJRF3.js";
|
|
201
204
|
import {
|
|
202
205
|
GraphIndex
|
|
203
206
|
} from "./chunk-C2EFFULQ.js";
|
|
@@ -224,8 +227,10 @@ import {
|
|
|
224
227
|
isDisagreementPrompt
|
|
225
228
|
} from "./chunk-XYIK4LF6.js";
|
|
226
229
|
import {
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
abortError,
|
|
231
|
+
isAbortError,
|
|
232
|
+
throwIfAborted
|
|
233
|
+
} from "./chunk-PVGDJXVK.js";
|
|
229
234
|
import {
|
|
230
235
|
resolveHomeDir
|
|
231
236
|
} from "./chunk-MARWOCVP.js";
|
|
@@ -244,6 +249,12 @@ import {
|
|
|
244
249
|
import {
|
|
245
250
|
searchCausalTrajectories
|
|
246
251
|
} from "./chunk-4NRAJUDS.js";
|
|
252
|
+
import {
|
|
253
|
+
canReadNamespace,
|
|
254
|
+
defaultNamespaceForPrincipal,
|
|
255
|
+
recallNamespacesForPrincipal,
|
|
256
|
+
resolvePrincipal
|
|
257
|
+
} from "./chunk-N5AKDXAI.js";
|
|
247
258
|
import {
|
|
248
259
|
decideLifecycleTransition,
|
|
249
260
|
resolveLifecycleState
|
|
@@ -256,10 +267,10 @@ import {
|
|
|
256
267
|
normalizeAttributePairs,
|
|
257
268
|
normalizeEntityName,
|
|
258
269
|
parseEntityFile
|
|
259
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-GV6NLQ4X.js";
|
|
260
271
|
import {
|
|
261
272
|
confidenceTier
|
|
262
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-3WHVNEN7.js";
|
|
263
274
|
import {
|
|
264
275
|
attachCitation,
|
|
265
276
|
hasCitationForTemplate,
|
|
@@ -278,12 +289,6 @@ import {
|
|
|
278
289
|
import {
|
|
279
290
|
log
|
|
280
291
|
} from "./chunk-2ODBA7MQ.js";
|
|
281
|
-
import {
|
|
282
|
-
canReadNamespace,
|
|
283
|
-
defaultNamespaceForPrincipal,
|
|
284
|
-
recallNamespacesForPrincipal,
|
|
285
|
-
resolvePrincipal
|
|
286
|
-
} from "./chunk-N5AKDXAI.js";
|
|
287
292
|
|
|
288
293
|
// src/orchestrator.ts
|
|
289
294
|
import path5 from "path";
|
|
@@ -901,6 +906,7 @@ import path2 from "path";
|
|
|
901
906
|
var DAY_SUMMARY_CRON_ID = "engram-day-summary";
|
|
902
907
|
var GOVERNANCE_CRON_ID = "engram-nightly-governance";
|
|
903
908
|
var PROCEDURAL_MINING_CRON_ID = "engram-procedural-mining";
|
|
909
|
+
var CONTRADICTION_SCAN_CRON_ID = "engram-contradiction-scan";
|
|
904
910
|
async function acquireCronJobsLock(jobsPath) {
|
|
905
911
|
const lockPath2 = `${jobsPath}.lock`;
|
|
906
912
|
const start = Date.now();
|
|
@@ -1037,6 +1043,30 @@ async function ensureProceduralMiningCron(jobsPath, options) {
|
|
|
1037
1043
|
delivery: { mode: "none" }
|
|
1038
1044
|
}));
|
|
1039
1045
|
}
|
|
1046
|
+
async function ensureContradictionScanCron(jobsPath, options) {
|
|
1047
|
+
const scheduleExpr = typeof options.scheduleExpr === "string" && options.scheduleExpr.trim().length > 0 ? options.scheduleExpr.trim() : "37 3 * * *";
|
|
1048
|
+
const agentId = typeof options.agentId === "string" && options.agentId.trim().length > 0 ? options.agentId.trim() : "main";
|
|
1049
|
+
return ensureCronJob(jobsPath, CONTRADICTION_SCAN_CRON_ID, () => ({
|
|
1050
|
+
id: CONTRADICTION_SCAN_CRON_ID,
|
|
1051
|
+
agentId,
|
|
1052
|
+
name: "Remnic Contradiction Scan (nightly)",
|
|
1053
|
+
enabled: true,
|
|
1054
|
+
schedule: {
|
|
1055
|
+
kind: "cron",
|
|
1056
|
+
expr: scheduleExpr,
|
|
1057
|
+
tz: options.timezone
|
|
1058
|
+
},
|
|
1059
|
+
sessionTarget: "isolated",
|
|
1060
|
+
wakeMode: "now",
|
|
1061
|
+
payload: {
|
|
1062
|
+
kind: "agentTurn",
|
|
1063
|
+
timeoutSeconds: 900,
|
|
1064
|
+
thinking: "off",
|
|
1065
|
+
message: "You are OpenClaw automation. Call tool `engram.contradiction_scan_run` with empty params. If successful output exactly NO_REPLY. On error output one concise line. Do NOT use message tool."
|
|
1066
|
+
},
|
|
1067
|
+
delivery: { mode: "none" }
|
|
1068
|
+
}));
|
|
1069
|
+
}
|
|
1040
1070
|
|
|
1041
1071
|
// src/dedup/semantic.ts
|
|
1042
1072
|
async function decideSemanticDedup(content, lookup, options) {
|
|
@@ -2463,15 +2493,9 @@ function fingerprintEntitySynthesisEvidence(entity) {
|
|
|
2463
2493
|
fingerprint.update(fingerprintEntityStructuredFacts(entity) ?? "");
|
|
2464
2494
|
return fingerprint.digest("hex");
|
|
2465
2495
|
}
|
|
2466
|
-
|
|
2467
|
-
const err = new Error(message);
|
|
2468
|
-
Object.defineProperty(err, "name", { value: "AbortError" });
|
|
2469
|
-
return err;
|
|
2470
|
-
}
|
|
2496
|
+
var abortRecallError = abortError;
|
|
2471
2497
|
function throwIfRecallAborted(signal, message = "recall aborted") {
|
|
2472
|
-
|
|
2473
|
-
throw abortRecallError(message);
|
|
2474
|
-
}
|
|
2498
|
+
throwIfAborted(signal, message);
|
|
2475
2499
|
}
|
|
2476
2500
|
async function raceRecallAbort(promise, signal, message = "recall aborted") {
|
|
2477
2501
|
throwIfRecallAborted(signal, message);
|
|
@@ -3111,6 +3135,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
3111
3135
|
);
|
|
3112
3136
|
this.judgeVerdictCache = createVerdictCache();
|
|
3113
3137
|
this.localLlm = new LocalLlmClient(config, this.modelRegistry);
|
|
3138
|
+
this.localLlm.disableThinking = config.localLlmDisableThinking;
|
|
3114
3139
|
this.fastLlm = config.localLlmFastEnabled ? (() => {
|
|
3115
3140
|
const client = new LocalLlmClient(
|
|
3116
3141
|
{
|
|
@@ -3611,6 +3636,13 @@ var Orchestrator = class _Orchestrator {
|
|
|
3611
3636
|
log.debug(`procedural mining cron auto-register failed (non-fatal): ${err}`);
|
|
3612
3637
|
}
|
|
3613
3638
|
}
|
|
3639
|
+
if (this.config.contradictionScan?.enabled) {
|
|
3640
|
+
try {
|
|
3641
|
+
await this.autoRegisterContradictionScanCron();
|
|
3642
|
+
} catch (err) {
|
|
3643
|
+
log.debug(`contradiction scan cron auto-register failed (non-fatal): ${err}`);
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3614
3646
|
log.info("orchestrator initialized (full \u2014 deferred steps complete)");
|
|
3615
3647
|
}
|
|
3616
3648
|
/**
|
|
@@ -3778,6 +3810,26 @@ var Orchestrator = class _Orchestrator {
|
|
|
3778
3810
|
log.debug(`procedural mining cron auto-register error: ${err}`);
|
|
3779
3811
|
}
|
|
3780
3812
|
}
|
|
3813
|
+
async autoRegisterContradictionScanCron() {
|
|
3814
|
+
const home = resolveHomeDir();
|
|
3815
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
3816
|
+
try {
|
|
3817
|
+
if (!existsSync2(jobsPath)) {
|
|
3818
|
+
log.debug("contradiction scan cron: jobs.json not found, skipping auto-register");
|
|
3819
|
+
return;
|
|
3820
|
+
}
|
|
3821
|
+
const created = await ensureContradictionScanCron(jobsPath, {
|
|
3822
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
3823
|
+
});
|
|
3824
|
+
if (created.created) {
|
|
3825
|
+
log.info(`contradiction scan cron auto-registered (${created.jobId})`);
|
|
3826
|
+
} else {
|
|
3827
|
+
log.debug("contradiction scan cron already exists, skipping auto-register");
|
|
3828
|
+
}
|
|
3829
|
+
} catch (err) {
|
|
3830
|
+
log.debug(`contradiction scan cron auto-register error: ${err}`);
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3781
3833
|
async applyBehaviorRuntimePolicy(state) {
|
|
3782
3834
|
const result = await this.policyRuntime.applyFromBehaviorState(state);
|
|
3783
3835
|
this.runtimePolicyValues = await this.policyRuntime.loadRuntimeValues();
|
|
@@ -7182,7 +7234,7 @@ ${formatted}`;
|
|
|
7182
7234
|
if (!this.isRecallSectionEnabled("procedure-recall", true)) return null;
|
|
7183
7235
|
try {
|
|
7184
7236
|
return await buildProcedureRecallSection(
|
|
7185
|
-
|
|
7237
|
+
profileStorage,
|
|
7186
7238
|
retrievalQuery,
|
|
7187
7239
|
this.config
|
|
7188
7240
|
);
|
|
@@ -8595,7 +8647,7 @@ _Context: ${topQuestion.context}_`
|
|
|
8595
8647
|
if (!this.queueProcessing) {
|
|
8596
8648
|
this.queueProcessing = true;
|
|
8597
8649
|
this.processQueue().catch((err) => {
|
|
8598
|
-
|
|
8650
|
+
this.logExtractionQueueFailure(err, "processor");
|
|
8599
8651
|
this.queueProcessing = false;
|
|
8600
8652
|
});
|
|
8601
8653
|
}
|
|
@@ -8653,12 +8705,38 @@ ${normalized}`).digest("hex");
|
|
|
8653
8705
|
try {
|
|
8654
8706
|
await task();
|
|
8655
8707
|
} catch (err) {
|
|
8656
|
-
|
|
8708
|
+
this.logExtractionQueueFailure(err, "task");
|
|
8657
8709
|
}
|
|
8658
8710
|
}
|
|
8659
8711
|
}
|
|
8660
8712
|
this.queueProcessing = false;
|
|
8661
8713
|
}
|
|
8714
|
+
/**
|
|
8715
|
+
* Classify + log a failure from either the per-task catch inside
|
|
8716
|
+
* `processQueue()` or the outer `processQueue().catch(...)` in
|
|
8717
|
+
* `queueBufferedExtraction()`. Issue #549: `throwIfRecallAborted`
|
|
8718
|
+
* (used throughout `runExtraction`) raises an Error whose `name` is
|
|
8719
|
+
* `"AbortError"`. That path fires when `before_reset` aborts a
|
|
8720
|
+
* queued task to avoid duplicate extraction — it is intentional
|
|
8721
|
+
* cancellation, not a failure. Downgrading the log to debug
|
|
8722
|
+
* prevents spurious `error`-level lines that routinely appear
|
|
8723
|
+
* right next to a successful `persisted: N facts, M entities` log
|
|
8724
|
+
* and that confuse operators into thinking extraction is broken.
|
|
8725
|
+
* Genuine extraction failures (network, parse, I/O) still log at
|
|
8726
|
+
* `error`.
|
|
8727
|
+
*
|
|
8728
|
+
* Source differentiates the two call sites so the log message
|
|
8729
|
+
* names the right layer (`task` vs `processor`).
|
|
8730
|
+
*/
|
|
8731
|
+
logExtractionQueueFailure(err, source) {
|
|
8732
|
+
const aborted = source === "task" ? "background extraction task aborted (session transition)" : "background extraction queue processor aborted (session transition)";
|
|
8733
|
+
const failed = source === "task" ? "background extraction task failed" : "background extraction queue processor failed";
|
|
8734
|
+
if (isAbortError(err)) {
|
|
8735
|
+
log.debug(aborted);
|
|
8736
|
+
} else {
|
|
8737
|
+
log.error(failed, err);
|
|
8738
|
+
}
|
|
8739
|
+
}
|
|
8662
8740
|
async runExtraction(turns, options = {}) {
|
|
8663
8741
|
log.debug(`running extraction on ${turns.length} turns`);
|
|
8664
8742
|
const clearBufferAfterExtraction = options.clearBufferAfterExtraction ?? true;
|
|
@@ -8670,12 +8748,12 @@ ${normalized}`).digest("hex");
|
|
|
8670
8748
|
throw new Error(`replay extraction deadline exceeded (${stage})`);
|
|
8671
8749
|
}
|
|
8672
8750
|
};
|
|
8673
|
-
const
|
|
8751
|
+
const throwIfAborted2 = (stage) => {
|
|
8674
8752
|
throwIfRecallAborted(options.abortSignal, `extraction aborted (${stage})`);
|
|
8675
8753
|
};
|
|
8676
8754
|
const clearBuffer = async (options2) => {
|
|
8677
8755
|
if (options2?.ignoreAbort !== true) {
|
|
8678
|
-
|
|
8756
|
+
throwIfAborted2("before_clear_buffer");
|
|
8679
8757
|
}
|
|
8680
8758
|
if (clearBufferAfterExtraction) {
|
|
8681
8759
|
await this.buffer.clearAfterExtraction(bufferKey);
|
|
@@ -8694,7 +8772,7 @@ ${normalized}`).digest("hex");
|
|
|
8694
8772
|
content: t.content.trim().slice(0, this.config.extractionMaxTurnChars)
|
|
8695
8773
|
})).filter((t) => t.content.length > 0);
|
|
8696
8774
|
throwIfDeadlineExceeded("before_extract");
|
|
8697
|
-
|
|
8775
|
+
throwIfAborted2("before_extract");
|
|
8698
8776
|
const userTurns = normalizedTurns.filter((t) => t.role === "user");
|
|
8699
8777
|
const totalChars = normalizedTurns.reduce(
|
|
8700
8778
|
(sum, t) => sum + t.content.length,
|
|
@@ -8739,7 +8817,7 @@ ${normalized}`).digest("hex");
|
|
|
8739
8817
|
"extraction aborted (during_extract)"
|
|
8740
8818
|
);
|
|
8741
8819
|
throwIfDeadlineExceeded("before_persist");
|
|
8742
|
-
|
|
8820
|
+
throwIfAborted2("before_persist");
|
|
8743
8821
|
if (!result) {
|
|
8744
8822
|
log.warn("runExtraction: extraction returned null/undefined");
|
|
8745
8823
|
await clearBuffer();
|
|
@@ -9452,16 +9530,6 @@ ${normalized}`).digest("hex");
|
|
|
9452
9530
|
}
|
|
9453
9531
|
fact.tags = Array.isArray(fact.tags) ? fact.tags.filter((t) => typeof t === "string") : [];
|
|
9454
9532
|
fact.confidence = typeof fact.confidence === "number" ? fact.confidence : 0.7;
|
|
9455
|
-
if (this.contentHashIndex) {
|
|
9456
|
-
const canonicalContent = citationEnabled && hasCitationForTemplate(fact.content, citationTemplate) ? stripCitationForTemplate(fact.content, citationTemplate) : fact.content;
|
|
9457
|
-
if (this.contentHashIndex.has(canonicalContent)) {
|
|
9458
|
-
log.debug(
|
|
9459
|
-
`dedup: skipping duplicate fact "${fact.content.slice(0, 60)}\u2026"`
|
|
9460
|
-
);
|
|
9461
|
-
dedupedCount++;
|
|
9462
|
-
continue;
|
|
9463
|
-
}
|
|
9464
|
-
}
|
|
9465
9533
|
let writeCategory = fact.category;
|
|
9466
9534
|
let targetStorage = storage;
|
|
9467
9535
|
let routedRuleId;
|
|
@@ -9486,6 +9554,15 @@ ${normalized}`).digest("hex");
|
|
|
9486
9554
|
);
|
|
9487
9555
|
}
|
|
9488
9556
|
}
|
|
9557
|
+
const canonicalContentForHash = citationEnabled && hasCitationForTemplate(fact.content, citationTemplate) ? stripCitationForTemplate(fact.content, citationTemplate) : fact.content;
|
|
9558
|
+
const contentHashDedupKey = writeCategory === "procedure" ? buildProcedurePersistBody(fact.content, fact.procedureSteps) : canonicalContentForHash;
|
|
9559
|
+
if (this.contentHashIndex && this.contentHashIndex.has(contentHashDedupKey)) {
|
|
9560
|
+
log.debug(
|
|
9561
|
+
`dedup: skipping duplicate fact "${fact.content.slice(0, 60)}\u2026"`
|
|
9562
|
+
);
|
|
9563
|
+
dedupedCount++;
|
|
9564
|
+
continue;
|
|
9565
|
+
}
|
|
9489
9566
|
const importance = scoreImportance(
|
|
9490
9567
|
fact.content,
|
|
9491
9568
|
writeCategory,
|
|
@@ -9529,16 +9606,10 @@ ${normalized}`).digest("hex");
|
|
|
9529
9606
|
procedureSteps: fact.procedureSteps
|
|
9530
9607
|
});
|
|
9531
9608
|
if (!procGate.durable) {
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
} else {
|
|
9537
|
-
log.debug(
|
|
9538
|
-
`extraction-procedure-gate: rejected "${fact.content.slice(0, 60)}\u2026" reason="${procGate.reason}"`
|
|
9539
|
-
);
|
|
9540
|
-
continue;
|
|
9541
|
-
}
|
|
9609
|
+
log.debug(
|
|
9610
|
+
`extraction-procedure-gate: rejected "${fact.content.slice(0, 60)}\u2026" reason="${procGate.reason}"`
|
|
9611
|
+
);
|
|
9612
|
+
continue;
|
|
9542
9613
|
}
|
|
9543
9614
|
}
|
|
9544
9615
|
let pendingSemanticSkip = null;
|
|
@@ -9935,7 +10006,8 @@ ${normalized}`).digest("hex");
|
|
|
9935
10006
|
}
|
|
9936
10007
|
if (this.contentHashIndex) {
|
|
9937
10008
|
const canonicalFactContent = citationEnabled && hasCitationForTemplate(fact.content, citationTemplate) ? stripCitationForTemplate(fact.content, citationTemplate) : fact.content;
|
|
9938
|
-
|
|
10009
|
+
const hashRegisterKey = writeCategory === "procedure" ? buildProcedurePersistBody(fact.content, fact.procedureSteps) : canonicalFactContent;
|
|
10010
|
+
this.contentHashIndex.add(hashRegisterKey);
|
|
9939
10011
|
}
|
|
9940
10012
|
}
|
|
9941
10013
|
for (const entity of entities) {
|
|
@@ -12113,4 +12185,4 @@ export {
|
|
|
12113
12185
|
resolvePersistedMemoryRelativePath,
|
|
12114
12186
|
Orchestrator
|
|
12115
12187
|
};
|
|
12116
|
-
//# sourceMappingURL=chunk-
|
|
12188
|
+
//# sourceMappingURL=chunk-DEPL3635.js.map
|