@remnic/core 9.3.736 → 9.3.738
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-boundary.d.ts +17 -6
- package/dist/access-boundary.js +10 -10
- package/dist/access-cli.js +26 -26
- package/dist/access-http.d.ts +17 -6
- package/dist/access-http.js +15 -15
- package/dist/access-mcp.d.ts +17 -6
- package/dist/access-mcp.js +14 -14
- package/dist/access-operations-batch.js +12 -12
- package/dist/access-operations.d.ts +17 -6
- package/dist/access-operations.js +13 -13
- package/dist/{access-service-CdC0q4pr.d.ts → access-service-DwQ6BIQw.d.ts} +3 -3
- package/dist/access-service.d.ts +16 -5
- package/dist/access-service.js +9 -9
- package/dist/access-surface-catalog.d.ts +17 -6
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +3 -3
- 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 +16 -4
- 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/buffer.js +2 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +99 -2
- package/dist/capabilities.js +7 -1
- package/dist/{catalog-D2NLDg4S.d.ts → catalog-_Bap6vfD.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-G54IDCD3.js → chunk-23PLOBWT.js} +30 -27
- package/dist/chunk-23PLOBWT.js.map +1 -0
- package/dist/{chunk-K3Y2SJTN.js → chunk-56LP72AD.js} +6 -6
- package/dist/{chunk-ZBZ4XULO.js → chunk-66RZ4EIT.js} +3 -3
- package/dist/{chunk-IPI45Q4S.js → chunk-75PDC7VT.js} +9 -8
- package/dist/chunk-75PDC7VT.js.map +1 -0
- package/dist/{chunk-GB2FZOWB.js → chunk-7B7IPPN5.js} +5 -5
- package/dist/{chunk-QNTLWH3T.js → chunk-A7INTIC5.js} +3 -3
- package/dist/{chunk-FLPKEMSO.js → chunk-AKKFHN3I.js} +2 -2
- package/dist/{chunk-AAIHDIMD.js → chunk-BHJAMSVC.js} +7 -7
- package/dist/{chunk-BXPG5AVX.js → chunk-BHQQVUEQ.js} +6 -6
- package/dist/{chunk-HFXZIF3V.js → chunk-BVG2IZOB.js} +3 -3
- package/dist/{chunk-NDKW67ER.js → chunk-C53JDEH3.js} +4 -4
- package/dist/{chunk-AESC5OQJ.js → chunk-CKHPUOAP.js} +2 -2
- package/dist/{chunk-OYHYBHHI.js → chunk-DS3FZ7GS.js} +4 -4
- package/dist/{chunk-AE2HPUP7.js → chunk-EKQ3LWBM.js} +428 -370
- package/dist/chunk-EKQ3LWBM.js.map +1 -0
- package/dist/{chunk-UO6MPN77.js → chunk-EU543UDC.js} +10 -9
- package/dist/chunk-EU543UDC.js.map +1 -0
- package/dist/{chunk-E4LYJ7PY.js → chunk-IFCM6OLK.js} +6 -6
- package/dist/{chunk-5BOQNB2K.js → chunk-JQSP7YBJ.js} +3 -3
- package/dist/{chunk-2T2N7ISV.js → chunk-L3TYGUTH.js} +3 -3
- package/dist/{chunk-AB2E5DCN.js → chunk-MAU7DFCJ.js} +2 -2
- package/dist/{chunk-P6VLG7KE.js → chunk-N2O23WYA.js} +2 -2
- package/dist/{chunk-HYNHLBKA.js → chunk-OQQRWPFZ.js} +5 -2
- package/dist/chunk-OQQRWPFZ.js.map +1 -0
- package/dist/{chunk-IXGXALRV.js → chunk-QTJOORGN.js} +2 -2
- package/dist/{chunk-JWDE7OVJ.js → chunk-RJBW4EOU.js} +46 -2
- package/dist/{chunk-JWDE7OVJ.js.map → chunk-RJBW4EOU.js.map} +1 -1
- package/dist/{chunk-AE7NTZ75.js → chunk-TNLXCSXV.js} +3 -3
- package/dist/{chunk-NNJKEAP2.js → chunk-VRBBZH4U.js} +4 -4
- package/dist/{chunk-VOEVVIP3.js → chunk-W2FBVBQ4.js} +4 -4
- package/dist/{chunk-WNGXQMRI.js → chunk-WFNH4UDF.js} +5 -2
- package/dist/chunk-WFNH4UDF.js.map +1 -0
- package/dist/{chunk-CHJIWG2H.js → chunk-WVAEIKUY.js} +2 -2
- package/dist/{chunk-FF36YNKY.js → chunk-XIQAOGAA.js} +11 -10
- package/dist/chunk-XIQAOGAA.js.map +1 -0
- package/dist/{chunk-HLPYL6LC.js → chunk-Y5OOHER4.js} +14 -12
- package/dist/chunk-Y5OOHER4.js.map +1 -0
- package/dist/{chunk-GYICIICQ.js → chunk-YF2MMBKA.js} +9 -7
- package/dist/chunk-YF2MMBKA.js.map +1 -0
- package/dist/{chunk-IX4L7E5G.js → chunk-YXOXAQ5Y.js} +2 -2
- package/dist/{cli-BHy6Bo6u.d.ts → cli-BlEIWDQw.d.ts} +3 -3
- package/dist/cli.d.ts +9 -7
- package/dist/cli.js +21 -21
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +2 -2
- 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/contradiction/index.js +2 -2
- package/dist/{contradiction-scan-2B4AE4TI.js → contradiction-scan-CWO3LIWV.js} +3 -3
- 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/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +2 -2
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +16 -4
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-faithfulness.d.ts +1 -1
- 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/extraction.js +3 -3
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-2RQYDIZ7.js → first-start-migration-5DXD3TF2.js} +2 -2
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +20 -18
- package/dist/index.js +32 -32
- 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/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/mcp-memory-inspector-app.d.ts +17 -6
- 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 +2 -2
- package/dist/namespaces/migrate.js +6 -6
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/principal.js +2 -2
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +2 -2
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +11 -11
- package/dist/orchestration/compression-guideline-coordinator.d.ts +1 -1
- package/dist/orchestration/compression-guideline-coordinator.js +2 -2
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +6 -6
- package/dist/{orchestrator-C-xp_rtZ.d.ts → orchestrator-CJZ21ZiB.d.ts} +78 -12
- package/dist/orchestrator.d.ts +16 -4
- package/dist/orchestrator.js +21 -21
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +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/schemas.d.ts +22 -22
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/embed-helper.js +2 -2
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +3 -3
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +3 -3
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-COdwU-me.d.ts → semantic-consolidation-DsIEiCka.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/summarizer.js +3 -3
- 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/{tier-stats-KPDIISG7.js → tier-stats-QID73BBB.js} +2 -2
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +2 -2
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-w3Y232yi.d.ts → types-CglNn2V-.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-service.ts +7 -8
- package/src/buffer.ts +2 -1
- package/src/capabilities.test.ts +137 -0
- package/src/capabilities.ts +209 -0
- package/src/cli/creation-ledger-commands.ts +3 -3
- package/src/cli/research-status-commands.ts +4 -4
- package/src/cli.ts +9 -10
- package/src/compounding/engine.ts +7 -7
- package/src/correction/correction-access-wiring.ts +3 -2
- package/src/extraction.ts +8 -10
- package/src/operator-toolkit.ts +6 -7
- package/src/orchestration/entity-synthesis-coordinator.ts +2 -1
- package/src/orchestration/maintenance.ts +5 -7
- package/src/orchestration/recall-result-formatter.ts +438 -0
- package/src/orchestration/semantic-consolidation-coordinator.ts +2 -2
- package/src/orchestrator.ts +71 -355
- package/dist/chunk-AE2HPUP7.js.map +0 -1
- package/dist/chunk-FF36YNKY.js.map +0 -1
- package/dist/chunk-G54IDCD3.js.map +0 -1
- package/dist/chunk-GYICIICQ.js.map +0 -1
- package/dist/chunk-HLPYL6LC.js.map +0 -1
- package/dist/chunk-HYNHLBKA.js.map +0 -1
- package/dist/chunk-IPI45Q4S.js.map +0 -1
- package/dist/chunk-UO6MPN77.js.map +0 -1
- package/dist/chunk-WNGXQMRI.js.map +0 -1
- /package/dist/{chunk-K3Y2SJTN.js.map → chunk-56LP72AD.js.map} +0 -0
- /package/dist/{chunk-ZBZ4XULO.js.map → chunk-66RZ4EIT.js.map} +0 -0
- /package/dist/{chunk-GB2FZOWB.js.map → chunk-7B7IPPN5.js.map} +0 -0
- /package/dist/{chunk-QNTLWH3T.js.map → chunk-A7INTIC5.js.map} +0 -0
- /package/dist/{chunk-FLPKEMSO.js.map → chunk-AKKFHN3I.js.map} +0 -0
- /package/dist/{chunk-AAIHDIMD.js.map → chunk-BHJAMSVC.js.map} +0 -0
- /package/dist/{chunk-BXPG5AVX.js.map → chunk-BHQQVUEQ.js.map} +0 -0
- /package/dist/{chunk-HFXZIF3V.js.map → chunk-BVG2IZOB.js.map} +0 -0
- /package/dist/{chunk-NDKW67ER.js.map → chunk-C53JDEH3.js.map} +0 -0
- /package/dist/{chunk-AESC5OQJ.js.map → chunk-CKHPUOAP.js.map} +0 -0
- /package/dist/{chunk-OYHYBHHI.js.map → chunk-DS3FZ7GS.js.map} +0 -0
- /package/dist/{chunk-E4LYJ7PY.js.map → chunk-IFCM6OLK.js.map} +0 -0
- /package/dist/{chunk-5BOQNB2K.js.map → chunk-JQSP7YBJ.js.map} +0 -0
- /package/dist/{chunk-2T2N7ISV.js.map → chunk-L3TYGUTH.js.map} +0 -0
- /package/dist/{chunk-AB2E5DCN.js.map → chunk-MAU7DFCJ.js.map} +0 -0
- /package/dist/{chunk-P6VLG7KE.js.map → chunk-N2O23WYA.js.map} +0 -0
- /package/dist/{chunk-IXGXALRV.js.map → chunk-QTJOORGN.js.map} +0 -0
- /package/dist/{chunk-AE7NTZ75.js.map → chunk-TNLXCSXV.js.map} +0 -0
- /package/dist/{chunk-NNJKEAP2.js.map → chunk-VRBBZH4U.js.map} +0 -0
- /package/dist/{chunk-VOEVVIP3.js.map → chunk-W2FBVBQ4.js.map} +0 -0
- /package/dist/{chunk-CHJIWG2H.js.map → chunk-WVAEIKUY.js.map} +0 -0
- /package/dist/{chunk-IX4L7E5G.js.map → chunk-YXOXAQ5Y.js.map} +0 -0
- /package/dist/{contradiction-scan-2B4AE4TI.js.map → contradiction-scan-CWO3LIWV.js.map} +0 -0
- /package/dist/{first-start-migration-2RQYDIZ7.js.map → first-start-migration-5DXD3TF2.js.map} +0 -0
- /package/dist/{tier-stats-KPDIISG7.js.map → tier-stats-QID73BBB.js.map} +0 -0
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from "./chunk-OZECYVGI.js";
|
|
8
8
|
import {
|
|
9
9
|
CompressionGuidelineCoordinator
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QTJOORGN.js";
|
|
11
11
|
import {
|
|
12
12
|
MaintenanceScheduler
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YF2MMBKA.js";
|
|
14
14
|
import {
|
|
15
15
|
runPeerProfileReasoner
|
|
16
16
|
} from "./chunk-I74SUMNI.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
CompoundingEngine,
|
|
31
31
|
defaultTierMigrationCycleBudget
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-75PDC7VT.js";
|
|
33
33
|
import {
|
|
34
34
|
SharedContextManager
|
|
35
35
|
} from "./chunk-UFS7OXGL.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
} from "./chunk-UHGBNIOS.js";
|
|
64
64
|
import {
|
|
65
65
|
HourlySummarizer
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-BVG2IZOB.js";
|
|
67
67
|
import {
|
|
68
68
|
buildTargetedFactRecallSection,
|
|
69
69
|
shouldRecallTargetedFactEvidence
|
|
@@ -160,7 +160,7 @@ import {
|
|
|
160
160
|
} from "./chunk-LTHVM4XN.js";
|
|
161
161
|
import {
|
|
162
162
|
ExtractionEngine
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-XIQAOGAA.js";
|
|
164
164
|
import {
|
|
165
165
|
parseMemoryActionEligibilityContext
|
|
166
166
|
} from "./chunk-5GSUBCZM.js";
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
} from "./chunk-PWFWCGOO.js";
|
|
170
170
|
import {
|
|
171
171
|
LocalLlmClient
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-YXOXAQ5Y.js";
|
|
173
173
|
import {
|
|
174
174
|
buildFocusedListRecallSection,
|
|
175
175
|
shouldRecallFocusedListEvidence
|
|
@@ -193,12 +193,12 @@ import {
|
|
|
193
193
|
} from "./chunk-Q6IP2ARR.js";
|
|
194
194
|
import {
|
|
195
195
|
EmbeddingFallback
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-WVAEIKUY.js";
|
|
197
197
|
import {
|
|
198
198
|
buildEntityRecallSection,
|
|
199
199
|
entityRecentTranscriptLookbackHours,
|
|
200
200
|
readRecentEntityTranscriptEntries
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-CKHPUOAP.js";
|
|
202
202
|
import {
|
|
203
203
|
RoutingRulesStore
|
|
204
204
|
} from "./chunk-WIWPSQYU.js";
|
|
@@ -228,14 +228,14 @@ import {
|
|
|
228
228
|
import {
|
|
229
229
|
runNamespaceMaintenanceFanout,
|
|
230
230
|
summarizeNamespaceMaintenanceHealth
|
|
231
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-TNLXCSXV.js";
|
|
232
232
|
import {
|
|
233
233
|
NamespaceCatalog,
|
|
234
234
|
planNamespaceMaintenance
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-BHQQVUEQ.js";
|
|
236
236
|
import {
|
|
237
237
|
NamespaceStorageRouter
|
|
238
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-VRBBZH4U.js";
|
|
239
239
|
import {
|
|
240
240
|
searchHarmonicRetrieval
|
|
241
241
|
} from "./chunk-AV5ZEH4M.js";
|
|
@@ -292,7 +292,7 @@ import {
|
|
|
292
292
|
} from "./chunk-UQ7RN5HK.js";
|
|
293
293
|
import {
|
|
294
294
|
SmartBuffer
|
|
295
|
-
} from "./chunk-
|
|
295
|
+
} from "./chunk-OQQRWPFZ.js";
|
|
296
296
|
import {
|
|
297
297
|
isDisagreementPrompt
|
|
298
298
|
} from "./chunk-H3FZVNRN.js";
|
|
@@ -311,7 +311,7 @@ import {
|
|
|
311
311
|
clusterByKey,
|
|
312
312
|
createCorrectionService,
|
|
313
313
|
detectPassiveCorrections
|
|
314
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-WFNH4UDF.js";
|
|
315
315
|
import {
|
|
316
316
|
listTrustZoneRecords,
|
|
317
317
|
searchTrustZoneRecords
|
|
@@ -333,14 +333,14 @@ import {
|
|
|
333
333
|
resolveNamespaceFromStorageDir,
|
|
334
334
|
resolveScopePlan,
|
|
335
335
|
resolveScopeProfilePlan
|
|
336
|
-
} from "./chunk-
|
|
336
|
+
} from "./chunk-7B7IPPN5.js";
|
|
337
337
|
import {
|
|
338
338
|
NamespaceSearchRouter
|
|
339
|
-
} from "./chunk-
|
|
339
|
+
} from "./chunk-66RZ4EIT.js";
|
|
340
340
|
import {
|
|
341
341
|
createConversationIndexRuntime,
|
|
342
342
|
createSearchBackend
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-JQSP7YBJ.js";
|
|
344
344
|
import {
|
|
345
345
|
NoopSearchBackend
|
|
346
346
|
} from "./chunk-CYEPCZN5.js";
|
|
@@ -363,7 +363,7 @@ import {
|
|
|
363
363
|
} from "./chunk-QDW3E4RD.js";
|
|
364
364
|
import {
|
|
365
365
|
shouldSkipImplicitExtraction
|
|
366
|
-
} from "./chunk-
|
|
366
|
+
} from "./chunk-C53JDEH3.js";
|
|
367
367
|
import {
|
|
368
368
|
searchCausalTrajectories
|
|
369
369
|
} from "./chunk-SQNED75R.js";
|
|
@@ -465,10 +465,15 @@ import {
|
|
|
465
465
|
defaultNamespaceForPrincipal,
|
|
466
466
|
recallNamespacesForPrincipal,
|
|
467
467
|
resolvePrincipal
|
|
468
|
-
} from "./chunk-
|
|
468
|
+
} from "./chunk-DS3FZ7GS.js";
|
|
469
|
+
import {
|
|
470
|
+
isSafeRouteNamespace,
|
|
471
|
+
selectRouteRule
|
|
472
|
+
} from "./chunk-U3PN77QT.js";
|
|
469
473
|
import {
|
|
470
474
|
resolveCapabilities,
|
|
471
475
|
resolveCompressionCapabilities,
|
|
476
|
+
resolveConsolidationCapabilities,
|
|
472
477
|
resolveCreationMemoryCapabilities,
|
|
473
478
|
resolveEvalCapabilities,
|
|
474
479
|
resolveGraphConstructionCapabilities,
|
|
@@ -478,14 +483,12 @@ import {
|
|
|
478
483
|
resolveMemoryLifecycleCapabilities,
|
|
479
484
|
resolveNamespaceCapabilities,
|
|
480
485
|
resolveObjectiveStateCapabilities,
|
|
486
|
+
resolvePresentationCapabilities,
|
|
481
487
|
resolveQmdCapabilities,
|
|
488
|
+
resolveRecallAuxiliaryCapabilities,
|
|
482
489
|
resolveSecurityCapabilities,
|
|
483
490
|
resolveUtilityLearningCapabilities
|
|
484
|
-
} from "./chunk-
|
|
485
|
-
import {
|
|
486
|
-
isSafeRouteNamespace,
|
|
487
|
-
selectRouteRule
|
|
488
|
-
} from "./chunk-U3PN77QT.js";
|
|
491
|
+
} from "./chunk-RJBW4EOU.js";
|
|
489
492
|
import {
|
|
490
493
|
sanitizeMemoryContent
|
|
491
494
|
} from "./chunk-5GKPFL3S.js";
|
|
@@ -902,7 +905,7 @@ var SemanticConsolidationCoordinator = class {
|
|
|
902
905
|
errors: 0,
|
|
903
906
|
clusters: []
|
|
904
907
|
};
|
|
905
|
-
if (!this.config.
|
|
908
|
+
if (!resolveConsolidationCapabilities(this.config).semanticConsolidation && !options?.force) {
|
|
906
909
|
log.debug("[semantic-consolidation] disabled in config");
|
|
907
910
|
return result;
|
|
908
911
|
}
|
|
@@ -1515,7 +1518,7 @@ var EntitySynthesisCoordinator = class {
|
|
|
1515
1518
|
*/
|
|
1516
1519
|
async processQueue(namespace, maxEntities = 5) {
|
|
1517
1520
|
const { config } = this.deps;
|
|
1518
|
-
if (!config.
|
|
1521
|
+
if (!resolvePresentationCapabilities(config).entitySummary || maxEntities <= 0 || config.entitySynthesisMaxTokens <= 0) return 0;
|
|
1519
1522
|
const storage = await this.deps.getStorage(namespace);
|
|
1520
1523
|
const queued = await storage.refreshEntitySynthesisQueue();
|
|
1521
1524
|
let processed = 0;
|
|
@@ -1626,6 +1629,319 @@ ${evidenceText}`
|
|
|
1626
1629
|
}
|
|
1627
1630
|
};
|
|
1628
1631
|
|
|
1632
|
+
// src/orchestration/recall-result-formatter.ts
|
|
1633
|
+
function hasIdentityRecoveryIntent(prompt) {
|
|
1634
|
+
const text = typeof prompt === "string" ? prompt.toLowerCase() : "";
|
|
1635
|
+
if (!text) return false;
|
|
1636
|
+
return /\b(identity|continuity|recover(?:y|ing|ed)?|incident|drift|restore|regress(?:ion|ed|ing)?)\b/i.test(
|
|
1637
|
+
text
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
function resolveEffectiveIdentityInjectionMode(options) {
|
|
1641
|
+
if (options.configuredMode === "recovery_only" && !hasIdentityRecoveryIntent(options.prompt)) {
|
|
1642
|
+
return { mode: "recovery_only", shouldInject: false };
|
|
1643
|
+
}
|
|
1644
|
+
if (options.recallMode === "minimal" && options.configuredMode === "full") {
|
|
1645
|
+
return { mode: "minimal", shouldInject: true };
|
|
1646
|
+
}
|
|
1647
|
+
return { mode: options.configuredMode, shouldInject: true };
|
|
1648
|
+
}
|
|
1649
|
+
var RecallResultFormatter = class {
|
|
1650
|
+
constructor(config) {
|
|
1651
|
+
this.config = config;
|
|
1652
|
+
}
|
|
1653
|
+
config;
|
|
1654
|
+
// ── QMD results (memory handles + epistemic hedge) ──────────────────────
|
|
1655
|
+
formatQmdResults(title, results, sessionKey, trustByPath) {
|
|
1656
|
+
const handleByIndex = buildHandleIndexForResults(
|
|
1657
|
+
results,
|
|
1658
|
+
this.config.recallMemoryHandles === true && sessionKey != null
|
|
1659
|
+
);
|
|
1660
|
+
const renderHedge = this.config.trustScoreEpistemicRendering && trustByPath !== null && trustByPath !== void 0;
|
|
1661
|
+
const hedgeMap = renderHedge ? trustByPath : null;
|
|
1662
|
+
const lines = results.map((r, i) => {
|
|
1663
|
+
const snippet = r.snippet ? r.snippet.slice(0, 500).replace(/\n/g, " ") : "(no preview)";
|
|
1664
|
+
const source = typeof r.line === "number" ? `${r.path}:${r.line}` : r.path;
|
|
1665
|
+
const head = `[${i + 1}] ${source} (score: ${r.score.toFixed(3)})
|
|
1666
|
+
${snippet}`;
|
|
1667
|
+
const handle = handleByIndex.get(i);
|
|
1668
|
+
const hedged = head.replace(/\s+$/, "");
|
|
1669
|
+
const withHandle = handle ? `${hedged} ${handle}` : hedged;
|
|
1670
|
+
if (hedgeMap) {
|
|
1671
|
+
const item = hedgeMap.get(r.path);
|
|
1672
|
+
if (item) {
|
|
1673
|
+
const hedge = renderEpistemicHedge(item.trust);
|
|
1674
|
+
if (hedge.length > 0) return `${withHandle} ${hedge}`;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
return withHandle;
|
|
1678
|
+
});
|
|
1679
|
+
return `## ${title}
|
|
1680
|
+
|
|
1681
|
+
${lines.join("\n\n")}`;
|
|
1682
|
+
}
|
|
1683
|
+
// ── Specialized recall result formatters ────────────────────────────────
|
|
1684
|
+
formatObjectiveStateResults(results) {
|
|
1685
|
+
const lines = results.map(({ snapshot }, index) => {
|
|
1686
|
+
const parts = [
|
|
1687
|
+
snapshot.recordedAt.replace("T", " ").slice(0, 16),
|
|
1688
|
+
`${snapshot.kind}/${snapshot.changeKind}`
|
|
1689
|
+
];
|
|
1690
|
+
if (snapshot.outcome) parts.push(snapshot.outcome);
|
|
1691
|
+
const header = `[${index + 1}] ${parts.join(" | ")} | ${snapshot.scope}`;
|
|
1692
|
+
const detailParts = [snapshot.summary];
|
|
1693
|
+
if (snapshot.command) detailParts.push(`command: ${snapshot.command}`);
|
|
1694
|
+
else if (snapshot.toolName)
|
|
1695
|
+
detailParts.push(`tool: ${snapshot.toolName}`);
|
|
1696
|
+
return `${header}
|
|
1697
|
+
${detailParts.join(" | ")}`;
|
|
1698
|
+
});
|
|
1699
|
+
return `## Objective State
|
|
1700
|
+
|
|
1701
|
+
${lines.join("\n\n")}`;
|
|
1702
|
+
}
|
|
1703
|
+
formatCausalTrajectoryResults(results) {
|
|
1704
|
+
const lines = results.map(({ record, matchedFields }, index) => {
|
|
1705
|
+
const header = [
|
|
1706
|
+
`[${index + 1}] ${record.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
1707
|
+
record.outcomeKind
|
|
1708
|
+
].join(" | ");
|
|
1709
|
+
const details = [
|
|
1710
|
+
`goal: ${record.goal}`,
|
|
1711
|
+
`action: ${record.actionSummary}`,
|
|
1712
|
+
`observation: ${record.observationSummary}`,
|
|
1713
|
+
`outcome: ${record.outcomeSummary}`
|
|
1714
|
+
];
|
|
1715
|
+
if (record.followUpSummary)
|
|
1716
|
+
details.push(`follow-up: ${record.followUpSummary}`);
|
|
1717
|
+
if (matchedFields.length > 0)
|
|
1718
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1719
|
+
return `${header}
|
|
1720
|
+
${details.join("\n")}`;
|
|
1721
|
+
});
|
|
1722
|
+
return `## Causal Trajectories
|
|
1723
|
+
|
|
1724
|
+
${lines.join("\n\n")}`;
|
|
1725
|
+
}
|
|
1726
|
+
formatTrustZoneResults(results) {
|
|
1727
|
+
const lines = results.map(({ record, matchedFields }, index) => {
|
|
1728
|
+
const header = [
|
|
1729
|
+
`[${index + 1}] ${record.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
1730
|
+
record.zone,
|
|
1731
|
+
record.kind
|
|
1732
|
+
].join(" | ");
|
|
1733
|
+
const details = [
|
|
1734
|
+
record.summary,
|
|
1735
|
+
`provenance: ${record.provenance.sourceClass}`
|
|
1736
|
+
];
|
|
1737
|
+
if (record.entityRefs && record.entityRefs.length > 0) {
|
|
1738
|
+
details.push(`entities: ${record.entityRefs.join(", ")}`);
|
|
1739
|
+
}
|
|
1740
|
+
if (record.tags && record.tags.length > 0) {
|
|
1741
|
+
details.push(`tags: ${record.tags.join(", ")}`);
|
|
1742
|
+
}
|
|
1743
|
+
if (matchedFields.length > 0) {
|
|
1744
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1745
|
+
}
|
|
1746
|
+
return `${header}
|
|
1747
|
+
${details.join("\n")}`;
|
|
1748
|
+
});
|
|
1749
|
+
return `## Trust Zones
|
|
1750
|
+
|
|
1751
|
+
${lines.join("\n\n")}`;
|
|
1752
|
+
}
|
|
1753
|
+
formatHarmonicRetrievalResults(results) {
|
|
1754
|
+
const lines = results.map(
|
|
1755
|
+
({ node, matchedAnchors, matchedFields, nodeScore, anchorScore }, index) => {
|
|
1756
|
+
const header = [
|
|
1757
|
+
`[${index + 1}] ${node.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
1758
|
+
`${node.kind}/${node.abstractionLevel}`,
|
|
1759
|
+
node.sessionKey
|
|
1760
|
+
].join(" | ");
|
|
1761
|
+
const details = [
|
|
1762
|
+
node.title,
|
|
1763
|
+
node.summary,
|
|
1764
|
+
`scores: node=${nodeScore.toFixed(1)} anchor=${anchorScore.toFixed(1)}`
|
|
1765
|
+
];
|
|
1766
|
+
if (matchedAnchors.length > 0) {
|
|
1767
|
+
details.push(
|
|
1768
|
+
`anchors: ${matchedAnchors.map((anchor) => `${anchor.anchorType}:${anchor.anchorValue}`).join("; ")}`
|
|
1769
|
+
);
|
|
1770
|
+
}
|
|
1771
|
+
if (matchedFields.length > 0) {
|
|
1772
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1773
|
+
}
|
|
1774
|
+
return `${header}
|
|
1775
|
+
${details.join("\n")}`;
|
|
1776
|
+
}
|
|
1777
|
+
);
|
|
1778
|
+
return `## Harmonic Retrieval
|
|
1779
|
+
|
|
1780
|
+
${lines.join("\n\n")}`;
|
|
1781
|
+
}
|
|
1782
|
+
formatWorkProductResults(results) {
|
|
1783
|
+
const lines = results.map(({ entry, matchedFields }, index) => {
|
|
1784
|
+
const header = [
|
|
1785
|
+
`[${index + 1}] ${entry.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
1786
|
+
`${entry.kind}/${entry.action}`,
|
|
1787
|
+
entry.sessionKey
|
|
1788
|
+
].join(" | ");
|
|
1789
|
+
const details = [entry.summary, `scope: ${entry.scope}`];
|
|
1790
|
+
if (entry.artifactPath) details.push(`artifact: ${entry.artifactPath}`);
|
|
1791
|
+
if (entry.tags && entry.tags.length > 0)
|
|
1792
|
+
details.push(`tags: ${entry.tags.join(", ")}`);
|
|
1793
|
+
if (matchedFields.length > 0)
|
|
1794
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1795
|
+
return `${header}
|
|
1796
|
+
${details.join("\n")}`;
|
|
1797
|
+
});
|
|
1798
|
+
return `## Work Products
|
|
1799
|
+
|
|
1800
|
+
${lines.join("\n\n")}`;
|
|
1801
|
+
}
|
|
1802
|
+
formatVerifiedEpisodeResults(results) {
|
|
1803
|
+
const lines = results.map(
|
|
1804
|
+
({ box, verifiedEpisodeCount, matchedFields }, index) => {
|
|
1805
|
+
const header = [
|
|
1806
|
+
`[${index + 1}] ${box.sealedAt.replace("T", " ").slice(0, 16)}`,
|
|
1807
|
+
box.traceId ? `trace:${box.traceId.slice(0, 12)}` : "trace:none"
|
|
1808
|
+
].join(" | ");
|
|
1809
|
+
const details = [
|
|
1810
|
+
box.goal ?? `topics: ${box.topics.join(", ")}`,
|
|
1811
|
+
`verified episodes: ${verifiedEpisodeCount}`
|
|
1812
|
+
];
|
|
1813
|
+
if (box.toolsUsed && box.toolsUsed.length > 0) {
|
|
1814
|
+
details.push(`tools: ${box.toolsUsed.join(", ")}`);
|
|
1815
|
+
}
|
|
1816
|
+
if (matchedFields.length > 0) {
|
|
1817
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1818
|
+
}
|
|
1819
|
+
return `${header}
|
|
1820
|
+
${details.join("\n")}`;
|
|
1821
|
+
}
|
|
1822
|
+
);
|
|
1823
|
+
return `## Verified Episodes
|
|
1824
|
+
|
|
1825
|
+
${lines.join("\n\n")}`;
|
|
1826
|
+
}
|
|
1827
|
+
formatVerifiedSemanticRuleResults(results) {
|
|
1828
|
+
const lines = results.map(
|
|
1829
|
+
({
|
|
1830
|
+
rule,
|
|
1831
|
+
sourceMemoryId,
|
|
1832
|
+
verificationStatus,
|
|
1833
|
+
effectiveConfidence,
|
|
1834
|
+
matchedFields
|
|
1835
|
+
}, index) => {
|
|
1836
|
+
const header = [
|
|
1837
|
+
`[${index + 1}] ${rule.frontmatter.updated.replace("T", " ").slice(0, 16)}`,
|
|
1838
|
+
verificationStatus,
|
|
1839
|
+
`confidence:${effectiveConfidence.toFixed(2)}`
|
|
1840
|
+
].join(" | ");
|
|
1841
|
+
const details = [rule.content, `source memory: ${sourceMemoryId}`];
|
|
1842
|
+
if (matchedFields.length > 0) {
|
|
1843
|
+
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
1844
|
+
}
|
|
1845
|
+
return `${header}
|
|
1846
|
+
${details.join("\n")}`;
|
|
1847
|
+
}
|
|
1848
|
+
);
|
|
1849
|
+
return `## Verified Rules
|
|
1850
|
+
|
|
1851
|
+
${lines.join("\n\n")}`;
|
|
1852
|
+
}
|
|
1853
|
+
// ── Identity continuity helpers ─────────────────────────────────────────
|
|
1854
|
+
summarizeIdentityText(raw, maxLines, maxChars) {
|
|
1855
|
+
const lines = raw.replace(/\r/g, "").split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
1856
|
+
const compact = lines.slice(0, Math.max(1, maxLines)).join(" ");
|
|
1857
|
+
if (compact.length <= maxChars) return compact;
|
|
1858
|
+
return `${compact.slice(0, Math.max(0, maxChars - 1))}\u2026`;
|
|
1859
|
+
}
|
|
1860
|
+
formatOpenIncidentLine(incident, includeDetails) {
|
|
1861
|
+
const base = `[${incident.id}] ${incident.symptom.trim()}`;
|
|
1862
|
+
if (!includeDetails) return `- ${base}`;
|
|
1863
|
+
const parts = [base];
|
|
1864
|
+
if (incident.suspectedCause)
|
|
1865
|
+
parts.push(`cause: ${incident.suspectedCause.trim()}`);
|
|
1866
|
+
if (incident.triggerWindow)
|
|
1867
|
+
parts.push(`window: ${incident.triggerWindow.trim()}`);
|
|
1868
|
+
return `- ${parts.join(" | ")}`;
|
|
1869
|
+
}
|
|
1870
|
+
trimIdentitySection(content, maxChars) {
|
|
1871
|
+
if (maxChars <= 0) return { text: "", truncated: false };
|
|
1872
|
+
if (content.length <= maxChars) return { text: content, truncated: false };
|
|
1873
|
+
const suffix = "\n\n...(identity continuity trimmed)";
|
|
1874
|
+
if (maxChars <= suffix.length) {
|
|
1875
|
+
return { text: content.slice(0, maxChars), truncated: true };
|
|
1876
|
+
}
|
|
1877
|
+
const headroom = Math.max(0, maxChars - suffix.length);
|
|
1878
|
+
return { text: `${content.slice(0, headroom)}${suffix}`, truncated: true };
|
|
1879
|
+
}
|
|
1880
|
+
async buildIdentityContinuitySection(options) {
|
|
1881
|
+
if (!resolveIdentityContinuityCapabilities(this.config).identityContinuity) return null;
|
|
1882
|
+
if (this.config.identityMaxInjectChars <= 0) return null;
|
|
1883
|
+
const resolved = resolveEffectiveIdentityInjectionMode({
|
|
1884
|
+
configuredMode: this.config.identityInjectionMode,
|
|
1885
|
+
recallMode: options.recallMode,
|
|
1886
|
+
prompt: options.prompt
|
|
1887
|
+
});
|
|
1888
|
+
if (!resolved.shouldInject) return null;
|
|
1889
|
+
const [anchorRaw, loopsRaw, incidents] = await Promise.all([
|
|
1890
|
+
options.storage.readIdentityAnchor(),
|
|
1891
|
+
options.storage.readIdentityImprovementLoops(),
|
|
1892
|
+
options.storage.readContinuityIncidents(200)
|
|
1893
|
+
]);
|
|
1894
|
+
const openIncidents = incidents.filter(
|
|
1895
|
+
(incident) => incident.state === "open"
|
|
1896
|
+
);
|
|
1897
|
+
const lines = [];
|
|
1898
|
+
if (resolved.mode === "full") {
|
|
1899
|
+
lines.push("## Identity Continuity");
|
|
1900
|
+
if (anchorRaw && anchorRaw.trim().length > 0) {
|
|
1901
|
+
lines.push("", "### Anchor", "", anchorRaw.trim());
|
|
1902
|
+
}
|
|
1903
|
+
if (loopsRaw && loopsRaw.trim().length > 0) {
|
|
1904
|
+
lines.push("", "### Improvement Loops", "", loopsRaw.trim());
|
|
1905
|
+
}
|
|
1906
|
+
lines.push("", "### Open Incidents", "");
|
|
1907
|
+
if (openIncidents.length === 0) {
|
|
1908
|
+
lines.push("- none");
|
|
1909
|
+
} else {
|
|
1910
|
+
lines.push(
|
|
1911
|
+
...openIncidents.slice(0, 5).map((incident) => this.formatOpenIncidentLine(incident, true))
|
|
1912
|
+
);
|
|
1913
|
+
}
|
|
1914
|
+
} else {
|
|
1915
|
+
const anchorSummary = anchorRaw ? this.summarizeIdentityText(anchorRaw, 3, 320) : "";
|
|
1916
|
+
const loopsSummary = loopsRaw ? this.summarizeIdentityText(loopsRaw, 2, 240) : "";
|
|
1917
|
+
lines.push("## Identity Continuity Signals", "");
|
|
1918
|
+
if (anchorSummary) lines.push(`- anchor: ${anchorSummary}`);
|
|
1919
|
+
if (loopsSummary) lines.push(`- loops: ${loopsSummary}`);
|
|
1920
|
+
if (openIncidents.length === 0) {
|
|
1921
|
+
lines.push("- incidents: 0 open");
|
|
1922
|
+
} else {
|
|
1923
|
+
lines.push(`- incidents: ${openIncidents.length} open`);
|
|
1924
|
+
lines.push(
|
|
1925
|
+
...openIncidents.slice(0, 2).map((incident) => this.formatOpenIncidentLine(incident, false))
|
|
1926
|
+
);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
const body = lines.join("\n").trim();
|
|
1930
|
+
if (!body) return null;
|
|
1931
|
+
const { text, truncated } = this.trimIdentitySection(
|
|
1932
|
+
body,
|
|
1933
|
+
this.config.identityMaxInjectChars
|
|
1934
|
+
);
|
|
1935
|
+
if (!text) return null;
|
|
1936
|
+
return {
|
|
1937
|
+
section: text,
|
|
1938
|
+
mode: resolved.mode,
|
|
1939
|
+
injectedChars: text.length,
|
|
1940
|
+
truncated
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1629
1945
|
// src/maintenance/pattern-reinforcement.ts
|
|
1630
1946
|
function patternReinforcementKey(content) {
|
|
1631
1947
|
return content.trim().toLowerCase().replace(/\s+/g, " ").slice(0, 200);
|
|
@@ -3411,22 +3727,6 @@ async function resolveRecallModeDecisionAsync(options) {
|
|
|
3411
3727
|
plannerHeuristicMode: planned.heuristicMode
|
|
3412
3728
|
};
|
|
3413
3729
|
}
|
|
3414
|
-
function hasIdentityRecoveryIntent(prompt) {
|
|
3415
|
-
const text = typeof prompt === "string" ? prompt.toLowerCase() : "";
|
|
3416
|
-
if (!text) return false;
|
|
3417
|
-
return /\b(identity|continuity|recover(?:y|ing|ed)?|incident|drift|restore|regress(?:ion|ed|ing)?)\b/i.test(
|
|
3418
|
-
text
|
|
3419
|
-
);
|
|
3420
|
-
}
|
|
3421
|
-
function resolveEffectiveIdentityInjectionMode(options) {
|
|
3422
|
-
if (options.configuredMode === "recovery_only" && !hasIdentityRecoveryIntent(options.prompt)) {
|
|
3423
|
-
return { mode: "recovery_only", shouldInject: false };
|
|
3424
|
-
}
|
|
3425
|
-
if (options.recallMode === "minimal" && options.configuredMode === "full") {
|
|
3426
|
-
return { mode: "minimal", shouldInject: true };
|
|
3427
|
-
}
|
|
3428
|
-
return { mode: options.configuredMode, shouldInject: true };
|
|
3429
|
-
}
|
|
3430
3730
|
function computeArtifactCandidateFetchLimit(targetCount) {
|
|
3431
3731
|
const cappedTarget = Math.max(0, targetCount);
|
|
3432
3732
|
if (cappedTarget === 0) return 0;
|
|
@@ -3811,6 +4111,11 @@ var Orchestrator = class _Orchestrator {
|
|
|
3811
4111
|
* hands it to `enqueue`.
|
|
3812
4112
|
*/
|
|
3813
4113
|
extractionQueueCoordinator;
|
|
4114
|
+
/**
|
|
4115
|
+
* Issue #1526: recall result formatting + identity continuity section moved
|
|
4116
|
+
* to RecallResultFormatter.
|
|
4117
|
+
*/
|
|
4118
|
+
recallResultFormatter;
|
|
3814
4119
|
heartbeatObserverChains = /* @__PURE__ */ new Map();
|
|
3815
4120
|
recentExtractionFingerprints = /* @__PURE__ */ new Map();
|
|
3816
4121
|
consolidationObservers = /* @__PURE__ */ new Set();
|
|
@@ -4323,7 +4628,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4323
4628
|
this.contentHashIndexesByStorageDir.clear();
|
|
4324
4629
|
}
|
|
4325
4630
|
async contentHashIndexForStorage(targetStorage) {
|
|
4326
|
-
if (!this.config.
|
|
4631
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).factDeduplication) return null;
|
|
4327
4632
|
if (targetStorage.dir === this.storage.dir) {
|
|
4328
4633
|
if (!this.contentHashIndex) {
|
|
4329
4634
|
this.contentHashIndex = this.storage.createContentHashIndex();
|
|
@@ -4480,7 +4785,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4480
4785
|
this.storage.citationTemplate = config.inlineSourceAttributionFormat;
|
|
4481
4786
|
if (config.defaultNamespace) this.storageRouter.bindCatalogWriteHook(this.storage, config.defaultNamespace);
|
|
4482
4787
|
this.storage.setVersioningConfig({
|
|
4483
|
-
enabled: config.
|
|
4788
|
+
enabled: resolveRecallAuxiliaryCapabilities(config).versioning,
|
|
4484
4789
|
maxVersionsPerPage: config.versioningMaxPerPage,
|
|
4485
4790
|
sidecarDir: config.versioningSidecarDir
|
|
4486
4791
|
});
|
|
@@ -4496,7 +4801,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4496
4801
|
semanticMatch: tombstonesSemanticMatch,
|
|
4497
4802
|
semanticThreshold: tombstonesSemanticThreshold
|
|
4498
4803
|
});
|
|
4499
|
-
if (config.
|
|
4804
|
+
if (resolveRecallAuxiliaryCapabilities(config).secureStore) {
|
|
4500
4805
|
this.storage.setSecureStoreRequired(true);
|
|
4501
4806
|
const storeId = secureStoreDir(config.memoryDir);
|
|
4502
4807
|
const existingKey = keyring_exports.getKey(storeId);
|
|
@@ -4516,6 +4821,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4516
4821
|
namespaceCatalog: this.namespaceCatalog
|
|
4517
4822
|
});
|
|
4518
4823
|
this.extractionQueueCoordinator = new ExtractionQueueCoordinator();
|
|
4824
|
+
this.recallResultFormatter = new RecallResultFormatter(this.config);
|
|
4519
4825
|
const conversationIndexRuntime = createConversationIndexRuntime(config, {
|
|
4520
4826
|
getQmd: () => this.conversationQmd,
|
|
4521
4827
|
getFaiss: () => this.conversationFaiss
|
|
@@ -4524,7 +4830,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4524
4830
|
this.conversationFaiss = conversationIndexRuntime.faiss;
|
|
4525
4831
|
this.conversationIndexBackend = conversationIndexRuntime.backend;
|
|
4526
4832
|
this.sharedContext = config.sharedContextEnabled ? new SharedContextManager(config) : void 0;
|
|
4527
|
-
this.compounding = config.
|
|
4833
|
+
this.compounding = resolveConsolidationCapabilities(config).compounding ? new CompoundingEngine(config, this.storage) : void 0;
|
|
4528
4834
|
this.buffer = new SmartBuffer(config, this.storage);
|
|
4529
4835
|
this.transcript = new TranscriptManager(config);
|
|
4530
4836
|
this.conversationIndexDir = path4.join(
|
|
@@ -4669,7 +4975,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4669
4975
|
this.boxBuilders.set(
|
|
4670
4976
|
dir,
|
|
4671
4977
|
new BoxBuilder(dir, {
|
|
4672
|
-
memoryBoxesEnabled: this.config.
|
|
4978
|
+
memoryBoxesEnabled: resolvePresentationCapabilities(this.config).memoryBoxes,
|
|
4673
4979
|
traceWeaverEnabled: this.config.traceWeaverEnabled,
|
|
4674
4980
|
boxTopicShiftThreshold: this.config.boxTopicShiftThreshold,
|
|
4675
4981
|
boxTimeGapMs: this.config.boxTimeGapMs,
|
|
@@ -4916,7 +5222,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4916
5222
|
memoryUtilityLearningEnabled: resolveUtilityLearningCapabilities(this.config).memoryUtilityLearning,
|
|
4917
5223
|
promotionByOutcomeEnabled: resolveUtilityLearningCapabilities(this.config).promotionByOutcome
|
|
4918
5224
|
});
|
|
4919
|
-
if (this.config.
|
|
5225
|
+
if (resolveRecallAuxiliaryCapabilities(this.config).factDeduplication) {
|
|
4920
5226
|
this.contentHashIndex = this.storage.createContentHashIndex();
|
|
4921
5227
|
await this.contentHashIndex.load();
|
|
4922
5228
|
log.info(
|
|
@@ -4939,7 +5245,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
4939
5245
|
);
|
|
4940
5246
|
this.buffer.resetToEmpty();
|
|
4941
5247
|
}
|
|
4942
|
-
if (this.config.
|
|
5248
|
+
if (resolveRecallAuxiliaryCapabilities(this.config).compactionReset) {
|
|
4943
5249
|
try {
|
|
4944
5250
|
const wsDir = this.config.workspaceDir || defaultWorkspaceDir();
|
|
4945
5251
|
const files = await readdir(wsDir).catch(() => []);
|
|
@@ -5088,7 +5394,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
5088
5394
|
await Promise.all(warmupPromises);
|
|
5089
5395
|
if (signal.aborted) return;
|
|
5090
5396
|
const cacheWarmups = [];
|
|
5091
|
-
if (this.config.
|
|
5397
|
+
if (resolveRecallAuxiliaryCapabilities(this.config).knowledgeIndex) {
|
|
5092
5398
|
cacheWarmups.push(
|
|
5093
5399
|
(async () => {
|
|
5094
5400
|
try {
|
|
@@ -5140,7 +5446,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
5140
5446
|
if (signal.aborted) return;
|
|
5141
5447
|
if (lifecycleCaps.lifecyclePolicy && resolveQmdCapabilities(this.config).qmdTierMigration) {
|
|
5142
5448
|
try {
|
|
5143
|
-
const { runFirstStartMigration } = await import("./first-start-migration-
|
|
5449
|
+
const { runFirstStartMigration } = await import("./first-start-migration-5DXD3TF2.js");
|
|
5144
5450
|
const result = await runFirstStartMigration({
|
|
5145
5451
|
storage: this.storage,
|
|
5146
5452
|
config: this.config,
|
|
@@ -5314,7 +5620,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
5314
5620
|
*/
|
|
5315
5621
|
async runPatternReinforcement(options = {}) {
|
|
5316
5622
|
const cadenceKey = options.namespace ?? "";
|
|
5317
|
-
if (!this.config.
|
|
5623
|
+
if (!resolveConsolidationCapabilities(this.config).patternReinforcement) {
|
|
5318
5624
|
return { ran: false, skippedReason: "disabled", namespace: cadenceKey };
|
|
5319
5625
|
}
|
|
5320
5626
|
const cadence = this.config.patternReinforcementCadenceMs;
|
|
@@ -5355,7 +5661,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
5355
5661
|
}
|
|
5356
5662
|
return result.result ? { itemCount: result.result.clustersFound } : { itemCount: 0 };
|
|
5357
5663
|
},
|
|
5358
|
-
{ enabled: this.config.
|
|
5664
|
+
{ enabled: resolveConsolidationCapabilities(this.config).patternReinforcement }
|
|
5359
5665
|
);
|
|
5360
5666
|
}
|
|
5361
5667
|
/**
|
|
@@ -5395,7 +5701,7 @@ var Orchestrator = class _Orchestrator {
|
|
|
5395
5701
|
});
|
|
5396
5702
|
return { itemCount: result.clustersFound };
|
|
5397
5703
|
},
|
|
5398
|
-
{ enabled: this.config.
|
|
5704
|
+
{ enabled: resolveConsolidationCapabilities(this.config).semanticConsolidation }
|
|
5399
5705
|
);
|
|
5400
5706
|
}
|
|
5401
5707
|
/**
|
|
@@ -6279,7 +6585,7 @@ ${r.snippet.trim()}
|
|
|
6279
6585
|
log.warn("recall: init gate timed out \u2014 proceeding without full init");
|
|
6280
6586
|
}
|
|
6281
6587
|
}
|
|
6282
|
-
if (this.config.
|
|
6588
|
+
if (resolveRecallAuxiliaryCapabilities(this.config).secureStore && !this.storage.isSecureStoreUnlocked()) {
|
|
6283
6589
|
const lockedMsg = "[secure-store locked] Memory store is encrypted and locked. Unlock the secure-store inside this daemon process, or restart the daemon through a secure-store aware launcher that installs the key.";
|
|
6284
6590
|
log.warn("recall blocked: secure-store is locked");
|
|
6285
6591
|
return lockedMsg;
|
|
@@ -6383,7 +6689,7 @@ ${r.snippet.trim()}
|
|
|
6383
6689
|
});
|
|
6384
6690
|
const observationNamespaces = observationScopePlan.readNamespaces;
|
|
6385
6691
|
const observationQueryPolicy = buildRecallQueryPolicy(prompt, sessionKey, {
|
|
6386
|
-
cronRecallPolicyEnabled: this.config.
|
|
6692
|
+
cronRecallPolicyEnabled: resolveRecallAuxiliaryCapabilities(this.config).cronRecallPolicy,
|
|
6387
6693
|
cronRecallNormalizedQueryMaxChars: this.config.cronRecallNormalizedQueryMaxChars,
|
|
6388
6694
|
cronRecallInstructionHeavyTokenCap: this.effectiveCronRecallInstructionHeavyTokenCap(),
|
|
6389
6695
|
cronConversationRecallMode: this.config.cronConversationRecallMode
|
|
@@ -7415,7 +7721,7 @@ ${r.snippet.trim()}
|
|
|
7415
7721
|
const traceId = createHash2("sha256").update(`${sessionKey ?? "default"}:${recallStart}:${promptHash}`).digest("hex").slice(0, 16);
|
|
7416
7722
|
const sectionBuckets = /* @__PURE__ */ new Map();
|
|
7417
7723
|
const queryPolicy = buildRecallQueryPolicy(prompt, sessionKey, {
|
|
7418
|
-
cronRecallPolicyEnabled: this.config.
|
|
7724
|
+
cronRecallPolicyEnabled: resolveRecallAuxiliaryCapabilities(this.config).cronRecallPolicy,
|
|
7419
7725
|
cronRecallNormalizedQueryMaxChars: this.config.cronRecallNormalizedQueryMaxChars,
|
|
7420
7726
|
cronRecallInstructionHeavyTokenCap: this.effectiveCronRecallInstructionHeavyTokenCap(),
|
|
7421
7727
|
cronConversationRecallMode: this.config.cronConversationRecallMode
|
|
@@ -7500,7 +7806,7 @@ ${r.snippet.trim()}
|
|
|
7500
7806
|
}
|
|
7501
7807
|
return limit;
|
|
7502
7808
|
})() : 0;
|
|
7503
|
-
const recallHeadroom = this.config.
|
|
7809
|
+
const recallHeadroom = resolvePresentationCapabilities(this.config).verbatimArtifacts ? Math.max(12, this.config.verbatimArtifactsMaxRecall * 4) : 12;
|
|
7504
7810
|
const computedFetchLimit = recallResultLimit === 0 ? 0 : Math.max(
|
|
7505
7811
|
recallResultLimit,
|
|
7506
7812
|
Math.min(200, recallResultLimit + recallHeadroom)
|
|
@@ -7508,7 +7814,7 @@ ${r.snippet.trim()}
|
|
|
7508
7814
|
const qmdFetchLimit = computedFetchLimit;
|
|
7509
7815
|
const qmdHybridFetchLimit = computeQmdHybridFetchLimit(
|
|
7510
7816
|
qmdFetchLimit,
|
|
7511
|
-
this.config.
|
|
7817
|
+
resolvePresentationCapabilities(this.config).verbatimArtifacts,
|
|
7512
7818
|
this.config.verbatimArtifactsMaxRecall
|
|
7513
7819
|
);
|
|
7514
7820
|
const embeddingFetchLimit = computedFetchLimit;
|
|
@@ -8016,10 +8322,10 @@ ${lines.join("\n\n")}`;
|
|
|
8016
8322
|
const entityRetrievalPromise = (async () => {
|
|
8017
8323
|
if (!this.isRecallSectionEnabled(
|
|
8018
8324
|
"entity-retrieval",
|
|
8019
|
-
this.config.
|
|
8325
|
+
resolveRecallAuxiliaryCapabilities(this.config).entityRetrieval
|
|
8020
8326
|
))
|
|
8021
8327
|
return null;
|
|
8022
|
-
if (!this.config.
|
|
8328
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).entityRetrieval) return null;
|
|
8023
8329
|
const maxChars = this.getRecallSectionMaxChars("entity-retrieval") ?? this.config.entityRetrievalMaxChars;
|
|
8024
8330
|
const maxHints = this.getRecallSectionNumber("entity-retrieval", "maxHints") ?? this.config.entityRetrievalMaxHints;
|
|
8025
8331
|
const maxSupportingFacts = this.getRecallSectionNumber("entity-retrieval", "maxSupportingFacts") ?? this.config.entityRetrievalMaxSupportingFacts;
|
|
@@ -8074,10 +8380,10 @@ ${lines.join("\n\n")}`;
|
|
|
8074
8380
|
const knowledgeIndexPromise = (async () => {
|
|
8075
8381
|
if (!this.isRecallSectionEnabled(
|
|
8076
8382
|
"knowledge-index",
|
|
8077
|
-
this.config.
|
|
8383
|
+
resolveRecallAuxiliaryCapabilities(this.config).knowledgeIndex
|
|
8078
8384
|
))
|
|
8079
8385
|
return null;
|
|
8080
|
-
if (!this.config.
|
|
8386
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).knowledgeIndex) return null;
|
|
8081
8387
|
const t0 = Date.now();
|
|
8082
8388
|
try {
|
|
8083
8389
|
const knowledgeIndexMaxChars = this.getRecallSectionNumber("knowledge-index", "maxChars") ?? this.config.knowledgeIndexMaxChars;
|
|
@@ -8153,10 +8459,10 @@ ${rows.join("\n")}
|
|
|
8153
8459
|
const artifactsPromise = (async () => {
|
|
8154
8460
|
if (!this.isRecallSectionEnabled(
|
|
8155
8461
|
"verbatim-artifacts",
|
|
8156
|
-
this.config.
|
|
8462
|
+
resolvePresentationCapabilities(this.config).verbatimArtifacts === true
|
|
8157
8463
|
))
|
|
8158
8464
|
return [];
|
|
8159
|
-
if (!this.config.
|
|
8465
|
+
if (!resolvePresentationCapabilities(this.config).verbatimArtifacts) return [];
|
|
8160
8466
|
const t0 = Date.now();
|
|
8161
8467
|
const targetCount = computeArtifactRecallLimit(
|
|
8162
8468
|
recallMode,
|
|
@@ -8353,9 +8659,9 @@ ${rows.join("\n")}
|
|
|
8353
8659
|
})();
|
|
8354
8660
|
const calibrationPromise = (async () => {
|
|
8355
8661
|
const t0 = Date.now();
|
|
8356
|
-
if (!this.config.
|
|
8662
|
+
if (!resolveConsolidationCapabilities(this.config).calibration || !this.isRecallSectionEnabled(
|
|
8357
8663
|
"calibration-rules",
|
|
8358
|
-
this.config.
|
|
8664
|
+
resolveConsolidationCapabilities(this.config).calibration === true
|
|
8359
8665
|
)) {
|
|
8360
8666
|
recordRecallSectionMetric({
|
|
8361
8667
|
section: "calibrationRules",
|
|
@@ -8501,7 +8807,7 @@ ${rows.join("\n")}
|
|
|
8501
8807
|
query: retrievalQuery,
|
|
8502
8808
|
maxResults,
|
|
8503
8809
|
sessionKey,
|
|
8504
|
-
anchorsEnabled: this.config.
|
|
8810
|
+
anchorsEnabled: resolveConsolidationCapabilities(this.config).abstractionAnchors,
|
|
8505
8811
|
abortSignal: harmonicRetrievalAbort.signal
|
|
8506
8812
|
})
|
|
8507
8813
|
)
|
|
@@ -8530,9 +8836,9 @@ ${rows.join("\n")}
|
|
|
8530
8836
|
);
|
|
8531
8837
|
const verifiedRecallPromise = (async () => {
|
|
8532
8838
|
const t0 = Date.now();
|
|
8533
|
-
if (!this.config.
|
|
8839
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).verifiedRecall || !this.isRecallSectionEnabled(
|
|
8534
8840
|
"verified-episodes",
|
|
8535
|
-
this.config.
|
|
8841
|
+
resolveRecallAuxiliaryCapabilities(this.config).verifiedRecall === true
|
|
8536
8842
|
)) {
|
|
8537
8843
|
recordRecallSectionMetric({
|
|
8538
8844
|
section: "verifiedRecall",
|
|
@@ -8610,9 +8916,9 @@ ${rows.join("\n")}
|
|
|
8610
8916
|
})();
|
|
8611
8917
|
const verifiedRulesPromise = (async () => {
|
|
8612
8918
|
const t0 = Date.now();
|
|
8613
|
-
if (!this.config.
|
|
8919
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).semanticRuleVerification || !this.isRecallSectionEnabled(
|
|
8614
8920
|
"verified-rules",
|
|
8615
|
-
this.config.
|
|
8921
|
+
resolveRecallAuxiliaryCapabilities(this.config).semanticRuleVerification === true
|
|
8616
8922
|
)) {
|
|
8617
8923
|
recordRecallSectionMetric({
|
|
8618
8924
|
section: "verifiedRules",
|
|
@@ -8689,9 +8995,9 @@ ${rows.join("\n")}
|
|
|
8689
8995
|
})();
|
|
8690
8996
|
const workProductsPromise = (async () => {
|
|
8691
8997
|
const t0 = Date.now();
|
|
8692
|
-
if (!resolveCreationMemoryCapabilities(this.config).creationMemory || !this.config.
|
|
8998
|
+
if (!resolveCreationMemoryCapabilities(this.config).creationMemory || !resolveRecallAuxiliaryCapabilities(this.config).workProductRecall || !this.isRecallSectionEnabled(
|
|
8693
8999
|
"work-products",
|
|
8694
|
-
this.config.
|
|
9000
|
+
resolveRecallAuxiliaryCapabilities(this.config).workProductRecall === true
|
|
8695
9001
|
)) {
|
|
8696
9002
|
recordRecallSectionMetric({
|
|
8697
9003
|
section: "workProducts",
|
|
@@ -9101,7 +9407,7 @@ ${rows.join("\n")}
|
|
|
9101
9407
|
);
|
|
9102
9408
|
const transcriptPromise = (async () => {
|
|
9103
9409
|
const t0 = Date.now();
|
|
9104
|
-
if (!this.config.
|
|
9410
|
+
if (!resolvePresentationCapabilities(this.config).transcript || !this.isRecallSectionEnabled("transcript", true)) {
|
|
9105
9411
|
recordRecallSectionMetric({
|
|
9106
9412
|
section: "transcript",
|
|
9107
9413
|
priority: "core",
|
|
@@ -9183,7 +9489,7 @@ ${formatted}`;
|
|
|
9183
9489
|
const effectiveSessionKey = sessionKey ?? "default";
|
|
9184
9490
|
const compactionWorkspaceDir = this._recallWorkspaceOverrides.get(effectiveSessionKey);
|
|
9185
9491
|
this._recallWorkspaceOverrides.delete(effectiveSessionKey);
|
|
9186
|
-
if (!this.config.
|
|
9492
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).compactionReset) return null;
|
|
9187
9493
|
const workspaceDir = compactionWorkspaceDir || this.config.workspaceDir || defaultWorkspaceDir();
|
|
9188
9494
|
const safeSessionKey = sanitizeSessionKeyForFilename(effectiveSessionKey);
|
|
9189
9495
|
const signalPath = path4.join(
|
|
@@ -9467,8 +9773,8 @@ ${formatted}`;
|
|
|
9467
9773
|
const recentBoxesPromise = observeEnrichmentPromise(
|
|
9468
9774
|
this.isRecallSectionEnabled(
|
|
9469
9775
|
"memory-boxes",
|
|
9470
|
-
this.config.
|
|
9471
|
-
) && this.config.
|
|
9776
|
+
resolvePresentationCapabilities(this.config).memoryBoxes === true
|
|
9777
|
+
) && resolvePresentationCapabilities(this.config).memoryBoxes && this.config.boxRecallDays > 0 ? Promise.all(
|
|
9472
9778
|
profileStorages.map(
|
|
9473
9779
|
(storage) => this.boxBuilderFor(storage).readRecentBoxes(this.config.boxRecallDays).catch(() => [])
|
|
9474
9780
|
)
|
|
@@ -11753,7 +12059,7 @@ ${normalized}`).digest("hex");
|
|
|
11753
12059
|
async maybeCapturePassiveCorrections(turns, opts) {
|
|
11754
12060
|
const mode = this.config.correctionCaptureMode;
|
|
11755
12061
|
if (mode === "off") return;
|
|
11756
|
-
if (!this.config.
|
|
12062
|
+
if (!resolveRecallAuxiliaryCapabilities(this.config).correction) return;
|
|
11757
12063
|
try {
|
|
11758
12064
|
const corrections = detectPassiveCorrections(
|
|
11759
12065
|
turns.map((t) => ({ role: t.role, content: t.content }))
|
|
@@ -11769,7 +12075,7 @@ ${normalized}`).digest("hex");
|
|
|
11769
12075
|
const result = await capturePassiveCorrections(
|
|
11770
12076
|
corrections,
|
|
11771
12077
|
{
|
|
11772
|
-
correctionEnabled: this.config.
|
|
12078
|
+
correctionEnabled: resolveRecallAuxiliaryCapabilities(this.config).correction,
|
|
11773
12079
|
isLiveSession: opts.isLiveSession,
|
|
11774
12080
|
bufferKey: opts.bufferKey,
|
|
11775
12081
|
sessionKey: opts.sessionKey,
|
|
@@ -12083,7 +12389,7 @@ ${normalized}`).digest("hex");
|
|
|
12083
12389
|
return { status: "skipped", reason: "empty_extraction_result", persistedCount: 0, durableOutputCount: 0 };
|
|
12084
12390
|
}
|
|
12085
12391
|
let threadIdForExtraction = null;
|
|
12086
|
-
if (this.config.
|
|
12392
|
+
if (resolvePresentationCapabilities(this.config).threading && turns.length > 0) {
|
|
12087
12393
|
const lastTurn = turns[turns.length - 1];
|
|
12088
12394
|
try {
|
|
12089
12395
|
threadIdForExtraction = await this.threading.processTurn(lastTurn, []);
|
|
@@ -12164,7 +12470,7 @@ ${normalized}`).digest("hex");
|
|
|
12164
12470
|
bufferKey,
|
|
12165
12471
|
isLiveSession: clearBufferAfterExtraction
|
|
12166
12472
|
});
|
|
12167
|
-
if (this.config.
|
|
12473
|
+
if (resolvePresentationCapabilities(this.config).memoryBoxes && persistedIds.length > 0) {
|
|
12168
12474
|
const extractionTopics = deriveTopicsFromExtraction(result);
|
|
12169
12475
|
const firstUserTurn = turns.find((t) => t.role === "user");
|
|
12170
12476
|
const boxGoal = firstUserTurn?.content?.slice(0, 100)?.trim() || void 0;
|
|
@@ -12177,13 +12483,13 @@ ${normalized}`).digest("hex");
|
|
|
12177
12483
|
(err) => log.warn("[boxes] onExtraction failed (non-fatal)", err)
|
|
12178
12484
|
);
|
|
12179
12485
|
}
|
|
12180
|
-
if (this.config.
|
|
12486
|
+
if (resolvePresentationCapabilities(this.config).threading && threadIdForExtraction && persistedIds.length > 0) {
|
|
12181
12487
|
await this.appendPersistedThreadEpisodes(
|
|
12182
12488
|
threadIdForExtraction,
|
|
12183
12489
|
persistedIds
|
|
12184
12490
|
);
|
|
12185
12491
|
}
|
|
12186
|
-
if (this.config.
|
|
12492
|
+
if (resolvePresentationCapabilities(this.config).threading && threadIdForExtraction) {
|
|
12187
12493
|
const conversationContent = turns.map((t) => t.content).join(" ");
|
|
12188
12494
|
try {
|
|
12189
12495
|
await this.threading.updateThreadTitle(
|
|
@@ -13217,7 +13523,7 @@ ${normalized}`).digest("hex");
|
|
|
13217
13523
|
chunkResult = chunkContent(fact.content, chunkingConfig);
|
|
13218
13524
|
}
|
|
13219
13525
|
if (chunkResult.chunked && chunkResult.chunks.length > 1) {
|
|
13220
|
-
const memoryKind2 = this.config.
|
|
13526
|
+
const memoryKind2 = resolvePresentationCapabilities(this.config).episodeNoteMode ? classifyMemoryKind(fact.content, fact.tags ?? [], writeCategory) : void 0;
|
|
13221
13527
|
const rawChunkedContent = citationEnabled && hasCitationForTemplate(fact.content, citationTemplate) ? stripCitationForTemplate(fact.content, citationTemplate) : fact.content;
|
|
13222
13528
|
const citedChunkedContent = applyInlineCitation(rawChunkedContent);
|
|
13223
13529
|
const parentWrite = await targetStorage.writeMemory(
|
|
@@ -13383,7 +13689,7 @@ ${normalized}`).digest("hex");
|
|
|
13383
13689
|
}
|
|
13384
13690
|
}
|
|
13385
13691
|
try {
|
|
13386
|
-
if (this.config.
|
|
13692
|
+
if (resolvePresentationCapabilities(this.config).verbatimArtifacts && this.config.verbatimArtifactCategories.includes(writeCategory) && fact.confidence >= this.config.verbatimArtifactsMinConfidence && !postWriteGuard2) {
|
|
13387
13693
|
await targetStorage.writeArtifact(citedChunkedContent, {
|
|
13388
13694
|
confidence: fact.confidence,
|
|
13389
13695
|
tags: [...fact.tags, "artifact", "chunked-parent"],
|
|
@@ -13457,7 +13763,7 @@ ${normalized}`).digest("hex");
|
|
|
13457
13763
|
links.push(...suggestedLinks);
|
|
13458
13764
|
}
|
|
13459
13765
|
}
|
|
13460
|
-
const memoryKind = writeCategory === "procedure" ? void 0 : this.config.
|
|
13766
|
+
const memoryKind = writeCategory === "procedure" ? void 0 : resolvePresentationCapabilities(this.config).episodeNoteMode ? classifyMemoryKind(fact.content, fact.tags ?? [], writeCategory) : void 0;
|
|
13461
13767
|
const rawPersistBody = writeCategory === "procedure" ? buildProcedurePersistBody(fact.content, fact.procedureSteps) : fact.content;
|
|
13462
13768
|
const citedFactContent = applyInlineCitation(rawPersistBody);
|
|
13463
13769
|
const factWrite = await targetStorage.writeMemory(
|
|
@@ -13599,7 +13905,7 @@ ${normalized}`).digest("hex");
|
|
|
13599
13905
|
} catch {
|
|
13600
13906
|
}
|
|
13601
13907
|
}
|
|
13602
|
-
if (this.config.
|
|
13908
|
+
if (resolvePresentationCapabilities(this.config).verbatimArtifacts && this.config.verbatimArtifactCategories.includes(writeCategory) && fact.confidence >= this.config.verbatimArtifactsMinConfidence && !postWriteGuard) {
|
|
13603
13909
|
await targetStorage.writeArtifact(citedFactContent, {
|
|
13604
13910
|
confidence: fact.confidence,
|
|
13605
13911
|
tags: [...fact.tags, "artifact"],
|
|
@@ -13999,7 +14305,7 @@ ${normalized}`).digest("hex");
|
|
|
13999
14305
|
memoryItemMutated = true;
|
|
14000
14306
|
log.info(`merged ${entitiesMerged} fragmented entity files`);
|
|
14001
14307
|
}
|
|
14002
|
-
if (this.config.
|
|
14308
|
+
if (resolvePresentationCapabilities(this.config).entitySummary) {
|
|
14003
14309
|
try {
|
|
14004
14310
|
const synthesized = await this.processEntitySynthesisQueue(
|
|
14005
14311
|
this.config.defaultNamespace,
|
|
@@ -14114,7 +14420,7 @@ ${normalized}`).digest("hex");
|
|
|
14114
14420
|
throw err;
|
|
14115
14421
|
}
|
|
14116
14422
|
}
|
|
14117
|
-
if (this.config.
|
|
14423
|
+
if (resolveConsolidationCapabilities(this.config).semanticConsolidation) {
|
|
14118
14424
|
try {
|
|
14119
14425
|
const stateFilePath = path4.join(
|
|
14120
14426
|
this.config.memoryDir,
|
|
@@ -14361,306 +14667,58 @@ ${reflectionsContent.trim()}
|
|
|
14361
14667
|
const patternsSection = [
|
|
14362
14668
|
"## Learned Patterns (consolidated from reflections, " + (/* @__PURE__ */ new Date()).toISOString().slice(0, 10) + ")",
|
|
14363
14669
|
"",
|
|
14364
|
-
...result.learnedPatterns.map((p) => `- ${p}`),
|
|
14365
|
-
""
|
|
14366
|
-
].join("\n");
|
|
14367
|
-
const newContent = staticHeader + "\n\n" + patternsSection + "\n";
|
|
14368
|
-
await storage.writeIdentity(
|
|
14369
|
-
this.config.workspaceDir,
|
|
14370
|
-
newContent,
|
|
14371
|
-
identityNamespace
|
|
14372
|
-
);
|
|
14373
|
-
await storage.writeIdentityReflections("");
|
|
14374
|
-
log.info(
|
|
14375
|
-
`IDENTITY(${namespace}) consolidated: ${identityContent.length} \u2192 ${newContent.length} chars, ${result.learnedPatterns.length} patterns`
|
|
14376
|
-
);
|
|
14377
|
-
}
|
|
14378
|
-
}
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
);
|
|
14384
|
-
const renderHedge = this.config.trustScoreEpistemicRendering && trustByPath !== null && trustByPath !== void 0;
|
|
14385
|
-
const hedgeMap = renderHedge ? trustByPath : null;
|
|
14386
|
-
const lines = results.map((r, i) => {
|
|
14387
|
-
const snippet = r.snippet ? r.snippet.slice(0, 500).replace(/\n/g, " ") : "(no preview)";
|
|
14388
|
-
const source = typeof r.line === "number" ? `${r.path}:${r.line}` : r.path;
|
|
14389
|
-
const head = `[${i + 1}] ${source} (score: ${r.score.toFixed(3)})
|
|
14390
|
-
${snippet}`;
|
|
14391
|
-
const handle = handleByIndex.get(i);
|
|
14392
|
-
const hedged = head.replace(/\s+$/, "");
|
|
14393
|
-
const withHandle = handle ? `${hedged} ${handle}` : hedged;
|
|
14394
|
-
if (hedgeMap) {
|
|
14395
|
-
const item = hedgeMap.get(r.path);
|
|
14396
|
-
if (item) {
|
|
14397
|
-
const hedge = renderEpistemicHedge(item.trust);
|
|
14398
|
-
if (hedge.length > 0) return `${withHandle} ${hedge}`;
|
|
14399
|
-
}
|
|
14400
|
-
}
|
|
14401
|
-
return withHandle;
|
|
14402
|
-
});
|
|
14403
|
-
return `## ${title}
|
|
14404
|
-
|
|
14405
|
-
${lines.join("\n\n")}`;
|
|
14670
|
+
...result.learnedPatterns.map((p) => `- ${p}`),
|
|
14671
|
+
""
|
|
14672
|
+
].join("\n");
|
|
14673
|
+
const newContent = staticHeader + "\n\n" + patternsSection + "\n";
|
|
14674
|
+
await storage.writeIdentity(
|
|
14675
|
+
this.config.workspaceDir,
|
|
14676
|
+
newContent,
|
|
14677
|
+
identityNamespace
|
|
14678
|
+
);
|
|
14679
|
+
await storage.writeIdentityReflections("");
|
|
14680
|
+
log.info(
|
|
14681
|
+
`IDENTITY(${namespace}) consolidated: ${identityContent.length} \u2192 ${newContent.length} chars, ${result.learnedPatterns.length} patterns`
|
|
14682
|
+
);
|
|
14683
|
+
}
|
|
14684
|
+
}
|
|
14685
|
+
// Issue #1526: recall result formatting moved to RecallResultFormatter. Thin
|
|
14686
|
+
// delegation keeps the private API stable for callers + tests.
|
|
14687
|
+
formatQmdResults(title, results, sessionKey, trustByPath) {
|
|
14688
|
+
return this.recallResultFormatter.formatQmdResults(title, results, sessionKey, trustByPath);
|
|
14406
14689
|
}
|
|
14407
14690
|
formatObjectiveStateResults(results) {
|
|
14408
|
-
|
|
14409
|
-
const parts = [
|
|
14410
|
-
snapshot.recordedAt.replace("T", " ").slice(0, 16),
|
|
14411
|
-
`${snapshot.kind}/${snapshot.changeKind}`
|
|
14412
|
-
];
|
|
14413
|
-
if (snapshot.outcome) parts.push(snapshot.outcome);
|
|
14414
|
-
const header = `[${index + 1}] ${parts.join(" | ")} | ${snapshot.scope}`;
|
|
14415
|
-
const detailParts = [snapshot.summary];
|
|
14416
|
-
if (snapshot.command) detailParts.push(`command: ${snapshot.command}`);
|
|
14417
|
-
else if (snapshot.toolName)
|
|
14418
|
-
detailParts.push(`tool: ${snapshot.toolName}`);
|
|
14419
|
-
return `${header}
|
|
14420
|
-
${detailParts.join(" | ")}`;
|
|
14421
|
-
});
|
|
14422
|
-
return `## Objective State
|
|
14423
|
-
|
|
14424
|
-
${lines.join("\n\n")}`;
|
|
14691
|
+
return this.recallResultFormatter.formatObjectiveStateResults(results);
|
|
14425
14692
|
}
|
|
14426
14693
|
formatCausalTrajectoryResults(results) {
|
|
14427
|
-
|
|
14428
|
-
const header = [
|
|
14429
|
-
`[${index + 1}] ${record.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
14430
|
-
record.outcomeKind
|
|
14431
|
-
].join(" | ");
|
|
14432
|
-
const details = [
|
|
14433
|
-
`goal: ${record.goal}`,
|
|
14434
|
-
`action: ${record.actionSummary}`,
|
|
14435
|
-
`observation: ${record.observationSummary}`,
|
|
14436
|
-
`outcome: ${record.outcomeSummary}`
|
|
14437
|
-
];
|
|
14438
|
-
if (record.followUpSummary)
|
|
14439
|
-
details.push(`follow-up: ${record.followUpSummary}`);
|
|
14440
|
-
if (matchedFields.length > 0)
|
|
14441
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14442
|
-
return `${header}
|
|
14443
|
-
${details.join("\n")}`;
|
|
14444
|
-
});
|
|
14445
|
-
return `## Causal Trajectories
|
|
14446
|
-
|
|
14447
|
-
${lines.join("\n\n")}`;
|
|
14694
|
+
return this.recallResultFormatter.formatCausalTrajectoryResults(results);
|
|
14448
14695
|
}
|
|
14449
14696
|
formatTrustZoneResults(results) {
|
|
14450
|
-
|
|
14451
|
-
const header = [
|
|
14452
|
-
`[${index + 1}] ${record.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
14453
|
-
record.zone,
|
|
14454
|
-
record.kind
|
|
14455
|
-
].join(" | ");
|
|
14456
|
-
const details = [
|
|
14457
|
-
record.summary,
|
|
14458
|
-
`provenance: ${record.provenance.sourceClass}`
|
|
14459
|
-
];
|
|
14460
|
-
if (record.entityRefs && record.entityRefs.length > 0) {
|
|
14461
|
-
details.push(`entities: ${record.entityRefs.join(", ")}`);
|
|
14462
|
-
}
|
|
14463
|
-
if (record.tags && record.tags.length > 0) {
|
|
14464
|
-
details.push(`tags: ${record.tags.join(", ")}`);
|
|
14465
|
-
}
|
|
14466
|
-
if (matchedFields.length > 0) {
|
|
14467
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14468
|
-
}
|
|
14469
|
-
return `${header}
|
|
14470
|
-
${details.join("\n")}`;
|
|
14471
|
-
});
|
|
14472
|
-
return `## Trust Zones
|
|
14473
|
-
|
|
14474
|
-
${lines.join("\n\n")}`;
|
|
14697
|
+
return this.recallResultFormatter.formatTrustZoneResults(results);
|
|
14475
14698
|
}
|
|
14476
14699
|
formatHarmonicRetrievalResults(results) {
|
|
14477
|
-
|
|
14478
|
-
({ node, matchedAnchors, matchedFields, nodeScore, anchorScore }, index) => {
|
|
14479
|
-
const header = [
|
|
14480
|
-
`[${index + 1}] ${node.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
14481
|
-
`${node.kind}/${node.abstractionLevel}`,
|
|
14482
|
-
node.sessionKey
|
|
14483
|
-
].join(" | ");
|
|
14484
|
-
const details = [
|
|
14485
|
-
node.title,
|
|
14486
|
-
node.summary,
|
|
14487
|
-
`scores: node=${nodeScore.toFixed(1)} anchor=${anchorScore.toFixed(1)}`
|
|
14488
|
-
];
|
|
14489
|
-
if (matchedAnchors.length > 0) {
|
|
14490
|
-
details.push(
|
|
14491
|
-
`anchors: ${matchedAnchors.map((anchor) => `${anchor.anchorType}:${anchor.anchorValue}`).join("; ")}`
|
|
14492
|
-
);
|
|
14493
|
-
}
|
|
14494
|
-
if (matchedFields.length > 0) {
|
|
14495
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14496
|
-
}
|
|
14497
|
-
return `${header}
|
|
14498
|
-
${details.join("\n")}`;
|
|
14499
|
-
}
|
|
14500
|
-
);
|
|
14501
|
-
return `## Harmonic Retrieval
|
|
14502
|
-
|
|
14503
|
-
${lines.join("\n\n")}`;
|
|
14700
|
+
return this.recallResultFormatter.formatHarmonicRetrievalResults(results);
|
|
14504
14701
|
}
|
|
14505
14702
|
formatWorkProductResults(results) {
|
|
14506
|
-
|
|
14507
|
-
const header = [
|
|
14508
|
-
`[${index + 1}] ${entry.recordedAt.replace("T", " ").slice(0, 16)}`,
|
|
14509
|
-
`${entry.kind}/${entry.action}`,
|
|
14510
|
-
entry.sessionKey
|
|
14511
|
-
].join(" | ");
|
|
14512
|
-
const details = [entry.summary, `scope: ${entry.scope}`];
|
|
14513
|
-
if (entry.artifactPath) details.push(`artifact: ${entry.artifactPath}`);
|
|
14514
|
-
if (entry.tags && entry.tags.length > 0)
|
|
14515
|
-
details.push(`tags: ${entry.tags.join(", ")}`);
|
|
14516
|
-
if (matchedFields.length > 0)
|
|
14517
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14518
|
-
return `${header}
|
|
14519
|
-
${details.join("\n")}`;
|
|
14520
|
-
});
|
|
14521
|
-
return `## Work Products
|
|
14522
|
-
|
|
14523
|
-
${lines.join("\n\n")}`;
|
|
14703
|
+
return this.recallResultFormatter.formatWorkProductResults(results);
|
|
14524
14704
|
}
|
|
14525
14705
|
formatVerifiedEpisodeResults(results) {
|
|
14526
|
-
|
|
14527
|
-
({ box, verifiedEpisodeCount, matchedFields }, index) => {
|
|
14528
|
-
const header = [
|
|
14529
|
-
`[${index + 1}] ${box.sealedAt.replace("T", " ").slice(0, 16)}`,
|
|
14530
|
-
box.traceId ? `trace:${box.traceId.slice(0, 12)}` : "trace:none"
|
|
14531
|
-
].join(" | ");
|
|
14532
|
-
const details = [
|
|
14533
|
-
box.goal ?? `topics: ${box.topics.join(", ")}`,
|
|
14534
|
-
`verified episodes: ${verifiedEpisodeCount}`
|
|
14535
|
-
];
|
|
14536
|
-
if (box.toolsUsed && box.toolsUsed.length > 0) {
|
|
14537
|
-
details.push(`tools: ${box.toolsUsed.join(", ")}`);
|
|
14538
|
-
}
|
|
14539
|
-
if (matchedFields.length > 0) {
|
|
14540
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14541
|
-
}
|
|
14542
|
-
return `${header}
|
|
14543
|
-
${details.join("\n")}`;
|
|
14544
|
-
}
|
|
14545
|
-
);
|
|
14546
|
-
return `## Verified Episodes
|
|
14547
|
-
|
|
14548
|
-
${lines.join("\n\n")}`;
|
|
14706
|
+
return this.recallResultFormatter.formatVerifiedEpisodeResults(results);
|
|
14549
14707
|
}
|
|
14550
14708
|
formatVerifiedSemanticRuleResults(results) {
|
|
14551
|
-
|
|
14552
|
-
({
|
|
14553
|
-
rule,
|
|
14554
|
-
sourceMemoryId,
|
|
14555
|
-
verificationStatus,
|
|
14556
|
-
effectiveConfidence,
|
|
14557
|
-
matchedFields
|
|
14558
|
-
}, index) => {
|
|
14559
|
-
const header = [
|
|
14560
|
-
`[${index + 1}] ${rule.frontmatter.updated.replace("T", " ").slice(0, 16)}`,
|
|
14561
|
-
verificationStatus,
|
|
14562
|
-
`confidence:${effectiveConfidence.toFixed(2)}`
|
|
14563
|
-
].join(" | ");
|
|
14564
|
-
const details = [rule.content, `source memory: ${sourceMemoryId}`];
|
|
14565
|
-
if (matchedFields.length > 0) {
|
|
14566
|
-
details.push(`matched: ${matchedFields.join(", ")}`);
|
|
14567
|
-
}
|
|
14568
|
-
return `${header}
|
|
14569
|
-
${details.join("\n")}`;
|
|
14570
|
-
}
|
|
14571
|
-
);
|
|
14572
|
-
return `## Verified Rules
|
|
14573
|
-
|
|
14574
|
-
${lines.join("\n\n")}`;
|
|
14709
|
+
return this.recallResultFormatter.formatVerifiedSemanticRuleResults(results);
|
|
14575
14710
|
}
|
|
14576
14711
|
summarizeIdentityText(raw, maxLines, maxChars) {
|
|
14577
|
-
|
|
14578
|
-
const compact = lines.slice(0, Math.max(1, maxLines)).join(" ");
|
|
14579
|
-
if (compact.length <= maxChars) return compact;
|
|
14580
|
-
return `${compact.slice(0, Math.max(0, maxChars - 1))}\u2026`;
|
|
14712
|
+
return this.recallResultFormatter.summarizeIdentityText(raw, maxLines, maxChars);
|
|
14581
14713
|
}
|
|
14582
14714
|
formatOpenIncidentLine(incident, includeDetails) {
|
|
14583
|
-
|
|
14584
|
-
if (!includeDetails) return `- ${base}`;
|
|
14585
|
-
const parts = [base];
|
|
14586
|
-
if (incident.suspectedCause)
|
|
14587
|
-
parts.push(`cause: ${incident.suspectedCause.trim()}`);
|
|
14588
|
-
if (incident.triggerWindow)
|
|
14589
|
-
parts.push(`window: ${incident.triggerWindow.trim()}`);
|
|
14590
|
-
return `- ${parts.join(" | ")}`;
|
|
14715
|
+
return this.recallResultFormatter.formatOpenIncidentLine(incident, includeDetails);
|
|
14591
14716
|
}
|
|
14592
14717
|
trimIdentitySection(content, maxChars) {
|
|
14593
|
-
|
|
14594
|
-
if (content.length <= maxChars) return { text: content, truncated: false };
|
|
14595
|
-
const suffix = "\n\n...(identity continuity trimmed)";
|
|
14596
|
-
if (maxChars <= suffix.length) {
|
|
14597
|
-
return { text: content.slice(0, maxChars), truncated: true };
|
|
14598
|
-
}
|
|
14599
|
-
const headroom = Math.max(0, maxChars - suffix.length);
|
|
14600
|
-
return { text: `${content.slice(0, headroom)}${suffix}`, truncated: true };
|
|
14718
|
+
return this.recallResultFormatter.trimIdentitySection(content, maxChars);
|
|
14601
14719
|
}
|
|
14602
14720
|
async buildIdentityContinuitySection(options) {
|
|
14603
|
-
|
|
14604
|
-
if (this.config.identityMaxInjectChars <= 0) return null;
|
|
14605
|
-
const resolved = resolveEffectiveIdentityInjectionMode({
|
|
14606
|
-
configuredMode: this.config.identityInjectionMode,
|
|
14607
|
-
recallMode: options.recallMode,
|
|
14608
|
-
prompt: options.prompt
|
|
14609
|
-
});
|
|
14610
|
-
if (!resolved.shouldInject) return null;
|
|
14611
|
-
const [anchorRaw, loopsRaw, incidents] = await Promise.all([
|
|
14612
|
-
options.storage.readIdentityAnchor(),
|
|
14613
|
-
options.storage.readIdentityImprovementLoops(),
|
|
14614
|
-
options.storage.readContinuityIncidents(200)
|
|
14615
|
-
]);
|
|
14616
|
-
const openIncidents = incidents.filter(
|
|
14617
|
-
(incident) => incident.state === "open"
|
|
14618
|
-
);
|
|
14619
|
-
const lines = [];
|
|
14620
|
-
if (resolved.mode === "full") {
|
|
14621
|
-
lines.push("## Identity Continuity");
|
|
14622
|
-
if (anchorRaw && anchorRaw.trim().length > 0) {
|
|
14623
|
-
lines.push("", "### Anchor", "", anchorRaw.trim());
|
|
14624
|
-
}
|
|
14625
|
-
if (loopsRaw && loopsRaw.trim().length > 0) {
|
|
14626
|
-
lines.push("", "### Improvement Loops", "", loopsRaw.trim());
|
|
14627
|
-
}
|
|
14628
|
-
lines.push("", "### Open Incidents", "");
|
|
14629
|
-
if (openIncidents.length === 0) {
|
|
14630
|
-
lines.push("- none");
|
|
14631
|
-
} else {
|
|
14632
|
-
lines.push(
|
|
14633
|
-
...openIncidents.slice(0, 5).map((incident) => this.formatOpenIncidentLine(incident, true))
|
|
14634
|
-
);
|
|
14635
|
-
}
|
|
14636
|
-
} else {
|
|
14637
|
-
const anchorSummary = anchorRaw ? this.summarizeIdentityText(anchorRaw, 3, 320) : "";
|
|
14638
|
-
const loopsSummary = loopsRaw ? this.summarizeIdentityText(loopsRaw, 2, 240) : "";
|
|
14639
|
-
lines.push("## Identity Continuity Signals", "");
|
|
14640
|
-
if (anchorSummary) lines.push(`- anchor: ${anchorSummary}`);
|
|
14641
|
-
if (loopsSummary) lines.push(`- loops: ${loopsSummary}`);
|
|
14642
|
-
if (openIncidents.length === 0) {
|
|
14643
|
-
lines.push("- incidents: 0 open");
|
|
14644
|
-
} else {
|
|
14645
|
-
lines.push(`- incidents: ${openIncidents.length} open`);
|
|
14646
|
-
lines.push(
|
|
14647
|
-
...openIncidents.slice(0, 2).map((incident) => this.formatOpenIncidentLine(incident, false))
|
|
14648
|
-
);
|
|
14649
|
-
}
|
|
14650
|
-
}
|
|
14651
|
-
const body = lines.join("\n").trim();
|
|
14652
|
-
if (!body) return null;
|
|
14653
|
-
const { text, truncated } = this.trimIdentitySection(
|
|
14654
|
-
body,
|
|
14655
|
-
this.config.identityMaxInjectChars
|
|
14656
|
-
);
|
|
14657
|
-
if (!text) return null;
|
|
14658
|
-
return {
|
|
14659
|
-
section: text,
|
|
14660
|
-
mode: resolved.mode,
|
|
14661
|
-
injectedChars: text.length,
|
|
14662
|
-
truncated
|
|
14663
|
-
};
|
|
14721
|
+
return this.recallResultFormatter.buildIdentityContinuitySection(options);
|
|
14664
14722
|
}
|
|
14665
14723
|
emitTrace(event) {
|
|
14666
14724
|
try {
|
|
@@ -16339,6 +16397,8 @@ ${lines.join("\n\n")}`;
|
|
|
16339
16397
|
|
|
16340
16398
|
export {
|
|
16341
16399
|
buildProcedureRecallSection,
|
|
16400
|
+
hasIdentityRecoveryIntent,
|
|
16401
|
+
resolveEffectiveIdentityInjectionMode,
|
|
16342
16402
|
decideSemanticDedup,
|
|
16343
16403
|
DEFAULT_TAXONOMY,
|
|
16344
16404
|
generateResolverDocument,
|
|
@@ -16368,8 +16428,6 @@ export {
|
|
|
16368
16428
|
resolveEffectiveRecallMode,
|
|
16369
16429
|
resolveRecallModeDecision,
|
|
16370
16430
|
resolveRecallModeDecisionAsync,
|
|
16371
|
-
hasIdentityRecoveryIntent,
|
|
16372
|
-
resolveEffectiveIdentityInjectionMode,
|
|
16373
16431
|
computeArtifactCandidateFetchLimit,
|
|
16374
16432
|
computeQmdHybridFetchLimit,
|
|
16375
16433
|
mergeGraphExpandedResults,
|
|
@@ -16383,4 +16441,4 @@ export {
|
|
|
16383
16441
|
resolvePersistedMemoryRelativePath,
|
|
16384
16442
|
Orchestrator
|
|
16385
16443
|
};
|
|
16386
|
-
//# sourceMappingURL=chunk-
|
|
16444
|
+
//# sourceMappingURL=chunk-EKQ3LWBM.js.map
|