@remnic/core 9.31.0 → 9.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +10 -10
- package/dist/access-admin-ops-surface.js +33 -27
- package/dist/access-authorization-probe.d.ts +10 -10
- package/dist/access-authorization-probe.js +34 -28
- package/dist/access-boundary.d.ts +10 -10
- package/dist/access-boundary.js +33 -27
- package/dist/access-cli.js +69 -68
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +10 -10
- package/dist/access-extraction-force-flush.js +33 -27
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +10 -10
- package/dist/access-http-lifecycle-flush.d.ts +10 -10
- package/dist/access-http.d.ts +10 -10
- package/dist/access-http.js +42 -36
- package/dist/access-identity-continuity-surface.d.ts +8 -8
- package/dist/access-identity-continuity-surface.js +33 -27
- package/dist/access-lcm-surface.d.ts +10 -10
- package/dist/access-lcm-surface.js +33 -27
- package/dist/access-mcp.d.ts +10 -10
- package/dist/access-mcp.js +38 -32
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-D4vW97H1.d.ts → access-namespace-preflight-CWyL4Zai.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +33 -27
- package/dist/access-observe-write-surface.d.ts +10 -10
- package/dist/access-observe-write-surface.js +33 -27
- package/dist/access-operations-batch.js +35 -29
- package/dist/access-operations.d.ts +10 -10
- package/dist/access-operations.js +37 -31
- package/dist/access-recall-concurrency.d.ts +10 -10
- package/dist/access-recall-concurrency.js +33 -27
- package/dist/access-recall-response.d.ts +10 -10
- package/dist/access-recall-response.js +33 -27
- package/dist/access-recall-surface.d.ts +10 -10
- package/dist/access-recall-surface.js +33 -27
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-B6PZ_xUL.d.ts → access-service-D9zIBlpp.d.ts} +7 -7
- package/dist/access-service-helpers.d.ts +10 -10
- package/dist/access-service.d.ts +10 -10
- package/dist/access-service.js +33 -27
- package/dist/access-surface-catalog.d.ts +10 -10
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/auto-sync-UPTUVE4X.js +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +8 -8
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +7 -7
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +2 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{catalog-CGFYmTT8.d.ts → catalog-Du4bpZWM.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +10 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-AU7Q3LSC.js → chunk-2QSZNTDO.js} +4 -4
- package/dist/{chunk-7G5MH4NT.js → chunk-4TGZCYHH.js} +15 -15
- package/dist/{chunk-U52AKICI.js → chunk-6JE3HGS4.js} +6 -6
- package/dist/{chunk-MAXVH44E.js → chunk-6NNNURLK.js} +4 -4
- package/dist/{chunk-65ZPVYTA.js → chunk-6NPZ3FP2.js} +2 -2
- package/dist/{chunk-BLAKS3CP.js → chunk-77CNV7DY.js} +4 -4
- package/dist/{chunk-227UFSEQ.js → chunk-7RZJWZ46.js} +5 -5
- package/dist/{chunk-GTTAHHD3.js → chunk-7TWUCYER.js} +7 -4
- package/dist/chunk-7TWUCYER.js.map +1 -0
- package/dist/{chunk-XHDIB4T4.js → chunk-7ZHGPX56.js} +2 -2
- package/dist/{chunk-PNPOWBGC.js → chunk-AEPYA55F.js} +4 -4
- package/dist/{chunk-GOUILH55.js → chunk-ATUURSST.js} +3 -3
- package/dist/chunk-B6XHIBIB.js +111 -0
- package/dist/chunk-B6XHIBIB.js.map +1 -0
- package/dist/{chunk-BUGVGH4N.js → chunk-BIXWNHIL.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-FI4F5X2V.js → chunk-C4PEMCP4.js} +8 -8
- package/dist/{chunk-TGTTESJS.js → chunk-CMQZNEIF.js} +2 -2
- package/dist/chunk-CMQZNEIF.js.map +1 -0
- package/dist/{chunk-KE353EWI.js → chunk-DMT2RGAZ.js} +3 -3
- package/dist/{chunk-QIHIHZYC.js → chunk-DP7ZV2II.js} +42 -89
- package/dist/chunk-DP7ZV2II.js.map +1 -0
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-AJEMDQNA.js → chunk-EHNENZHZ.js} +6 -6
- package/dist/{chunk-5XA7PQ5I.js → chunk-EO7X2LDK.js} +2 -2
- package/dist/{chunk-TL4TO3EA.js → chunk-F3BNEYX2.js} +2 -2
- package/dist/{chunk-7DRETLP5.js → chunk-HXDWZFNP.js} +1 -1
- package/dist/chunk-HXDWZFNP.js.map +1 -0
- package/dist/{chunk-3F2LKUMU.js → chunk-I5DQ6KZK.js} +2 -2
- package/dist/{chunk-YFOMN2II.js → chunk-IZXTZ7BF.js} +5 -5
- package/dist/{chunk-UR77VKF7.js → chunk-J6BYDVPL.js} +2 -2
- package/dist/{chunk-KIT6M7EB.js → chunk-J6SLNQRO.js} +2 -2
- package/dist/{chunk-VANLTS5F.js → chunk-KEWUNL7P.js} +2 -2
- package/dist/{chunk-BR2K43MK.js → chunk-KWU6MAD4.js} +2 -2
- package/dist/{chunk-EJCAV3QZ.js → chunk-MPH263X2.js} +2 -2
- package/dist/{chunk-CZDOT5I2.js → chunk-MYXWPG5O.js} +2 -2
- package/dist/{chunk-Z4SWV4VW.js → chunk-N2B56SIS.js} +3 -3
- package/dist/{chunk-C4VQMFVM.js → chunk-OPRP6Q4Z.js} +3 -3
- package/dist/{chunk-ES36HTSC.js → chunk-PTN6UAUA.js} +4 -4
- package/dist/{chunk-NYCGIQRA.js → chunk-QHYB4MJV.js} +21 -5
- package/dist/chunk-QHYB4MJV.js.map +1 -0
- package/dist/{chunk-S2BBISHU.js → chunk-RYHWZ52A.js} +4 -4
- package/dist/{chunk-YPC7W6GA.js → chunk-RYMPLSIT.js} +3 -2
- package/dist/{chunk-YPC7W6GA.js.map → chunk-RYMPLSIT.js.map} +1 -1
- package/dist/{chunk-J7WZUL2K.js → chunk-SFW2NABJ.js} +11 -11
- package/dist/{chunk-CIVDJD6P.js → chunk-SIKCTPRK.js} +3 -3
- package/dist/{chunk-RUYJ7TWU.js → chunk-SPPL77NI.js} +32 -29
- package/dist/chunk-SPPL77NI.js.map +1 -0
- package/dist/chunk-T2TTP3KU.js +28 -0
- package/dist/chunk-T2TTP3KU.js.map +1 -0
- package/dist/{chunk-H36LJIPD.js → chunk-TCIWHK3N.js} +2 -2
- package/dist/{chunk-4XHR3I67.js → chunk-TITQYVKD.js} +38 -38
- package/dist/{chunk-E6BMSH7U.js → chunk-V2MVDDJF.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-JCFTIQBR.js → chunk-XABS455Y.js} +2 -2
- package/dist/{chunk-E4PWACUN.js → chunk-XWDZQIYU.js} +2 -2
- package/dist/{chunk-QGENAYVS.js → chunk-Y2ZD2RVG.js} +2 -2
- package/dist/{chunk-NFXQJHJD.js → chunk-Y6OWJ3V5.js} +2 -2
- package/dist/{chunk-OGCNZPKX.js → chunk-YFQMW2TH.js} +35 -23
- package/dist/{chunk-OGCNZPKX.js.map → chunk-YFQMW2TH.js.map} +1 -1
- package/dist/{chunk-27P5YVDU.js → chunk-YJ7PWEWI.js} +2 -2
- package/dist/{cli-BptUDTtp.d.ts → cli-mFX-QQvx.d.ts} +5 -5
- package/dist/cli.d.ts +12 -12
- package/dist/cli.js +58 -54
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +7 -7
- 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/config.js +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +7 -8
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +5 -2
- package/dist/connectors/index.js +19 -14
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- 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/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +18 -18
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +7 -7
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +8 -8
- package/dist/explicit-capture.js +3 -3
- package/dist/extraction-error-classification.d.ts +1 -1
- 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-liveness.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction.d.ts +1 -2
- package/dist/extraction.js +63 -2
- package/dist/fallback-llm.d.ts +1 -1
- 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/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +106 -105
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +5 -5
- 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-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +7 -7
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -7
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +8 -8
- package/dist/{maintenance-b6f92bRz.d.ts → maintenance-70Wq118b.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +10 -10
- 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 +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +17 -17
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +7 -7
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +19 -19
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +23 -23
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +12 -12
- package/dist/{orchestrator-3uGxC1qO.d.ts → orchestrator-BH8LT-NX.d.ts} +7 -7
- package/dist/orchestrator.d.ts +8 -8
- package/dist/orchestrator.js +69 -68
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-DepuNr-m.d.ts → pipeline-DSLWFeHz.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-Dalr3Jby.d.ts → qmd-BSDGyr0H.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.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-explain-renderer.js +3 -3
- package/dist/recall-memory-map.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-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +1 -1
- package/dist/retrieval-agents.d.ts +2 -2
- 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/salvage-envelope.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/{scope-profiles-BpiM5hTU.d.ts → scope-profiles-C4zY-a2K.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-CMtVrf9f.d.ts → semantic-consolidation-ChKRYpRO.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +9 -10
- package/dist/semantic-rule-promotion.js +7 -7
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +7 -7
- package/dist/{service-DuAxwSgg.d.ts → service-CrxXHz5T.d.ts} +2 -2
- 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/source-agent-qualifier.d.ts +24 -0
- package/dist/source-agent-qualifier.js +98 -0
- package/dist/source-agent-qualifier.js.map +1 -0
- package/dist/{storage-CF0Ih8GP.d.ts → storage-CyWa1Jm6.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +6 -6
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.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 +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-BpaYvJ6v.d.ts → types-5398p7Zm.d.ts} +8 -8
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +7 -7
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/connector-provenance-lifecycle.test.ts +86 -3
- package/src/connectors/index.ts +3 -3
- package/src/connectors/label.ts +36 -0
- package/src/extraction-scope-source-agent.test.ts +513 -0
- package/src/extraction.ts +45 -98
- package/src/orchestration/extraction-run.ts +1 -1
- package/src/orchestration/recall-result-formatter.ts +22 -2
- package/src/orchestration/recall-search-pipeline.test.ts +34 -0
- package/src/orchestration/recall-search-pipeline.ts +9 -1
- package/src/recall-source-connector-label.test.ts +300 -0
- package/src/schemas.ts +1 -1
- package/src/source-agent-qualifier.ts +156 -0
- package/src/types.ts +8 -9
- package/dist/chunk-3UXOZBHV.js +0 -20
- package/dist/chunk-3UXOZBHV.js.map +0 -1
- package/dist/chunk-7DRETLP5.js.map +0 -1
- package/dist/chunk-GTTAHHD3.js.map +0 -1
- package/dist/chunk-NYCGIQRA.js.map +0 -1
- package/dist/chunk-QIHIHZYC.js.map +0 -1
- package/dist/chunk-RUYJ7TWU.js.map +0 -1
- package/dist/chunk-TGTTESJS.js.map +0 -1
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-AU7Q3LSC.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-7G5MH4NT.js.map → chunk-4TGZCYHH.js.map} +0 -0
- /package/dist/{chunk-U52AKICI.js.map → chunk-6JE3HGS4.js.map} +0 -0
- /package/dist/{chunk-MAXVH44E.js.map → chunk-6NNNURLK.js.map} +0 -0
- /package/dist/{chunk-65ZPVYTA.js.map → chunk-6NPZ3FP2.js.map} +0 -0
- /package/dist/{chunk-BLAKS3CP.js.map → chunk-77CNV7DY.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-7RZJWZ46.js.map} +0 -0
- /package/dist/{chunk-XHDIB4T4.js.map → chunk-7ZHGPX56.js.map} +0 -0
- /package/dist/{chunk-PNPOWBGC.js.map → chunk-AEPYA55F.js.map} +0 -0
- /package/dist/{chunk-GOUILH55.js.map → chunk-ATUURSST.js.map} +0 -0
- /package/dist/{chunk-BUGVGH4N.js.map → chunk-BIXWNHIL.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-FI4F5X2V.js.map → chunk-C4PEMCP4.js.map} +0 -0
- /package/dist/{chunk-KE353EWI.js.map → chunk-DMT2RGAZ.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-AJEMDQNA.js.map → chunk-EHNENZHZ.js.map} +0 -0
- /package/dist/{chunk-5XA7PQ5I.js.map → chunk-EO7X2LDK.js.map} +0 -0
- /package/dist/{chunk-TL4TO3EA.js.map → chunk-F3BNEYX2.js.map} +0 -0
- /package/dist/{chunk-3F2LKUMU.js.map → chunk-I5DQ6KZK.js.map} +0 -0
- /package/dist/{chunk-YFOMN2II.js.map → chunk-IZXTZ7BF.js.map} +0 -0
- /package/dist/{chunk-UR77VKF7.js.map → chunk-J6BYDVPL.js.map} +0 -0
- /package/dist/{chunk-KIT6M7EB.js.map → chunk-J6SLNQRO.js.map} +0 -0
- /package/dist/{chunk-VANLTS5F.js.map → chunk-KEWUNL7P.js.map} +0 -0
- /package/dist/{chunk-BR2K43MK.js.map → chunk-KWU6MAD4.js.map} +0 -0
- /package/dist/{chunk-EJCAV3QZ.js.map → chunk-MPH263X2.js.map} +0 -0
- /package/dist/{chunk-CZDOT5I2.js.map → chunk-MYXWPG5O.js.map} +0 -0
- /package/dist/{chunk-Z4SWV4VW.js.map → chunk-N2B56SIS.js.map} +0 -0
- /package/dist/{chunk-C4VQMFVM.js.map → chunk-OPRP6Q4Z.js.map} +0 -0
- /package/dist/{chunk-ES36HTSC.js.map → chunk-PTN6UAUA.js.map} +0 -0
- /package/dist/{chunk-S2BBISHU.js.map → chunk-RYHWZ52A.js.map} +0 -0
- /package/dist/{chunk-J7WZUL2K.js.map → chunk-SFW2NABJ.js.map} +0 -0
- /package/dist/{chunk-CIVDJD6P.js.map → chunk-SIKCTPRK.js.map} +0 -0
- /package/dist/{chunk-H36LJIPD.js.map → chunk-TCIWHK3N.js.map} +0 -0
- /package/dist/{chunk-4XHR3I67.js.map → chunk-TITQYVKD.js.map} +0 -0
- /package/dist/{chunk-E6BMSH7U.js.map → chunk-V2MVDDJF.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-JCFTIQBR.js.map → chunk-XABS455Y.js.map} +0 -0
- /package/dist/{chunk-E4PWACUN.js.map → chunk-XWDZQIYU.js.map} +0 -0
- /package/dist/{chunk-QGENAYVS.js.map → chunk-Y2ZD2RVG.js.map} +0 -0
- /package/dist/{chunk-NFXQJHJD.js.map → chunk-Y6OWJ3V5.js.map} +0 -0
- /package/dist/{chunk-27P5YVDU.js.map → chunk-YJ7PWEWI.js.map} +0 -0
package/src/extraction.ts
CHANGED
|
@@ -41,9 +41,9 @@ import { normalizeReasoningTrace } from "./reasoning-trace-types.js";
|
|
|
41
41
|
import { looksLikeMechanicalTelemetryTranscript } from "./telemetry-transcript.js";
|
|
42
42
|
import {
|
|
43
43
|
attachExtractionProvenance,
|
|
44
|
-
applyExtractionSourceGrounding,
|
|
45
44
|
type ExtractionGroundingRoleSources,
|
|
46
45
|
} from "./extraction-source-grounding.js";
|
|
46
|
+
import { applyGroundingWithConnector, headerConnector, renderExtractionConversation, resolveSourceConnector, type ExtractionGroundingContext } from "./source-agent-qualifier.js";
|
|
47
47
|
import { isMemoryCategory } from "./write-envelope.js";
|
|
48
48
|
import { classifyExtractionThrownError, classifyFallbackParseFailure } from "./extraction-error-classification.js";
|
|
49
49
|
export { classifyExtractionThrownError, classifyFallbackParseFailure } from "./extraction-error-classification.js";
|
|
@@ -666,10 +666,7 @@ export class ExtractionEngine {
|
|
|
666
666
|
private async applyProactiveQuestionPass(
|
|
667
667
|
conversation: string,
|
|
668
668
|
base: ExtractionResult,
|
|
669
|
-
|
|
670
|
-
assertionSource: string,
|
|
671
|
-
messageTimestamp?: Date,
|
|
672
|
-
roleAssertionSources?: ExtractionGroundingRoleSources,
|
|
669
|
+
ctx: ExtractionGroundingContext,
|
|
673
670
|
signal?: AbortSignal,
|
|
674
671
|
): Promise<ExtractionResult> {
|
|
675
672
|
if (!resolvePipelineProcessingCapabilities(this.config).proactiveExtraction) return base;
|
|
@@ -684,16 +681,11 @@ export class ExtractionEngine {
|
|
|
684
681
|
base,
|
|
685
682
|
proactive,
|
|
686
683
|
maxAdditional,
|
|
684
|
+
ctx.sourceConnector,
|
|
687
685
|
signal,
|
|
688
686
|
);
|
|
689
|
-
const sanitizedAdditions = this.sanitizeExtractionResult(proactiveAdditions, messageTimestamp);
|
|
690
|
-
const groundedAdditions = this.
|
|
691
|
-
sanitizedAdditions,
|
|
692
|
-
groundingSource,
|
|
693
|
-
assertionSource,
|
|
694
|
-
roleAssertionSources,
|
|
695
|
-
messageTimestamp,
|
|
696
|
-
);
|
|
687
|
+
const sanitizedAdditions = this.sanitizeExtractionResult(proactiveAdditions, ctx.messageTimestamp);
|
|
688
|
+
const groundedAdditions = applyGroundingWithConnector(this.config, sanitizedAdditions, ctx);
|
|
697
689
|
if (!this.hasExtractionOutputs(groundedAdditions)) return base;
|
|
698
690
|
return this.mergeProactiveExtractionPass(base, groundedAdditions, maxAdditional);
|
|
699
691
|
} catch (err) {
|
|
@@ -841,6 +833,7 @@ export class ExtractionEngine {
|
|
|
841
833
|
base: ExtractionResult,
|
|
842
834
|
proactiveQuestions: ExtractionQuestion[],
|
|
843
835
|
maxAdditional: number,
|
|
836
|
+
sourceConnector: string | undefined,
|
|
844
837
|
signal?: AbortSignal,
|
|
845
838
|
): Promise<ExtractionResult> {
|
|
846
839
|
const factsPreview = base.facts
|
|
@@ -870,6 +863,9 @@ export class ExtractionEngine {
|
|
|
870
863
|
// (chatgpt-codex thread on extraction.ts:1607). Returns "" when the
|
|
871
864
|
// bi-temporal gate is off, keeping the prompt unchanged by default.
|
|
872
865
|
this.eventTimePromptInstruction(),
|
|
866
|
+
headerConnector(sourceConnector) !== undefined && resolveMemoryLifecycleCapabilities(this.config).extractionScopeClassification
|
|
867
|
+
? `Tool, command, or CLI-flag instructions tied to the ${sourceConnector} agent are "project" scope; when you recover one, begin the fact with a leading "In ${sourceConnector}, " clause naming that agent (e.g. "In ${sourceConnector}, use the search tool with a repository path.").`
|
|
868
|
+
: "",
|
|
873
869
|
"",
|
|
874
870
|
"Base extracted facts (do not repeat):",
|
|
875
871
|
factsPreview || "(none)",
|
|
@@ -1097,27 +1093,6 @@ export class ExtractionEngine {
|
|
|
1097
1093
|
return null;
|
|
1098
1094
|
}
|
|
1099
1095
|
|
|
1100
|
-
private applySourceGrounding(
|
|
1101
|
-
result: ExtractionResult,
|
|
1102
|
-
sourceText: string,
|
|
1103
|
-
assertionSourceText: string = sourceText,
|
|
1104
|
-
roleAssertionSources?: ExtractionGroundingRoleSources,
|
|
1105
|
-
messageTimestamp?: Date,
|
|
1106
|
-
): ExtractionResult {
|
|
1107
|
-
const capabilities = resolvePipelineProcessingCapabilities(this.config);
|
|
1108
|
-
return applyExtractionSourceGrounding(
|
|
1109
|
-
result,
|
|
1110
|
-
sourceText,
|
|
1111
|
-
assertionSourceText,
|
|
1112
|
-
roleAssertionSources,
|
|
1113
|
-
messageTimestamp,
|
|
1114
|
-
{
|
|
1115
|
-
sourceGrounding: capabilities.sourceGrounding,
|
|
1116
|
-
anchorTemporalExpressions: capabilities.delinearize,
|
|
1117
|
-
},
|
|
1118
|
-
);
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
1096
|
private finalizeExtractionResult(
|
|
1122
1097
|
result: ExtractionResult,
|
|
1123
1098
|
turns: ReadonlyArray<{
|
|
@@ -1127,8 +1102,10 @@ export class ExtractionEngine {
|
|
|
1127
1102
|
timestamp: string;
|
|
1128
1103
|
turnFingerprint?: string;
|
|
1129
1104
|
}>,
|
|
1105
|
+
sourceConnector?: string,
|
|
1130
1106
|
): ExtractionResult {
|
|
1131
|
-
|
|
1107
|
+
const provenanced = attachExtractionProvenance(result, turns, this.config.provenance);
|
|
1108
|
+
return sourceConnector === undefined ? provenanced : { ...provenanced, sourceConnector };
|
|
1132
1109
|
}
|
|
1133
1110
|
|
|
1134
1111
|
async extract(
|
|
@@ -1153,13 +1130,17 @@ export class ExtractionEngine {
|
|
|
1153
1130
|
: turn.content,
|
|
1154
1131
|
}))
|
|
1155
1132
|
.filter((turn) => turn.content.trim().length > 0);
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1133
|
+
// One derivation, over the turns the model actually sees (boundedTurns) —
|
|
1134
|
+
// the same set the qualifier, grounding source, and telemetry filter
|
|
1135
|
+
// operate on. result.sourceConnector carries it to persistence so the
|
|
1136
|
+
// orchestrator does not recompute over a different turn set (#2183).
|
|
1137
|
+
const resolvedConnector = resolveSourceConnector(boundedTurns);
|
|
1138
|
+
// The header and qualifier strip/restore are gated on the scope-classification
|
|
1139
|
+
// capability; persistence records resolvedConnector regardless (trusted metadata).
|
|
1140
|
+
const sourceConnector = lifecycleCaps.extractionScopeClassification
|
|
1141
|
+
? resolvedConnector
|
|
1142
|
+
: undefined;
|
|
1143
|
+
const { conversation, renderedConversation } = renderExtractionConversation(boundedTurns, headerConnector(sourceConnector));
|
|
1163
1144
|
|
|
1164
1145
|
const groundingSource = boundedTurns
|
|
1165
1146
|
.map((turn) => turn.content)
|
|
@@ -1178,13 +1159,13 @@ export class ExtractionEngine {
|
|
|
1178
1159
|
.map((turn) => turn.content)
|
|
1179
1160
|
.join("\n\n"),
|
|
1180
1161
|
};
|
|
1181
|
-
if (
|
|
1162
|
+
if (renderedConversation.trim().length === 0) {
|
|
1182
1163
|
log.debug("extraction skipped — conversation only contained non-memory work-layer context");
|
|
1183
1164
|
return { facts: [], profileUpdates: [], entities: [], questions: [] };
|
|
1184
1165
|
}
|
|
1185
1166
|
if (
|
|
1186
1167
|
lifecycleCaps.extractionTelemetryPrefilter &&
|
|
1187
|
-
looksLikeMechanicalTelemetryTranscript(
|
|
1168
|
+
looksLikeMechanicalTelemetryTranscript(renderedConversation)
|
|
1188
1169
|
) {
|
|
1189
1170
|
log.debug("extraction skipped — mechanical action/state telemetry without durable-memory cues");
|
|
1190
1171
|
return {
|
|
@@ -1198,6 +1179,14 @@ export class ExtractionEngine {
|
|
|
1198
1179
|
// Use the last turn's timestamp for temporal anchoring (more accurate than wall-clock)
|
|
1199
1180
|
const lastTurnTs = boundedTurns.length > 0 ? new Date(boundedTurns[boundedTurns.length - 1].timestamp) : undefined;
|
|
1200
1181
|
const messageTimestamp = lastTurnTs && !isNaN(lastTurnTs.getTime()) ? lastTurnTs : undefined;
|
|
1182
|
+
const groundingContext: ExtractionGroundingContext = {
|
|
1183
|
+
groundingSource,
|
|
1184
|
+
assertionSource,
|
|
1185
|
+
roleAssertionSources,
|
|
1186
|
+
messageTimestamp,
|
|
1187
|
+
sourceConnector,
|
|
1188
|
+
scopeClassificationEnabled: lifecycleCaps.extractionScopeClassification,
|
|
1189
|
+
};
|
|
1201
1190
|
|
|
1202
1191
|
const traceId = crypto.randomUUID();
|
|
1203
1192
|
// Only emit llm_start for the direct path when a client or local LLM is configured.
|
|
@@ -1234,23 +1223,9 @@ export class ExtractionEngine {
|
|
|
1234
1223
|
this.emit({ kind: "llm_end", traceId, model: this.config.localLlmModel, operation: "extraction", durationMs });
|
|
1235
1224
|
log.debug(`extraction: used local LLM — ${localResult.facts.length} facts, ${localResult.entities.length} entities`);
|
|
1236
1225
|
const sanitized = this.sanitizeExtractionResult(localResult, messageTimestamp);
|
|
1237
|
-
const grounded = this.
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
assertionSource,
|
|
1241
|
-
roleAssertionSources,
|
|
1242
|
-
messageTimestamp,
|
|
1243
|
-
);
|
|
1244
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
1245
|
-
conversation,
|
|
1246
|
-
grounded,
|
|
1247
|
-
groundingSource,
|
|
1248
|
-
assertionSource,
|
|
1249
|
-
messageTimestamp,
|
|
1250
|
-
roleAssertionSources,
|
|
1251
|
-
signal,
|
|
1252
|
-
);
|
|
1253
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
1226
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
1227
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
1228
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
1254
1229
|
}
|
|
1255
1230
|
// Local failed, fall back if allowed
|
|
1256
1231
|
if (!this.config.localLlmFallback) {
|
|
@@ -1297,23 +1272,9 @@ export class ExtractionEngine {
|
|
|
1297
1272
|
this.emit({ kind: "llm_end", traceId, model: this.config.model, operation: "extraction", durationMs });
|
|
1298
1273
|
log.debug(`extraction: used direct client (${this.config.model}) — ${directResult.facts.length} facts, ${directResult.entities.length} entities`);
|
|
1299
1274
|
const sanitized = this.sanitizeExtractionResult(directResult, messageTimestamp);
|
|
1300
|
-
const grounded = this.
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
assertionSource,
|
|
1304
|
-
roleAssertionSources,
|
|
1305
|
-
messageTimestamp,
|
|
1306
|
-
);
|
|
1307
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
1308
|
-
conversation,
|
|
1309
|
-
grounded,
|
|
1310
|
-
groundingSource,
|
|
1311
|
-
assertionSource,
|
|
1312
|
-
messageTimestamp,
|
|
1313
|
-
roleAssertionSources,
|
|
1314
|
-
signal,
|
|
1315
|
-
);
|
|
1316
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
1275
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
1276
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
1277
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
1317
1278
|
}
|
|
1318
1279
|
// Emit error event so Opik sees the direct client failure before fallback.
|
|
1319
1280
|
// Wrapped in try/catch so a subscriber error doesn't break the fallback path.
|
|
@@ -1399,23 +1360,9 @@ export class ExtractionEngine {
|
|
|
1399
1360
|
);
|
|
1400
1361
|
const normalized = this.normalizeExtractionResultPayload(result);
|
|
1401
1362
|
const sanitized = this.sanitizeExtractionResult(normalized, messageTimestamp);
|
|
1402
|
-
const grounded = this.
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
assertionSource,
|
|
1406
|
-
roleAssertionSources,
|
|
1407
|
-
messageTimestamp,
|
|
1408
|
-
);
|
|
1409
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
1410
|
-
conversation,
|
|
1411
|
-
grounded,
|
|
1412
|
-
groundingSource,
|
|
1413
|
-
assertionSource,
|
|
1414
|
-
messageTimestamp,
|
|
1415
|
-
roleAssertionSources,
|
|
1416
|
-
signal,
|
|
1417
|
-
);
|
|
1418
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
1363
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
1364
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
1365
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
1419
1366
|
}
|
|
1420
1367
|
|
|
1421
1368
|
this.emit({
|
|
@@ -1519,7 +1466,7 @@ Rules:
|
|
|
1519
1466
|
- Add structuredAttributes only for concrete values.
|
|
1520
1467
|
- Include at most five durable relationships.${this.config.provenance?.enabled ? `
|
|
1521
1468
|
- Each fact must include a quote copied verbatim from one contiguous conversation span.` : ""}${lifecycleCaps.extractionScopeClassification ? `
|
|
1522
|
-
- Set each fact scope to "global" for cross-project knowledge or "project" for codebase-specific knowledge.` : ""}
|
|
1469
|
+
- Set each fact scope to "global" for cross-project knowledge or "project" for codebase-specific knowledge. Tool, command, or CLI-flag instructions tied to one agent are "project" (the same tool name can mean different things across agents); when keeping one, begin the fact with a leading "In <agent>," clause naming that agent.` : ""}
|
|
1523
1470
|
${this.eventTimePromptInstruction()}
|
|
1524
1471
|
Return only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:
|
|
1525
1472
|
${EXTRACTION_RESPONSE_SHAPE}
|
|
@@ -1748,8 +1695,8 @@ Rules:
|
|
|
1748
1695
|
|
|
1749
1696
|
Scope classification:
|
|
1750
1697
|
For each fact, set "scope" to one of:
|
|
1751
|
-
- "global" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style),
|
|
1752
|
-
- "project" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions
|
|
1698
|
+
- "global" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style), general coding patterns, infrastructure knowledge, technology facts not tied to one codebase
|
|
1699
|
+
- "project" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions. Tool, command, or CLI-flag instructions TIED TO ONE AGENT are also "project", because the same tool name means different things in different agent integrations (a "search" tool may search repository code in one agent and the web in another); when keeping such an agent-tied instruction, the fact text MUST name the originating agent as a leading "In <agent>," clause (e.g. "In Pi, use the search tool with a repository path."). A tool/command fact that holds in every agent and every repo is NOT agent-tied — leave it "global" and do not add a qualifier (e.g. "\`git status --short\` emits compact output"). Examples: "In Pi, the search tool takes a repository path" -> "project"; "\`git status --short\` emits compact output" -> "global".
|
|
1753
1700
|
When in doubt, prefer "project" — it is safer to keep knowledge scoped narrowly.` : ""}
|
|
1754
1701
|
Entity creation rules (STRICT):
|
|
1755
1702
|
- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects
|
|
@@ -1067,7 +1067,7 @@ export class ExtractionRunCoordinator {
|
|
|
1067
1067
|
result,
|
|
1068
1068
|
storage,
|
|
1069
1069
|
threadIdForExtraction,
|
|
1070
|
-
{ sessionKey, principal, validAt: sourceValidAt, sourceConnector:
|
|
1070
|
+
{ sessionKey, principal, validAt: sourceValidAt, sourceConnector: result.sourceConnector },
|
|
1071
1071
|
// Pass the KNOWN base namespace (NHIdx) so the catalog write touch records the
|
|
1072
1072
|
// real namespace rather than a guess decoded from the storage dir.
|
|
1073
1073
|
selfNamespace,
|
|
@@ -30,6 +30,8 @@ import type { VerifiedEpisodeResult } from "../verified-recall.js";
|
|
|
30
30
|
import type { VerifiedSemanticRuleResult } from "../semantic-rule-verifier.js";
|
|
31
31
|
import type { WorkProductLedgerSearchResult } from "../work-product-ledger.js";
|
|
32
32
|
import { trustResultFor, type TrustStageResultItem } from "../trust-score-stage.js";
|
|
33
|
+
import { CONNECTOR_ID_PATTERN, CONNECTOR_LABEL_MAX_LENGTH } from "../connectors/label.js";
|
|
34
|
+
import { isValidConnectorId } from "../connectors/index.js";
|
|
33
35
|
import type {
|
|
34
36
|
ContinuityIncidentRecord,
|
|
35
37
|
IdentityInjectionMode,
|
|
@@ -38,6 +40,22 @@ import type {
|
|
|
38
40
|
RecallPlanMode,
|
|
39
41
|
} from "../types.js";
|
|
40
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Issue #2183 — render the persisted `sourceConnector` carried on the result
|
|
45
|
+
* (hydrated where the memory is loaded) as `[agent: <connector>]`. The value
|
|
46
|
+
* reaches model-visible recall context, so it is validated against the canonical
|
|
47
|
+
* persisted-ID charset (CONNECTOR_ID_PATTERN — IDs the system accepts,
|
|
48
|
+
* including '.'/'_', keep their label) and TRUNCATED past CONNECTOR_LABEL_MAX
|
|
49
|
+
* with an explicit marker (attribution survives; suppression would lose the
|
|
50
|
+
* exact signal this PR adds). One resolver at the single render site.
|
|
51
|
+
*/
|
|
52
|
+
function renderConnectorLabel(connector: string | undefined): string | null {
|
|
53
|
+
if (!isValidConnectorId(connector)) return null;
|
|
54
|
+
return connector.length <= CONNECTOR_LABEL_MAX_LENGTH
|
|
55
|
+
? connector
|
|
56
|
+
: `${connector.slice(0, CONNECTOR_LABEL_MAX_LENGTH - 1)}…`;
|
|
57
|
+
}
|
|
58
|
+
|
|
41
59
|
// ---------------------------------------------------------------------------
|
|
42
60
|
// Identity injection mode helpers (moved verbatim from orchestrator.ts)
|
|
43
61
|
// ---------------------------------------------------------------------------
|
|
@@ -211,14 +229,16 @@ export class RecallResultFormatter {
|
|
|
211
229
|
const head = `[${i + 1}] ${source} (score: ${r.score.toFixed(3)})\n${snippet}`;
|
|
212
230
|
const handle = handleByIndex.get(i);
|
|
213
231
|
const withHandle = handle ? `${head.trimEnd()} ${handle}` : head.trimEnd();
|
|
232
|
+
const connectorLabel = renderConnectorLabel(r.sourceConnector);
|
|
233
|
+
const withConnector = connectorLabel ? `${withHandle} [agent: ${connectorLabel}]` : withHandle;
|
|
214
234
|
if (hedgeMap) {
|
|
215
235
|
const item = trustResultFor(hedgeMap, r);
|
|
216
236
|
if (item) {
|
|
217
237
|
const hedge = renderEpistemicHedge(item.trust);
|
|
218
|
-
if (hedge.length > 0) return `${
|
|
238
|
+
if (hedge.length > 0) return `${withConnector} ${hedge}`;
|
|
219
239
|
}
|
|
220
240
|
}
|
|
221
|
-
return
|
|
241
|
+
return withConnector;
|
|
222
242
|
});
|
|
223
243
|
return { heading: `## ${title}`, entries };
|
|
224
244
|
}
|
|
@@ -70,6 +70,40 @@ test("recall safety keeps same relative path distinct across namespaces", async
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
+
test("recall safety derives sourceConnector exclusively from the hydrated memory (#2183)", async () => {
|
|
74
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-conn-prov-"));
|
|
75
|
+
try {
|
|
76
|
+
const coordinator = await makeCoordinator(memoryDir);
|
|
77
|
+
// Both results arrive carrying an UNTRUSTED sourceConnector (e.g. a remote
|
|
78
|
+
// search backend casting arbitrary response objects). One's memory carries
|
|
79
|
+
// a real connector; the other's memory is connectorless.
|
|
80
|
+
const has = { ...result("default", "facts/has.md"), sourceConnector: "untrusted" };
|
|
81
|
+
const none = { ...result("default", "facts/none.md"), sourceConnector: "untrusted" };
|
|
82
|
+
const memHas = {
|
|
83
|
+
path: "facts/has.md",
|
|
84
|
+
content: "facts/has.md",
|
|
85
|
+
frontmatter: { status: "active", memoryKind: "fact", created: "2026-07-19T00:00:00.000Z", updated: "2026-07-19T00:00:00.000Z", sourceConnector: "trusted-pi" } as unknown as MemoryFile["frontmatter"],
|
|
86
|
+
};
|
|
87
|
+
const memNone = {
|
|
88
|
+
path: "facts/none.md",
|
|
89
|
+
content: "facts/none.md",
|
|
90
|
+
frontmatter: { status: "active", memoryKind: "fact", created: "2026-07-19T00:00:00.000Z", updated: "2026-07-19T00:00:00.000Z" } as unknown as MemoryFile["frontmatter"],
|
|
91
|
+
};
|
|
92
|
+
const memoryByPath = new Map<string, MemoryFile>([
|
|
93
|
+
["default\0facts/has.md", memHas],
|
|
94
|
+
["default\0facts/none.md", memNone],
|
|
95
|
+
]);
|
|
96
|
+
const safe = coordinator.filterSearchResultsByRecallSafety([has, none], memoryByPath);
|
|
97
|
+
const byPath = new Map(safe.map((r) => [r.path, r.sourceConnector]));
|
|
98
|
+
assert.equal(byPath.get("facts/has.md"), "trusted-pi", "an untrusted result-supplied value is overwritten by the memory's connector");
|
|
99
|
+
assert.equal(byPath.get("facts/none.md"), undefined, "an untrusted value is cleared when the memory is connectorless");
|
|
100
|
+
// The shared/cached input objects are never mutated.
|
|
101
|
+
assert.equal(has.sourceConnector, "untrusted", "the input result object is not mutated (copy semantics, no cross-recall leak)");
|
|
102
|
+
} finally {
|
|
103
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
73
107
|
function scopedCandidatesStub(
|
|
74
108
|
seed: QmdSearchResult[],
|
|
75
109
|
): RecallSearchPipelineDeps["searchScopedMemoryCandidates"] {
|
|
@@ -1339,7 +1339,15 @@ export class RecallSearchPipelineCoordinator {
|
|
|
1339
1339
|
continue;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
|
|
1342
|
+
// Issue #2183 — derive sourceConnector EXCLUSIVELY from the hydrated
|
|
1343
|
+
// memory, on a copy so a shared/cached result object (global QMD cache)
|
|
1344
|
+
// is never mutated across recalls and a result-supplied value (e.g.
|
|
1345
|
+
// RemoteSearchBackend casting arbitrary responses) cannot pose as trusted
|
|
1346
|
+
// provenance. Connectorless memory (or no memory) → cleared (undefined).
|
|
1347
|
+
filtered.push({
|
|
1348
|
+
...r,
|
|
1349
|
+
sourceConnector: memory ? memory.frontmatter.sourceConnector : undefined,
|
|
1350
|
+
});
|
|
1343
1351
|
}
|
|
1344
1352
|
if (lifecycleFilteredCount > 0) {
|
|
1345
1353
|
log.debug(
|