@remnic/core 9.6.0 → 9.6.2
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.d.ts +7 -8
- package/dist/access-admin-ops-surface.js +8 -8
- package/dist/access-boundary.d.ts +9 -8
- package/dist/access-boundary.js +9 -9
- package/dist/access-cli.js +40 -40
- package/dist/access-http.d.ts +47 -16
- package/dist/access-http.js +13 -13
- package/dist/access-identity-continuity-surface.d.ts +6 -7
- package/dist/access-identity-continuity-surface.js +8 -8
- package/dist/access-lcm-surface.d.ts +7 -8
- package/dist/access-lcm-surface.js +8 -8
- package/dist/access-mcp.d.ts +13 -8
- package/dist/access-mcp.js +12 -12
- package/dist/access-observe-write-surface.d.ts +7 -8
- package/dist/access-observe-write-surface.js +8 -8
- package/dist/access-operations-batch.js +10 -10
- package/dist/access-operations.d.ts +8 -9
- package/dist/access-operations.js +11 -11
- package/dist/access-recall-surface.d.ts +7 -8
- package/dist/access-recall-surface.js +8 -8
- package/dist/access-schema.d.ts +6 -6
- package/dist/{access-service-CXJaql3A.d.ts → access-service-B_sc1w_k.d.ts} +9 -9
- package/dist/access-service.d.ts +7 -8
- package/dist/access-service.js +8 -8
- package/dist/access-surface-catalog.d.ts +7 -8
- package/dist/action-confidence.d.ts +1 -2
- package/dist/active-memory-bridge.d.ts +1 -2
- package/dist/active-recall.d.ts +1 -2
- package/dist/behavior-learner.d.ts +1 -2
- package/dist/behavior-signals.d.ts +1 -2
- package/dist/bootstrap.d.ts +6 -7
- package/dist/briefing.d.ts +2 -3
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +1 -2
- package/dist/buffer.d.ts +2 -3
- package/dist/buffer.js +1 -1
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/bulk-import/index.js +2 -2
- package/dist/calibration.d.ts +1 -2
- package/dist/capabilities.d.ts +1 -2
- package/dist/{catalog-C9cu67Ig.d.ts → catalog-9WanSGtt.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -2
- package/dist/causal-consolidation.d.ts +1 -2
- package/dist/causal-consolidation.js +4 -4
- package/dist/causal-trajectory-graph.d.ts +1 -2
- package/dist/{chunk-PNLFN2PZ.js → chunk-23G3T2Q5.js} +2 -2
- package/dist/{chunk-SIRPLF54.js → chunk-2K3OSLHE.js} +2 -2
- package/dist/{chunk-JS2HKKOK.js → chunk-3AC5UYKI.js} +1 -1
- package/dist/{chunk-JS2HKKOK.js.map → chunk-3AC5UYKI.js.map} +1 -1
- package/dist/{chunk-FKCRGLRD.js → chunk-4WRKKRTD.js} +266 -160
- package/dist/chunk-4WRKKRTD.js.map +1 -0
- package/dist/{chunk-LQHDIS7L.js → chunk-54BGIBCR.js} +2 -2
- package/dist/{chunk-PVUJ6WVV.js → chunk-5MH5NF3U.js} +5 -5
- package/dist/{chunk-PCLIWBGD.js → chunk-7ARV32PI.js} +8 -6
- package/dist/chunk-7ARV32PI.js.map +1 -0
- package/dist/{chunk-Y7UNNAZD.js → chunk-7ZYBDQ7V.js} +2 -2
- package/dist/{chunk-2PRQG7PV.js → chunk-AJVLDJU6.js} +1 -1
- package/dist/chunk-AJVLDJU6.js.map +1 -0
- package/dist/{chunk-LR5DZ56F.js → chunk-AXALUFAH.js} +2 -2
- package/dist/{chunk-AYZJID4S.js → chunk-B5GBWBCZ.js} +2 -2
- package/dist/{chunk-TLUDFPZL.js → chunk-CAZ3Z5M6.js} +2 -2
- package/dist/{chunk-RGK27ELN.js → chunk-DEKIXXIG.js} +2 -2
- package/dist/{chunk-2KK5WNQB.js → chunk-DQ42IQSK.js} +2 -2
- package/dist/{chunk-UFUKHGZD.js → chunk-F4I5NYBI.js} +89 -33
- package/dist/chunk-F4I5NYBI.js.map +1 -0
- package/dist/{chunk-HOJZMQ4J.js → chunk-FGDKJJZS.js} +2 -2
- package/dist/{chunk-ABP6QMVM.js → chunk-FQ7HAWWC.js} +2 -2
- package/dist/{chunk-CYWA2CXR.js → chunk-FVTLSFWU.js} +2 -2
- package/dist/{chunk-JJEJJ7RK.js → chunk-FXZTL7F7.js} +2 -2
- package/dist/{chunk-LADFWYHY.js → chunk-GOEV7CYF.js} +6 -6
- package/dist/chunk-GOEV7CYF.js.map +1 -0
- package/dist/{chunk-DANV2HTH.js → chunk-GQGDRLDM.js} +3 -3
- package/dist/{chunk-7F7Z6MOS.js → chunk-H4CKS5B2.js} +2 -2
- package/dist/{chunk-SVOHGUMI.js → chunk-H4FHR4UM.js} +174 -197
- package/dist/chunk-H4FHR4UM.js.map +1 -0
- package/dist/{chunk-CKITWVWJ.js → chunk-HSSERO3E.js} +2 -2
- package/dist/{chunk-23JFRB73.js → chunk-JODHPNLN.js} +2 -2
- package/dist/{chunk-DS7MM2ES.js → chunk-JZKR6ZAV.js} +2 -2
- package/dist/{chunk-BEM4D2QG.js → chunk-KJIJNLXT.js} +3 -3
- package/dist/{chunk-JSNVWNGX.js → chunk-KVSVVKHA.js} +2 -2
- package/dist/{chunk-4GNEDXDI.js → chunk-M67TLMP6.js} +2 -2
- package/dist/chunk-M67TLMP6.js.map +1 -0
- package/dist/{chunk-MC4FJXPA.js → chunk-MMACM5G2.js} +2 -2
- package/dist/{chunk-OUELRE5E.js → chunk-NOUJNHWG.js} +1 -1
- package/dist/chunk-NOUJNHWG.js.map +1 -0
- package/dist/{chunk-3XIY7MDQ.js → chunk-O6YI4CVI.js} +2 -2
- package/dist/{chunk-F53UF7CI.js → chunk-QLVLW7UD.js} +6 -2
- package/dist/{chunk-F53UF7CI.js.map → chunk-QLVLW7UD.js.map} +1 -1
- package/dist/{chunk-XCL57M6Q.js → chunk-RRKPLLCC.js} +21 -20
- package/dist/chunk-RRKPLLCC.js.map +1 -0
- package/dist/{chunk-72WG5QKN.js → chunk-SDAXPXER.js} +2 -2
- package/dist/{chunk-4LV23CHK.js → chunk-VHJARF5R.js} +2 -2
- package/dist/{chunk-H2DXDQCQ.js → chunk-VRJG3HIZ.js} +46 -42
- package/dist/chunk-VRJG3HIZ.js.map +1 -0
- package/dist/{chunk-6MMONPHM.js → chunk-W2AHSCKY.js} +2 -2
- package/dist/{chunk-P454KXD6.js → chunk-YAWJMR3Y.js} +21 -21
- package/dist/{chunk-K5LLP4CY.js → chunk-ZGPDSEKG.js} +20 -9
- package/dist/chunk-ZGPDSEKG.js.map +1 -0
- package/dist/{cli-CqdPA6z9.d.ts → cli-CnRsWREp.d.ts} +4 -5
- package/dist/cli.d.ts +9 -10
- package/dist/cli.js +32 -32
- package/dist/compounding/engine.d.ts +2 -3
- package/dist/compounding/engine.js +3 -3
- package/dist/compounding/preference-consolidator.d.ts +1 -2
- package/dist/compression-optimizer.d.ts +1 -2
- package/dist/config.d.ts +1 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -2
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -2
- package/dist/connectors/index.d.ts +1 -2
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.d.ts +2 -3
- package/dist/consolidation-undo.d.ts +2 -3
- package/dist/contradiction/index.d.ts +3 -4
- package/dist/conversation-index/backend.d.ts +1 -2
- package/dist/conversation-index/chunker.d.ts +1 -2
- package/dist/conversation-index/faiss-adapter.d.ts +1 -2
- package/dist/conversation-index/indexer.d.ts +1 -2
- package/dist/conversation-index/search.d.ts +1 -2
- package/dist/day-summary.d.ts +1 -2
- package/dist/delinearize.d.ts +1 -2
- package/dist/direct-answer-wiring.d.ts +1 -2
- package/dist/direct-answer.d.ts +1 -2
- package/dist/embedding-fallback.d.ts +1 -2
- package/dist/enrichment/index.d.ts +1 -2
- package/dist/entity-retrieval.d.ts +2 -3
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +1 -2
- package/dist/explicit-capture.d.ts +8 -7
- package/dist/explicit-capture.js +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -2
- package/dist/extraction-judge-training.d.ts +1 -2
- package/dist/extraction-judge.d.ts +1 -2
- package/dist/extraction.d.ts +1 -2
- package/dist/fallback-llm.d.ts +1 -2
- package/dist/graph-dashboard-diff.d.ts +1 -2
- package/dist/graph-dashboard-key.d.ts +1 -2
- package/dist/graph-dashboard-parser.d.ts +1 -2
- package/dist/graph-edge-reinforcement.d.ts +1 -2
- package/dist/graph-snapshot.d.ts +1 -2
- package/dist/graph.d.ts +1 -2
- package/dist/identity-continuity.d.ts +1 -2
- package/dist/importance.d.ts +1 -2
- package/dist/importers/index.d.ts +1 -1
- package/dist/importers/index.js +2 -2
- package/dist/index.d.ts +14 -15
- package/dist/index.js +40 -40
- package/dist/intent.d.ts +1 -2
- package/dist/lcm/engine.d.ts +1 -2
- package/dist/lcm/index.d.ts +1 -2
- package/dist/lcm/tools.d.ts +1 -2
- package/dist/lifecycle.d.ts +1 -2
- package/dist/live-connectors-runner.d.ts +1 -2
- package/dist/local-llm.d.ts +1 -2
- package/dist/local-model-endpoint.d.ts +1 -2
- package/dist/maintenance/memory-governance.d.ts +1 -2
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +7 -8
- package/dist/memory-action-policy.d.ts +1 -2
- package/dist/memory-cache.d.ts +1 -2
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -2
- package/dist/memory-projection-store.d.ts +1 -2
- package/dist/memory-provenance.d.ts +1 -2
- package/dist/memory-worth-outcomes.d.ts +2 -3
- package/dist/models-json.d.ts +1 -2
- package/dist/namespaces/migrate.d.ts +3 -4
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/principal.d.ts +1 -2
- package/dist/namespaces/search.d.ts +1 -2
- package/dist/namespaces/storage.d.ts +3 -4
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -2
- package/dist/operator-toolkit.d.ts +2 -3
- package/dist/operator-toolkit.js +7 -7
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -3
- package/dist/orchestration/maintenance.d.ts +2 -3
- package/dist/orchestration/maintenance.js +5 -5
- package/dist/{orchestrator-CWFrT8AF.d.ts → orchestrator-NRLVXPpH.d.ts} +40 -15
- package/dist/orchestrator.d.ts +6 -7
- package/dist/orchestrator.js +40 -40
- package/dist/patterns-cli.d.ts +1 -2
- package/dist/{pipeline-DmqtvION.d.ts → pipeline-CiD86zIk.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -2
- package/dist/provenance.d.ts +1 -2
- package/dist/{qmd--fnPMK60.d.ts → qmd-Bef7DDuQ.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -3
- package/dist/qmd-recall-cache.d.ts +1 -2
- package/dist/qmd.d.ts +2 -3
- package/dist/recall-disclosure-escalation.d.ts +1 -2
- package/dist/recall-explain-renderer.d.ts +1 -2
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-planner-llm.d.ts +1 -2
- package/dist/recall-state.d.ts +1 -2
- package/dist/recall-tag-filter.d.ts +1 -2
- package/dist/recall-timings.d.ts +1 -2
- package/dist/recall-xray-cli.d.ts +1 -2
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -2
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -2
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -0
- package/dist/replay/normalizers/chatgpt.js +3 -3
- package/dist/replay/normalizers/claude.d.ts +1 -0
- package/dist/replay/normalizers/claude.js +3 -3
- package/dist/replay/normalizers/openclaw.d.ts +1 -0
- package/dist/replay/normalizers/openclaw.js +3 -3
- package/dist/replay/normalizers/shared.d.ts +1 -0
- package/dist/replay/normalizers/shared.js +2 -2
- package/dist/replay/runner.d.ts +1 -0
- package/dist/replay/runner.js +2 -2
- package/dist/replay/types.d.ts +2 -1
- package/dist/replay/types.js +1 -1
- package/dist/resolve-auth-token.d.ts +1 -2
- package/dist/retrieval-agents.d.ts +2 -3
- package/dist/retrieval-tiers.d.ts +1 -2
- package/dist/routing/engine.d.ts +1 -2
- package/dist/routing/store.d.ts +1 -2
- package/dist/schemas.d.ts +44 -44
- package/dist/search/embed-helper.d.ts +1 -2
- package/dist/search/factory.d.ts +1 -2
- package/dist/search/index.d.ts +1 -2
- package/dist/search/lancedb-backend.d.ts +1 -2
- package/dist/search/meilisearch-backend.d.ts +1 -2
- package/dist/search/noop-backend.d.ts +1 -2
- package/dist/search/orama-backend.d.ts +1 -2
- package/dist/search/port.d.ts +1 -2
- package/dist/search/remote-backend.d.ts +1 -2
- package/dist/{semantic-DJR8_DMQ.d.ts → semantic-TddhF0y7.d.ts} +17 -1
- package/dist/{semantic-consolidation-O5lMZ4LG.d.ts → semantic-consolidation-BTShF2Fo.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -3
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +1 -2
- package/dist/semantic-rule-verifier.js +3 -3
- package/dist/session-observer-bands.d.ts +1 -2
- package/dist/session-observer-state.d.ts +1 -2
- package/dist/shared-context/manager.d.ts +3 -4
- package/dist/signal.d.ts +1 -2
- package/dist/{storage-C1maCNbc.d.ts → storage-DxPDAiU9.d.ts} +5 -1
- package/dist/storage.d.ts +2 -3
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +1 -2
- package/dist/summary-snapshot.d.ts +1 -2
- package/dist/temporal-supersession.d.ts +2 -3
- package/dist/temporal-validity.d.ts +1 -2
- package/dist/threading.d.ts +1 -2
- package/dist/tier-migration.d.ts +2 -3
- package/dist/tier-routing.d.ts +1 -2
- package/dist/topics.d.ts +1 -2
- package/dist/transcript.d.ts +1 -2
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +1 -2
- package/dist/trust-score.d.ts +1 -2
- package/dist/{types-CGgcNWCG.d.ts → types-DDUDgd7T.d.ts} +93 -4
- package/dist/types.d.ts +1 -2
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -2
- package/dist/verified-recall.js +3 -3
- package/package.json +2 -2
- package/src/access-admin-ops-surface.ts +1 -0
- package/src/access-boundary.ts +2 -0
- package/src/access-http.test.ts +129 -0
- package/src/access-http.ts +92 -23
- package/src/access-mcp.ts +11 -2
- package/src/access-observe-write-surface.ts +87 -113
- package/src/access-operations-batch.ts +2 -2
- package/src/access-operations.ts +17 -16
- package/src/access-service.ts +11 -3
- package/src/admin/admin-surfaces.ts +2 -0
- package/src/buffer.ts +6 -1
- package/src/bulk-import/types.ts +2 -1
- package/src/coding/architecture-surfaces.test.ts +79 -5
- package/src/coding/architecture-surfaces.ts +7 -1
- package/src/coding/decision-surfaces.test.ts +1 -0
- package/src/coding/decision-surfaces.ts +4 -0
- package/src/connector-provenance-lifecycle.test.ts +618 -0
- package/src/connector-provenance.test.ts +219 -0
- package/src/dedup/semantic.test.ts +105 -0
- package/src/dedup/semantic.ts +69 -1
- package/src/explicit-capture.ts +21 -4
- package/src/orchestration/extraction-persist.ts +154 -6
- package/src/orchestration/extraction-run.ts +138 -228
- package/src/orchestration/persistence-index.ts +40 -5
- package/src/orchestration/turn-ingestion.ts +16 -9
- package/src/orchestrator-connector-dedup.test.ts +1082 -0
- package/src/orchestrator.ts +7 -11
- package/src/replay/types.ts +2 -1
- package/src/storage.ts +426 -553
- package/src/types.ts +11 -2
- package/src/utils/yaml-scalar.ts +20 -0
- package/dist/chunk-2PRQG7PV.js.map +0 -1
- package/dist/chunk-4GNEDXDI.js.map +0 -1
- package/dist/chunk-FKCRGLRD.js.map +0 -1
- package/dist/chunk-H2DXDQCQ.js.map +0 -1
- package/dist/chunk-K5LLP4CY.js.map +0 -1
- package/dist/chunk-LADFWYHY.js.map +0 -1
- package/dist/chunk-OUELRE5E.js.map +0 -1
- package/dist/chunk-PCLIWBGD.js.map +0 -1
- package/dist/chunk-SVOHGUMI.js.map +0 -1
- package/dist/chunk-UFUKHGZD.js.map +0 -1
- package/dist/chunk-XCL57M6Q.js.map +0 -1
- package/dist/types-gb_SNtjR.d.ts +0 -85
- /package/dist/{chunk-PNLFN2PZ.js.map → chunk-23G3T2Q5.js.map} +0 -0
- /package/dist/{chunk-SIRPLF54.js.map → chunk-2K3OSLHE.js.map} +0 -0
- /package/dist/{chunk-LQHDIS7L.js.map → chunk-54BGIBCR.js.map} +0 -0
- /package/dist/{chunk-PVUJ6WVV.js.map → chunk-5MH5NF3U.js.map} +0 -0
- /package/dist/{chunk-Y7UNNAZD.js.map → chunk-7ZYBDQ7V.js.map} +0 -0
- /package/dist/{chunk-LR5DZ56F.js.map → chunk-AXALUFAH.js.map} +0 -0
- /package/dist/{chunk-AYZJID4S.js.map → chunk-B5GBWBCZ.js.map} +0 -0
- /package/dist/{chunk-TLUDFPZL.js.map → chunk-CAZ3Z5M6.js.map} +0 -0
- /package/dist/{chunk-RGK27ELN.js.map → chunk-DEKIXXIG.js.map} +0 -0
- /package/dist/{chunk-2KK5WNQB.js.map → chunk-DQ42IQSK.js.map} +0 -0
- /package/dist/{chunk-HOJZMQ4J.js.map → chunk-FGDKJJZS.js.map} +0 -0
- /package/dist/{chunk-ABP6QMVM.js.map → chunk-FQ7HAWWC.js.map} +0 -0
- /package/dist/{chunk-CYWA2CXR.js.map → chunk-FVTLSFWU.js.map} +0 -0
- /package/dist/{chunk-JJEJJ7RK.js.map → chunk-FXZTL7F7.js.map} +0 -0
- /package/dist/{chunk-DANV2HTH.js.map → chunk-GQGDRLDM.js.map} +0 -0
- /package/dist/{chunk-7F7Z6MOS.js.map → chunk-H4CKS5B2.js.map} +0 -0
- /package/dist/{chunk-CKITWVWJ.js.map → chunk-HSSERO3E.js.map} +0 -0
- /package/dist/{chunk-23JFRB73.js.map → chunk-JODHPNLN.js.map} +0 -0
- /package/dist/{chunk-DS7MM2ES.js.map → chunk-JZKR6ZAV.js.map} +0 -0
- /package/dist/{chunk-BEM4D2QG.js.map → chunk-KJIJNLXT.js.map} +0 -0
- /package/dist/{chunk-JSNVWNGX.js.map → chunk-KVSVVKHA.js.map} +0 -0
- /package/dist/{chunk-MC4FJXPA.js.map → chunk-MMACM5G2.js.map} +0 -0
- /package/dist/{chunk-3XIY7MDQ.js.map → chunk-O6YI4CVI.js.map} +0 -0
- /package/dist/{chunk-72WG5QKN.js.map → chunk-SDAXPXER.js.map} +0 -0
- /package/dist/{chunk-4LV23CHK.js.map → chunk-VHJARF5R.js.map} +0 -0
- /package/dist/{chunk-6MMONPHM.js.map → chunk-W2AHSCKY.js.map} +0 -0
- /package/dist/{chunk-P454KXD6.js.map → chunk-YAWJMR3Y.js.map} +0 -0
|
@@ -80,6 +80,7 @@ import {
|
|
|
80
80
|
dedupeBehaviorSignalsByMemoryAndHash,
|
|
81
81
|
} from "../behavior-signals.js";
|
|
82
82
|
import { buildProcedurePersistBody } from "../procedural/procedure-types.js";
|
|
83
|
+
import { stripAttributesSuffix } from "../structured-attributes.js";
|
|
83
84
|
import { LocalLlmClient } from "../local-llm.js";
|
|
84
85
|
import {
|
|
85
86
|
FallbackLlmClient,
|
|
@@ -133,6 +134,7 @@ export interface ExtractionPersistDeps {
|
|
|
133
134
|
eventTimeSource?: "extracted" | "assumed";
|
|
134
135
|
},
|
|
135
136
|
entityRef?: string,
|
|
137
|
+
sourceConnector?: string,
|
|
136
138
|
) => Promise<void>;
|
|
137
139
|
saveContentHashIndexes: () => Promise<void>;
|
|
138
140
|
artifactTypeForCategory: (
|
|
@@ -215,7 +217,7 @@ export class ExtractionPersistCoordinator {
|
|
|
215
217
|
result: ExtractionResult,
|
|
216
218
|
storage: StorageManager,
|
|
217
219
|
threadIdForExtraction?: string | null,
|
|
218
|
-
sourceContext?: { sessionKey?: string; principal?: string; validAt?: string },
|
|
220
|
+
sourceContext?: { sessionKey?: string; principal?: string; validAt?: string; sourceConnector?: string },
|
|
219
221
|
baseNamespace?: string,
|
|
220
222
|
scopeProfileWritePlan?: ResolvedScopeProfilePlan | null,
|
|
221
223
|
/** Verbatim source turn text the facts were extracted from (faithfulness gate #1576). */
|
|
@@ -230,6 +232,17 @@ export class ExtractionPersistCoordinator {
|
|
|
230
232
|
// see zero behavioral change.
|
|
231
233
|
const citationEnabled = resolvePipelineProcessingCapabilities(this.deps.config).inlineSourceAttribution === true;
|
|
232
234
|
const citationTemplate = this.deps.config.inlineSourceAttributionFormat;
|
|
235
|
+
|
|
236
|
+
// Canonicalize stored content for dedup comparison: strip citations
|
|
237
|
+
// (using the same template), sanitize, then normalize whitespace.
|
|
238
|
+
const normalizeStoredHashSource = (raw: string): string =>
|
|
239
|
+
ContentHashIndex.normalizeContent(
|
|
240
|
+
sanitizeMemoryContent(
|
|
241
|
+
citationEnabled && hasCitationForTemplate(raw, citationTemplate)
|
|
242
|
+
? stripCitationForTemplate(raw, citationTemplate)
|
|
243
|
+
: raw,
|
|
244
|
+
).text,
|
|
245
|
+
);
|
|
233
246
|
// The stable fields (agent, session) are computed once; `ts` is intentionally
|
|
234
247
|
// omitted here and added fresh per invocation so each fact in a large batch
|
|
235
248
|
// gets its own insertion timestamp rather than sharing a single batch-start time.
|
|
@@ -477,6 +490,27 @@ export class ExtractionPersistCoordinator {
|
|
|
477
490
|
options.category === "fact" &&
|
|
478
491
|
(await targetStorage.hasFactContentHash(dedupContent))
|
|
479
492
|
) {
|
|
493
|
+
// Connector-aware dedup (QOjlD): verify a same-connector
|
|
494
|
+
// active fact exists before skipping the promotion write.
|
|
495
|
+
// Different connectors with same content should NOT be deduped.
|
|
496
|
+
let skipPromotion = true;
|
|
497
|
+
try {
|
|
498
|
+
const allMems = await targetStorage.readAllMemories();
|
|
499
|
+
const nc = sourceContext?.sourceConnector?.trim() || undefined;
|
|
500
|
+
skipPromotion = allMems.some((m) => {
|
|
501
|
+
if (m.frontmatter.category !== options.category) return false;
|
|
502
|
+
if ((m.frontmatter.status ?? "active") !== "active") return false;
|
|
503
|
+
if (normalizeStoredHashSource(m.content ?? "") !==
|
|
504
|
+
ContentHashIndex.normalizeContent(dedupContent)) return false;
|
|
505
|
+
return (m.frontmatter.sourceConnector?.trim() || undefined) === nc;
|
|
506
|
+
});
|
|
507
|
+
} catch (err) {
|
|
508
|
+
log.warn(
|
|
509
|
+
`connector-aware promotion dedup scan failed; writing fail-open: ${err instanceof Error ? err.message : String(err)}`,
|
|
510
|
+
);
|
|
511
|
+
skipPromotion = false;
|
|
512
|
+
}
|
|
513
|
+
if (skipPromotion) {
|
|
480
514
|
// #1671 — backfill bi-temporal bounds the existing promoted copy
|
|
481
515
|
// lacks (re-extraction with a now-resolved invalidAt). Best-effort,
|
|
482
516
|
// fail-open; the helper gates on invalidAt to avoid I/O when no
|
|
@@ -493,9 +527,11 @@ export class ExtractionPersistCoordinator {
|
|
|
493
527
|
...(options.eventTimeSource ? { eventTimeSource: options.eventTimeSource } : {}),
|
|
494
528
|
},
|
|
495
529
|
options.entityRef,
|
|
530
|
+
sourceContext?.sourceConnector,
|
|
496
531
|
);
|
|
497
532
|
}
|
|
498
533
|
continue;
|
|
534
|
+
}
|
|
499
535
|
}
|
|
500
536
|
const targetPromotion = await targetStorage.writeMemory(
|
|
501
537
|
options.category as any,
|
|
@@ -521,6 +557,7 @@ export class ExtractionPersistCoordinator {
|
|
|
521
557
|
contentHashSource: options.category === "fact" ? dedupContent : rawContent,
|
|
522
558
|
...(options.sources && options.sources.length > 0 ? { sources: options.sources } : {}),
|
|
523
559
|
...(options.provenance ? { provenance: options.provenance } : {}),
|
|
560
|
+
...(sourceContext?.sourceConnector ? { sourceConnector: sourceContext.sourceConnector } : {}),
|
|
524
561
|
},
|
|
525
562
|
);
|
|
526
563
|
const promotedId = targetPromotion.id;
|
|
@@ -666,11 +703,43 @@ export class ExtractionPersistCoordinator {
|
|
|
666
703
|
options.category === "fact" &&
|
|
667
704
|
(await sharedStorage.hasFactContentHash(dedupContent))
|
|
668
705
|
) {
|
|
706
|
+
// Connector identity gate: only backfill temporal bounds onto a
|
|
707
|
+
// same-connector fact. Different connectors with identical content
|
|
708
|
+
// must not cross-patch each other's temporal fields (codex finding:
|
|
709
|
+
// temporal backfill occurred before connector mismatch check).
|
|
710
|
+
// Fail-open: on scan error backfill proceeds (preserving prior
|
|
711
|
+
// best-effort behaviour).
|
|
712
|
+
let sharedSameConnector = true;
|
|
713
|
+
if (options.invalidAt || options.validAt) {
|
|
714
|
+
try {
|
|
715
|
+
const sharedMems = await sharedStorage.readAllMemories();
|
|
716
|
+
const snc = sourceContext?.sourceConnector?.trim() || undefined;
|
|
717
|
+
sharedSameConnector = sharedMems.some((m) => {
|
|
718
|
+
if (m.frontmatter.category !== "fact") return false;
|
|
719
|
+
if ((m.frontmatter.status ?? "active") !== "active") return false;
|
|
720
|
+
if (normalizeStoredHashSource(m.content ?? "") !==
|
|
721
|
+
ContentHashIndex.normalizeContent(dedupContent)) return false;
|
|
722
|
+
return (m.frontmatter.sourceConnector?.trim() || undefined) === snc;
|
|
723
|
+
});
|
|
724
|
+
} catch (scanErr) {
|
|
725
|
+
// Review f1b89fe9: on scan error, conservatively skip backfill
|
|
726
|
+
// instead of fail-opening. A fail-open here still calls the
|
|
727
|
+
// helper, which selects the first hash/entity match — and if
|
|
728
|
+
// that match is a different connector's fact, the mutation
|
|
729
|
+
// corrupts its temporal bounds. Skipping is the safe choice.
|
|
730
|
+
sharedSameConnector = false;
|
|
731
|
+
log.warn(
|
|
732
|
+
`connector-aware shared backfill scan failed; skipping backfill to avoid cross-connector mutation: ${scanErr instanceof Error ? scanErr.message : String(scanErr)}`,
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
669
736
|
// #1671 — backfill bi-temporal bounds onto the existing shared copy
|
|
670
737
|
// before the supersession short-circuit. Covers all return paths below
|
|
671
738
|
// (supersession-hit, catch-skip, and the no-supersession short-circuit)
|
|
672
739
|
// in one shot. Best-effort / fail-open; the helper gates on invalidAt.
|
|
673
|
-
|
|
740
|
+
// Connector gate: skip backfill when no same-connector active fact
|
|
741
|
+
// exists so a different connector's copy is not mutated.
|
|
742
|
+
if (sharedSameConnector && (options.invalidAt || options.validAt)) {
|
|
674
743
|
await this.deps.backfillTemporalBoundsOnDedupHit(
|
|
675
744
|
sharedStorage,
|
|
676
745
|
dedupContent,
|
|
@@ -682,6 +751,7 @@ export class ExtractionPersistCoordinator {
|
|
|
682
751
|
...(options.eventTimeSource ? { eventTimeSource: options.eventTimeSource } : {}),
|
|
683
752
|
},
|
|
684
753
|
options.entityRef,
|
|
754
|
+
sourceContext?.sourceConnector,
|
|
685
755
|
);
|
|
686
756
|
}
|
|
687
757
|
// Uj6H fix: shared-namespace temporal supersession must also run when
|
|
@@ -741,7 +811,13 @@ export class ExtractionPersistCoordinator {
|
|
|
741
811
|
// (including any appended "[Attributes: ...]" suffix) against the
|
|
742
812
|
// enriched normalizedIncoming so the candidate selected is the one
|
|
743
813
|
// whose hash actually matched in hasFactContentHash.
|
|
744
|
-
|
|
814
|
+
if (normalizeStoredHashSource(m.content ?? "") !== normalizedIncoming) return false;
|
|
815
|
+
// Connector-aware dedup: same content from different connectors
|
|
816
|
+
// is NOT a duplicate (review thread QOjlD).
|
|
817
|
+
const existingConnector = m.frontmatter.sourceConnector?.trim() || undefined;
|
|
818
|
+
const newConnector = sourceContext?.sourceConnector?.trim() || undefined;
|
|
819
|
+
if (existingConnector !== newConnector) return false;
|
|
820
|
+
return true;
|
|
745
821
|
});
|
|
746
822
|
hashDedupLookupComplete = true;
|
|
747
823
|
if (hashDedupMatchingFact) {
|
|
@@ -819,9 +895,33 @@ export class ExtractionPersistCoordinator {
|
|
|
819
895
|
);
|
|
820
896
|
}
|
|
821
897
|
} else {
|
|
822
|
-
//
|
|
823
|
-
// the
|
|
824
|
-
|
|
898
|
+
// Connector-aware dedup (QPAn-): when temporal supersession is off
|
|
899
|
+
// or the fact has no entity/structuredAttributes, the original
|
|
900
|
+
// short-circuit would drop a different-connector fact. Verify a
|
|
901
|
+
// same-connector active fact exists before skipping the shared
|
|
902
|
+
// promotion write; otherwise fall through so the new connector's
|
|
903
|
+
// fact gets its own promoted copy.
|
|
904
|
+
let skipSharedPromotion = true;
|
|
905
|
+
try {
|
|
906
|
+
const allSharedMems = await sharedStorage.readAllMemories();
|
|
907
|
+
const snc = sourceContext?.sourceConnector?.trim() || undefined;
|
|
908
|
+
const sharedNormalized = ContentHashIndex.normalizeContent(dedupContent);
|
|
909
|
+
skipSharedPromotion = allSharedMems.some((m) => {
|
|
910
|
+
if (m.frontmatter.category !== "fact") return false;
|
|
911
|
+
if ((m.frontmatter.status ?? "active") !== "active") return false;
|
|
912
|
+
if (normalizeStoredHashSource(m.content ?? "") !== sharedNormalized) return false;
|
|
913
|
+
return (m.frontmatter.sourceConnector?.trim() || undefined) === snc;
|
|
914
|
+
});
|
|
915
|
+
} catch (err) {
|
|
916
|
+
log.warn(
|
|
917
|
+
`connector-aware shared promotion dedup scan failed; writing fail-open: ${err instanceof Error ? err.message : String(err)}`,
|
|
918
|
+
);
|
|
919
|
+
skipSharedPromotion = false;
|
|
920
|
+
}
|
|
921
|
+
if (skipSharedPromotion) {
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
// No same-connector active shared fact — fall through to write.
|
|
825
925
|
}
|
|
826
926
|
}
|
|
827
927
|
const sharedPromotion = await sharedStorage.writeMemory(
|
|
@@ -849,6 +949,7 @@ export class ExtractionPersistCoordinator {
|
|
|
849
949
|
// Claim-level provenance spans (issue #1575 PR 2).
|
|
850
950
|
...(options.sources && options.sources.length > 0 ? { sources: options.sources } : {}),
|
|
851
951
|
...(options.provenance ? { provenance: options.provenance } : {}),
|
|
952
|
+
...(sourceContext?.sourceConnector ? { sourceConnector: sourceContext.sourceConnector } : {}),
|
|
852
953
|
},
|
|
853
954
|
);
|
|
854
955
|
const promotedId = sharedPromotion.id;
|
|
@@ -930,6 +1031,7 @@ export class ExtractionPersistCoordinator {
|
|
|
930
1031
|
confidence: number;
|
|
931
1032
|
entityRef?: string;
|
|
932
1033
|
structuredAttributes?: Record<string, string>;
|
|
1034
|
+
sourceConnector?: string;
|
|
933
1035
|
bounds: {
|
|
934
1036
|
invalidAt?: string;
|
|
935
1037
|
validFrom?: string;
|
|
@@ -989,6 +1091,7 @@ export class ExtractionPersistCoordinator {
|
|
|
989
1091
|
dedupContent,
|
|
990
1092
|
args.bounds,
|
|
991
1093
|
args.entityRef,
|
|
1094
|
+
args.sourceConnector,
|
|
992
1095
|
);
|
|
993
1096
|
} catch (err) {
|
|
994
1097
|
log.warn(
|
|
@@ -1016,6 +1119,7 @@ export class ExtractionPersistCoordinator {
|
|
|
1016
1119
|
dedupContent,
|
|
1017
1120
|
args.bounds,
|
|
1018
1121
|
args.entityRef,
|
|
1122
|
+
args.sourceConnector,
|
|
1019
1123
|
);
|
|
1020
1124
|
}
|
|
1021
1125
|
} catch (err) {
|
|
@@ -1574,6 +1678,36 @@ export class ExtractionPersistCoordinator {
|
|
|
1574
1678
|
`content-hash dedup lookup failed for storage ${targetStorage.dir}; writing fact fail-open: ${err}`,
|
|
1575
1679
|
);
|
|
1576
1680
|
}
|
|
1681
|
+
// Connector-aware dedup (QOjlB): if the hash says duplicate, verify
|
|
1682
|
+
// a same-content, same-connector active fact exists. Different
|
|
1683
|
+
// connectors with same content should NOT be deduped. Fail open
|
|
1684
|
+
// (write) on scan failure so an unverifiable hash hit cannot
|
|
1685
|
+
// silently drop content.
|
|
1686
|
+
if (exactDuplicate) {
|
|
1687
|
+
try {
|
|
1688
|
+
const allMems = await targetStorage.readAllMemories();
|
|
1689
|
+
const nc = sourceContext?.sourceConnector?.trim() || undefined;
|
|
1690
|
+
exactDuplicate = allMems.some((m) => {
|
|
1691
|
+
if (m.frontmatter.category !== writeCategory) return false;
|
|
1692
|
+
if ((m.frontmatter.status ?? "active") !== "active") return false;
|
|
1693
|
+
// Thread 5 (QPDE5): for procedures the hash is keyed on the full
|
|
1694
|
+
// body (title + steps via buildProcedurePersistBody), so compare
|
|
1695
|
+
// against contentHashDedupKey — not canonicalContentForHash which
|
|
1696
|
+
// is the title only. Thread 3 (QO42V): facts with
|
|
1697
|
+
// structuredAttributes get an appended [Attributes: ...] suffix in
|
|
1698
|
+
// the stored body that the hash key lacks; strip it before
|
|
1699
|
+
// comparing so same-connector enriched facts dedup correctly.
|
|
1700
|
+
if (normalizeStoredHashSource(stripAttributesSuffix(m.content ?? "")) !==
|
|
1701
|
+
ContentHashIndex.normalizeContent(contentHashDedupKey)) return false;
|
|
1702
|
+
return (m.frontmatter.sourceConnector?.trim() || undefined) === nc;
|
|
1703
|
+
});
|
|
1704
|
+
} catch (err) {
|
|
1705
|
+
log.warn(
|
|
1706
|
+
`connector-aware dedup scan failed for storage ${targetStorage.dir}; writing fail-open: ${err instanceof Error ? err.message : String(err)}`,
|
|
1707
|
+
);
|
|
1708
|
+
exactDuplicate = false;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1577
1711
|
if (exactDuplicate) {
|
|
1578
1712
|
// #1671 — before short-circuiting, backfill bi-temporal bounds
|
|
1579
1713
|
// onto the existing source-namespace copy if it lacks bounds the
|
|
@@ -1628,6 +1762,7 @@ export class ExtractionPersistCoordinator {
|
|
|
1628
1762
|
eventTimeSource: biTemporal.eventTimeSource,
|
|
1629
1763
|
},
|
|
1630
1764
|
fact.entityRef,
|
|
1765
|
+
sourceContext?.sourceConnector,
|
|
1631
1766
|
);
|
|
1632
1767
|
// #1707 thread 1 — the source branch short-circuits (`continue`
|
|
1633
1768
|
// below) before the promotion dedup paths run, so promoted
|
|
@@ -1642,6 +1777,7 @@ export class ExtractionPersistCoordinator {
|
|
|
1642
1777
|
confidence: fact.confidence,
|
|
1643
1778
|
entityRef: fact.entityRef,
|
|
1644
1779
|
structuredAttributes: fact.structuredAttributes,
|
|
1780
|
+
sourceConnector: sourceContext?.sourceConnector,
|
|
1645
1781
|
bounds: {
|
|
1646
1782
|
invalidAt: biTemporal.validUntil,
|
|
1647
1783
|
validFrom: biTemporal.validFrom,
|
|
@@ -1803,6 +1939,9 @@ export class ExtractionPersistCoordinator {
|
|
|
1803
1939
|
// would cause the fact to be dropped here — cross-namespace
|
|
1804
1940
|
// write suppression / data loss.
|
|
1805
1941
|
const lookupStorage = targetStorage;
|
|
1942
|
+
// PR #1852 review finding on 7e0eb1a0: forward the candidate's
|
|
1943
|
+
// sourceConnector so the connector-aware skip gate can refuse to
|
|
1944
|
+
// drop a connector B paraphrase against connector A's memory.
|
|
1806
1945
|
semanticDecision = await decideSemanticDedup(
|
|
1807
1946
|
fact.content,
|
|
1808
1947
|
(content, limit) =>
|
|
@@ -1811,6 +1950,7 @@ export class ExtractionPersistCoordinator {
|
|
|
1811
1950
|
enabled: true,
|
|
1812
1951
|
threshold: this.deps.config.semanticDedupThreshold,
|
|
1813
1952
|
candidates: this.deps.config.semanticDedupCandidates,
|
|
1953
|
+
sourceConnector: sourceContext?.sourceConnector,
|
|
1814
1954
|
},
|
|
1815
1955
|
);
|
|
1816
1956
|
} catch (err) {
|
|
@@ -1841,6 +1981,7 @@ export class ExtractionPersistCoordinator {
|
|
|
1841
1981
|
(fact as any).source === "proactive"
|
|
1842
1982
|
? "extraction-proactive"
|
|
1843
1983
|
: "extraction";
|
|
1984
|
+
const extractionSourceConnector = sourceContext?.sourceConnector;
|
|
1844
1985
|
|
|
1845
1986
|
// Check for contradictions before writing (Phase 2B).
|
|
1846
1987
|
// NOTE: This block was moved above the chunking branch so that the
|
|
@@ -2025,6 +2166,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2025
2166
|
tags: [...fact.tags, "chunked"],
|
|
2026
2167
|
entityRef: fact.entityRef,
|
|
2027
2168
|
source: extractionWriteSource,
|
|
2169
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2028
2170
|
importance,
|
|
2029
2171
|
supersedes,
|
|
2030
2172
|
links: links.length > 0 ? links : undefined,
|
|
@@ -2118,6 +2260,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2118
2260
|
// the verified span (chatgpt-codex-connector thread Ocvmo).
|
|
2119
2261
|
...(fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {}),
|
|
2120
2262
|
...(fact.provenance ? { provenance: fact.provenance } : {}),
|
|
2263
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2121
2264
|
},
|
|
2122
2265
|
);
|
|
2123
2266
|
}
|
|
@@ -2207,6 +2350,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2207
2350
|
}
|
|
2208
2351
|
: {}),
|
|
2209
2352
|
source: extractionWriteSource,
|
|
2353
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2210
2354
|
...(fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {}),
|
|
2211
2355
|
...(fact.provenance ? { provenance: fact.provenance } : {}),
|
|
2212
2356
|
});
|
|
@@ -2261,6 +2405,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2261
2405
|
intentGoal: inferredIntent?.goal,
|
|
2262
2406
|
intentActionType: inferredIntent?.actionType,
|
|
2263
2407
|
intentEntityTypes: inferredIntent?.entityTypes,
|
|
2408
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2264
2409
|
});
|
|
2265
2410
|
}
|
|
2266
2411
|
// v8.2: graph edge building for chunked memories. #1576: skip pending_review.
|
|
@@ -2377,6 +2522,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2377
2522
|
? (fact as any).entityRef
|
|
2378
2523
|
: undefined,
|
|
2379
2524
|
source: extractionWriteSource,
|
|
2525
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2380
2526
|
importance,
|
|
2381
2527
|
supersedes,
|
|
2382
2528
|
links: links.length > 0 ? links : undefined,
|
|
@@ -2498,6 +2644,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2498
2644
|
}
|
|
2499
2645
|
: {}),
|
|
2500
2646
|
source: extractionWriteSource,
|
|
2647
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2501
2648
|
...(fact.sources && fact.sources.length > 0 ? { sources: fact.sources } : {}),
|
|
2502
2649
|
...(fact.provenance ? { provenance: fact.provenance } : {}),
|
|
2503
2650
|
});
|
|
@@ -2558,6 +2705,7 @@ export class ExtractionPersistCoordinator {
|
|
|
2558
2705
|
intentGoal: inferredIntent?.goal,
|
|
2559
2706
|
intentActionType: inferredIntent?.actionType,
|
|
2560
2707
|
intentEntityTypes: inferredIntent?.entityTypes,
|
|
2708
|
+
...(extractionSourceConnector ? { sourceConnector: extractionSourceConnector } : {}),
|
|
2561
2709
|
});
|
|
2562
2710
|
}
|
|
2563
2711
|
// Register in the target storage content-hash index after successful
|