@remnic/core 9.69.38 → 9.69.40
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 +16 -14
- package/dist/access-admin-ops-surface.js +39 -39
- package/dist/access-authorization-probe.d.ts +16 -14
- package/dist/access-authorization-probe.js +40 -40
- package/dist/access-boundary.d.ts +16 -14
- package/dist/access-boundary.js +39 -39
- package/dist/access-cli.js +107 -105
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +16 -14
- package/dist/access-extraction-force-flush.js +39 -39
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-briefing.d.ts +16 -14
- package/dist/access-http-briefing.js +40 -40
- package/dist/access-http-lcm-compaction.d.ts +16 -14
- package/dist/access-http-lifecycle-flush.d.ts +16 -14
- package/dist/access-http-offline-stream.d.ts +16 -14
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +41 -41
- package/dist/access-http.d.ts +17 -15
- package/dist/access-http.js +58 -58
- package/dist/access-identity-continuity-surface.d.ts +13 -12
- package/dist/access-identity-continuity-surface.js +39 -39
- package/dist/access-lcm-surface.d.ts +16 -14
- package/dist/access-lcm-surface.js +39 -39
- package/dist/access-mcp.d.ts +16 -14
- package/dist/access-mcp.js +47 -47
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-DY4z6L5X.d.ts → access-namespace-preflight-CKBumJ8W.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +39 -39
- package/dist/access-observe-transcript.d.ts +13 -12
- package/dist/access-observe-write-category.d.ts +1 -1
- package/dist/access-observe-write-category.js +2 -2
- package/dist/access-observe-write-surface.d.ts +16 -14
- package/dist/access-observe-write-surface.js +39 -39
- package/dist/access-offline-manifest.d.ts +37 -13
- package/dist/access-offline-manifest.js +7 -3
- package/dist/access-operations-batch.js +41 -41
- package/dist/access-operations.d.ts +16 -14
- package/dist/access-operations.js +46 -46
- package/dist/access-recall-concurrency.d.ts +16 -14
- package/dist/access-recall-concurrency.js +39 -39
- package/dist/access-recall-response.d.ts +16 -14
- package/dist/access-recall-response.js +39 -39
- package/dist/access-recall-surface.d.ts +16 -14
- package/dist/access-recall-surface.js +39 -39
- package/dist/access-schema.d.ts +5 -3
- package/dist/access-schema.js +1 -1
- package/dist/{access-service-gBcdRUHY.d.ts → access-service-DJ3qogNt.d.ts} +8 -8
- package/dist/access-service-helpers.d.ts +16 -14
- package/dist/access-service.d.ts +16 -14
- package/dist/access-service.js +39 -39
- package/dist/access-surface-catalog.d.ts +16 -14
- package/dist/access-surface-catalog.js +41 -41
- package/dist/access-wearables-meetings-surface.d.ts +6 -5
- 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 +6 -5
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-RP4C6ZPF.js → auto-sync-D6BAPIJV.js} +5 -5
- package/dist/background-generation-config.d.ts +1 -1
- package/dist/background-generation-config.js +3 -1
- package/dist/background-generation.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +13 -12
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +16 -16
- 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 +5 -5
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +3 -2
- package/dist/calibration.js +2 -2
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-CW87xGx8.d.ts → catalog-BHXkBVhg.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 +20 -19
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-B36GUU6T.js → chunk-23HFXQ5J.js} +36 -3
- package/dist/chunk-23HFXQ5J.js.map +1 -0
- package/dist/{chunk-YFTNZMGR.js → chunk-27NO2KVB.js} +31 -8
- package/dist/chunk-27NO2KVB.js.map +1 -0
- package/dist/{chunk-T32B72QX.js → chunk-2SKMZUOW.js} +2 -2
- package/dist/{chunk-VHOSM5G4.js → chunk-2SNCQHJZ.js} +2 -2
- package/dist/{chunk-VV4ZVUE6.js → chunk-3QEVOQF5.js} +2 -2
- package/dist/{chunk-3N3PBBEH.js → chunk-3XPN7AVY.js} +2 -2
- package/dist/{chunk-XN6XT6GR.js → chunk-46Z3VGWF.js} +2 -2
- package/dist/{chunk-2PTNJTBE.js → chunk-4CMXI55L.js} +2 -2
- package/dist/{chunk-2MT4ADLQ.js → chunk-5LYSEZOF.js} +18 -9
- package/dist/chunk-5LYSEZOF.js.map +1 -0
- package/dist/{chunk-XWLLFKHM.js → chunk-62HFZNCJ.js} +19 -12
- package/dist/chunk-62HFZNCJ.js.map +1 -0
- package/dist/{chunk-VELCIWJZ.js → chunk-6L2II3KS.js} +22 -11
- package/dist/chunk-6L2II3KS.js.map +1 -0
- package/dist/{chunk-A6CKMIPK.js → chunk-7D6SER6A.js} +8 -8
- package/dist/{chunk-4B3HBIFX.js → chunk-7Z54NXVS.js} +2 -2
- package/dist/{chunk-X2NFFBTO.js → chunk-A7GQBJP5.js} +4 -4
- package/dist/{chunk-ACY4ZPF7.js → chunk-AEOOGXMQ.js} +10 -5
- package/dist/chunk-AEOOGXMQ.js.map +1 -0
- package/dist/{chunk-NWMUSKED.js → chunk-BGRTZOJB.js} +3 -3
- package/dist/{chunk-ZEGL7YCC.js → chunk-BXIJSPCL.js} +2 -2
- package/dist/{chunk-MLWMR2GE.js → chunk-BYQX4IOG.js} +2 -2
- package/dist/{chunk-ULDBGA5W.js → chunk-C5R73BON.js} +2 -2
- package/dist/{chunk-BD7JTBYP.js → chunk-D7MAYFQP.js} +2 -2
- package/dist/{chunk-V6G2PSXA.js → chunk-DAZANIYU.js} +251 -297
- package/dist/chunk-DAZANIYU.js.map +1 -0
- package/dist/{chunk-BRZWWUCJ.js → chunk-DFVSJFHK.js} +2 -2
- package/dist/{chunk-DPMTLJCT.js → chunk-ES5BUPYB.js} +2 -2
- package/dist/{chunk-MVAQ2WM3.js → chunk-G2XZFGYN.js} +6 -2
- package/dist/chunk-G2XZFGYN.js.map +1 -0
- package/dist/{chunk-TNSCIPBQ.js → chunk-G6NQ3L4T.js} +2 -2
- package/dist/{chunk-5N4MZLEH.js → chunk-GO5LOHCD.js} +2 -2
- package/dist/{chunk-AECJY3GJ.js → chunk-GSSDHAYH.js} +2 -2
- package/dist/{chunk-JA2QJOAX.js → chunk-HJUP3K6L.js} +2 -2
- package/dist/{chunk-ZKZFFWLV.js → chunk-ICNJ6J46.js} +2 -2
- package/dist/{chunk-6EHM2AV7.js → chunk-IMBQFHRV.js} +2 -2
- package/dist/{chunk-6PRY6CLC.js → chunk-IOPIGX7Y.js} +1 -1
- package/dist/{chunk-TRHBQVVO.js → chunk-IS2IDFJP.js} +14 -14
- package/dist/{chunk-R4VAUNNC.js → chunk-J4WGTN2N.js} +2 -2
- package/dist/{chunk-JPOX2AJB.js → chunk-J7FVMLBR.js} +2 -2
- package/dist/{chunk-BYZKLEWG.js → chunk-JAJIMTFB.js} +6 -6
- package/dist/{chunk-OKO57IXB.js → chunk-JOP7W24J.js} +11 -11
- package/dist/{chunk-YUW66UAH.js → chunk-JUDT33RX.js} +2 -2
- package/dist/{chunk-QHT7MOUF.js → chunk-K4A6UVPB.js} +22 -11
- package/dist/chunk-K4A6UVPB.js.map +1 -0
- package/dist/{chunk-UQNYPK7G.js → chunk-K4JKAXMO.js} +2 -2
- package/dist/{chunk-BV4ZKIZH.js → chunk-K75A5XWU.js} +3 -2
- package/dist/{chunk-3CBI2ZSA.js → chunk-KG2OOAFF.js} +20 -12
- package/dist/chunk-KG2OOAFF.js.map +1 -0
- package/dist/{chunk-M6HBPLBA.js → chunk-KOTG3RXE.js} +2 -2
- package/dist/{chunk-CWTCMZGE.js → chunk-KTOXQMW3.js} +119 -3
- package/dist/chunk-KTOXQMW3.js.map +1 -0
- package/dist/{chunk-OB3XMWX5.js → chunk-KVO2BTA4.js} +2 -2
- package/dist/{chunk-CBFYCDYO.js → chunk-KY236SP5.js} +3 -3
- package/dist/{chunk-4BCHFSC7.js → chunk-LFVZD5EC.js} +3 -3
- package/dist/{chunk-GGAXFTNH.js → chunk-LKFVVN7R.js} +2 -2
- package/dist/{chunk-IYKZJVL5.js → chunk-MDIEES23.js} +1 -1
- package/dist/chunk-MDIEES23.js.map +1 -0
- package/dist/{chunk-4RX5O34R.js → chunk-MJC7UKH7.js} +2 -2
- package/dist/{chunk-7S53BPTU.js → chunk-MVG3KXON.js} +69 -22
- package/dist/chunk-MVG3KXON.js.map +1 -0
- package/dist/chunk-NETQXOPY.js +221 -0
- package/dist/chunk-NETQXOPY.js.map +1 -0
- package/dist/{chunk-UZZ7SQT3.js → chunk-NVVZPBKI.js} +2 -2
- package/dist/{chunk-BLDBT6HZ.js → chunk-PJRKLB4Z.js} +18 -2
- package/dist/chunk-PJRKLB4Z.js.map +1 -0
- package/dist/{chunk-TTSJ7WUC.js → chunk-PKUJNICO.js} +2 -2
- package/dist/{chunk-QMWKENNK.js → chunk-Q4AUIFUA.js} +4 -4
- package/dist/{chunk-G43PMSME.js → chunk-QE6YVNP5.js} +7 -7
- package/dist/{chunk-WKDFJXW5.js → chunk-QM2SPLKQ.js} +1 -1
- package/dist/chunk-QM2SPLKQ.js.map +1 -0
- package/dist/{chunk-GT4ZHOKT.js → chunk-QPVNK2VE.js} +2 -2
- package/dist/{chunk-K5DA5TRG.js → chunk-QS5Q5RBV.js} +2 -2
- package/dist/{chunk-BX4EOMKT.js → chunk-RDLPFM7I.js} +2 -2
- package/dist/{chunk-EY5JAWZC.js → chunk-RJQAP333.js} +2 -2
- package/dist/{chunk-5AERZWJD.js → chunk-RLU2Y5GV.js} +4 -4
- package/dist/chunk-RLU2Y5GV.js.map +1 -0
- package/dist/{chunk-2OGTN37H.js → chunk-ROEFLU37.js} +4 -4
- package/dist/{chunk-62QIQEUC.js → chunk-SFHLQPBF.js} +25 -25
- package/dist/chunk-SK7D34OL.js +68 -0
- package/dist/chunk-SK7D34OL.js.map +1 -0
- package/dist/{chunk-HVS7TH2Y.js → chunk-SUEOG2S4.js} +2 -2
- package/dist/{chunk-74AHCL56.js → chunk-TEMKBSV6.js} +2 -2
- package/dist/{chunk-LQNRVPTV.js → chunk-THTF2W7M.js} +151 -118
- package/dist/chunk-THTF2W7M.js.map +1 -0
- package/dist/{chunk-KDFDXEXZ.js → chunk-TO36VPZI.js} +2 -2
- package/dist/{chunk-BJEJUOGM.js → chunk-TZ44E732.js} +44 -6
- package/dist/chunk-TZ44E732.js.map +1 -0
- package/dist/{chunk-JXN77SGO.js → chunk-U2VDCFXW.js} +1 -1
- package/dist/chunk-U2VDCFXW.js.map +1 -0
- package/dist/{chunk-3OYSIVOO.js → chunk-UZ6JYPJ6.js} +611 -289
- package/dist/chunk-UZ6JYPJ6.js.map +1 -0
- package/dist/{chunk-M3MYMWXG.js → chunk-V2ZA4YWE.js} +2 -2
- package/dist/{chunk-UIOIDW3L.js → chunk-VHKXRYQN.js} +2 -2
- package/dist/{chunk-GAS7KYC7.js → chunk-VKWFNPBH.js} +2 -2
- package/dist/{chunk-6H2G7RFT.js → chunk-VNQRRUNS.js} +11 -10
- package/dist/chunk-VNQRRUNS.js.map +1 -0
- package/dist/{chunk-XGRXQR6T.js → chunk-VQWBUPSJ.js} +2 -2
- package/dist/{chunk-TUKGXQ5T.js → chunk-VQYWKCDR.js} +2 -2
- package/dist/{chunk-PPQEP4OH.js → chunk-W23JARAQ.js} +2 -2
- package/dist/{chunk-YQNNHLCG.js → chunk-WPGR3RW4.js} +2 -2
- package/dist/{chunk-474DL7UB.js → chunk-WZYHPAG5.js} +3 -3
- package/dist/{chunk-5HYUUFMQ.js → chunk-XCPNH2MG.js} +259 -10
- package/dist/chunk-XCPNH2MG.js.map +1 -0
- package/dist/{chunk-GQQVEH6V.js → chunk-XM46Y66S.js} +2 -2
- package/dist/{chunk-JNSENHV5.js → chunk-YRIFXXMI.js} +3 -3
- package/dist/{chunk-TRLOFIQC.js → chunk-YTK5MVNF.js} +2 -2
- package/dist/{chunk-VMNCZ627.js → chunk-YTZN2UZO.js} +2 -2
- package/dist/chunk-Z4GUX2M6.js +94 -0
- package/dist/chunk-Z4GUX2M6.js.map +1 -0
- package/dist/{chunk-6ZMNTRU3.js → chunk-ZAEPD4C2.js} +2 -2
- package/dist/{chunk-KQW3YGEN.js → chunk-ZRMMXWYI.js} +2 -2
- package/dist/{chunk-P4ZAEYKG.js → chunk-ZX3AYNNV.js} +6 -3
- package/dist/chunk-ZX3AYNNV.js.map +1 -0
- package/dist/{chunk-MCRVQ5YQ.js → chunk-ZZCR2QYL.js} +2 -2
- package/dist/{cli-BNg-TAlz.d.ts → cli-BWri5-am.d.ts} +5 -5
- package/dist/cli.d.ts +18 -16
- package/dist/cli.js +80 -79
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +15 -15
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +16 -16
- 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 +6 -5
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +16 -16
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +16 -16
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +6 -5
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +18 -18
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +18 -18
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/deep-recall-http-glue.d.ts +16 -14
- package/dist/deep-recall-http-glue.js +2 -2
- package/dist/deep-recall-mcp-tools.d.ts +16 -14
- package/dist/deep-recall-policy-llm.d.ts +4 -3
- package/dist/deep-recall-policy-llm.js +3 -3
- package/dist/deep-recall-seeds.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-Cq1ekOwV.d.ts → dependency-propagation-delivery-ueZlKTQB.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-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +16 -16
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +13 -12
- package/dist/external-wiki-access.d.ts +16 -14
- package/dist/external-wiki-access.js +40 -40
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +16 -14
- package/dist/extraction-error-classification.d.ts +14 -3
- package/dist/extraction-error-classification.js +5 -3
- package/dist/extraction-faithfulness.d.ts +4 -3
- package/dist/extraction-faithfulness.js +3 -3
- package/dist/extraction-judge-telemetry.d.ts +4 -3
- package/dist/extraction-judge-training.d.ts +4 -3
- package/dist/extraction-judge.d.ts +4 -3
- package/dist/extraction-judge.js +3 -3
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.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-span-config.d.ts +1 -1
- package/dist/extraction-span-materialize.d.ts +1 -1
- package/dist/extraction.d.ts +4 -4
- package/dist/extraction.js +26 -24
- package/dist/fallback-llm-codex-subscription.d.ts +52 -7
- package/dist/fallback-llm-codex-subscription.js +17 -1
- package/dist/fallback-llm.d.ts +25 -28
- package/dist/fallback-llm.js +4 -3
- package/dist/{generic-recall-paths-BcySh_f9.d.ts → generic-recall-paths-CpyVmA88.d.ts} +1 -1
- package/dist/graph-append-error.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-jsonl.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/importers/test-utils.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/{index-DWOb4wz9.d.ts → index-BvUA4S7M.d.ts} +3 -3
- package/dist/index.d.ts +80 -40
- package/dist/index.js +140 -115
- 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 +7 -7
- 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-BsJGulur.d.ts +247 -0
- package/dist/local-llm-config.d.ts +4 -1
- package/dist/local-llm-config.js +4 -2
- package/dist/local-llm-helpers.d.ts +18 -69
- package/dist/local-llm-helpers.js +1 -1
- package/dist/local-llm.d.ts +3 -170
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +3 -3
- package/dist/location/index.js +18 -18
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +16 -16
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +16 -16
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +17 -17
- package/dist/{maintenance-CW9wCzMP.d.ts → maintenance-CYubtIRr.d.ts} +9 -3
- package/dist/mcp-memory-inspector-app.d.ts +16 -14
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.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-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +16 -14
- package/dist/memory-subject.d.ts +16 -14
- 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 +12 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +16 -16
- 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 +30 -29
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +27 -27
- package/dist/{orchestrator-DocO0_hw.d.ts → orchestrator-BWDRJ_0d.d.ts} +37 -13
- package/dist/orchestrator.d.ts +13 -12
- package/dist/orchestrator.js +110 -106
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CiYcqqhl.d.ts → pipeline-7JMn2yMH.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +2 -2
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-C0FoTiL_.d.ts → public-http-CJWs3mo9.d.ts} +1 -1
- package/dist/{qmd-qXD4vatU.d.ts → qmd-CxCH9G9m.d.ts} +2 -2
- 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/qmd.js +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-navigate-access.d.ts +1 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +1 -1
- package/dist/recall-navigate-disclosure.js +1 -1
- package/dist/recall-navigate.d.ts +1 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-planner-llm.d.ts +3 -2
- package/dist/recall-planner-llm.js +4 -3
- package/dist/recall-planner-llm.js.map +1 -1
- package/dist/recall-state-view-admission.d.ts +13 -3
- package/dist/recall-state-view-admission.js +8 -8
- package/dist/recall-state-view-anchors.d.ts +85 -0
- package/dist/recall-state-view-anchors.js +21 -0
- package/dist/recall-state-view-anchors.js.map +1 -0
- package/dist/recall-state-view-inject.js +2 -2
- package/dist/recall-state-view-render.js +2 -2
- package/dist/recall-state-view-widen.js +2 -2
- package/dist/recall-state-view-wire.js +3 -3
- package/dist/recall-state-view.d.ts +38 -1
- package/dist/recall-state-view.js +11 -3
- 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/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- 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 +7 -6
- 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/{scope-profiles-BT9rqC3w.d.ts → scope-profiles-BGAUqhBR.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 +12 -12
- 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 +2 -2
- package/dist/search/port.js +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/search/remote-backend.js +2 -2
- package/dist/{semantic-consolidation-CmZi7thY.d.ts → semantic-consolidation-CCeRD9pV.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +17 -17
- package/dist/semantic-rule-promotion.js +16 -16
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +16 -16
- package/dist/{service-CLkA7AQB.d.ts → service-BwpzRduk.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 +1 -1
- package/dist/source-agent-qualifier.js +19 -19
- package/dist/standup/build.js +16 -16
- package/dist/{storage-wvX01lht.d.ts → storage-BprAGBG0.d.ts} +2 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +15 -15
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +18 -17
- package/dist/support-passport/index.js +42 -42
- package/dist/task-llm-config.d.ts +16 -0
- package/dist/task-llm-config.js +12 -0
- package/dist/task-llm-config.js.map +1 -0
- 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/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +16 -16
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-Cyr32ABj.d.ts → types-nJV23pa3.d.ts} +1 -1
- 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 +16 -16
- package/dist/who-knows-cli.d.ts +16 -14
- package/dist/who-knows-cli.js +17 -17
- package/dist/who-knows.d.ts +16 -14
- package/dist/who-knows.js +16 -16
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-category-alias.test.ts +93 -0
- package/src/access-offline-manifest.ts +52 -2
- package/src/access-schema.ts +9 -4
- package/src/activity/config.test.ts +61 -0
- package/src/activity/config.ts +40 -1
- package/src/activity/timeline/analysis-provider.ts +8 -2
- package/src/activity/timeline/analysis-run.test.ts +82 -0
- package/src/activity/timeline/publish-cli.test.ts +30 -0
- package/src/activity/timeline/publish-cli.ts +7 -0
- package/src/activity/timeline/query.ts +8 -1
- package/src/activity/timeline/regenerate.test.ts +82 -2
- package/src/activity/timeline/regenerate.ts +7 -1
- package/src/activity/vault-frontmatter.test.ts +99 -1
- package/src/activity/vault-frontmatter.ts +131 -0
- package/src/activity/vault-publish.ts +6 -0
- package/src/activity/vault-publisher.test.ts +172 -0
- package/src/activity/vault-publisher.ts +69 -15
- package/src/activity/vault-region.test.ts +7 -2
- package/src/activity/vault-region.ts +7 -3
- package/src/background-generation-config.ts +32 -6
- package/src/background-generation.test.ts +10 -1
- package/src/cli/timeline-publish-commands.ts +9 -0
- package/src/config.test.ts +170 -43
- package/src/config.ts +17 -5
- package/src/extraction-error-classification.ts +36 -1
- package/src/extraction-timeout.test.ts +110 -1
- package/src/extraction.test.ts +19 -1
- package/src/extraction.ts +23 -21
- package/src/fallback-llm-codex-subscription.ts +193 -7
- package/src/fallback-llm-parse-failure.test.ts +156 -0
- package/src/fallback-llm.test.ts +58 -0
- package/src/fallback-llm.ts +187 -186
- package/src/index.ts +1 -0
- package/src/local-llm-config.ts +11 -10
- package/src/local-llm-headers-timeout.test.ts +30 -0
- package/src/local-llm-helpers.ts +28 -0
- package/src/local-llm.ts +8 -19
- package/src/namespaces/search.test.ts +51 -1
- package/src/namespaces/search.ts +48 -3
- package/src/orchestration/extraction-persist-promotion.test.ts +228 -2
- package/src/orchestration/extraction-persist-promotion.ts +17 -14
- package/src/orchestration/orchestrator-helpers.test.ts +104 -0
- package/src/orchestration/orchestrator-init.ts +366 -106
- package/src/orchestration/recall-internal.ts +85 -74
- package/src/orchestration/recall-rerank-coordinator.ts +41 -4
- package/src/orchestration/recall-search-pipeline.ts +25 -18
- package/src/orchestration/recall-state-view-pipeline.test.ts +89 -0
- package/src/orchestration/semantic-merge-promotion-payload.ts +62 -6
- package/src/orchestration/startup-collection-checks.ts +85 -0
- package/src/orchestrator-flush.test.ts +7 -0
- package/src/orchestrator-init.test.ts +1539 -0
- package/src/orchestrator.ts +7 -0
- package/src/qmd.ts +21 -10
- package/src/recall-rerank-coordinator.test.ts +153 -0
- package/src/recall-state-view-admission.ts +11 -1
- package/src/recall-state-view-anchors.ts +163 -0
- package/src/recall-state-view-cron-intent.test.ts +268 -0
- package/src/recall-state-view-widen.test.ts +14 -5
- package/src/recall-state-view-widen.ts +29 -8
- package/src/recall-state-view-zero-diff.test.ts +30 -0
- package/src/recall-state-view.test.ts +161 -0
- package/src/recall-state-view.ts +211 -37
- package/src/reconcile-identity-cache.test.ts +82 -1
- package/src/search/port.ts +1 -1
- package/src/storage/cas-revision-store.test.ts +4 -0
- package/src/storage/cas-revision-store.ts +104 -12
- package/src/storage-frontmatter-cas.test.ts +19 -17
- package/src/summarizer.ts +5 -1
- package/src/task-llm-config.test.ts +124 -0
- package/src/task-llm-config.ts +88 -0
- package/src/testing/subjects/startup-discovery-lifecycle.test.ts +273 -0
- package/src/trust-score-recall-paths.test.ts +1 -1
- package/src/types.ts +1 -0
- package/dist/chunk-255PC37A.js +0 -120
- package/dist/chunk-255PC37A.js.map +0 -1
- package/dist/chunk-2MT4ADLQ.js.map +0 -1
- package/dist/chunk-3CBI2ZSA.js.map +0 -1
- package/dist/chunk-3OYSIVOO.js.map +0 -1
- package/dist/chunk-5AERZWJD.js.map +0 -1
- package/dist/chunk-5HYUUFMQ.js.map +0 -1
- package/dist/chunk-6H2G7RFT.js.map +0 -1
- package/dist/chunk-7S53BPTU.js.map +0 -1
- package/dist/chunk-ACY4ZPF7.js.map +0 -1
- package/dist/chunk-B36GUU6T.js.map +0 -1
- package/dist/chunk-BJEJUOGM.js.map +0 -1
- package/dist/chunk-BLDBT6HZ.js.map +0 -1
- package/dist/chunk-CWTCMZGE.js.map +0 -1
- package/dist/chunk-IYKZJVL5.js.map +0 -1
- package/dist/chunk-JXN77SGO.js.map +0 -1
- package/dist/chunk-LQNRVPTV.js.map +0 -1
- package/dist/chunk-MVAQ2WM3.js.map +0 -1
- package/dist/chunk-P4ZAEYKG.js.map +0 -1
- package/dist/chunk-QHT7MOUF.js.map +0 -1
- package/dist/chunk-V6G2PSXA.js.map +0 -1
- package/dist/chunk-VELCIWJZ.js.map +0 -1
- package/dist/chunk-WKDFJXW5.js.map +0 -1
- package/dist/chunk-XWLLFKHM.js.map +0 -1
- package/dist/chunk-YFTNZMGR.js.map +0 -1
- /package/dist/{auto-sync-RP4C6ZPF.js.map → auto-sync-D6BAPIJV.js.map} +0 -0
- /package/dist/{chunk-T32B72QX.js.map → chunk-2SKMZUOW.js.map} +0 -0
- /package/dist/{chunk-VHOSM5G4.js.map → chunk-2SNCQHJZ.js.map} +0 -0
- /package/dist/{chunk-VV4ZVUE6.js.map → chunk-3QEVOQF5.js.map} +0 -0
- /package/dist/{chunk-3N3PBBEH.js.map → chunk-3XPN7AVY.js.map} +0 -0
- /package/dist/{chunk-XN6XT6GR.js.map → chunk-46Z3VGWF.js.map} +0 -0
- /package/dist/{chunk-2PTNJTBE.js.map → chunk-4CMXI55L.js.map} +0 -0
- /package/dist/{chunk-A6CKMIPK.js.map → chunk-7D6SER6A.js.map} +0 -0
- /package/dist/{chunk-4B3HBIFX.js.map → chunk-7Z54NXVS.js.map} +0 -0
- /package/dist/{chunk-X2NFFBTO.js.map → chunk-A7GQBJP5.js.map} +0 -0
- /package/dist/{chunk-NWMUSKED.js.map → chunk-BGRTZOJB.js.map} +0 -0
- /package/dist/{chunk-ZEGL7YCC.js.map → chunk-BXIJSPCL.js.map} +0 -0
- /package/dist/{chunk-MLWMR2GE.js.map → chunk-BYQX4IOG.js.map} +0 -0
- /package/dist/{chunk-ULDBGA5W.js.map → chunk-C5R73BON.js.map} +0 -0
- /package/dist/{chunk-BD7JTBYP.js.map → chunk-D7MAYFQP.js.map} +0 -0
- /package/dist/{chunk-BRZWWUCJ.js.map → chunk-DFVSJFHK.js.map} +0 -0
- /package/dist/{chunk-DPMTLJCT.js.map → chunk-ES5BUPYB.js.map} +0 -0
- /package/dist/{chunk-TNSCIPBQ.js.map → chunk-G6NQ3L4T.js.map} +0 -0
- /package/dist/{chunk-5N4MZLEH.js.map → chunk-GO5LOHCD.js.map} +0 -0
- /package/dist/{chunk-AECJY3GJ.js.map → chunk-GSSDHAYH.js.map} +0 -0
- /package/dist/{chunk-JA2QJOAX.js.map → chunk-HJUP3K6L.js.map} +0 -0
- /package/dist/{chunk-ZKZFFWLV.js.map → chunk-ICNJ6J46.js.map} +0 -0
- /package/dist/{chunk-6EHM2AV7.js.map → chunk-IMBQFHRV.js.map} +0 -0
- /package/dist/{chunk-6PRY6CLC.js.map → chunk-IOPIGX7Y.js.map} +0 -0
- /package/dist/{chunk-TRHBQVVO.js.map → chunk-IS2IDFJP.js.map} +0 -0
- /package/dist/{chunk-R4VAUNNC.js.map → chunk-J4WGTN2N.js.map} +0 -0
- /package/dist/{chunk-JPOX2AJB.js.map → chunk-J7FVMLBR.js.map} +0 -0
- /package/dist/{chunk-BYZKLEWG.js.map → chunk-JAJIMTFB.js.map} +0 -0
- /package/dist/{chunk-OKO57IXB.js.map → chunk-JOP7W24J.js.map} +0 -0
- /package/dist/{chunk-YUW66UAH.js.map → chunk-JUDT33RX.js.map} +0 -0
- /package/dist/{chunk-UQNYPK7G.js.map → chunk-K4JKAXMO.js.map} +0 -0
- /package/dist/{chunk-BV4ZKIZH.js.map → chunk-K75A5XWU.js.map} +0 -0
- /package/dist/{chunk-M6HBPLBA.js.map → chunk-KOTG3RXE.js.map} +0 -0
- /package/dist/{chunk-OB3XMWX5.js.map → chunk-KVO2BTA4.js.map} +0 -0
- /package/dist/{chunk-CBFYCDYO.js.map → chunk-KY236SP5.js.map} +0 -0
- /package/dist/{chunk-4BCHFSC7.js.map → chunk-LFVZD5EC.js.map} +0 -0
- /package/dist/{chunk-GGAXFTNH.js.map → chunk-LKFVVN7R.js.map} +0 -0
- /package/dist/{chunk-4RX5O34R.js.map → chunk-MJC7UKH7.js.map} +0 -0
- /package/dist/{chunk-UZZ7SQT3.js.map → chunk-NVVZPBKI.js.map} +0 -0
- /package/dist/{chunk-TTSJ7WUC.js.map → chunk-PKUJNICO.js.map} +0 -0
- /package/dist/{chunk-QMWKENNK.js.map → chunk-Q4AUIFUA.js.map} +0 -0
- /package/dist/{chunk-G43PMSME.js.map → chunk-QE6YVNP5.js.map} +0 -0
- /package/dist/{chunk-GT4ZHOKT.js.map → chunk-QPVNK2VE.js.map} +0 -0
- /package/dist/{chunk-K5DA5TRG.js.map → chunk-QS5Q5RBV.js.map} +0 -0
- /package/dist/{chunk-BX4EOMKT.js.map → chunk-RDLPFM7I.js.map} +0 -0
- /package/dist/{chunk-EY5JAWZC.js.map → chunk-RJQAP333.js.map} +0 -0
- /package/dist/{chunk-2OGTN37H.js.map → chunk-ROEFLU37.js.map} +0 -0
- /package/dist/{chunk-62QIQEUC.js.map → chunk-SFHLQPBF.js.map} +0 -0
- /package/dist/{chunk-HVS7TH2Y.js.map → chunk-SUEOG2S4.js.map} +0 -0
- /package/dist/{chunk-74AHCL56.js.map → chunk-TEMKBSV6.js.map} +0 -0
- /package/dist/{chunk-KDFDXEXZ.js.map → chunk-TO36VPZI.js.map} +0 -0
- /package/dist/{chunk-M3MYMWXG.js.map → chunk-V2ZA4YWE.js.map} +0 -0
- /package/dist/{chunk-UIOIDW3L.js.map → chunk-VHKXRYQN.js.map} +0 -0
- /package/dist/{chunk-GAS7KYC7.js.map → chunk-VKWFNPBH.js.map} +0 -0
- /package/dist/{chunk-XGRXQR6T.js.map → chunk-VQWBUPSJ.js.map} +0 -0
- /package/dist/{chunk-TUKGXQ5T.js.map → chunk-VQYWKCDR.js.map} +0 -0
- /package/dist/{chunk-PPQEP4OH.js.map → chunk-W23JARAQ.js.map} +0 -0
- /package/dist/{chunk-YQNNHLCG.js.map → chunk-WPGR3RW4.js.map} +0 -0
- /package/dist/{chunk-474DL7UB.js.map → chunk-WZYHPAG5.js.map} +0 -0
- /package/dist/{chunk-GQQVEH6V.js.map → chunk-XM46Y66S.js.map} +0 -0
- /package/dist/{chunk-JNSENHV5.js.map → chunk-YRIFXXMI.js.map} +0 -0
- /package/dist/{chunk-TRLOFIQC.js.map → chunk-YTK5MVNF.js.map} +0 -0
- /package/dist/{chunk-VMNCZ627.js.map → chunk-YTZN2UZO.js.map} +0 -0
- /package/dist/{chunk-6ZMNTRU3.js.map → chunk-ZAEPD4C2.js.map} +0 -0
- /package/dist/{chunk-KQW3YGEN.js.map → chunk-ZRMMXWYI.js.map} +0 -0
- /package/dist/{chunk-MCRVQ5YQ.js.map → chunk-ZZCR2QYL.js.map} +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* recall-state-view-cron-intent.test.ts — issue #2893.
|
|
3
|
+
*
|
|
4
|
+
* Cron recall policy (buildRecallQueryPolicy) normalizes the retrieval
|
|
5
|
+
* query: standard prompts are truncated at maxChars, instruction-heavy
|
|
6
|
+
* prompts are compacted with stop-word removal ("when", "before",
|
|
7
|
+
* "after") plus a token cap. Either path can erase the change-intent
|
|
8
|
+
* signal that gates state views. These regressions pin:
|
|
9
|
+
*
|
|
10
|
+
* 1. Change intent is classified from the ORIGINAL prompt at the recall
|
|
11
|
+
* entry seam, so a long cron prompt whose intent phrase lies beyond
|
|
12
|
+
* the normalization cutoff still activates state views.
|
|
13
|
+
* 2. Only the validated boolean flows downstream: retrieval keeps the
|
|
14
|
+
* normalized query, and the inject seam does not re-classify intent
|
|
15
|
+
* against it when the per-request flag is threaded.
|
|
16
|
+
* 3. Negative controls: non-change prompts, flag-less calls, and the
|
|
17
|
+
* legacy config-only path (no threaded flag) keep prior behavior.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import assert from "node:assert/strict";
|
|
21
|
+
import os from "node:os";
|
|
22
|
+
import path from "node:path";
|
|
23
|
+
import { mkdtemp, mkdir, writeFile, rm } from "node:fs/promises";
|
|
24
|
+
import test from "node:test";
|
|
25
|
+
|
|
26
|
+
import { parseConfig } from "./config.js";
|
|
27
|
+
import { buildRecallQueryPolicy, type RecallQueryPolicyConfig } from "./recall-query-policy.js";
|
|
28
|
+
import { resolveRecallStateViewActive } from "./recall-state-view-admission.js";
|
|
29
|
+
import { annotateStateView, isChangeOrientedQuery, type StateViewResult } from "./recall-state-view.js";
|
|
30
|
+
import { widenRecallStateViews } from "./recall-state-view-widen.js";
|
|
31
|
+
import { applyRecallStateViews } from "./recall-state-view-wire.js";
|
|
32
|
+
import { Orchestrator } from "./orchestrator.js";
|
|
33
|
+
import type { PluginConfig } from "./types.js";
|
|
34
|
+
|
|
35
|
+
// No change-intent tokens; comfortably longer than the 120-char cutoff.
|
|
36
|
+
const FILLER =
|
|
37
|
+
"daily ops digest for platform delivery covering deploy notes on-call handoffs release cadence sprint board columns quota dashboards vendor invoices and rotating shift owners";
|
|
38
|
+
const LONG_CHANGE = `${FILLER} plus tell me when did the job title change`;
|
|
39
|
+
const LONG_NON_CHANGE = `${FILLER} plus confirm the current job title roster`;
|
|
40
|
+
const CRON_KEY = "sess:cron:nightly-digest";
|
|
41
|
+
const POLICY_CFG: RecallQueryPolicyConfig = {
|
|
42
|
+
cronRecallPolicyEnabled: true,
|
|
43
|
+
cronRecallNormalizedQueryMaxChars: 120,
|
|
44
|
+
cronRecallInstructionHeavyTokenCap: 8,
|
|
45
|
+
cronConversationRecallMode: "auto",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
test("fixtures: filler carries no intent and outruns the cutoff", () => {
|
|
49
|
+
assert.ok(FILLER.length >= 120, `filler must exceed maxChars, got ${FILLER.length}`);
|
|
50
|
+
assert.equal(isChangeOrientedQuery(FILLER), false);
|
|
51
|
+
assert.equal(isChangeOrientedQuery(LONG_CHANGE), true);
|
|
52
|
+
assert.equal(isChangeOrientedQuery(LONG_NON_CHANGE), false);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test("standard cron truncation erases intent from the normalized query", () => {
|
|
56
|
+
const policy = buildRecallQueryPolicy(LONG_CHANGE, CRON_KEY, POLICY_CFG);
|
|
57
|
+
assert.equal(policy.promptShape, "standard");
|
|
58
|
+
assert.equal(isChangeOrientedQuery(policy.retrievalQuery), false);
|
|
59
|
+
assert.ok(!policy.retrievalQuery.includes("when did"));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("instruction-heavy compaction erases intent from the normalized query", () => {
|
|
63
|
+
const lines = [
|
|
64
|
+
"GOAL: nightly infrastructure digest",
|
|
65
|
+
"OUTPUT FORMAT: markdown summary",
|
|
66
|
+
"TONE RULES: concise operator voice",
|
|
67
|
+
"GROUNDING RULES: cite memory ids",
|
|
68
|
+
];
|
|
69
|
+
for (let i = 0; i < 10; i += 1) lines.push(`- item-${i} inventory cluster-${i}`);
|
|
70
|
+
for (let i = 0; i < 14; i += 1) lines.push(`vendor ledger panel review segment ${i}`);
|
|
71
|
+
lines.push("finally answer when did the job title change");
|
|
72
|
+
const prompt = lines.join("\n");
|
|
73
|
+
|
|
74
|
+
const policy = buildRecallQueryPolicy(prompt, CRON_KEY, POLICY_CFG);
|
|
75
|
+
assert.equal(policy.promptShape, "instruction_heavy");
|
|
76
|
+
assert.equal(isChangeOrientedQuery(prompt), true);
|
|
77
|
+
assert.equal(isChangeOrientedQuery(policy.retrievalQuery), false);
|
|
78
|
+
assert.ok(!policy.retrievalQuery.includes("change"));
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("entry seam classifies the ORIGINAL prompt, not the normalized query (#2893)", () => {
|
|
82
|
+
const policy = buildRecallQueryPolicy(LONG_CHANGE, CRON_KEY, POLICY_CFG);
|
|
83
|
+
// Pre-fix shape: classifying the normalized query disables the view.
|
|
84
|
+
assert.equal(resolveRecallStateViewActive({ stateView: true }, {}, policy.retrievalQuery), false);
|
|
85
|
+
// Post-fix contract: the original prompt carries the signal.
|
|
86
|
+
assert.equal(resolveRecallStateViewActive({ stateView: true }, { recallStateViews: false }, LONG_CHANGE), true);
|
|
87
|
+
assert.equal(resolveRecallStateViewActive({}, { recallStateViews: true }, LONG_CHANGE), true);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("negative controls: non-change prompts and flag-less calls stay inactive", () => {
|
|
91
|
+
assert.equal(
|
|
92
|
+
resolveRecallStateViewActive({ stateView: true }, { recallStateViews: true }, LONG_NON_CHANGE),
|
|
93
|
+
false,
|
|
94
|
+
);
|
|
95
|
+
assert.equal(resolveRecallStateViewActive({}, {}, LONG_CHANGE), false);
|
|
96
|
+
assert.equal(
|
|
97
|
+
resolveRecallStateViewActive({ stateView: false }, { recallStateViews: false }, LONG_CHANGE),
|
|
98
|
+
false,
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("non-cron sessions keep the original prompt as the retrieval query", () => {
|
|
103
|
+
const policy = buildRecallQueryPolicy(LONG_CHANGE, "sess-interactive", POLICY_CFG);
|
|
104
|
+
assert.equal(policy.retrievalQuery, LONG_CHANGE);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
function fact(id: string, extra: Partial<StateViewResult> = {}): StateViewResult {
|
|
108
|
+
return { id, ...extra };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const CURRENT = fact("new-job", { status: "active" });
|
|
112
|
+
const HISTORICAL = fact("old-job", {
|
|
113
|
+
status: "superseded",
|
|
114
|
+
supersededBy: "new-job",
|
|
115
|
+
supersededAt: "2026-03-01",
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("threaded flag carries the decision past the normalized query at the inject seam (#2893)", () => {
|
|
119
|
+
const policy = buildRecallQueryPolicy(LONG_CHANGE, CRON_KEY, POLICY_CFG);
|
|
120
|
+
assert.equal(isChangeOrientedQuery(policy.retrievalQuery), false);
|
|
121
|
+
|
|
122
|
+
const labeled = widenRecallStateViews([CURRENT], policy.retrievalQuery, { recallStateViews: false }, [HISTORICAL], true);
|
|
123
|
+
assert.deepEqual(
|
|
124
|
+
labeled.map((row) => [row.id, row.stateLabel]),
|
|
125
|
+
[
|
|
126
|
+
["new-job", "current"],
|
|
127
|
+
["old-job", "historical"],
|
|
128
|
+
],
|
|
129
|
+
);
|
|
130
|
+
assert.deepEqual(
|
|
131
|
+
applyRecallStateViews([CURRENT, HISTORICAL], policy.retrievalQuery, { recallStateViews: false }, true).map(
|
|
132
|
+
(row) => row.stateLabel,
|
|
133
|
+
),
|
|
134
|
+
["current", "historical"],
|
|
135
|
+
);
|
|
136
|
+
assert.deepEqual(
|
|
137
|
+
annotateStateView([CURRENT, HISTORICAL], policy.retrievalQuery, [], {
|
|
138
|
+
enabled: true,
|
|
139
|
+
changeIntent: true,
|
|
140
|
+
}).map((row) => row.stateLabel),
|
|
141
|
+
["current", "historical"],
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("legacy config-only path still re-checks intent against the given query", () => {
|
|
146
|
+
const policy = buildRecallQueryPolicy(LONG_CHANGE, CRON_KEY, POLICY_CFG);
|
|
147
|
+
const input = [CURRENT, HISTORICAL];
|
|
148
|
+
// No threaded flag: config-on alone must not label a non-change query.
|
|
149
|
+
assert.equal(widenRecallStateViews(input, policy.retrievalQuery, { recallStateViews: true }), input);
|
|
150
|
+
assert.equal(applyRecallStateViews(input, policy.retrievalQuery, { recallStateViews: true }), input);
|
|
151
|
+
assert.equal(annotateStateView(input, policy.retrievalQuery, [], { enabled: true }), input);
|
|
152
|
+
assert.equal(input[0]?.stateLabel, undefined);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
async function makeOrchestrator(
|
|
156
|
+
overrides: Partial<PluginConfig> = {},
|
|
157
|
+
): Promise<{ orchestrator: Orchestrator; memoryDir: string }> {
|
|
158
|
+
const memoryDir = await mkdtemp(path.join(os.tmpdir(), "remnic-sv-cron-"));
|
|
159
|
+
const config = parseConfig({
|
|
160
|
+
openaiApiKey: "sk-test",
|
|
161
|
+
memoryDir,
|
|
162
|
+
workspaceDir: path.join(memoryDir, "workspace"),
|
|
163
|
+
qmdEnabled: false,
|
|
164
|
+
embeddingFallbackEnabled: false,
|
|
165
|
+
multiGraphMemoryEnabled: false,
|
|
166
|
+
entityGraphEnabled: false,
|
|
167
|
+
timeGraphEnabled: false,
|
|
168
|
+
causalGraphEnabled: false,
|
|
169
|
+
extractionJudgeEnabled: false,
|
|
170
|
+
temporalSupersessionEnabled: true,
|
|
171
|
+
temporalSupersessionIncludeInRecall: false,
|
|
172
|
+
contradictionDetectionEnabled: false,
|
|
173
|
+
chunkingEnabled: false,
|
|
174
|
+
extractionMinChars: 0,
|
|
175
|
+
extractionMinImportanceLevel: "trivial",
|
|
176
|
+
inlineSourceAttributionEnabled: false,
|
|
177
|
+
initGateTimeoutMs: 200,
|
|
178
|
+
...overrides,
|
|
179
|
+
});
|
|
180
|
+
return { orchestrator: new Orchestrator(config), memoryDir };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
async function writePair(memoryDir: string): Promise<void> {
|
|
184
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
185
|
+
const factsDir = path.join(memoryDir, "facts", today);
|
|
186
|
+
await mkdir(factsDir, { recursive: true });
|
|
187
|
+
const now = new Date().toISOString();
|
|
188
|
+
const successor = [
|
|
189
|
+
"---",
|
|
190
|
+
"id: sv-new",
|
|
191
|
+
"category: fact",
|
|
192
|
+
`created: ${now}`,
|
|
193
|
+
`updated: ${now}`,
|
|
194
|
+
"source: extraction",
|
|
195
|
+
"confidence: 0.8",
|
|
196
|
+
"confidenceTier: high",
|
|
197
|
+
"tags: []",
|
|
198
|
+
"status: active",
|
|
199
|
+
"---",
|
|
200
|
+
"",
|
|
201
|
+
"Current job title: Staff Engineer.",
|
|
202
|
+
"",
|
|
203
|
+
];
|
|
204
|
+
const predecessor = [
|
|
205
|
+
"---",
|
|
206
|
+
"id: sv-old",
|
|
207
|
+
"category: fact",
|
|
208
|
+
`created: ${now}`,
|
|
209
|
+
`updated: ${now}`,
|
|
210
|
+
"source: extraction",
|
|
211
|
+
"confidence: 0.8",
|
|
212
|
+
"confidenceTier: high",
|
|
213
|
+
"tags: []",
|
|
214
|
+
"status: superseded",
|
|
215
|
+
"supersededBy: sv-new",
|
|
216
|
+
"supersededAt: 2026-08-01",
|
|
217
|
+
"---",
|
|
218
|
+
"",
|
|
219
|
+
"Job title history: the job title used to be Senior Engineer.",
|
|
220
|
+
"",
|
|
221
|
+
];
|
|
222
|
+
await writeFile(path.join(factsDir, "sv-new.md"), `${successor.join("\n")}\n`, "utf-8");
|
|
223
|
+
await writeFile(path.join(factsDir, "sv-old.md"), `${predecessor.join("\n")}\n`, "utf-8");
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const CRON_E2E_CONFIG: Partial<PluginConfig> = {
|
|
227
|
+
cronRecallPolicyEnabled: true,
|
|
228
|
+
cronRecallNormalizedQueryMaxChars: 120,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
test("long cron prompt keeps per-call stateView labels when truncation erases intent (#2893)", async () => {
|
|
232
|
+
const { orchestrator, memoryDir } = await makeOrchestrator(CRON_E2E_CONFIG);
|
|
233
|
+
try {
|
|
234
|
+
await writePair(memoryDir);
|
|
235
|
+
const out = await orchestrator.recall(LONG_CHANGE, CRON_KEY, { stateView: true });
|
|
236
|
+
assert.ok(
|
|
237
|
+
out.includes("[superseded 2026-08-01 by sv-new]"),
|
|
238
|
+
`cron truncation must not erase the classified intent, got:\n${out}`,
|
|
239
|
+
);
|
|
240
|
+
} finally {
|
|
241
|
+
await orchestrator.destroy();
|
|
242
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
test("e2e negative: long cron prompt without intent stays unlabeled even with the flag", async () => {
|
|
247
|
+
const { orchestrator, memoryDir } = await makeOrchestrator(CRON_E2E_CONFIG);
|
|
248
|
+
try {
|
|
249
|
+
await writePair(memoryDir);
|
|
250
|
+
const out = await orchestrator.recall(LONG_NON_CHANGE, CRON_KEY, { stateView: true });
|
|
251
|
+
assert.ok(!out.includes("[superseded "), `non-change prompt must stay filtered, got:\n${out}`);
|
|
252
|
+
} finally {
|
|
253
|
+
await orchestrator.destroy();
|
|
254
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
test("e2e negative: long cron prompt with intent stays zero-diff without flags", async () => {
|
|
259
|
+
const { orchestrator, memoryDir } = await makeOrchestrator(CRON_E2E_CONFIG);
|
|
260
|
+
try {
|
|
261
|
+
await writePair(memoryDir);
|
|
262
|
+
const out = await orchestrator.recall(LONG_CHANGE, CRON_KEY);
|
|
263
|
+
assert.ok(!out.includes("[superseded "), `no flags must keep the injection byte-identical, got:\n${out}`);
|
|
264
|
+
} finally {
|
|
265
|
+
await orchestrator.destroy();
|
|
266
|
+
await rm(memoryDir, { recursive: true, force: true });
|
|
267
|
+
}
|
|
268
|
+
});
|
|
@@ -96,11 +96,20 @@ test("#1952 precedence is OR: per-call false never disables a global true", () =
|
|
|
96
96
|
assert.equal(labeled[1]?.stateLabel, "historical");
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
test("#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
test("#2893 threaded stateViewActive is trusted: no intent re-check at the seam", () => {
|
|
100
|
+
// The threaded flag means change intent was already classified on the
|
|
101
|
+
// ORIGINAL prompt at recall entry (resolveRecallStateViewActive); the
|
|
102
|
+
// query reaching this seam is the cron-normalized retrievalQuery and
|
|
103
|
+
// can lack the intent signal. Non-change ORIGINAL prompts never thread
|
|
104
|
+
// a true flag — pinned in recall-state-view-cron-intent.test.ts.
|
|
105
|
+
const labeled = widenRecallStateViews([CURRENT], NON_CHANGE, { recallStateViews: false }, [HISTORICAL], true);
|
|
106
|
+
assert.deepEqual(
|
|
107
|
+
labeled.map((row) => [row.id, row.stateLabel]),
|
|
108
|
+
[
|
|
109
|
+
["new-job", "current"],
|
|
110
|
+
["old-job", "historical"],
|
|
111
|
+
],
|
|
112
|
+
);
|
|
104
113
|
});
|
|
105
114
|
|
|
106
115
|
test("asOf mode keeps a pin-filtered predecessor and never widens the pool (#1952)", () => {
|
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
annotateStateView,
|
|
10
10
|
isChangeOrientedQuery,
|
|
11
11
|
parseRecallStateViews,
|
|
12
|
-
|
|
12
|
+
resultStateViewKey,
|
|
13
13
|
shouldWidenSuperseded,
|
|
14
|
+
stateViewKey,
|
|
14
15
|
type StateViewResult,
|
|
15
16
|
} from "./recall-state-view.js";
|
|
16
17
|
|
|
@@ -42,29 +43,49 @@ export function widenRecallStateViews<T extends StateViewResult>(
|
|
|
42
43
|
? config.recallStateViews
|
|
43
44
|
: undefined;
|
|
44
45
|
const enabled = stateViewActive === true || parseRecallStateViews(raw);
|
|
45
|
-
if (!enabled
|
|
46
|
+
if (!enabled) return results;
|
|
47
|
+
// #2893 — a threaded stateViewActive was gated on change intent
|
|
48
|
+
// classified from the ORIGINAL prompt at recall entry; `query` here is
|
|
49
|
+
// the cron-normalized retrievalQuery and may have lost the intent
|
|
50
|
+
// signal (truncation / stop-word compaction), so do not re-check it.
|
|
51
|
+
// Only the legacy config-only path re-checks intent against this query.
|
|
52
|
+
if (stateViewActive !== true && !isChangeOrientedQuery(query)) return results;
|
|
46
53
|
const asOfActive = typeof asOfMs === "number" && Number.isFinite(asOfMs);
|
|
47
54
|
|
|
55
|
+
// #2859: matches are namespace-qualified, and a successor's `supersedes`
|
|
56
|
+
// back-pointer anchors its predecessor even when the predecessor's own
|
|
57
|
+
// `supersededBy` is absent.
|
|
48
58
|
const candidateIds = new Set<string>();
|
|
59
|
+
const supersedesAnchors = new Set<string>();
|
|
49
60
|
for (const result of results) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
61
|
+
const key = resultStateViewKey(result);
|
|
62
|
+
if (!key) continue;
|
|
63
|
+
candidateIds.add(key);
|
|
64
|
+
if (result.supersedes) {
|
|
65
|
+
supersedesAnchors.add(stateViewKey(result.namespace, result.supersedes));
|
|
66
|
+
}
|
|
52
67
|
}
|
|
53
68
|
|
|
54
69
|
const seen = new Set(candidateIds);
|
|
55
70
|
const extra: T[] = [];
|
|
56
71
|
if (!asOfActive) {
|
|
57
72
|
for (const item of pool) {
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
60
|
-
|
|
73
|
+
const key = resultStateViewKey(item);
|
|
74
|
+
if (!key || seen.has(key)) continue;
|
|
75
|
+
const successorKey = item.supersededBy
|
|
76
|
+
? stateViewKey(item.namespace, item.supersededBy)
|
|
77
|
+
: undefined;
|
|
78
|
+
if (!shouldWidenSuperseded(successorKey, candidateIds) && !supersedesAnchors.has(key)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
61
81
|
extra.push(item);
|
|
62
|
-
seen.add(
|
|
82
|
+
seen.add(key);
|
|
63
83
|
}
|
|
64
84
|
}
|
|
65
85
|
|
|
66
86
|
return annotateStateView(extra.length > 0 ? results.concat(extra) : results, query, [], {
|
|
67
87
|
enabled: true,
|
|
88
|
+
...(stateViewActive === true ? { changeIntent: true } : {}),
|
|
68
89
|
...(asOfActive ? { asOfMs } : {}),
|
|
69
90
|
});
|
|
70
91
|
}
|
|
@@ -143,6 +143,7 @@ type LiveFixtureRow = StateViewLine & {
|
|
|
143
143
|
score: number;
|
|
144
144
|
supersededAt?: string;
|
|
145
145
|
supersededBy?: string;
|
|
146
|
+
supersedes?: string;
|
|
146
147
|
};
|
|
147
148
|
|
|
148
149
|
// Review round 2: the earlier follow-up ran `injectStateViewLines`, which has
|
|
@@ -176,6 +177,7 @@ function liveEntries(
|
|
|
176
177
|
stateLabel: result.stateLabel,
|
|
177
178
|
...(result.supersededAt ? { supersededAt: result.supersededAt } : {}),
|
|
178
179
|
...(result.supersededBy ? { supersededBy: result.supersededBy } : {}),
|
|
180
|
+
...(result.supersedes ? { supersedes: result.supersedes } : {}),
|
|
179
181
|
}));
|
|
180
182
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- test fixture
|
|
181
183
|
const widened = applyRecallStateViews(qmdResults as any[], query, config);
|
|
@@ -289,3 +291,31 @@ test("the live route still renders every current entry it was given", () => {
|
|
|
289
291
|
assert.match(entries[0]!, /the API limit is 100\/min/);
|
|
290
292
|
assert.match(entries[1]!, /we chose SQLite/);
|
|
291
293
|
});
|
|
294
|
+
|
|
295
|
+
test("the enabled route renders history for a supersedes-only pair", () => {
|
|
296
|
+
const results = [
|
|
297
|
+
{
|
|
298
|
+
memoryId: "m-1",
|
|
299
|
+
text: "we use PostgreSQL",
|
|
300
|
+
stateLabel: "current" as const,
|
|
301
|
+
score: 0.9,
|
|
302
|
+
supersedes: "m-0",
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
memoryId: "m-0",
|
|
306
|
+
text: "we use SQLite",
|
|
307
|
+
stateLabel: "current" as const,
|
|
308
|
+
supersededAt: "2026-08-01",
|
|
309
|
+
score: 0.7,
|
|
310
|
+
},
|
|
311
|
+
];
|
|
312
|
+
const query = "what changed about the database?";
|
|
313
|
+
const enabled = liveEntries(results, query, true);
|
|
314
|
+
const old = enabled.entries.find((entry) => entry.includes("we use SQLite"));
|
|
315
|
+
assert.equal(
|
|
316
|
+
enabled.widened.find((row) => row.id === "m-0")?.stateLabel,
|
|
317
|
+
"historical",
|
|
318
|
+
);
|
|
319
|
+
assert.ok(old, "enabled render includes the predecessor");
|
|
320
|
+
assert.match(old!, /\[superseded 2026-08-01 by m-1\] we use SQLite/);
|
|
321
|
+
});
|
|
@@ -3,9 +3,11 @@ import test from "node:test";
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
annotateStateView,
|
|
6
|
+
capStateViewPackets,
|
|
6
7
|
formatSupersededPrefix,
|
|
7
8
|
isChangeOrientedQuery,
|
|
8
9
|
parseRecallStateViews,
|
|
10
|
+
reconcileStateViewPairs,
|
|
9
11
|
shouldWidenSuperseded,
|
|
10
12
|
type StateViewChain,
|
|
11
13
|
type StateViewResult,
|
|
@@ -271,3 +273,162 @@ test("transitive orphan chains collapse: A→B→(C absent) drops both A and B",
|
|
|
271
273
|
"the fixpoint must drop A once B is dropped, not render a dangling historical",
|
|
272
274
|
);
|
|
273
275
|
});
|
|
276
|
+
|
|
277
|
+
test("#2859 reverse chain derives from the successor supersedes back-pointer when supersededBy is absent", () => {
|
|
278
|
+
const results = [
|
|
279
|
+
fact("new-job", { status: "active", supersedes: "old-job" }),
|
|
280
|
+
// Corrected row: no supersededBy, and even no "superseded" status —
|
|
281
|
+
// the ONLY link is the successor's back-pointer.
|
|
282
|
+
fact("old-job", {}),
|
|
283
|
+
];
|
|
284
|
+
const labeled = annotateStateView(results, "when did the job title change", [], { enabled: true });
|
|
285
|
+
assert.deepEqual(
|
|
286
|
+
labeled.map((row) => [row.id, row.stateLabel, row.supersededBy]),
|
|
287
|
+
[
|
|
288
|
+
["new-job", "current", undefined],
|
|
289
|
+
["old-job", "historical", "new-job"],
|
|
290
|
+
],
|
|
291
|
+
"the back-pointer must link the pair, admit the predecessor, and carry derived supersededBy",
|
|
292
|
+
);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
test("#2859 back-pointer pair survives the orphan fixpoint in both directions", () => {
|
|
296
|
+
const results = [
|
|
297
|
+
fact("v3", { status: "active", supersedes: "v2" }),
|
|
298
|
+
fact("v2", { status: "superseded", supersedes: "v1" }),
|
|
299
|
+
fact("v1", {}),
|
|
300
|
+
];
|
|
301
|
+
const labeled = annotateStateView(results, "what changed about the database", [], { enabled: true });
|
|
302
|
+
assert.deepEqual(
|
|
303
|
+
labeled.map((row) => [row.id, row.stateLabel]),
|
|
304
|
+
[
|
|
305
|
+
["v3", "current"],
|
|
306
|
+
["v2", "transition"],
|
|
307
|
+
["v1", "historical"],
|
|
308
|
+
],
|
|
309
|
+
);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
test("#2859 asOf label uses the validity boundary, not the supersededAt write time", () => {
|
|
313
|
+
const pin = Date.parse("2026-08-05T00:00:00.000Z");
|
|
314
|
+
// Write time January, validity flip September: at an August pin the row
|
|
315
|
+
// was still the live fact even though supersededAt PREDATES the pin.
|
|
316
|
+
const predecessor = fact("old-job", {
|
|
317
|
+
status: "superseded",
|
|
318
|
+
supersededBy: "new-job",
|
|
319
|
+
supersededAt: "2026-01-01T00:00:00.000Z",
|
|
320
|
+
invalidAt: "2026-09-01T00:00:00.000Z",
|
|
321
|
+
});
|
|
322
|
+
const labeled = annotateStateView([predecessor], "when did the job title change", [], {
|
|
323
|
+
enabled: true,
|
|
324
|
+
asOfMs: pin,
|
|
325
|
+
});
|
|
326
|
+
assert.equal(
|
|
327
|
+
labeled[0]?.stateLabel,
|
|
328
|
+
"current",
|
|
329
|
+
"the boundary is invalidAt, so a pin before the flip labels the row current-at-snapshot",
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
// Past the boundary the same row labels historical (boundary <= pin).
|
|
333
|
+
const afterFlip = annotateStateView([predecessor], "when did the job title change", [], {
|
|
334
|
+
enabled: true,
|
|
335
|
+
asOfMs: Date.parse("2026-09-05T00:00:00.000Z"),
|
|
336
|
+
});
|
|
337
|
+
assert.equal(
|
|
338
|
+
afterFlip[0]?.stateLabel,
|
|
339
|
+
"historical",
|
|
340
|
+
"a pin past the validity flip labels the row historical",
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
// Legacy row without a validity window keeps the supersededAt fallback.
|
|
344
|
+
const legacy = fact("old-legacy", {
|
|
345
|
+
status: "superseded",
|
|
346
|
+
supersededBy: "new-legacy",
|
|
347
|
+
supersededAt: "2026-01-01T00:00:00.000Z",
|
|
348
|
+
});
|
|
349
|
+
const legacyLabel = annotateStateView([legacy], "when did the job title change", [], {
|
|
350
|
+
enabled: true,
|
|
351
|
+
asOfMs: pin,
|
|
352
|
+
});
|
|
353
|
+
assert.equal(
|
|
354
|
+
legacyLabel[0]?.stateLabel,
|
|
355
|
+
"historical",
|
|
356
|
+
"no invalidAt → the supersededAt write time is the only recorded boundary",
|
|
357
|
+
);
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
test("#2859 namespace-qualified identities: same id across namespaces never cross-anchors", () => {
|
|
361
|
+
// ns-a has the superseded predecessor; ns-b has an UNRELATED row that
|
|
362
|
+
// happens to reuse the successor id. Bare-id matching would admit the
|
|
363
|
+
// ns-a predecessor on the ns-b anchor.
|
|
364
|
+
const results = [
|
|
365
|
+
fact("m-1", { namespace: "ns-b", status: "active" }),
|
|
366
|
+
fact("m-0", { namespace: "ns-a", status: "superseded", supersededBy: "m-1" }),
|
|
367
|
+
];
|
|
368
|
+
const labeled = annotateStateView(results, "when did this change", [], { enabled: true });
|
|
369
|
+
assert.deepEqual(
|
|
370
|
+
labeled.map((row) => row.id),
|
|
371
|
+
["m-1"],
|
|
372
|
+
"a foreign-namespace successor must not anchor the superseded row",
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
// Positive control: the same-namespace successor anchors it.
|
|
376
|
+
const anchored = annotateStateView(
|
|
377
|
+
[
|
|
378
|
+
fact("m-1", { namespace: "ns-a", status: "active" }),
|
|
379
|
+
fact("m-0", { namespace: "ns-a", status: "superseded", supersededBy: "m-1" }),
|
|
380
|
+
],
|
|
381
|
+
"when did this change",
|
|
382
|
+
[],
|
|
383
|
+
{ enabled: true },
|
|
384
|
+
);
|
|
385
|
+
assert.deepEqual(
|
|
386
|
+
anchored.map((row) => [row.id, row.stateLabel]),
|
|
387
|
+
[
|
|
388
|
+
["m-1", "current"],
|
|
389
|
+
["m-0", "historical"],
|
|
390
|
+
],
|
|
391
|
+
);
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test("#2859 namespace-qualified chains: a chain link never crosses namespaces", () => {
|
|
395
|
+
const chains: StateViewChain[] = [
|
|
396
|
+
{ predecessorId: "old", successorId: "new", namespace: "ns-a" },
|
|
397
|
+
];
|
|
398
|
+
const results = [
|
|
399
|
+
fact("new", { namespace: "ns-b", status: "active" }),
|
|
400
|
+
fact("old", { namespace: "ns-a", status: "superseded", supersededAt: "2026-02-01" }),
|
|
401
|
+
];
|
|
402
|
+
const labeled = annotateStateView(results, "before the correction what was it", chains, {
|
|
403
|
+
enabled: true,
|
|
404
|
+
});
|
|
405
|
+
assert.deepEqual(
|
|
406
|
+
labeled.map((row) => row.id),
|
|
407
|
+
["new"],
|
|
408
|
+
"the ns-a chain link must not pair against the ns-b successor",
|
|
409
|
+
);
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
test("reconcile drops a linkless superseded row so it cannot consume a packet slot", () => {
|
|
413
|
+
const rows = [
|
|
414
|
+
fact("legacy", { status: "superseded", supersededAt: "2026-01-01" }),
|
|
415
|
+
fact("live", { status: "active" }),
|
|
416
|
+
];
|
|
417
|
+
assert.deepEqual(
|
|
418
|
+
reconcileStateViewPairs(rows).map((row) => row.id),
|
|
419
|
+
["live"],
|
|
420
|
+
"audit/kill-switch status-only rows have no successor and must leave before the cap",
|
|
421
|
+
);
|
|
422
|
+
assert.deepEqual(
|
|
423
|
+
capStateViewPackets(reconcileStateViewPairs(rows), 1).map((row) => row.id),
|
|
424
|
+
["live"],
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
test("reconcile still keeps an unlinked active row", () => {
|
|
429
|
+
const rows = [fact("solo", { status: "active" })];
|
|
430
|
+
assert.deepEqual(
|
|
431
|
+
reconcileStateViewPairs(rows).map((row) => row.id),
|
|
432
|
+
["solo"],
|
|
433
|
+
);
|
|
434
|
+
});
|