@remnic/core 10.0.50 → 10.0.52
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-admin-ops-surface.js +22 -22
- package/dist/access-authorization-probe.js +23 -23
- package/dist/access-boundary.d.ts +6 -1
- package/dist/access-boundary.d.ts.map +1 -1
- package/dist/access-boundary.js +22 -22
- package/dist/access-cli.js +68 -68
- package/dist/access-errors.d.ts.map +1 -1
- package/dist/access-errors.js +1 -1
- package/dist/access-extraction-force-flush.js +22 -22
- package/dist/access-http-briefing.js +23 -23
- package/dist/access-http-query.js +24 -24
- package/dist/access-http.js +42 -42
- package/dist/access-identity-continuity-surface.js +22 -22
- package/dist/access-lcm-surface.js +22 -22
- package/dist/access-mcp.js +32 -32
- package/dist/access-memory-search-fanout.js +2 -2
- package/dist/access-namespace-preflight.js +22 -22
- package/dist/access-observe-write-category.js +2 -2
- package/dist/access-observe-write-surface.js +22 -22
- package/dist/access-offline-manifest.js +2 -2
- package/dist/access-operations-batch.js +23 -23
- package/dist/access-operations.js +30 -30
- package/dist/access-recall-concurrency.js +22 -22
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +22 -22
- package/dist/access-recall-surface.js +22 -22
- package/dist/access-schema.d.ts +245 -773
- package/dist/access-schema.d.ts.map +1 -1
- package/dist/access-schema.js +1 -1
- package/dist/access-service.js +22 -22
- package/dist/access-surface-catalog.js +24 -24
- package/dist/access-token-capabilities.js +2 -2
- package/dist/active-recall.js +5 -5
- package/dist/briefing.js +3 -3
- package/dist/causal-consolidation.js +4 -4
- package/dist/{chunk-7YVER7ZO.js → chunk-2EXF6IIB.js} +2 -2
- package/dist/{chunk-HPNXS6W6.js → chunk-2ONKXEC7.js} +3 -3
- package/dist/{chunk-DMKTOCC7.js → chunk-2S6JADBB.js} +2 -2
- package/dist/{chunk-ZSEFGDCI.js → chunk-2TGIKMMZ.js} +2 -2
- package/dist/{chunk-Q3PNQYAC.js → chunk-44EUCSG4.js} +2 -2
- package/dist/{chunk-PJCVI44H.js → chunk-4FM35YIA.js} +3 -3
- package/dist/{chunk-M6TP6UYD.js → chunk-6ZAU7LAR.js} +2 -2
- package/dist/{chunk-SJTSWG2Z.js → chunk-72CBJ5VP.js} +3 -3
- package/dist/{chunk-EKYWZYZJ.js → chunk-75BK4XGV.js} +17 -17
- package/dist/{chunk-HKOMHP6D.js → chunk-A6JDT6QF.js} +2 -2
- package/dist/{chunk-TFWJXWL6.js → chunk-AHGOOZUC.js} +2 -2
- package/dist/{chunk-A7AISUJI.js → chunk-AJG2TAMR.js} +2 -2
- package/dist/{chunk-VCOMACR6.js → chunk-AZLD4CKG.js} +19 -19
- package/dist/{chunk-GXVXBYRA.js → chunk-B35EQQ7L.js} +3 -3
- package/dist/{chunk-E6UNM67F.js → chunk-B6SPPYGJ.js} +2 -2
- package/dist/{chunk-TXKQBQYW.js → chunk-CK6GCGMX.js} +3 -3
- package/dist/{chunk-NPLM7AFU.js → chunk-DF6ZF2BN.js} +3 -3
- package/dist/{chunk-6ZQX3R66.js → chunk-DJFULNXK.js} +4 -4
- package/dist/{chunk-JBWD3J5U.js → chunk-DQOGZZJA.js} +3 -3
- package/dist/{chunk-K5QQXVG6.js → chunk-EC2KVA27.js} +7 -7
- package/dist/{chunk-N74WJ7B2.js → chunk-EZS6QJNC.js} +2 -2
- package/dist/{chunk-MWURUSRE.js → chunk-FNNGWN3O.js} +2 -2
- package/dist/{chunk-5FUDSK6Z.js → chunk-FT75AQ74.js} +3 -3
- package/dist/{chunk-ZMO2S5RT.js → chunk-G6A3SGCE.js} +3 -3
- package/dist/chunk-G6A3SGCE.js.map +1 -0
- package/dist/{chunk-IMKOJVD4.js → chunk-GBGU5OZP.js} +52 -51
- package/dist/chunk-GBGU5OZP.js.map +1 -0
- package/dist/{chunk-5X2H3X4J.js → chunk-GE3ZX6YK.js} +2 -2
- package/dist/{chunk-UNOAVHV4.js → chunk-HCIRR3BA.js} +3 -3
- package/dist/{chunk-MLNXATFG.js → chunk-HEF4BRMT.js} +3 -3
- package/dist/{chunk-Z5277JWF.js → chunk-HQUYENKK.js} +7 -10
- package/dist/chunk-HQUYENKK.js.map +1 -0
- package/dist/{chunk-6UDLN4IA.js → chunk-I6ORDT54.js} +2 -2
- package/dist/{chunk-M4HRYLOA.js → chunk-IUQXRRJB.js} +3 -3
- package/dist/{chunk-GQIYL7OD.js → chunk-JIJAWTRK.js} +3 -3
- package/dist/{chunk-4KS4IHKH.js → chunk-JX3E4XCW.js} +2 -2
- package/dist/{chunk-ZFNXJEUG.js → chunk-KAJYSO3U.js} +2 -2
- package/dist/{chunk-QS765SBL.js → chunk-KETS5A62.js} +2 -2
- package/dist/{chunk-N7FNCE7F.js → chunk-KIWO4327.js} +2 -2
- package/dist/{chunk-FC3ZFEXF.js → chunk-KJ3MDX4V.js} +2 -2
- package/dist/{chunk-BNJAVRNJ.js → chunk-L3EFYRYK.js} +8 -8
- package/dist/{chunk-3MUKQQ7A.js → chunk-LGEH473S.js} +24 -29
- package/dist/chunk-LGEH473S.js.map +1 -0
- package/dist/{chunk-P7OVFGMU.js → chunk-LMB47UM6.js} +2 -2
- package/dist/{chunk-7SAE6T36.js → chunk-LWMLBVGB.js} +2 -2
- package/dist/{chunk-ZNRTHYYW.js → chunk-MC7PXJDP.js} +7 -7
- package/dist/{chunk-M2DOJBH7.js → chunk-MUNYUSBU.js} +2 -2
- package/dist/{chunk-LMMBV7QC.js → chunk-OCRLJJOV.js} +4 -4
- package/dist/{chunk-7J6A5MV2.js → chunk-ON77FQXH.js} +2 -2
- package/dist/{chunk-WV4UYDP6.js → chunk-POJRFSJM.js} +3 -3
- package/dist/{chunk-LKRXGOQW.js → chunk-QA3Y2O6H.js} +2 -2
- package/dist/{chunk-23ZLN5X6.js → chunk-QT5MGENX.js} +14 -6
- package/dist/chunk-QT5MGENX.js.map +1 -0
- package/dist/{chunk-YECEEJUU.js → chunk-RA7YRL6H.js} +2 -2
- package/dist/{chunk-UALXWWGN.js → chunk-RJDYDF5K.js} +4 -4
- package/dist/{chunk-WXJC2L66.js → chunk-ROAKLYOL.js} +2 -2
- package/dist/{chunk-NWIT3U2N.js → chunk-S5CQI2KF.js} +2 -2
- package/dist/{chunk-P6P35FY4.js → chunk-SDESKFKT.js} +2 -2
- package/dist/{chunk-UXGXJUZ5.js → chunk-SFRBUBUZ.js} +7 -7
- package/dist/{chunk-CRN3EPE2.js → chunk-SHNM7RIT.js} +3 -3
- package/dist/{chunk-XC3H7KON.js → chunk-SPTPBKZX.js} +2 -2
- package/dist/{chunk-IUYXCTA7.js → chunk-TC55M5PO.js} +2 -2
- package/dist/{chunk-EWBXMGXR.js → chunk-UCLJTGP3.js} +2 -2
- package/dist/{chunk-UZVQFGAY.js → chunk-UM3ZLT2X.js} +206 -165
- package/dist/chunk-UM3ZLT2X.js.map +1 -0
- package/dist/{chunk-754XN6LX.js → chunk-V27FK6D6.js} +2 -2
- package/dist/{chunk-LIBVANOF.js → chunk-V6Z4NAJZ.js} +2 -2
- package/dist/{chunk-XTXWR6KQ.js → chunk-VUMWVYMR.js} +7 -7
- package/dist/{chunk-ZSMA67FV.js → chunk-WY66J4PI.js} +2 -2
- package/dist/{chunk-5G53JSRO.js → chunk-XWJUFER3.js} +3 -3
- package/dist/{chunk-NSP5PIQH.js → chunk-Y3T5KQCR.js} +2 -2
- package/dist/{chunk-QTDZ2NYC.js → chunk-Y77FXULH.js} +2 -2
- package/dist/{chunk-IG747LRN.js → chunk-YO2JEX2Z.js} +2 -2
- package/dist/{chunk-KW5YZELC.js → chunk-ZKK3VMWU.js} +2 -2
- package/dist/cli.js +55 -55
- package/dist/coding/export-okf-codegraph.js +2 -2
- package/dist/compounding/engine.js +4 -4
- package/dist/config.js +5 -5
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/index.js +7 -7
- package/dist/convergence-refresh.js +5 -5
- package/dist/corpus-watermark.js +7 -7
- package/dist/deep-recall-config.js +2 -2
- package/dist/deep-recall-http-glue.js +4 -4
- package/dist/{entity-canonical-id-migration-ZBNRGUNV.js → entity-canonical-id-migration-F3JVG6K6.js} +2 -2
- package/dist/entity-retrieval.js +3 -3
- package/dist/external-wiki-access.js +23 -23
- package/dist/extraction-span-wire.d.ts.map +1 -1
- package/dist/extraction-span-wire.js +1 -1
- package/dist/extraction.js +11 -11
- package/dist/harmonic-retrieval.js +3 -3
- package/dist/index.js +68 -68
- package/dist/location/index.js +6 -6
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection-runner.js +5 -5
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/memory-browse-http-glue.js +2 -2
- package/dist/memory-browse-operations.js +23 -23
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/storage.js +3 -3
- package/dist/offline-sync-impression-drain.js +2 -2
- package/dist/operator-doctor-corpus.js +10 -10
- package/dist/operator-doctor-replica.js +4 -4
- package/dist/operator-toolkit.js +17 -17
- package/dist/orchestration/extraction-persist-deps.d.ts +2 -0
- package/dist/orchestration/extraction-persist-deps.d.ts.map +1 -1
- package/dist/orchestration/extraction-persist-promotion.d.ts +40 -10
- package/dist/orchestration/extraction-persist-promotion.d.ts.map +1 -1
- package/dist/orchestration/extraction-persist.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +15 -15
- package/dist/orchestrator.d.ts.map +1 -1
- package/dist/orchestrator.js +68 -68
- package/dist/recall-navigation-http-glue.js +2 -2
- package/dist/recall-navigation-operations.js +23 -23
- package/dist/recall-navigation.js +22 -22
- package/dist/relay/mission.d.ts +731 -3403
- package/dist/relay/mission.d.ts.map +1 -1
- package/dist/replica-divergence.js +3 -3
- package/dist/resume-bundles.js +6 -6
- package/dist/schemas.d.ts +346 -1771
- package/dist/schemas.d.ts.map +1 -1
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/shared-context/manager.d.ts +13 -33
- package/dist/shared-context/manager.d.ts.map +1 -1
- package/dist/source-agent-qualifier.js +9 -9
- package/dist/standup/build.js +4 -4
- package/dist/storage.js +2 -2
- package/dist/support-passport/access-operations.d.ts +51 -51
- package/dist/support-passport/contracts.d.ts +85 -126
- package/dist/support-passport/contracts.d.ts.map +1 -1
- package/dist/support-passport/generated-batch.d.ts +3 -17
- package/dist/support-passport/generated-batch.d.ts.map +1 -1
- package/dist/support-passport/grant-contracts.d.ts +75 -381
- package/dist/support-passport/grant-contracts.d.ts.map +1 -1
- package/dist/support-passport/index.js +25 -25
- package/dist/support-passport/model-audit.d.ts +17 -82
- package/dist/support-passport/model-audit.d.ts.map +1 -1
- package/dist/support-passport/model-bridge.d.ts +12 -51
- package/dist/support-passport/model-bridge.d.ts.map +1 -1
- package/dist/support-passport/model-contracts.d.ts +53 -192
- package/dist/support-passport/model-contracts.d.ts.map +1 -1
- package/dist/tokens.js +3 -3
- package/dist/transfer/export-okf.js +3 -3
- package/dist/transfer/types.d.ts +32 -737
- package/dist/transfer/types.d.ts.map +1 -1
- package/dist/verified-recall.js +3 -3
- package/dist/who-knows-cli.js +5 -5
- package/dist/who-knows.js +4 -4
- package/package.json +3 -4
- package/src/access-boundary.test.ts +14 -0
- package/src/access-boundary.ts +48 -42
- package/src/access-category-alias.test.ts +9 -7
- package/src/access-errors.test.ts +21 -9
- package/src/access-errors.ts +45 -31
- package/src/access-http.test.ts +1 -1
- package/src/access-schema.ts +13 -17
- package/src/extraction-scope-source-agent.test.ts +6 -6
- package/src/extraction-span-wire.test.ts +28 -0
- package/src/extraction-span-wire.ts +34 -6
- package/src/orchestration/extraction-persist-deps.ts +3 -0
- package/src/orchestration/extraction-persist-promotion.ts +104 -16
- package/src/orchestration/extraction-persist.ts +66 -77
- package/src/orchestrator-entity-write-failure.test.ts +370 -0
- package/src/orchestrator.ts +1 -0
- package/src/storage/entity-canonical-id-migration.ts +2 -2
- package/dist/chunk-23ZLN5X6.js.map +0 -1
- package/dist/chunk-3MUKQQ7A.js.map +0 -1
- package/dist/chunk-IMKOJVD4.js.map +0 -1
- package/dist/chunk-UZVQFGAY.js.map +0 -1
- package/dist/chunk-Z5277JWF.js.map +0 -1
- package/dist/chunk-ZMO2S5RT.js.map +0 -1
- /package/dist/{chunk-7YVER7ZO.js.map → chunk-2EXF6IIB.js.map} +0 -0
- /package/dist/{chunk-HPNXS6W6.js.map → chunk-2ONKXEC7.js.map} +0 -0
- /package/dist/{chunk-DMKTOCC7.js.map → chunk-2S6JADBB.js.map} +0 -0
- /package/dist/{chunk-ZSEFGDCI.js.map → chunk-2TGIKMMZ.js.map} +0 -0
- /package/dist/{chunk-Q3PNQYAC.js.map → chunk-44EUCSG4.js.map} +0 -0
- /package/dist/{chunk-PJCVI44H.js.map → chunk-4FM35YIA.js.map} +0 -0
- /package/dist/{chunk-M6TP6UYD.js.map → chunk-6ZAU7LAR.js.map} +0 -0
- /package/dist/{chunk-SJTSWG2Z.js.map → chunk-72CBJ5VP.js.map} +0 -0
- /package/dist/{chunk-EKYWZYZJ.js.map → chunk-75BK4XGV.js.map} +0 -0
- /package/dist/{chunk-HKOMHP6D.js.map → chunk-A6JDT6QF.js.map} +0 -0
- /package/dist/{chunk-TFWJXWL6.js.map → chunk-AHGOOZUC.js.map} +0 -0
- /package/dist/{chunk-A7AISUJI.js.map → chunk-AJG2TAMR.js.map} +0 -0
- /package/dist/{chunk-VCOMACR6.js.map → chunk-AZLD4CKG.js.map} +0 -0
- /package/dist/{chunk-GXVXBYRA.js.map → chunk-B35EQQ7L.js.map} +0 -0
- /package/dist/{chunk-E6UNM67F.js.map → chunk-B6SPPYGJ.js.map} +0 -0
- /package/dist/{chunk-TXKQBQYW.js.map → chunk-CK6GCGMX.js.map} +0 -0
- /package/dist/{chunk-NPLM7AFU.js.map → chunk-DF6ZF2BN.js.map} +0 -0
- /package/dist/{chunk-6ZQX3R66.js.map → chunk-DJFULNXK.js.map} +0 -0
- /package/dist/{chunk-JBWD3J5U.js.map → chunk-DQOGZZJA.js.map} +0 -0
- /package/dist/{chunk-K5QQXVG6.js.map → chunk-EC2KVA27.js.map} +0 -0
- /package/dist/{chunk-N74WJ7B2.js.map → chunk-EZS6QJNC.js.map} +0 -0
- /package/dist/{chunk-MWURUSRE.js.map → chunk-FNNGWN3O.js.map} +0 -0
- /package/dist/{chunk-5FUDSK6Z.js.map → chunk-FT75AQ74.js.map} +0 -0
- /package/dist/{chunk-5X2H3X4J.js.map → chunk-GE3ZX6YK.js.map} +0 -0
- /package/dist/{chunk-UNOAVHV4.js.map → chunk-HCIRR3BA.js.map} +0 -0
- /package/dist/{chunk-MLNXATFG.js.map → chunk-HEF4BRMT.js.map} +0 -0
- /package/dist/{chunk-6UDLN4IA.js.map → chunk-I6ORDT54.js.map} +0 -0
- /package/dist/{chunk-M4HRYLOA.js.map → chunk-IUQXRRJB.js.map} +0 -0
- /package/dist/{chunk-GQIYL7OD.js.map → chunk-JIJAWTRK.js.map} +0 -0
- /package/dist/{chunk-4KS4IHKH.js.map → chunk-JX3E4XCW.js.map} +0 -0
- /package/dist/{chunk-ZFNXJEUG.js.map → chunk-KAJYSO3U.js.map} +0 -0
- /package/dist/{chunk-QS765SBL.js.map → chunk-KETS5A62.js.map} +0 -0
- /package/dist/{chunk-N7FNCE7F.js.map → chunk-KIWO4327.js.map} +0 -0
- /package/dist/{chunk-FC3ZFEXF.js.map → chunk-KJ3MDX4V.js.map} +0 -0
- /package/dist/{chunk-BNJAVRNJ.js.map → chunk-L3EFYRYK.js.map} +0 -0
- /package/dist/{chunk-P7OVFGMU.js.map → chunk-LMB47UM6.js.map} +0 -0
- /package/dist/{chunk-7SAE6T36.js.map → chunk-LWMLBVGB.js.map} +0 -0
- /package/dist/{chunk-ZNRTHYYW.js.map → chunk-MC7PXJDP.js.map} +0 -0
- /package/dist/{chunk-M2DOJBH7.js.map → chunk-MUNYUSBU.js.map} +0 -0
- /package/dist/{chunk-LMMBV7QC.js.map → chunk-OCRLJJOV.js.map} +0 -0
- /package/dist/{chunk-7J6A5MV2.js.map → chunk-ON77FQXH.js.map} +0 -0
- /package/dist/{chunk-WV4UYDP6.js.map → chunk-POJRFSJM.js.map} +0 -0
- /package/dist/{chunk-LKRXGOQW.js.map → chunk-QA3Y2O6H.js.map} +0 -0
- /package/dist/{chunk-YECEEJUU.js.map → chunk-RA7YRL6H.js.map} +0 -0
- /package/dist/{chunk-UALXWWGN.js.map → chunk-RJDYDF5K.js.map} +0 -0
- /package/dist/{chunk-WXJC2L66.js.map → chunk-ROAKLYOL.js.map} +0 -0
- /package/dist/{chunk-NWIT3U2N.js.map → chunk-S5CQI2KF.js.map} +0 -0
- /package/dist/{chunk-P6P35FY4.js.map → chunk-SDESKFKT.js.map} +0 -0
- /package/dist/{chunk-UXGXJUZ5.js.map → chunk-SFRBUBUZ.js.map} +0 -0
- /package/dist/{chunk-CRN3EPE2.js.map → chunk-SHNM7RIT.js.map} +0 -0
- /package/dist/{chunk-XC3H7KON.js.map → chunk-SPTPBKZX.js.map} +0 -0
- /package/dist/{chunk-IUYXCTA7.js.map → chunk-TC55M5PO.js.map} +0 -0
- /package/dist/{chunk-EWBXMGXR.js.map → chunk-UCLJTGP3.js.map} +0 -0
- /package/dist/{chunk-754XN6LX.js.map → chunk-V27FK6D6.js.map} +0 -0
- /package/dist/{chunk-LIBVANOF.js.map → chunk-V6Z4NAJZ.js.map} +0 -0
- /package/dist/{chunk-XTXWR6KQ.js.map → chunk-VUMWVYMR.js.map} +0 -0
- /package/dist/{chunk-ZSMA67FV.js.map → chunk-WY66J4PI.js.map} +0 -0
- /package/dist/{chunk-5G53JSRO.js.map → chunk-XWJUFER3.js.map} +0 -0
- /package/dist/{chunk-NSP5PIQH.js.map → chunk-Y3T5KQCR.js.map} +0 -0
- /package/dist/{chunk-QTDZ2NYC.js.map → chunk-Y77FXULH.js.map} +0 -0
- /package/dist/{chunk-IG747LRN.js.map → chunk-YO2JEX2Z.js.map} +0 -0
- /package/dist/{chunk-KW5YZELC.js.map → chunk-ZKK3VMWU.js.map} +0 -0
- /package/dist/{entity-canonical-id-migration-ZBNRGUNV.js.map → entity-canonical-id-migration-F3JVG6K6.js.map} +0 -0
|
@@ -23,6 +23,11 @@ import {
|
|
|
23
23
|
import type { MemoryFile, PluginConfig } from "../types.js";
|
|
24
24
|
import type { ResolvedScopeProfilePlan } from "../namespaces/scope-profiles.js";
|
|
25
25
|
import { readDurableSemanticFingerprint, readPromotionReceiptStatus, type MergedTargetPromotionPayload } from "./semantic-merge-promotion-payload.js";
|
|
26
|
+
import type { BehaviorSignalEvent, ExtractionResult } from "../types.js";
|
|
27
|
+
import type { HarmonicConstructionInput } from "../harmonic-construction.js";
|
|
28
|
+
import { dedupeBehaviorSignalsByMemoryAndHash } from "../behavior-signals.js";
|
|
29
|
+
import { persistConstructedHarmonicRecords } from "./harmonic-construction-persist.js";
|
|
30
|
+
|
|
26
31
|
|
|
27
32
|
export const confidenceTierOrder = [
|
|
28
33
|
"explicit",
|
|
@@ -116,27 +121,110 @@ export async function readActiveMemoriesBothTiers(
|
|
|
116
121
|
return coldMems.length === 0 ? hotMems : [...hotMems, ...coldMems];
|
|
117
122
|
}
|
|
118
123
|
|
|
124
|
+
|
|
119
125
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
126
|
+
* Batch-end finalization for facts already durable in this persist pass:
|
|
127
|
+
* content-hash save, behavior signals, harmonic construction, temporal/tag
|
|
128
|
+
* indexes. Shared by the success tail and every rethrow path so a partial
|
|
129
|
+
* batch (e.g. fact wrote, entity failed) still lands deferred side effects
|
|
130
|
+
* before the original error propagates (#3228 / #3231). Best-effort: each
|
|
131
|
+
* step logs and never masks `originalError` at the call site.
|
|
132
|
+
*
|
|
133
|
+
* `scheduleQmd` is failure-only. Success still schedules QMD from
|
|
134
|
+
* extraction-run after persist returns, so success passes false.
|
|
129
135
|
*/
|
|
130
|
-
export async function
|
|
131
|
-
saveContentHashIndexes: () => Promise<void
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
export async function finalizeExtractionCommittedWrites(options: {
|
|
137
|
+
saveContentHashIndexes: () => Promise<void>;
|
|
138
|
+
behaviorSignalsByStorage: Iterable<{
|
|
139
|
+
storage: StorageManager;
|
|
140
|
+
events: BehaviorSignalEvent[];
|
|
141
|
+
}>;
|
|
142
|
+
harmonic?: {
|
|
143
|
+
enabled: boolean;
|
|
144
|
+
entries: Iterable<{
|
|
145
|
+
storage: StorageManager;
|
|
146
|
+
facts: HarmonicConstructionInput["persistedFacts"];
|
|
147
|
+
}>;
|
|
148
|
+
baseStorageDir: string;
|
|
149
|
+
abstractionNodeStoreDir?: string;
|
|
150
|
+
sessionKey?: string;
|
|
151
|
+
validAt?: string;
|
|
152
|
+
episodeTitle?: string;
|
|
153
|
+
anchorsEnabled: boolean;
|
|
154
|
+
entityMentions: ExtractionResult["entities"];
|
|
155
|
+
};
|
|
156
|
+
updateTemporalTagIndexes: (
|
|
157
|
+
storage: StorageManager,
|
|
158
|
+
persistedIds: string[],
|
|
159
|
+
) => Promise<void>;
|
|
160
|
+
fallbackStorage: StorageManager;
|
|
161
|
+
persistedIdsByStorage: Map<string, { storage: StorageManager; ids: string[] }>;
|
|
162
|
+
requestQmdMaintenance?: () => void;
|
|
163
|
+
scheduleQmd: boolean;
|
|
164
|
+
}): Promise<void> {
|
|
165
|
+
await options.saveContentHashIndexes().catch((err) => {
|
|
166
|
+
log.warn(`content-hash index save failed: ${err}`);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// Snapshot once — Map iterators are single-pass.
|
|
170
|
+
const behaviorEntries = [...options.behaviorSignalsByStorage];
|
|
171
|
+
for (const { storage: targetStorage, events } of behaviorEntries) {
|
|
172
|
+
const dedupedSignals = dedupeBehaviorSignalsByMemoryAndHash(events);
|
|
173
|
+
if (dedupedSignals.length === 0) continue;
|
|
174
|
+
await targetStorage
|
|
175
|
+
.appendBehaviorSignals(dedupedSignals)
|
|
176
|
+
.catch((err) =>
|
|
177
|
+
log.warn(`appendBehaviorSignals failed (non-fatal): ${err}`),
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const harmonic = options.harmonic;
|
|
182
|
+
let harmonicEntryCount = 0;
|
|
183
|
+
if (harmonic?.enabled) {
|
|
184
|
+
const entries = [...harmonic.entries];
|
|
185
|
+
harmonicEntryCount = entries.length;
|
|
186
|
+
if (entries.length > 0) {
|
|
187
|
+
await persistConstructedHarmonicRecords({
|
|
188
|
+
entries,
|
|
189
|
+
baseStorageDir: harmonic.baseStorageDir,
|
|
190
|
+
abstractionNodeStoreDir: harmonic.abstractionNodeStoreDir,
|
|
191
|
+
sessionKey: harmonic.sessionKey,
|
|
192
|
+
validAt: harmonic.validAt,
|
|
193
|
+
episodeTitle: harmonic.episodeTitle,
|
|
194
|
+
anchorsEnabled: harmonic.anchorsEnabled,
|
|
195
|
+
entityMentions: harmonic.entityMentions,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
void (async () => {
|
|
201
|
+
if (options.persistedIdsByStorage.size === 0) {
|
|
202
|
+
await options.updateTemporalTagIndexes(options.fallbackStorage, []);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
for (const entry of options.persistedIdsByStorage.values()) {
|
|
206
|
+
await options.updateTemporalTagIndexes(entry.storage, entry.ids);
|
|
207
|
+
}
|
|
208
|
+
})().catch((err) =>
|
|
209
|
+
log.debug(`temporal-index update error (non-fatal): ${err}`),
|
|
137
210
|
);
|
|
211
|
+
|
|
212
|
+
if (!options.scheduleQmd || !options.requestQmdMaintenance) return;
|
|
213
|
+
const hasCommitted =
|
|
214
|
+
options.persistedIdsByStorage.size > 0 ||
|
|
215
|
+
behaviorEntries.length > 0 ||
|
|
216
|
+
harmonicEntryCount > 0;
|
|
217
|
+
if (!hasCommitted) return;
|
|
218
|
+
try {
|
|
219
|
+
options.requestQmdMaintenance();
|
|
220
|
+
} catch (err) {
|
|
221
|
+
log.warn(
|
|
222
|
+
`QMD maintenance schedule after partial persist failed (non-fatal): ${err}`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
138
225
|
}
|
|
139
226
|
|
|
227
|
+
|
|
140
228
|
/**
|
|
141
229
|
* Merged-target promotion scope gate (PR #2771 finding A). A committed
|
|
142
230
|
* record stamped `toolScoped: true` must keep its promoted copy withheld
|
|
@@ -68,10 +68,7 @@ import {
|
|
|
68
68
|
} from "../source-attribution.js";
|
|
69
69
|
import { classifyMemoryKind } from "../himem.js";
|
|
70
70
|
import { shouldPromoteGlobalFactToShared, withholdToolScopedFromSharedNamespace } from "../tool-scoped-memory.js";
|
|
71
|
-
import {
|
|
72
|
-
buildBehaviorSignalsForMemory,
|
|
73
|
-
dedupeBehaviorSignalsByMemoryAndHash,
|
|
74
|
-
} from "../behavior-signals.js";
|
|
71
|
+
import { buildBehaviorSignalsForMemory } from "../behavior-signals.js";
|
|
75
72
|
import { buildProcedurePersistBody } from "../procedural/procedure-types.js";
|
|
76
73
|
import { stripAttributesSuffix } from "../structured-attributes.js";
|
|
77
74
|
import { resolveWriteSubject } from "../memory-subject.js";
|
|
@@ -103,7 +100,7 @@ import type {
|
|
|
103
100
|
} from "../types.js";
|
|
104
101
|
import {
|
|
105
102
|
createBatchPromotedCopyProbe,
|
|
106
|
-
|
|
103
|
+
finalizeExtractionCommittedWrites,
|
|
107
104
|
makeSubjectGuardAllows,
|
|
108
105
|
profileAutoPromotionAllows,
|
|
109
106
|
readActiveMemoriesBothTiers,
|
|
@@ -120,7 +117,7 @@ import {
|
|
|
120
117
|
resolvePersistedMemoryRelativePath,
|
|
121
118
|
} from "../orchestrator.js";
|
|
122
119
|
import type { HarmonicConstructionInput } from "../harmonic-construction.js";
|
|
123
|
-
import { enqueueMergedTargetForHarmonicConstruction
|
|
120
|
+
import { enqueueMergedTargetForHarmonicConstruction } from "./harmonic-construction-persist.js";
|
|
124
121
|
import { applySemanticMergeAtPersist, runMergedTargetPostEffects, writeMergedVerbatimArtifact } from "./semantic-merge-persist.js";
|
|
125
122
|
import { buildMergedTargetPromotionPayload } from "./semantic-merge-promotion-payload.js";
|
|
126
123
|
import { persistMergedTargetThreadEpisode } from "./semantic-merge-commit-effects.js";
|
|
@@ -291,6 +288,7 @@ export class ExtractionPersistCoordinator {
|
|
|
291
288
|
events: [...events],
|
|
292
289
|
});
|
|
293
290
|
};
|
|
291
|
+
|
|
294
292
|
const sharedProfileLayer = scopeProfileWritePlan?.layers.find(
|
|
295
293
|
(layer) =>
|
|
296
294
|
layer.id === "serverShared" &&
|
|
@@ -1106,6 +1104,32 @@ export class ExtractionPersistCoordinator {
|
|
|
1106
1104
|
0,
|
|
1107
1105
|
this.deps.config.extractionMaxProfileUpdatesPerRun,
|
|
1108
1106
|
);
|
|
1107
|
+
const finalizeCommittedWrites = async (scheduleQmd: boolean): Promise<void> => {
|
|
1108
|
+
await finalizeExtractionCommittedWrites({
|
|
1109
|
+
saveContentHashIndexes: () => this.deps.saveContentHashIndexes(),
|
|
1110
|
+
behaviorSignalsByStorage: behaviorSignalsByStorage.values(),
|
|
1111
|
+
harmonic: {
|
|
1112
|
+
enabled: harmonicConstructionEnabled,
|
|
1113
|
+
entries: harmonicFactsByStorage.values(),
|
|
1114
|
+
baseStorageDir: storage.dir,
|
|
1115
|
+
abstractionNodeStoreDir:
|
|
1116
|
+
!scopeProfileWritePlan && harmonicBaseNamespace === this.deps.config.defaultNamespace
|
|
1117
|
+
? this.deps.config.abstractionNodeStoreDir
|
|
1118
|
+
: undefined,
|
|
1119
|
+
sessionKey: sourceContext?.sessionKey,
|
|
1120
|
+
validAt: sourceContext?.validAt,
|
|
1121
|
+
episodeTitle: result.episodeTitle,
|
|
1122
|
+
anchorsEnabled: harmonicAnchorsEnabled,
|
|
1123
|
+
entityMentions: entities,
|
|
1124
|
+
},
|
|
1125
|
+
updateTemporalTagIndexes: (target, ids) =>
|
|
1126
|
+
this.deps.updateTemporalTagIndexes(target, ids),
|
|
1127
|
+
fallbackStorage: storage,
|
|
1128
|
+
persistedIdsByStorage,
|
|
1129
|
+
requestQmdMaintenance: () => this.deps.requestQmdMaintenance(),
|
|
1130
|
+
scheduleQmd,
|
|
1131
|
+
});
|
|
1132
|
+
};
|
|
1109
1133
|
|
|
1110
1134
|
if (
|
|
1111
1135
|
facts.length < result.facts.length ||
|
|
@@ -2583,6 +2607,25 @@ export class ExtractionPersistCoordinator {
|
|
|
2583
2607
|
// so a blocked fact creates no active shared copy / supersession / graph entry.
|
|
2584
2608
|
const tombstoneBlocked = factWrite.tombstoneBlocked;
|
|
2585
2609
|
const postWriteGuard = faithfulnessEnforceStatus === "pending_review" || tombstoneBlocked;
|
|
2610
|
+
// #3231: the fact is durable now. Track it before any post-write step
|
|
2611
|
+
// that can throw, so the batch-end finalization on a failure path still
|
|
2612
|
+
// covers it (a retry exact-dedupes the fact and would not re-queue it).
|
|
2613
|
+
trackBehaviorSignals(
|
|
2614
|
+
targetStorage,
|
|
2615
|
+
buildBehaviorSignalsForMemory({
|
|
2616
|
+
memoryId,
|
|
2617
|
+
category: writeCategory,
|
|
2618
|
+
content: fact.content,
|
|
2619
|
+
namespace: this.deps.storageDirNamespace(targetStorage.dir),
|
|
2620
|
+
confidence: fact.confidence,
|
|
2621
|
+
source: "extraction",
|
|
2622
|
+
}),
|
|
2623
|
+
);
|
|
2624
|
+
trackPersistedId(targetStorage, memoryId, {
|
|
2625
|
+
pendingReview: postWriteGuard,
|
|
2626
|
+
category: writeCategory,
|
|
2627
|
+
harmonicFact,
|
|
2628
|
+
});
|
|
2586
2629
|
// #1645: defer contradiction auto-resolve until tombstone status is
|
|
2587
2630
|
// known (see applyDeferredContradictionResolve).
|
|
2588
2631
|
try {
|
|
@@ -2596,7 +2639,9 @@ export class ExtractionPersistCoordinator {
|
|
|
2596
2639
|
await anchorSnapshots.remove(targetStorage, contradiction!.supersededId);
|
|
2597
2640
|
}
|
|
2598
2641
|
} catch (err) {
|
|
2599
|
-
await
|
|
2642
|
+
await finalizeCommittedWrites(true).catch((finalizeErr) =>
|
|
2643
|
+
log.warn(`committed-write finalization after post-write failure failed: ${finalizeErr}`),
|
|
2644
|
+
);
|
|
2600
2645
|
throw err;
|
|
2601
2646
|
}
|
|
2602
2647
|
if (routedRuleId) {
|
|
@@ -2632,22 +2677,6 @@ export class ExtractionPersistCoordinator {
|
|
|
2632
2677
|
}
|
|
2633
2678
|
}
|
|
2634
2679
|
try {
|
|
2635
|
-
trackBehaviorSignals(
|
|
2636
|
-
targetStorage,
|
|
2637
|
-
buildBehaviorSignalsForMemory({
|
|
2638
|
-
memoryId,
|
|
2639
|
-
category: writeCategory,
|
|
2640
|
-
content: fact.content,
|
|
2641
|
-
namespace: this.deps.storageDirNamespace(targetStorage.dir),
|
|
2642
|
-
confidence: fact.confidence,
|
|
2643
|
-
source: "extraction",
|
|
2644
|
-
}),
|
|
2645
|
-
);
|
|
2646
|
-
trackPersistedId(targetStorage, memoryId, {
|
|
2647
|
-
pendingReview: postWriteGuard,
|
|
2648
|
-
category: writeCategory,
|
|
2649
|
-
harmonicFact,
|
|
2650
|
-
});
|
|
2651
2680
|
await anchorSnapshots.replace(targetStorage, memoryId, writeCategory, memoryPathById);
|
|
2652
2681
|
if (
|
|
2653
2682
|
!postWriteGuard &&
|
|
@@ -2782,9 +2811,12 @@ export class ExtractionPersistCoordinator {
|
|
|
2782
2811
|
);
|
|
2783
2812
|
}
|
|
2784
2813
|
} catch (err) {
|
|
2785
|
-
// PR #2016:
|
|
2786
|
-
//
|
|
2787
|
-
|
|
2814
|
+
// PR #2016 / #3231: finalize deferred side effects for facts already
|
|
2815
|
+
// durable before propagating so hash/behavior/harmonic/temporal/QMD
|
|
2816
|
+
// still land on a partial batch.
|
|
2817
|
+
await finalizeCommittedWrites(true).catch((finalizeErr) =>
|
|
2818
|
+
log.warn(`committed-write finalization after post-write failure failed: ${finalizeErr}`),
|
|
2819
|
+
);
|
|
2788
2820
|
throw err;
|
|
2789
2821
|
}
|
|
2790
2822
|
}
|
|
@@ -2807,7 +2839,6 @@ export class ExtractionPersistCoordinator {
|
|
|
2807
2839
|
durableNonFactTouchRecorded = true;
|
|
2808
2840
|
touchBaseNonFactNamespace();
|
|
2809
2841
|
};
|
|
2810
|
-
// #1955 review: entity fields are screened before entering the index (screenEntityForIndex).
|
|
2811
2842
|
const entityScreenOn = resolveSecurityCapabilities(this.deps.config).injectionScreen;
|
|
2812
2843
|
const entityScreenProfile = resolveSecurityCapabilities(this.deps.config).injectionScreenProfile;
|
|
2813
2844
|
for (const entity of entities) {
|
|
@@ -2829,7 +2860,10 @@ export class ExtractionPersistCoordinator {
|
|
|
2829
2860
|
recordDurableNonFactWrite();
|
|
2830
2861
|
}
|
|
2831
2862
|
} catch (err) {
|
|
2832
|
-
|
|
2863
|
+
await finalizeCommittedWrites(true).catch((finalizeErr) =>
|
|
2864
|
+
log.warn(`committed-write finalization after entity failure failed: ${finalizeErr}`),
|
|
2865
|
+
);
|
|
2866
|
+
throw err;
|
|
2833
2867
|
}
|
|
2834
2868
|
}
|
|
2835
2869
|
// Persist entity relationships (v7.0). #1955 review: source/label/target are screened.
|
|
@@ -2929,28 +2963,9 @@ export class ExtractionPersistCoordinator {
|
|
|
2929
2963
|
touchBaseNonFactNamespace();
|
|
2930
2964
|
}
|
|
2931
2965
|
|
|
2932
|
-
//
|
|
2933
|
-
//
|
|
2934
|
-
|
|
2935
|
-
// this on-disk write is the in-process persisted view — never a cross-restart
|
|
2936
|
-
// trust anchor. A deferred write whose addContentHashDedup threw is still
|
|
2937
|
-
// safe: the fact .md is durable and the next restart's rebuild includes it.
|
|
2938
|
-
await this.deps.saveContentHashIndexes().catch((err) => {
|
|
2939
|
-
log.warn(`content-hash index save failed: ${err}`);
|
|
2940
|
-
});
|
|
2941
|
-
|
|
2942
|
-
for (const {
|
|
2943
|
-
storage: targetStorage,
|
|
2944
|
-
events,
|
|
2945
|
-
} of behaviorSignalsByStorage.values()) {
|
|
2946
|
-
const dedupedSignals = dedupeBehaviorSignalsByMemoryAndHash(events);
|
|
2947
|
-
if (dedupedSignals.length === 0) continue;
|
|
2948
|
-
await targetStorage
|
|
2949
|
-
.appendBehaviorSignals(dedupedSignals)
|
|
2950
|
-
.catch((err) =>
|
|
2951
|
-
log.warn(`appendBehaviorSignals failed (non-fatal): ${err}`),
|
|
2952
|
-
);
|
|
2953
|
-
}
|
|
2966
|
+
// Shared batch-end finalization (hash, behavior, harmonic, temporal).
|
|
2967
|
+
// Failure paths call the same helper with scheduleQmd=true (#3231).
|
|
2968
|
+
await finalizeCommittedWrites(false);
|
|
2954
2969
|
|
|
2955
2970
|
const dedupSuffix = `${dedupedCount > 0 ? ` (${dedupedCount} deduped)` : ""}${semanticMergedCount > 0 ? ` (${semanticMergedCount} merged)` : ""}`;
|
|
2956
2971
|
const gatedSuffix =
|
|
@@ -2962,33 +2977,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2962
2977
|
log.info(
|
|
2963
2978
|
`persisted: ${facts.length - dedupedCount - importanceGatedCount - judgeGatedCount - redactionGatedCount - semanticMergedCount} facts${dedupSuffix}${gatedSuffix}${judgeSuffix}${redactionSuffix}, ${entities.length} entities, ${questions.length} questions, ${profileUpdates.length} profile updates`,
|
|
2964
2979
|
);
|
|
2965
|
-
|
|
2966
|
-
await persistConstructedHarmonicRecords({
|
|
2967
|
-
entries: harmonicFactsByStorage.values(),
|
|
2968
|
-
baseStorageDir: storage.dir,
|
|
2969
|
-
abstractionNodeStoreDir:
|
|
2970
|
-
!scopeProfileWritePlan && harmonicBaseNamespace === this.deps.config.defaultNamespace
|
|
2971
|
-
? this.deps.config.abstractionNodeStoreDir
|
|
2972
|
-
: undefined,
|
|
2973
|
-
sessionKey: sourceContext?.sessionKey,
|
|
2974
|
-
validAt: sourceContext?.validAt,
|
|
2975
|
-
episodeTitle: result.episodeTitle,
|
|
2976
|
-
anchorsEnabled: harmonicAnchorsEnabled,
|
|
2977
|
-
entityMentions: entities,
|
|
2978
|
-
});
|
|
2979
|
-
}
|
|
2980
|
-
// Update temporal + tag indexes (v8.1) — fire-and-forget, fail-open
|
|
2981
|
-
void (async () => {
|
|
2982
|
-
if (persistedIdsByStorage.size === 0) {
|
|
2983
|
-
await this.deps.updateTemporalTagIndexes(storage, []);
|
|
2984
|
-
return;
|
|
2985
|
-
}
|
|
2986
|
-
for (const entry of persistedIdsByStorage.values()) {
|
|
2987
|
-
await this.deps.updateTemporalTagIndexes(entry.storage, entry.ids);
|
|
2988
|
-
}
|
|
2989
|
-
})().catch((err) =>
|
|
2990
|
-
log.debug(`temporal-index update error (non-fatal): ${err}`),
|
|
2991
|
-
);
|
|
2980
|
+
|
|
2992
2981
|
// #1635: surface pending_review ids so the thread episode set excludes them.
|
|
2993
2982
|
this.deps.setLastPersistExtractionPendingReviewIds(pendingReviewPersistedIds);
|
|
2994
2983
|
// Return the persisted fact IDs for threading
|