@remnic/core 9.69.49 → 9.69.50
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 +15 -14
- package/dist/access-admin-ops-surface.js +23 -23
- package/dist/access-authorization-probe.d.ts +15 -14
- package/dist/access-authorization-probe.js +24 -24
- package/dist/access-boundary.d.ts +15 -14
- package/dist/access-boundary.js +23 -23
- package/dist/access-cli.js +74 -73
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -1
- package/dist/access-extraction-force-flush.d.ts +15 -14
- package/dist/access-extraction-force-flush.js +23 -23
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-briefing.d.ts +15 -14
- package/dist/access-http-briefing.js +24 -24
- package/dist/access-http-lcm-compaction.d.ts +15 -14
- package/dist/access-http-lifecycle-flush.d.ts +15 -14
- package/dist/access-http-offline-stream.d.ts +15 -14
- package/dist/access-http-query.d.ts +3 -2
- package/dist/access-http-query.js +25 -25
- package/dist/access-http.d.ts +16 -15
- package/dist/access-http.js +40 -40
- package/dist/access-identity-continuity-surface.d.ts +12 -11
- package/dist/access-identity-continuity-surface.js +23 -23
- package/dist/access-lcm-surface.d.ts +15 -14
- package/dist/access-lcm-surface.js +23 -23
- package/dist/access-mcp-shared-context-tools.d.ts +15 -14
- package/dist/access-mcp.d.ts +15 -14
- package/dist/access-mcp.js +32 -32
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-DqRw_g-8.d.ts → access-namespace-preflight-C1q3XuAc.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +23 -23
- package/dist/access-observe-transcript.d.ts +12 -11
- package/dist/access-observe-write-category.d.ts +4 -3
- package/dist/access-observe-write-category.js +4 -4
- package/dist/access-observe-write-surface.d.ts +15 -14
- package/dist/access-observe-write-surface.js +23 -23
- package/dist/access-offline-manifest.d.ts +12 -11
- package/dist/access-operations-batch.js +24 -24
- package/dist/access-operations.d.ts +15 -14
- package/dist/access-operations.js +31 -31
- package/dist/access-recall-concurrency.d.ts +15 -14
- package/dist/access-recall-concurrency.js +23 -23
- package/dist/access-recall-response.d.ts +15 -14
- package/dist/access-recall-response.js +23 -23
- package/dist/access-recall-surface.d.ts +15 -14
- package/dist/access-recall-surface.js +23 -23
- package/dist/access-schema.d.ts +2 -1
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-70VHaltr.d.ts → access-service-BZaC-RZw.d.ts} +9 -9
- package/dist/access-service-helpers.d.ts +15 -14
- package/dist/access-service.d.ts +15 -14
- package/dist/access-service.js +23 -23
- package/dist/access-surface-catalog.d.ts +15 -14
- package/dist/access-surface-catalog.js +25 -25
- package/dist/access-wearables-meetings-surface.d.ts +5 -4
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +2 -1
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +2 -1
- package/dist/ambient-provenance.d.ts +2 -1
- package/dist/artifact-search.d.ts +2 -1
- package/dist/background-generation.d.ts +2 -1
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +12 -11
- package/dist/briefing-window.d.ts +3 -2
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +7 -7
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{catalog-Byi9prz9.d.ts → catalog-DK2eHhax.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +8 -8
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/{chunk-QQA6VTOY.js → chunk-3MIZ2EKQ.js} +2 -2
- package/dist/{chunk-PAQ7YGJY.js → chunk-3RZB7TYL.js} +2 -2
- package/dist/{chunk-FVRZDZ7J.js → chunk-3SI3FFTW.js} +2 -2
- package/dist/{chunk-WNMVUWI7.js → chunk-3UQIS2GC.js} +2 -2
- package/dist/{chunk-FLZJMXFV.js → chunk-42BV46XS.js} +2 -2
- package/dist/{chunk-ZYZW46HZ.js → chunk-4FWNMN5R.js} +4 -4
- package/dist/chunk-4KQIWY4A.js +197 -0
- package/dist/chunk-4KQIWY4A.js.map +1 -0
- package/dist/{chunk-EBLKS57G.js → chunk-4PXFLDMJ.js} +2 -2
- package/dist/{chunk-XQFHKPNB.js → chunk-4SDO74N2.js} +2 -2
- package/dist/{chunk-YOC3EEZH.js → chunk-56C7OO3N.js} +13 -13
- package/dist/{chunk-76RTJ533.js → chunk-6525YIYL.js} +3 -3
- package/dist/{chunk-PSQRBCGR.js → chunk-AL7OLBL7.js} +2 -2
- package/dist/{chunk-WGCASEEQ.js → chunk-AYGWJ2UK.js} +2 -2
- package/dist/{chunk-JUOJGZPV.js → chunk-AYP2FZFA.js} +2 -2
- package/dist/{chunk-6DYCSSHN.js → chunk-BHI5ILU5.js} +2 -2
- package/dist/{chunk-LE2UESGS.js → chunk-BOTSR5S3.js} +2 -2
- package/dist/{chunk-5WIGM42T.js → chunk-C3PKRFZ4.js} +2 -2
- package/dist/{chunk-AJLQH4RO.js → chunk-D2XUSZ24.js} +9 -9
- package/dist/{chunk-P36WML7L.js → chunk-D6WX5FEF.js} +2 -2
- package/dist/{chunk-LLFMZYFS.js → chunk-D7QX26FF.js} +2 -2
- package/dist/{chunk-6VLOKESS.js → chunk-DH536WT2.js} +2 -2
- package/dist/{chunk-KHLNIDWB.js → chunk-DNO6QWCB.js} +2 -2
- package/dist/{chunk-UB4UVALS.js → chunk-E73SVGJA.js} +2 -2
- package/dist/{chunk-BHXY5FXL.js → chunk-ECLY4NZA.js} +2 -2
- package/dist/{chunk-OTGIAJQ2.js → chunk-EZV43XBD.js} +2 -2
- package/dist/{chunk-2WMXZYMS.js → chunk-F5V7KRQS.js} +2 -2
- package/dist/{chunk-SKYYPVBW.js → chunk-FO6IK4IF.js} +8 -8
- package/dist/{chunk-Z2OKRO3E.js → chunk-HRCWDO6S.js} +2 -2
- package/dist/{chunk-PZHN7R35.js → chunk-IC3PM3YO.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-RBHQA2UU.js → chunk-IST6MBYC.js} +36 -36
- package/dist/{chunk-N57PUWUE.js → chunk-IYHHCSF6.js} +30 -30
- package/dist/{chunk-U3ZRHNNG.js → chunk-JHUODJRW.js} +2 -2
- package/dist/{chunk-C3YEB7CR.js → chunk-JOP7W24J.js} +4 -4
- package/dist/{chunk-DHTOYRDE.js → chunk-JTPAXDSX.js} +2 -2
- package/dist/{chunk-LX32KV2C.js → chunk-KOEDSRF5.js} +2 -2
- package/dist/{chunk-JI5Q6EOY.js → chunk-LR7KUQ2W.js} +5 -5
- package/dist/{chunk-YKWWG3CM.js → chunk-MECKA6G2.js} +2 -2
- package/dist/{chunk-YA5M7OC4.js → chunk-ML5FW2RO.js} +2 -2
- package/dist/{chunk-T3OLYUU6.js → chunk-MQMZO23A.js} +2 -2
- package/dist/{chunk-RS53SDCA.js → chunk-MVMNEU65.js} +2 -2
- package/dist/{chunk-SNOAFXKX.js → chunk-OLJYDGGP.js} +9 -1
- package/dist/chunk-OLJYDGGP.js.map +1 -0
- package/dist/{chunk-7VTQETLT.js → chunk-OP5IBPHP.js} +2 -2
- package/dist/{chunk-TUSY4KRE.js → chunk-OQZYHCWM.js} +16 -16
- package/dist/{chunk-JVM3CEGL.js → chunk-PA5EOTRR.js} +3 -3
- package/dist/{chunk-K26LFJE4.js → chunk-PMLFPVYJ.js} +2 -2
- package/dist/{chunk-EST3J4LX.js → chunk-PPNFKQ6D.js} +2 -2
- package/dist/{chunk-DNAD57VY.js → chunk-PQWICTRO.js} +1 -1
- package/dist/chunk-PQWICTRO.js.map +1 -0
- package/dist/{chunk-EHUUXLLA.js → chunk-QSP4Y73Q.js} +2 -2
- package/dist/{chunk-AIKUSXIS.js → chunk-QXQCPNKA.js} +4 -4
- package/dist/{chunk-HIBNECBQ.js → chunk-QZDUNK6V.js} +6 -6
- package/dist/{chunk-UE7L4EDU.js → chunk-SRMBMMTK.js} +3 -3
- package/dist/{chunk-T3F2HWIG.js → chunk-TZ44E732.js} +2 -2
- package/dist/{chunk-ZDGSHXJU.js → chunk-UI6R2YUB.js} +1 -1
- package/dist/{chunk-NDWBT2VV.js → chunk-UVEBBXB5.js} +2 -2
- package/dist/{chunk-AOMVOC2E.js → chunk-W6V7JN2E.js} +3 -3
- package/dist/{chunk-4WSR7MYV.js → chunk-X6B2QWXW.js} +2 -2
- package/dist/{chunk-WHSNLCRO.js → chunk-XTMABIFW.js} +2 -2
- package/dist/{chunk-IIDXU2CY.js → chunk-XUKUMBP3.js} +2 -2
- package/dist/{chunk-SYJZUVTN.js → chunk-ZBAQMSEY.js} +3 -3
- package/dist/{chunk-3MX4GWJO.js → chunk-ZUNYFDI4.js} +2 -2
- package/dist/{cli-CdJiBilM.d.ts → cli-BHDMJqJS.d.ts} +5 -5
- package/dist/cli.d.ts +17 -16
- package/dist/cli.js +59 -58
- package/dist/coding/export-okf-codegraph.d.ts +2 -1
- package/dist/coding/export-okf-codegraph.js +6 -6
- package/dist/coding/pre-action-gate.d.ts +2 -1
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +7 -7
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +2 -1
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +7 -7
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +7 -7
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +5 -4
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +3 -2
- package/dist/convergence-refresh.js +9 -9
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +9 -9
- package/dist/cross-lingual-recall.d.ts +2 -1
- package/dist/day-summary.d.ts +2 -1
- package/dist/deep-recall-http-glue.d.ts +15 -14
- package/dist/deep-recall-http-glue.js +4 -4
- package/dist/deep-recall-mcp-tools.d.ts +15 -14
- package/dist/deep-recall-policy-llm.d.ts +3 -2
- package/dist/deep-recall-seeds.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/dependency-propagation-config.d.ts +2 -1
- package/dist/{dependency-propagation-delivery-BgHy44WX.d.ts → dependency-propagation-delivery-BMkR4gmY.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-origin-fields.d.ts +2 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +7 -7
- package/dist/entity-schema.d.ts +2 -1
- package/dist/episodic-context.d.ts +2 -1
- package/dist/eval-trajectory-contracts.d.ts +2 -1
- package/dist/eval-trajectory-store.d.ts +2 -1
- package/dist/eval-trajectory.d.ts +2 -1
- package/dist/explicit-capture.d.ts +12 -11
- package/dist/external-wiki-access.d.ts +15 -14
- package/dist/external-wiki-access.js +24 -24
- package/dist/external-wiki-collection-registration.d.ts +2 -1
- package/dist/external-wiki-collection.d.ts +2 -1
- package/dist/external-wiki-mcp-tools.d.ts +15 -14
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-evidence-class.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +3 -2
- package/dist/extraction-judge-telemetry.d.ts +3 -2
- package/dist/extraction-judge-training.d.ts +3 -2
- package/dist/extraction-judge.d.ts +3 -2
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-normalization.d.ts +2 -1
- package/dist/extraction-prompt.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction-span-config.d.ts +2 -1
- package/dist/extraction-span-materialize.d.ts +2 -1
- package/dist/extraction-span-wire.d.ts +2 -1
- package/dist/extraction.d.ts +3 -2
- package/dist/extraction.js +7 -7
- package/dist/fallback-llm-codex-subscription.d.ts +2 -1
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/{generic-recall-paths-BoueWXYr.d.ts → generic-recall-paths-BCRtXU32.d.ts} +1 -1
- package/dist/graph-append-error.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-jsonl.d.ts +2 -1
- package/dist/graph-path-reconstruction.d.ts +2 -1
- package/dist/graph-path-scoring.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph.d.ts +2 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/importers/test-utils.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/{index-cwbrXoxe.d.ts → index-DMNTW4W6.d.ts} +3 -3
- package/dist/index.d.ts +27 -26
- package/dist/index.js +112 -76
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +3 -3
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/{local-llm-B0vd_rp9.d.ts → local-llm-BXYC-mbU.d.ts} +1 -1
- package/dist/local-llm-helpers.d.ts +3 -2
- package/dist/local-llm.d.ts +3 -2
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/location/index.d.ts +6 -5
- package/dist/location/index.js +9 -9
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +7 -7
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -7
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +8 -8
- package/dist/{maintenance-DJgQkoLh.d.ts → maintenance-zJiLsKBY.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +15 -14
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-browse-http-glue.d.ts +15 -14
- package/dist/memory-browse-mcp-tools.d.ts +15 -14
- package/dist/memory-browse-operations.js +24 -24
- package/dist/memory-browse.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-controller.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-snapshot.d.ts +2 -1
- package/dist/memory-subject-cli.d.ts +15 -14
- package/dist/memory-subject.d.ts +15 -14
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +8 -8
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +7 -7
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +10 -10
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +17 -16
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +15 -15
- package/dist/{orchestrator-Kx5zwNUm.d.ts → orchestrator-BTqT3F6X.d.ts} +10 -10
- package/dist/orchestrator.d.ts +12 -11
- package/dist/orchestrator.js +74 -73
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-9SYxxign.d.ts → pipeline-CgO2Sd4O.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/proactive-contention.d.ts +3 -2
- package/dist/provenance.d.ts +2 -1
- package/dist/{public-http-Bvol6Jr4.d.ts → public-http-Dk1EA9ix.d.ts} +1 -1
- package/dist/{qmd-DjwuG9Xa.d.ts → qmd-CwxtVz64.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +3 -2
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-navigate-access.d.ts +2 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +2 -1
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate.d.ts +2 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-http-glue.d.ts +15 -14
- package/dist/recall-navigation-mcp-tools.d.ts +15 -14
- package/dist/recall-navigation-operations.js +24 -24
- package/dist/recall-navigation-renderer.d.ts +2 -1
- package/dist/recall-navigation.d.ts +2 -1
- package/dist/recall-navigation.js +23 -23
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-recognition-tier.d.ts +121 -0
- package/dist/recall-recognition-tier.js +42 -0
- package/dist/recall-recognition-tier.js.map +1 -0
- package/dist/recall-state-view-admission.d.ts +3 -2
- package/dist/recall-state-view-anchors.d.ts +2 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +2 -1
- package/dist/reconcile/manifest.d.ts +2 -1
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +3 -2
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/{scope-profiles-DPegZtRf.d.ts → scope-profiles-Bg1rB-Dp.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/factory.d.ts +2 -1
- package/dist/search/factory.js +2 -2
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +4 -4
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/port.d.ts +2 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/{semantic-consolidation-DMzhKRYl.d.ts → semantic-consolidation-DEzRyeyn.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +8 -8
- package/dist/semantic-rule-promotion.js +7 -7
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +7 -7
- package/dist/{service-E99KuPvi.d.ts → service-DGEIDOeD.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +2 -1
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +7 -7
- package/dist/standup/build.js +7 -7
- package/dist/{storage-BS7ux8F7.d.ts → storage-DNQWtOSM.d.ts} +1 -1
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +6 -6
- package/dist/subject-config.d.ts +2 -1
- package/dist/summarizer.d.ts +2 -1
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/support-passport/index.d.ts +18 -17
- package/dist/support-passport/index.js +26 -26
- package/dist/{tagging-BhOEcSXP.d.ts → tagging-CPVwgadt.d.ts} +2 -2
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/export-okf.d.ts +2 -1
- package/dist/transfer/export-okf.js +7 -7
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-DQ2H8gAC.d.ts → types-DCB90q3g.d.ts} +2 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +7 -7
- package/dist/who-knows-cli.d.ts +15 -14
- package/dist/who-knows-cli.js +8 -8
- package/dist/who-knows.d.ts +15 -14
- package/dist/who-knows.js +7 -7
- package/dist/write-envelope.d.ts +2 -1
- package/package.json +2 -2
- package/src/config.ts +5 -0
- package/src/index.ts +1 -0
- package/src/lifecycle/seed-graduation.test.ts +424 -0
- package/src/lifecycle/seed-graduation.ts +376 -0
- package/src/recall-recognition-tier.test.ts +306 -0
- package/src/recall-recognition-tier.ts +375 -0
- package/src/testing/subjects/seed-graduation.test.ts +128 -0
- package/src/types.ts +2 -0
- package/dist/chunk-DNAD57VY.js.map +0 -1
- package/dist/chunk-SNOAFXKX.js.map +0 -1
- /package/dist/{chunk-QQA6VTOY.js.map → chunk-3MIZ2EKQ.js.map} +0 -0
- /package/dist/{chunk-PAQ7YGJY.js.map → chunk-3RZB7TYL.js.map} +0 -0
- /package/dist/{chunk-FVRZDZ7J.js.map → chunk-3SI3FFTW.js.map} +0 -0
- /package/dist/{chunk-WNMVUWI7.js.map → chunk-3UQIS2GC.js.map} +0 -0
- /package/dist/{chunk-FLZJMXFV.js.map → chunk-42BV46XS.js.map} +0 -0
- /package/dist/{chunk-ZYZW46HZ.js.map → chunk-4FWNMN5R.js.map} +0 -0
- /package/dist/{chunk-EBLKS57G.js.map → chunk-4PXFLDMJ.js.map} +0 -0
- /package/dist/{chunk-XQFHKPNB.js.map → chunk-4SDO74N2.js.map} +0 -0
- /package/dist/{chunk-YOC3EEZH.js.map → chunk-56C7OO3N.js.map} +0 -0
- /package/dist/{chunk-76RTJ533.js.map → chunk-6525YIYL.js.map} +0 -0
- /package/dist/{chunk-PSQRBCGR.js.map → chunk-AL7OLBL7.js.map} +0 -0
- /package/dist/{chunk-WGCASEEQ.js.map → chunk-AYGWJ2UK.js.map} +0 -0
- /package/dist/{chunk-JUOJGZPV.js.map → chunk-AYP2FZFA.js.map} +0 -0
- /package/dist/{chunk-6DYCSSHN.js.map → chunk-BHI5ILU5.js.map} +0 -0
- /package/dist/{chunk-LE2UESGS.js.map → chunk-BOTSR5S3.js.map} +0 -0
- /package/dist/{chunk-5WIGM42T.js.map → chunk-C3PKRFZ4.js.map} +0 -0
- /package/dist/{chunk-AJLQH4RO.js.map → chunk-D2XUSZ24.js.map} +0 -0
- /package/dist/{chunk-P36WML7L.js.map → chunk-D6WX5FEF.js.map} +0 -0
- /package/dist/{chunk-LLFMZYFS.js.map → chunk-D7QX26FF.js.map} +0 -0
- /package/dist/{chunk-6VLOKESS.js.map → chunk-DH536WT2.js.map} +0 -0
- /package/dist/{chunk-KHLNIDWB.js.map → chunk-DNO6QWCB.js.map} +0 -0
- /package/dist/{chunk-UB4UVALS.js.map → chunk-E73SVGJA.js.map} +0 -0
- /package/dist/{chunk-BHXY5FXL.js.map → chunk-ECLY4NZA.js.map} +0 -0
- /package/dist/{chunk-OTGIAJQ2.js.map → chunk-EZV43XBD.js.map} +0 -0
- /package/dist/{chunk-2WMXZYMS.js.map → chunk-F5V7KRQS.js.map} +0 -0
- /package/dist/{chunk-SKYYPVBW.js.map → chunk-FO6IK4IF.js.map} +0 -0
- /package/dist/{chunk-Z2OKRO3E.js.map → chunk-HRCWDO6S.js.map} +0 -0
- /package/dist/{chunk-PZHN7R35.js.map → chunk-IC3PM3YO.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-RBHQA2UU.js.map → chunk-IST6MBYC.js.map} +0 -0
- /package/dist/{chunk-N57PUWUE.js.map → chunk-IYHHCSF6.js.map} +0 -0
- /package/dist/{chunk-U3ZRHNNG.js.map → chunk-JHUODJRW.js.map} +0 -0
- /package/dist/{chunk-C3YEB7CR.js.map → chunk-JOP7W24J.js.map} +0 -0
- /package/dist/{chunk-DHTOYRDE.js.map → chunk-JTPAXDSX.js.map} +0 -0
- /package/dist/{chunk-LX32KV2C.js.map → chunk-KOEDSRF5.js.map} +0 -0
- /package/dist/{chunk-JI5Q6EOY.js.map → chunk-LR7KUQ2W.js.map} +0 -0
- /package/dist/{chunk-YKWWG3CM.js.map → chunk-MECKA6G2.js.map} +0 -0
- /package/dist/{chunk-YA5M7OC4.js.map → chunk-ML5FW2RO.js.map} +0 -0
- /package/dist/{chunk-T3OLYUU6.js.map → chunk-MQMZO23A.js.map} +0 -0
- /package/dist/{chunk-RS53SDCA.js.map → chunk-MVMNEU65.js.map} +0 -0
- /package/dist/{chunk-7VTQETLT.js.map → chunk-OP5IBPHP.js.map} +0 -0
- /package/dist/{chunk-TUSY4KRE.js.map → chunk-OQZYHCWM.js.map} +0 -0
- /package/dist/{chunk-JVM3CEGL.js.map → chunk-PA5EOTRR.js.map} +0 -0
- /package/dist/{chunk-K26LFJE4.js.map → chunk-PMLFPVYJ.js.map} +0 -0
- /package/dist/{chunk-EST3J4LX.js.map → chunk-PPNFKQ6D.js.map} +0 -0
- /package/dist/{chunk-EHUUXLLA.js.map → chunk-QSP4Y73Q.js.map} +0 -0
- /package/dist/{chunk-AIKUSXIS.js.map → chunk-QXQCPNKA.js.map} +0 -0
- /package/dist/{chunk-HIBNECBQ.js.map → chunk-QZDUNK6V.js.map} +0 -0
- /package/dist/{chunk-UE7L4EDU.js.map → chunk-SRMBMMTK.js.map} +0 -0
- /package/dist/{chunk-T3F2HWIG.js.map → chunk-TZ44E732.js.map} +0 -0
- /package/dist/{chunk-ZDGSHXJU.js.map → chunk-UI6R2YUB.js.map} +0 -0
- /package/dist/{chunk-NDWBT2VV.js.map → chunk-UVEBBXB5.js.map} +0 -0
- /package/dist/{chunk-AOMVOC2E.js.map → chunk-W6V7JN2E.js.map} +0 -0
- /package/dist/{chunk-4WSR7MYV.js.map → chunk-X6B2QWXW.js.map} +0 -0
- /package/dist/{chunk-WHSNLCRO.js.map → chunk-XTMABIFW.js.map} +0 -0
- /package/dist/{chunk-IIDXU2CY.js.map → chunk-XUKUMBP3.js.map} +0 -0
- /package/dist/{chunk-SYJZUVTN.js.map → chunk-ZBAQMSEY.js.map} +0 -0
- /package/dist/{chunk-3MX4GWJO.js.map → chunk-ZUNYFDI4.js.map} +0 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Full-index recognition tier (issue #2975, foundation slice).
|
|
3
|
+
*
|
|
4
|
+
* distill-kura's recall does not search — it recognizes: the entire
|
|
5
|
+
* namespace index (one line per memory: id + description) goes into a
|
|
6
|
+
* single prompt and a small model names which entries bear on the
|
|
7
|
+
* question. Keyword/vector search misses same-subject-different-words
|
|
8
|
+
* cases; a recognizer that reads the whole index cannot miss what it
|
|
9
|
+
* can see (~500 entries ≈ 6k tokens, sub-second locally).
|
|
10
|
+
*
|
|
11
|
+
* This slice ships the deterministic tier machinery only — nothing on
|
|
12
|
+
* the live recall path reads it yet, so recall behavior is unchanged:
|
|
13
|
+
* - a compact per-namespace index persisted at
|
|
14
|
+
* `<namespace memoryDir>/state/index_recognition.json` with
|
|
15
|
+
* build/save/load; loading is total: missing, corrupt, wrong-shape,
|
|
16
|
+
* or future-version indexes all yield `null`, never an error;
|
|
17
|
+
* - the tier decision, pure on (index, maxEntries): index present and
|
|
18
|
+
* at or under the entry threshold → recognition; absent or above →
|
|
19
|
+
* the vector tier, no error thrown;
|
|
20
|
+
* - the runner: renders the FULL index into one prompt, asks the
|
|
21
|
+
* recognizer for ids, keeps only ids the index actually carries, and
|
|
22
|
+
* returns them in index order — never recognizer order;
|
|
23
|
+
* - loud degradation: a recognizer that fails falls back to vector
|
|
24
|
+
* search labeled `recognizer_unavailable` (quiet degradation is
|
|
25
|
+
* worse than degradation).
|
|
26
|
+
*
|
|
27
|
+
* Determinism rules:
|
|
28
|
+
* - the decision is a pure function of (index, maxEntries) — no clock,
|
|
29
|
+
* no I/O, no locale;
|
|
30
|
+
* - an empty index short-circuits: no model call, zero candidates;
|
|
31
|
+
* - the prompt and the returned ids are byte-identical across runs
|
|
32
|
+
* with unchanged inputs.
|
|
33
|
+
*
|
|
34
|
+
* Host contract for the wiring slices:
|
|
35
|
+
* - maintenance slice: build/save the index at memory write time from
|
|
36
|
+
* each memory's id + description line (a recognition trigger — proper
|
|
37
|
+
* nouns, numbers, landmines, the conclusion reached — not a summary),
|
|
38
|
+
* serializing writes the way temporal-index does (op chain + lock);
|
|
39
|
+
* saveRecognitionIndex here is single-writer and does not lock;
|
|
40
|
+
* - recall slice: for each recalled namespace call
|
|
41
|
+
* recallViaRecognitionTier with the recognizer (one small-model call)
|
|
42
|
+
* and the existing vector search as the fallback; expand picks
|
|
43
|
+
* through the graph neighborhood, merge through the normal pipeline
|
|
44
|
+
* (filters → rerank → budget), and record tier = recognition plus any
|
|
45
|
+
* degraded fallback in xray;
|
|
46
|
+
* - config keys recallRecognitionTier (default false) and
|
|
47
|
+
* recognitionIndexMaxEntries (default 500) gate the wiring.
|
|
48
|
+
*/
|
|
49
|
+
import { promises as fsp } from "node:fs";
|
|
50
|
+
import path from "node:path";
|
|
51
|
+
import { coerceBooleanLike, coerceNumber } from "./connectors/coerce.js";
|
|
52
|
+
import { log } from "./logger.js";
|
|
53
|
+
|
|
54
|
+
export const DEFAULT_RECALL_RECOGNITION_TIER = false;
|
|
55
|
+
export const DEFAULT_RECOGNITION_INDEX_MAX_ENTRIES = 500;
|
|
56
|
+
export const RECOGNITION_INDEX_VERSION = 1;
|
|
57
|
+
const RECOGNITION_INDEX_FILE = "index_recognition.json";
|
|
58
|
+
|
|
59
|
+
export const RECOGNITION_PROMPT_HEADER =
|
|
60
|
+
"Memory index — one line per memory. Name the ids that bear on the question.";
|
|
61
|
+
export const RECOGNITION_PROMPT_FOOTER =
|
|
62
|
+
"Answer with the relevant ids only, comma-separated. If none bear on the question, answer with nothing.";
|
|
63
|
+
|
|
64
|
+
export interface RecognitionIndexEntry {
|
|
65
|
+
/** Stable memory id. Candidates always come back in index order. */
|
|
66
|
+
id: string;
|
|
67
|
+
/** One-line recognition trigger; not a summary (issue #2975 swap test). */
|
|
68
|
+
description: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface RecognitionIndex {
|
|
72
|
+
version: number;
|
|
73
|
+
entries: RecognitionIndexEntry[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Config fields this tier owns, mixed into `PluginConfig` (issue #2975) so
|
|
78
|
+
* the keys live beside their parsers instead of growing `types.ts`.
|
|
79
|
+
*/
|
|
80
|
+
export interface RecognitionTierSettings {
|
|
81
|
+
/** Small namespaces recall by recognizing against the whole compact index instead of vector search; parsed now, wiring lands in a later slice. Default false. */
|
|
82
|
+
recallRecognitionTier: boolean;
|
|
83
|
+
/** Max entries a namespace's recognition index may carry for the tier to engage (inclusive). Default 500. */
|
|
84
|
+
recognitionIndexMaxEntries: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function parseRecallRecognitionTier(raw: unknown): boolean {
|
|
88
|
+
return coerceBooleanLike(raw, "recallRecognitionTier") === true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function parseRecognitionIndexMaxEntries(raw: unknown): number {
|
|
92
|
+
if (raw === undefined || raw === null) return DEFAULT_RECOGNITION_INDEX_MAX_ENTRIES;
|
|
93
|
+
const n = coerceNumber(raw, "recognitionIndexMaxEntries");
|
|
94
|
+
if (n === undefined || !Number.isFinite(n) || n < 1) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`Invalid recognitionIndexMaxEntries: expected an integer >= 1, got ${JSON.stringify(raw)}`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return Math.floor(n);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** On-disk location of a namespace's recognition index. */
|
|
103
|
+
export function recognitionIndexPath(memoryDir: string): string {
|
|
104
|
+
return path.join(memoryDir, "state", RECOGNITION_INDEX_FILE);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Normalize raw records into a recognition index: blank/whitespace ids
|
|
109
|
+
* are dropped, descriptions are trimmed, and the first record for an id
|
|
110
|
+
* wins. Input order is preserved — it is the recognition order.
|
|
111
|
+
*/
|
|
112
|
+
export function buildRecognitionIndex(
|
|
113
|
+
records: ReadonlyArray<{ id?: string | null; description?: string | null }>,
|
|
114
|
+
): RecognitionIndex {
|
|
115
|
+
const seen = new Set<string>();
|
|
116
|
+
const out: RecognitionIndexEntry[] = [];
|
|
117
|
+
for (const record of records) {
|
|
118
|
+
const id = typeof record.id === "string" ? record.id.trim() : "";
|
|
119
|
+
if (id.length === 0 || seen.has(id)) continue;
|
|
120
|
+
seen.add(id);
|
|
121
|
+
out.push({
|
|
122
|
+
id,
|
|
123
|
+
description: typeof record.description === "string" ? record.description.trim() : "",
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return { version: RECOGNITION_INDEX_VERSION, entries: out };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Persist a recognition index. Single-writer: the maintenance slice that
|
|
131
|
+
* owns index writes must serialize calls the way temporal-index does.
|
|
132
|
+
*/
|
|
133
|
+
export async function saveRecognitionIndex(
|
|
134
|
+
memoryDir: string,
|
|
135
|
+
index: RecognitionIndex,
|
|
136
|
+
): Promise<void> {
|
|
137
|
+
const file = recognitionIndexPath(memoryDir);
|
|
138
|
+
await fsp.mkdir(path.dirname(file), { recursive: true });
|
|
139
|
+
await fsp.writeFile(file, `${JSON.stringify(index, null, 2)}\n`, "utf8");
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isRecognitionIndex(raw: unknown): raw is RecognitionIndex {
|
|
143
|
+
if (typeof raw !== "object" || raw === null) return false;
|
|
144
|
+
const candidate = raw as { version?: unknown; entries?: unknown };
|
|
145
|
+
if (candidate.version !== RECOGNITION_INDEX_VERSION) return false;
|
|
146
|
+
if (!Array.isArray(candidate.entries)) return false;
|
|
147
|
+
return candidate.entries.every(
|
|
148
|
+
(entry) =>
|
|
149
|
+
typeof entry === "object" &&
|
|
150
|
+
entry !== null &&
|
|
151
|
+
typeof (entry as RecognitionIndexEntry).id === "string" &&
|
|
152
|
+
typeof (entry as RecognitionIndexEntry).description === "string",
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Load a namespace's recognition index. Total: a missing, corrupt,
|
|
158
|
+
* wrong-shape, or future-version file all return `null` so the caller
|
|
159
|
+
* falls back to vector search without an error.
|
|
160
|
+
*/
|
|
161
|
+
export async function loadRecognitionIndex(memoryDir: string): Promise<RecognitionIndex | null> {
|
|
162
|
+
try {
|
|
163
|
+
const raw = await fsp.readFile(recognitionIndexPath(memoryDir), "utf8");
|
|
164
|
+
const parsed: unknown = JSON.parse(raw);
|
|
165
|
+
if (isRecognitionIndex(parsed)) return parsed;
|
|
166
|
+
log.warn(
|
|
167
|
+
`recognition index ignored at ${RECOGNITION_INDEX_FILE}: unexpected shape; falling back to vector search`,
|
|
168
|
+
);
|
|
169
|
+
return null;
|
|
170
|
+
} catch {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type RecognitionRecallTier = "recognition" | "vector";
|
|
176
|
+
export type RecognitionTierReason =
|
|
177
|
+
| "index_absent"
|
|
178
|
+
| "index_above_threshold"
|
|
179
|
+
| "index_within_threshold";
|
|
180
|
+
|
|
181
|
+
export interface RecognitionTierDecision {
|
|
182
|
+
tier: RecognitionRecallTier;
|
|
183
|
+
reason: RecognitionTierReason;
|
|
184
|
+
/** Entries the decision considered; 0 when the index is absent. */
|
|
185
|
+
entriesConsidered: number;
|
|
186
|
+
/** Threshold in force. */
|
|
187
|
+
maxEntries: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Deterministic tier choice, pure on (index, maxEntries). The threshold
|
|
192
|
+
* is inclusive: an index of exactly maxEntries entries still recognizes
|
|
193
|
+
* (a threshold-sized index is the designed working set, not an overrun).
|
|
194
|
+
*/
|
|
195
|
+
export function decideRecognitionTier(
|
|
196
|
+
index: RecognitionIndex | null,
|
|
197
|
+
opts: { maxEntries: number },
|
|
198
|
+
): RecognitionTierDecision {
|
|
199
|
+
const maxEntries = Math.max(1, Math.floor(opts.maxEntries));
|
|
200
|
+
if (index === null) {
|
|
201
|
+
return { tier: "vector", reason: "index_absent", entriesConsidered: 0, maxEntries };
|
|
202
|
+
}
|
|
203
|
+
if (index.entries.length > maxEntries) {
|
|
204
|
+
return {
|
|
205
|
+
tier: "vector",
|
|
206
|
+
reason: "index_above_threshold",
|
|
207
|
+
entriesConsidered: index.entries.length,
|
|
208
|
+
maxEntries,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
tier: "recognition",
|
|
213
|
+
reason: "index_within_threshold",
|
|
214
|
+
entriesConsidered: index.entries.length,
|
|
215
|
+
maxEntries,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Render the full index, one line per entry, in index order. */
|
|
220
|
+
export function renderRecognitionIndex(entries: ReadonlyArray<RecognitionIndexEntry>): string {
|
|
221
|
+
return entries.map((entry) => `${entry.id}: ${entry.description}`).join("\n");
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** The single recognition prompt: header, the FULL index, the question, the answer shape. */
|
|
225
|
+
export function buildRecognitionPrompt(
|
|
226
|
+
query: string,
|
|
227
|
+
entries: ReadonlyArray<RecognitionIndexEntry>,
|
|
228
|
+
): string {
|
|
229
|
+
return [
|
|
230
|
+
RECOGNITION_PROMPT_HEADER,
|
|
231
|
+
renderRecognitionIndex(entries),
|
|
232
|
+
`Question: ${query}`,
|
|
233
|
+
RECOGNITION_PROMPT_FOOTER,
|
|
234
|
+
].join("\n\n");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function dedupeOrdered(tokens: string[]): string[] {
|
|
238
|
+
const seen = new Set<string>();
|
|
239
|
+
const out: string[] = [];
|
|
240
|
+
for (const token of tokens) {
|
|
241
|
+
if (token.length > 0 && !seen.has(token)) {
|
|
242
|
+
seen.add(token);
|
|
243
|
+
out.push(token);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const TRAILING_PUNCTUATION: Record<string, true> = { ".": true, ",": true, ";": true, ":": true };
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Strip trailing sentence punctuation in linear time. A quantified anchored
|
|
253
|
+
* regex (`/[.,;:]+$/`) backtracks polynomially on recognizer output made of
|
|
254
|
+
* many separators, and that output is uncontrolled model text.
|
|
255
|
+
*/
|
|
256
|
+
function stripTrailingPunctuation(value: string): string {
|
|
257
|
+
let end = value.length;
|
|
258
|
+
while (end > 0 && TRAILING_PUNCTUATION[value.charAt(end - 1)]) end -= 1;
|
|
259
|
+
return value.slice(0, end);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Parse recognizer output into ordered unique id tokens. Accepts a JSON
|
|
264
|
+
* string array or comma/whitespace-separated ids, and strips sentence
|
|
265
|
+
* punctuation so prose wrappers do not corrupt ids. Tokens that are not
|
|
266
|
+
* real ids are dropped later by validation against the index.
|
|
267
|
+
*/
|
|
268
|
+
export function parseRecognizerIds(output: string | null | undefined): string[] {
|
|
269
|
+
if (typeof output !== "string") return [];
|
|
270
|
+
const text = output.trim();
|
|
271
|
+
if (text.length === 0) return [];
|
|
272
|
+
if (text.startsWith("[")) {
|
|
273
|
+
try {
|
|
274
|
+
const parsed: unknown = JSON.parse(text);
|
|
275
|
+
if (Array.isArray(parsed)) {
|
|
276
|
+
return dedupeOrdered(
|
|
277
|
+
parsed
|
|
278
|
+
.filter((item): item is string => typeof item === "string")
|
|
279
|
+
.map((item) => stripTrailingPunctuation(item.trim()).trim()),
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
} catch {
|
|
283
|
+
// Fall through to separator parsing.
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return dedupeOrdered(
|
|
287
|
+
text
|
|
288
|
+
.split(/[\s,]+/)
|
|
289
|
+
.map((token) => stripTrailingPunctuation(token.replace(/^[•\-*\d.)\]]+/, "")).trim()),
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** One model call over the full index; supplied by the wiring slice. */
|
|
294
|
+
export type Recognizer = (prompt: string) => Promise<string | null | undefined>;
|
|
295
|
+
|
|
296
|
+
export interface RecognitionRunResult {
|
|
297
|
+
/** Recognized ids, validated against the index, in index order. */
|
|
298
|
+
ids: string[];
|
|
299
|
+
/** Recognizer tokens the index does not carry (hallucinated ids). */
|
|
300
|
+
dropped: string[];
|
|
301
|
+
/** True when no model call was made (empty index). */
|
|
302
|
+
skipped: boolean;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Run the recognition pass: the FULL index goes into one prompt, the
|
|
307
|
+
* recognizer names ids, unknown ids are dropped, and the kept ids come
|
|
308
|
+
* back in index order so downstream merging stays deterministic.
|
|
309
|
+
*/
|
|
310
|
+
export async function runRecognitionTier(
|
|
311
|
+
query: string,
|
|
312
|
+
entries: ReadonlyArray<RecognitionIndexEntry>,
|
|
313
|
+
recognize: Recognizer,
|
|
314
|
+
): Promise<RecognitionRunResult> {
|
|
315
|
+
if (entries.length === 0) {
|
|
316
|
+
return { ids: [], dropped: [], skipped: true };
|
|
317
|
+
}
|
|
318
|
+
const raw = parseRecognizerIds(await recognize(buildRecognitionPrompt(query, entries)));
|
|
319
|
+
const byId = new Map(entries.map((entry) => [entry.id, entry]));
|
|
320
|
+
const picked = new Set(raw.filter((token) => byId.has(token)));
|
|
321
|
+
return {
|
|
322
|
+
ids: entries.filter((entry) => picked.has(entry.id)).map((entry) => entry.id),
|
|
323
|
+
dropped: dedupeOrdered(raw.filter((token) => !byId.has(token))),
|
|
324
|
+
skipped: false,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface RecognitionTierOutcome<TVector> {
|
|
329
|
+
decision: RecognitionTierDecision;
|
|
330
|
+
/** Recognition picks, index order; empty on the vector tier. */
|
|
331
|
+
ids: string[];
|
|
332
|
+
/** Vector-tier results from the fallback; empty on the recognition tier. */
|
|
333
|
+
vectorResults: TVector[];
|
|
334
|
+
/**
|
|
335
|
+
* Set when recognition was routed but the recognizer failed and the
|
|
336
|
+
* vector tier served the recall instead — loud degradation.
|
|
337
|
+
*/
|
|
338
|
+
degraded?: "recognizer_unavailable";
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* The wiring-seam composition for one namespace: load the index, decide
|
|
343
|
+
* the tier, then either recognize against the full index or run the
|
|
344
|
+
* caller's vector search. Never throws for index problems; a failing
|
|
345
|
+
* recognizer degrades to vector search labeled `recognizer_unavailable`.
|
|
346
|
+
*/
|
|
347
|
+
export async function recallViaRecognitionTier<TVector>(args: {
|
|
348
|
+
memoryDir: string;
|
|
349
|
+
query: string;
|
|
350
|
+
maxEntries: number;
|
|
351
|
+
recognize: Recognizer;
|
|
352
|
+
vectorSearch: () => Promise<TVector[]>;
|
|
353
|
+
}): Promise<RecognitionTierOutcome<TVector>> {
|
|
354
|
+
const index = await loadRecognitionIndex(args.memoryDir);
|
|
355
|
+
const decision = decideRecognitionTier(index, { maxEntries: args.maxEntries });
|
|
356
|
+
if (index === null || decision.tier === "vector") {
|
|
357
|
+
return { decision, ids: [], vectorResults: await args.vectorSearch() };
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
const run = await runRecognitionTier(args.query, index.entries, args.recognize);
|
|
361
|
+
return { decision, ids: run.ids, vectorResults: [] };
|
|
362
|
+
} catch (err) {
|
|
363
|
+
log.warn(
|
|
364
|
+
`recognition tier degraded to vector search: recognizer failed${
|
|
365
|
+
err instanceof Error ? ` (${err.message})` : ""
|
|
366
|
+
}`,
|
|
367
|
+
);
|
|
368
|
+
return {
|
|
369
|
+
decision,
|
|
370
|
+
ids: [],
|
|
371
|
+
vectorResults: await args.vectorSearch(),
|
|
372
|
+
degraded: "recognizer_unavailable",
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seed-graduation subject for the scenario-matrix harness.
|
|
3
|
+
*
|
|
4
|
+
* Every canonical row runs the real graduation pass twice: once gated off
|
|
5
|
+
* (the shipped default, which must touch storage zero times) and once enabled
|
|
6
|
+
* with independent corroboration present. The scenario dimensions are
|
|
7
|
+
* orthogonal to the gate, so the same promote/hold invariant holds per row.
|
|
8
|
+
*/
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
SEED_GRADUATION_DEFAULTS,
|
|
13
|
+
runSeedGraduationPass,
|
|
14
|
+
type SeedGraduationStorage,
|
|
15
|
+
} from "../../lifecycle/seed-graduation.js";
|
|
16
|
+
import type { MemoryFile, MemoryFrontmatter } from "../../types.js";
|
|
17
|
+
import { type LifecycleSubject, type MatrixRow, runLifecycleMatrix } from "../lifecycle-matrix.js";
|
|
18
|
+
|
|
19
|
+
const SEED_TEXT = "The launch moved to September twelfth after the vendor call.";
|
|
20
|
+
const RESTATE_TEXT = "Launch moved to September twelfth after the vendor call.";
|
|
21
|
+
|
|
22
|
+
interface PromotionCall {
|
|
23
|
+
id: string;
|
|
24
|
+
attributeUpdates: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface SeedGraduationState {
|
|
28
|
+
memories: MemoryFile[];
|
|
29
|
+
calls: PromotionCall[];
|
|
30
|
+
storage: SeedGraduationStorage;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function memory(overrides: {
|
|
34
|
+
id: string;
|
|
35
|
+
content: string;
|
|
36
|
+
created: string;
|
|
37
|
+
status?: MemoryFrontmatter["status"];
|
|
38
|
+
sessionKey: string;
|
|
39
|
+
}): MemoryFile {
|
|
40
|
+
return {
|
|
41
|
+
path: `facts/${overrides.id}.md`,
|
|
42
|
+
content: overrides.content,
|
|
43
|
+
frontmatter: {
|
|
44
|
+
id: overrides.id,
|
|
45
|
+
category: "fact",
|
|
46
|
+
created: overrides.created,
|
|
47
|
+
updated: overrides.created,
|
|
48
|
+
source: "extraction",
|
|
49
|
+
confidence: 0.7,
|
|
50
|
+
confidenceTier: "inferred",
|
|
51
|
+
tags: [],
|
|
52
|
+
status: overrides.status,
|
|
53
|
+
structuredAttributes: { sessionKey: overrides.sessionKey },
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const subject: LifecycleSubject<SeedGraduationState> = {
|
|
59
|
+
async setup(row: MatrixRow): Promise<SeedGraduationState> {
|
|
60
|
+
const calls: PromotionCall[] = [];
|
|
61
|
+
const memories = [
|
|
62
|
+
memory({
|
|
63
|
+
id: `seed-${row.id}`,
|
|
64
|
+
content: SEED_TEXT,
|
|
65
|
+
created: "2026-08-01T10:00:00.000Z",
|
|
66
|
+
status: "pending_review",
|
|
67
|
+
sessionKey: `session-seed-${row.id}`,
|
|
68
|
+
}),
|
|
69
|
+
memory({
|
|
70
|
+
id: `evidence-a-${row.id}`,
|
|
71
|
+
content: RESTATE_TEXT,
|
|
72
|
+
created: "2026-08-02T10:00:00.000Z",
|
|
73
|
+
sessionKey: `session-a-${row.id}`,
|
|
74
|
+
}),
|
|
75
|
+
memory({
|
|
76
|
+
id: `evidence-b-${row.id}`,
|
|
77
|
+
content: RESTATE_TEXT,
|
|
78
|
+
created: "2026-08-03T10:00:00.000Z",
|
|
79
|
+
sessionKey: `session-b-${row.id}`,
|
|
80
|
+
}),
|
|
81
|
+
];
|
|
82
|
+
return {
|
|
83
|
+
memories,
|
|
84
|
+
calls,
|
|
85
|
+
storage: {
|
|
86
|
+
async promoteWearableMemory(id, attributeUpdates): Promise<boolean> {
|
|
87
|
+
calls.push({ id, attributeUpdates });
|
|
88
|
+
return true;
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
async exercise(state): Promise<void> {
|
|
95
|
+
// Gate off (shipped default): no evaluation, no storage contact at all.
|
|
96
|
+
const off = await runSeedGraduationPass({
|
|
97
|
+
memories: state.memories,
|
|
98
|
+
storage: state.storage,
|
|
99
|
+
config: SEED_GRADUATION_DEFAULTS,
|
|
100
|
+
});
|
|
101
|
+
assert.equal(off.disabled, true);
|
|
102
|
+
assert.equal(off.promoted, 0);
|
|
103
|
+
assert.equal(state.calls.length, 0);
|
|
104
|
+
|
|
105
|
+
// Enabled with two independent corroborations: the seed graduates.
|
|
106
|
+
const on = await runSeedGraduationPass({
|
|
107
|
+
memories: state.memories,
|
|
108
|
+
storage: state.storage,
|
|
109
|
+
config: { enabled: true, minCorroborations: 2 },
|
|
110
|
+
});
|
|
111
|
+
assert.equal(on.disabled, false);
|
|
112
|
+
assert.equal(on.promoted, 1);
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
async invariants(state): Promise<void> {
|
|
116
|
+
assert.equal(state.calls.length, 1);
|
|
117
|
+
const call = state.calls[0];
|
|
118
|
+
assert.ok(call?.id.startsWith("seed-"));
|
|
119
|
+
assert.equal(call?.attributeUpdates.graduatedBy, "independent-corroboration");
|
|
120
|
+
assert.equal(call?.attributeUpdates.corroborationCount, "2");
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
async teardown(): Promise<void> {
|
|
124
|
+
// Pure in-memory corpus and fake storage — nothing durable to clean up.
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
runLifecycleMatrix("seed-graduation", subject);
|
package/src/types.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
} from "./preferences/drift-types.js";
|
|
23
23
|
import type { DeepRecallSettings } from "./deep-recall-config.js";
|
|
24
24
|
import type { RecallNavigationSettings } from "./recall-navigation-config.js";
|
|
25
|
+
import type { RecognitionTierSettings } from "./recall-recognition-tier.js";
|
|
25
26
|
import type { ProceduralMaintenanceConfig } from "./procedural/maintenance-config.js";
|
|
26
27
|
import type { SkillProjectionConfig } from "./procedural/skill-projection.js";
|
|
27
28
|
import type { SessionExperienceConfig } from "./experience/session-experience-config.js";
|
|
@@ -696,6 +697,7 @@ export interface PluginConfig
|
|
|
696
697
|
ActiveContextConfigFields,
|
|
697
698
|
DeepRecallSettings,
|
|
698
699
|
RecallNavigationSettings,
|
|
700
|
+
RecognitionTierSettings,
|
|
699
701
|
LocalLlmConfig {
|
|
700
702
|
openaiApiKey: string | undefined;
|
|
701
703
|
openaiBaseUrl: string | undefined;
|