@remnic/core 10.0.84 → 10.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.js +90 -88
- package/dist/access-authorization-probe.js +91 -89
- package/dist/access-boundary.d.ts.map +1 -1
- package/dist/access-boundary.js +90 -88
- package/dist/access-cli.js +198 -194
- package/dist/access-cli.js.map +1 -1
- package/dist/access-errors.d.ts +14 -0
- package/dist/access-errors.d.ts.map +1 -1
- package/dist/access-errors.js +5 -1
- package/dist/access-extraction-force-flush.js +90 -88
- package/dist/access-http-briefing.js +91 -89
- package/dist/access-http-query.js +92 -90
- package/dist/access-http.d.ts +12 -0
- package/dist/access-http.d.ts.map +1 -1
- package/dist/access-http.js +119 -116
- package/dist/access-identity-continuity-surface.js +90 -88
- package/dist/access-lcm-surface.js +90 -88
- package/dist/access-mcp-frames.d.ts +29 -0
- package/dist/access-mcp-frames.d.ts.map +1 -0
- package/dist/access-mcp-frames.js +10 -0
- package/dist/access-mcp.d.ts +1 -1
- package/dist/access-mcp.d.ts.map +1 -1
- package/dist/access-mcp.js +105 -102
- package/dist/access-memory-search-fanout.js +2 -2
- package/dist/access-namespace-preflight.js +90 -88
- package/dist/access-observe-write-category.js +15 -14
- package/dist/access-observe-write-surface.d.ts.map +1 -1
- package/dist/access-observe-write-surface.js +90 -88
- package/dist/access-offline-manifest.js +10 -10
- package/dist/access-operations-batch.js +94 -92
- package/dist/access-operations.js +101 -99
- package/dist/access-recall-concurrency.js +90 -88
- package/dist/access-recall-diagnostics.js +2 -2
- package/dist/access-recall-response.js +90 -88
- package/dist/access-recall-surface.js +90 -88
- package/dist/access-schema.d.ts.map +1 -1
- package/dist/access-schema.js +10 -9
- package/dist/access-service.d.ts +3 -3
- package/dist/access-service.d.ts.map +1 -1
- package/dist/access-service.js +90 -88
- package/dist/access-surface-catalog.js +92 -90
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-token-capabilities.js +2 -2
- package/dist/active-recall.js +38 -38
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/{auto-sync-C7E6G7Y2.js → auto-sync-3AZW7MXI.js} +6 -6
- package/dist/briefing-deadline.d.ts +2 -2
- package/dist/briefing-deadline.d.ts.map +1 -1
- package/dist/briefing-deadline.js +1 -1
- package/dist/briefing.js +25 -25
- package/dist/buffer-admission.d.ts +22 -0
- package/dist/buffer-admission.d.ts.map +1 -0
- package/dist/buffer-admission.js +13 -0
- package/dist/buffer-eviction.d.ts +4 -5
- package/dist/buffer-eviction.d.ts.map +1 -1
- package/dist/buffer-eviction.js +1 -1
- package/dist/buffer-persistence.d.ts +8 -4
- package/dist/buffer-persistence.d.ts.map +1 -1
- package/dist/buffer-persistence.js +1 -1
- package/dist/buffer-turn-helpers.d.ts +12 -0
- package/dist/buffer-turn-helpers.d.ts.map +1 -1
- package/dist/buffer-turn-helpers.js +9 -1
- package/dist/buffer-types.d.ts +24 -1
- package/dist/buffer-types.d.ts.map +1 -1
- package/dist/buffer.d.ts +21 -19
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +17 -13
- package/dist/calibration.js +3 -3
- package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/capsule-gunzip-KGBDGF7P.js +11 -0
- package/dist/capsule-gunzip-KGBDGF7P.js.map +1 -0
- package/dist/capsule-import-gate.d.ts +11 -0
- package/dist/capsule-import-gate.d.ts.map +1 -0
- package/dist/capsule-import-gate.js +12 -0
- package/dist/capsule-import-gate.js.map +1 -0
- package/dist/{capsule-merge-XVTQJJ6R.js → capsule-merge-2IIXFXN5.js} +5 -11
- package/dist/capsule-merge-2IIXFXN5.js.map +1 -0
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +27 -27
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-MSIRVXQ3.js → chunk-2G4TV2ML.js} +12 -12
- package/dist/{chunk-B74NPUHT.js → chunk-2JG2NI7C.js} +54 -54
- package/dist/chunk-2JG2NI7C.js.map +1 -0
- package/dist/{chunk-IR4C3DP2.js → chunk-2K3AUDH7.js} +2 -2
- package/dist/{chunk-2IW5PT7U.js → chunk-2N4OUSIA.js} +2 -2
- package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-QZSIDSB2.js → chunk-2NUDHVYM.js} +2 -2
- package/dist/{chunk-HPFVZPRH.js → chunk-2U4LMSEX.js} +3 -3
- package/dist/{chunk-WHQXWFH7.js → chunk-2XOFVTTT.js} +2 -2
- package/dist/{chunk-I6ORDT54.js → chunk-32CA7B6L.js} +2 -2
- package/dist/{chunk-T77AX6DG.js → chunk-32YX7EJ3.js} +4 -4
- package/dist/{chunk-HLKUZW42.js → chunk-3CTKEXXF.js} +144 -156
- package/dist/chunk-3CTKEXXF.js.map +1 -0
- package/dist/{chunk-HLWXCDUQ.js → chunk-3DAWHP5K.js} +5 -5
- package/dist/{chunk-ZJJFUEPO.js → chunk-3PJEDHLD.js} +2 -2
- package/dist/{chunk-PJYK7HH2.js → chunk-3UZ2VMKD.js} +2 -2
- package/dist/{chunk-IN4OFAHX.js → chunk-3Y5X6YFH.js} +2 -2
- package/dist/{chunk-YUTT4ZTI.js → chunk-45VUHDV2.js} +2 -2
- package/dist/{chunk-T6T2RMWW.js → chunk-4GMI5HFH.js} +12 -12
- package/dist/{chunk-YOEYL6CH.js → chunk-4LCVA2LW.js} +3 -3
- package/dist/{chunk-66JOLMWS.js → chunk-4X7HQKAG.js} +2 -2
- package/dist/{chunk-65SKM4BF.js → chunk-4XYAWK5H.js} +2 -2
- package/dist/{chunk-H7BZBSP6.js → chunk-52II7PB6.js} +4 -4
- package/dist/{chunk-TPX7XXY4.js → chunk-5SOSQTVE.js} +2 -2
- package/dist/{chunk-G3T6YMBO.js → chunk-64S6X4IU.js} +7 -7
- package/dist/{chunk-BK7AJUWB.js → chunk-6BCWFCDG.js} +7 -7
- package/dist/{chunk-V27FK6D6.js → chunk-6XTUZKCZ.js} +2 -2
- package/dist/{chunk-KASJJGRG.js → chunk-6ZELOK6O.js} +3 -8
- package/dist/chunk-6ZELOK6O.js.map +1 -0
- package/dist/{chunk-LECSS7EE.js → chunk-73UZZFJC.js} +3 -3
- package/dist/{chunk-4EACCIPO.js → chunk-77PDJ4OE.js} +3 -3
- package/dist/{chunk-GQZSGXR6.js → chunk-7GSL4LBG.js} +2 -2
- package/dist/{chunk-B6SPPYGJ.js → chunk-7IWRLYFJ.js} +2 -2
- package/dist/{chunk-R45L4TV6.js → chunk-7LCGFUMB.js} +6 -6
- package/dist/{chunk-A7BM2JTH.js → chunk-AJHNXIQU.js} +2 -2
- package/dist/{chunk-2D7BTSDW.js → chunk-ANZZLRUX.js} +2 -2
- package/dist/{chunk-ZXF3O7P4.js → chunk-ARRTLPRC.js} +2 -2
- package/dist/{chunk-S5CQI2KF.js → chunk-B3GKQ6DU.js} +2 -2
- package/dist/{chunk-XRBHIR7Q.js → chunk-B56LORLY.js} +2 -2
- package/dist/{chunk-KO3YBHOV.js → chunk-BIVKPQ6Q.js} +3 -3
- package/dist/{chunk-QZBTIYKD.js → chunk-BLSHFIR6.js} +7 -6
- package/dist/chunk-BLSHFIR6.js.map +1 -0
- package/dist/{chunk-54FDG7K7.js → chunk-C2HORX76.js} +3 -3
- package/dist/{chunk-WAD32CZG.js → chunk-CC4V7HNP.js} +43 -30
- package/dist/chunk-CC4V7HNP.js.map +1 -0
- package/dist/{chunk-LGEH473S.js → chunk-CJCTKL6Y.js} +9 -1
- package/dist/chunk-CJCTKL6Y.js.map +1 -0
- package/dist/{chunk-E33UJHY3.js → chunk-CN7Q3T2J.js} +4 -4
- package/dist/{chunk-YUTG35M4.js → chunk-CYCEROPR.js} +3 -3
- package/dist/{chunk-TFLPDNQV.js → chunk-D5EV6Y2L.js} +3 -3
- package/dist/{chunk-BFBS7OFQ.js → chunk-DC55RIEZ.js} +4 -4
- package/dist/{chunk-B4ZU34JQ.js → chunk-DT7SNJH6.js} +3 -3
- package/dist/{chunk-VLMBSGQF.js → chunk-DZ7DPDVW.js} +10 -8
- package/dist/chunk-DZ7DPDVW.js.map +1 -0
- package/dist/{chunk-FVRTCYZ3.js → chunk-EA2LA5RI.js} +2 -2
- package/dist/{chunk-WBN66HPI.js → chunk-ELHJK7LM.js} +6 -6
- package/dist/{chunk-77R7BQZ2.js → chunk-EQ4U73UH.js} +77 -24
- package/dist/chunk-EQ4U73UH.js.map +1 -0
- package/dist/{chunk-3JPTUCD7.js → chunk-EUBDYOLD.js} +32 -23
- package/dist/chunk-EUBDYOLD.js.map +1 -0
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-YAUHSNPB.js → chunk-F74G4KIH.js} +2 -2
- package/dist/{chunk-MPGLM2VU.js → chunk-FF3EFLUT.js} +7 -5
- package/dist/chunk-FF3EFLUT.js.map +1 -0
- package/dist/{chunk-BV2BRHD4.js → chunk-FHGWKODN.js} +2 -2
- package/dist/chunk-FKBGK3NC.js +62 -0
- package/dist/chunk-FKBGK3NC.js.map +1 -0
- package/dist/{chunk-X2KO4FK5.js → chunk-FNFURZBZ.js} +5 -5
- package/dist/chunk-FNFURZBZ.js.map +1 -0
- package/dist/{chunk-KESJ5XX3.js → chunk-G54BOKZ6.js} +2 -2
- package/dist/{chunk-YK7GOPIE.js → chunk-G67EUQAB.js} +9 -7
- package/dist/chunk-G67EUQAB.js.map +1 -0
- package/dist/{chunk-K36RMINQ.js → chunk-GOZXQNIM.js} +3 -3
- package/dist/{chunk-OQSSQOKQ.js → chunk-GULUWOA5.js} +2 -2
- package/dist/{chunk-K6RTQZA4.js → chunk-HFUKXOUW.js} +2 -2
- package/dist/{chunk-WV254W4V.js → chunk-HLN2HOXX.js} +2 -2
- package/dist/{chunk-FUOAIJKQ.js → chunk-IBDWYRDR.js} +3 -3
- package/dist/{chunk-Z3DDQXM4.js → chunk-IBGU6AN6.js} +45 -45
- package/dist/chunk-IBGU6AN6.js.map +1 -0
- package/dist/{chunk-AJG2TAMR.js → chunk-IEEV27BC.js} +2 -2
- package/dist/chunk-IGLJNHOX.js +62 -0
- package/dist/chunk-IGLJNHOX.js.map +1 -0
- package/dist/{chunk-LTDLJCMQ.js → chunk-IJ3OEECW.js} +4 -4
- package/dist/{chunk-BK4FBHZ3.js → chunk-IPD5GC7C.js} +3 -3
- package/dist/{chunk-KFLD7ZZG.js → chunk-IUKYFTGW.js} +3 -3
- package/dist/{chunk-GCAQ3VUJ.js → chunk-JM2YZKCQ.js} +2 -2
- package/dist/{chunk-BNQJKWWZ.js → chunk-K3FH3LAQ.js} +4 -4
- package/dist/{chunk-LU66I56Q.js → chunk-KVSOEVAF.js} +61 -12
- package/dist/chunk-KVSOEVAF.js.map +1 -0
- package/dist/chunk-M3BEJJNV.js +31 -0
- package/dist/chunk-M3BEJJNV.js.map +1 -0
- package/dist/{chunk-RZH5RVJC.js → chunk-MTTYIXSU.js} +2 -2
- package/dist/{chunk-XHGYZRVW.js → chunk-NIVKG3DS.js} +5 -5
- package/dist/{chunk-VZELUMKK.js → chunk-NQP4ZYGG.js} +2 -2
- package/dist/{chunk-7PMOCQOL.js → chunk-NT7F7WJQ.js} +192 -63
- package/dist/chunk-NT7F7WJQ.js.map +1 -0
- package/dist/{chunk-YO2JEX2Z.js → chunk-OGBQMY46.js} +2 -2
- package/dist/{chunk-TLHF75OR.js → chunk-OL553AWT.js} +12 -12
- package/dist/{chunk-CLVILSBR.js → chunk-OZNBZJ3S.js} +22 -22
- package/dist/{chunk-VUROWXFL.js → chunk-P452SEKO.js} +2 -2
- package/dist/{chunk-JX3E4XCW.js → chunk-PDOOUXCS.js} +2 -2
- package/dist/{chunk-6QYPL6NI.js → chunk-PKZ274PI.js} +3 -3
- package/dist/{chunk-KJCL2FZO.js → chunk-QD5R6U5J.js} +2 -2
- package/dist/{chunk-JRVMCZE3.js → chunk-QEYTRFR3.js} +2 -2
- package/dist/{chunk-VKDAJJQP.js → chunk-QEZ3DW5O.js} +11 -11
- package/dist/{chunk-WYPCJK6K.js → chunk-QKERFEJS.js} +2 -2
- package/dist/{chunk-BDN3TDGV.js → chunk-QKES7GU6.js} +2 -2
- package/dist/{chunk-PCQWKMOL.js → chunk-QNSZYTSG.js} +2 -2
- package/dist/chunk-QV2VZKD5.js +31 -0
- package/dist/chunk-QV2VZKD5.js.map +1 -0
- package/dist/{chunk-IZJQNDGI.js → chunk-R6HMAIKM.js} +2 -2
- package/dist/{chunk-CIIHIAJ2.js → chunk-ROGO7FRA.js} +6 -5
- package/dist/{chunk-CIIHIAJ2.js.map → chunk-ROGO7FRA.js.map} +1 -1
- package/dist/{chunk-NUSAAN75.js → chunk-ROKDHO74.js} +2 -2
- package/dist/{chunk-D5SSBCYY.js → chunk-RWGRSKN5.js} +7 -5
- package/dist/chunk-RWGRSKN5.js.map +1 -0
- package/dist/{chunk-FF6N7BXC.js → chunk-S45INSV3.js} +4 -4
- package/dist/{chunk-2RUTN7PR.js → chunk-S7GJNA3K.js} +2 -2
- package/dist/{chunk-XT45WCKX.js → chunk-SYKJBS7S.js} +10 -10
- package/dist/{chunk-5BE3FLKL.js → chunk-TAUHAP5J.js} +4 -4
- package/dist/{chunk-RJWL3RHB.js → chunk-TFEHSPGQ.js} +2 -2
- package/dist/{chunk-XYP5WBDO.js → chunk-TQ4SCPGQ.js} +76 -60
- package/dist/chunk-TQ4SCPGQ.js.map +1 -0
- package/dist/{chunk-K3B72DKJ.js → chunk-TRMZHGIX.js} +8 -8
- package/dist/{chunk-WBDIZWJQ.js → chunk-TSS3D7ZY.js} +2 -2
- package/dist/{chunk-6LCWKS62.js → chunk-UAUV3BWS.js} +104 -121
- package/dist/chunk-UAUV3BWS.js.map +1 -0
- package/dist/{chunk-KQUSP6LB.js → chunk-UDKWFDV2.js} +1 -1
- package/dist/chunk-UDKWFDV2.js.map +1 -0
- package/dist/{chunk-HQPFACXO.js → chunk-UH3FPX3L.js} +2 -2
- package/dist/{chunk-GGJFRVRD.js → chunk-US7KPQA5.js} +2 -2
- package/dist/{chunk-FJ2VJTGA.js → chunk-UWRHHRDK.js} +3 -3
- package/dist/{chunk-4KLQI3L2.js → chunk-UXXK523X.js} +40 -2
- package/dist/chunk-UXXK523X.js.map +1 -0
- package/dist/{chunk-SDESKFKT.js → chunk-UYHDMCY2.js} +2 -2
- package/dist/{chunk-3T3VHXUH.js → chunk-VKILERSL.js} +2 -2
- package/dist/{chunk-2TGIKMMZ.js → chunk-WXDTOE6F.js} +2 -2
- package/dist/{chunk-KQLBXUUQ.js → chunk-WYG5UNDY.js} +2 -2
- package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-MPDLLLOG.js → chunk-XO23OKMK.js} +9 -5
- package/dist/chunk-XO23OKMK.js.map +1 -0
- package/dist/{chunk-WC475JOG.js → chunk-XU37EJTW.js} +24 -24
- package/dist/chunk-XU37EJTW.js.map +1 -0
- package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
- package/dist/{chunk-QA3Y2O6H.js → chunk-YAVIBVCU.js} +2 -2
- package/dist/{chunk-2XJZLSXE.js → chunk-YL4UKMD7.js} +124 -58
- package/dist/chunk-YL4UKMD7.js.map +1 -0
- package/dist/{chunk-VPEIWMUT.js → chunk-YLTU2DC4.js} +2 -2
- package/dist/{chunk-HWHNQVRV.js → chunk-YMJRLT7S.js} +28 -8
- package/dist/chunk-YMJRLT7S.js.map +1 -0
- package/dist/{chunk-EBOHFZI4.js → chunk-YRZPBN46.js} +3 -3
- package/dist/{chunk-FMFCQRDM.js → chunk-ZANNIXXE.js} +3 -3
- package/dist/{chunk-HQGATKG2.js → chunk-ZBFLV657.js} +3 -3
- package/dist/{chunk-6L63IN3M.js → chunk-ZOJUWVAU.js} +1 -1
- package/dist/cli.js +144 -141
- package/dist/coding/export-okf-codegraph.js +24 -24
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +26 -26
- package/dist/config.js +35 -35
- package/dist/connectors/codex-materialize-runner.js +24 -24
- package/dist/connectors/index.js +28 -28
- package/dist/contradiction/index.js +4 -4
- package/dist/convergence-refresh.js +26 -26
- package/dist/corpus-watermark.js +28 -28
- package/dist/dashboard-runtime.js +2 -2
- package/dist/deep-recall-config.js +2 -2
- package/dist/deep-recall-http-glue.js +12 -12
- package/dist/entity-retrieval.js +25 -25
- package/dist/event-order-recall.js +2 -2
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.js +91 -89
- package/dist/extraction-evidence-class.js +2 -2
- package/dist/extraction-quote-grounding.d.ts +5 -1
- package/dist/extraction-quote-grounding.d.ts.map +1 -1
- package/dist/extraction-quote-grounding.js +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +3 -1
- package/dist/extraction-source-grounding-rules.d.ts.map +1 -1
- package/dist/extraction-source-grounding-rules.js +2 -2
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts.map +1 -1
- package/dist/extraction-source-grounding.js +5 -5
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction.d.ts.map +1 -1
- package/dist/extraction.js +43 -43
- package/dist/{first-start-migration-QVD22WWS.js → first-start-migration-A6PHIBUQ.js} +4 -4
- package/dist/{graph-edge-decay-CXTNJ7IQ.js → graph-edge-decay-EKWXRBWF.js} +5 -5
- package/dist/graph-edge-decay-EKWXRBWF.js.map +1 -0
- package/dist/graph-jsonl.js +3 -3
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.js +2 -2
- package/dist/harmonic-retrieval.js +24 -24
- package/dist/index.js +255 -251
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +5 -5
- package/dist/local-llm.js +3 -3
- package/dist/location/index.js +28 -28
- package/dist/maintenance/memory-governance.js +24 -24
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +24 -24
- package/dist/maintenance/rebuild-memory-projection-runner.js +26 -26
- package/dist/maintenance/rebuild-memory-projection.js +25 -25
- package/dist/memory-browse-http-glue.js +2 -2
- package/dist/memory-browse-operations.js +91 -89
- package/dist/memory-browse.js +5 -5
- package/dist/memory-subject.js +2 -2
- package/dist/namespaces/migrate.js +25 -25
- package/dist/namespaces/search.d.ts +9 -0
- package/dist/namespaces/search.d.ts.map +1 -1
- package/dist/namespaces/search.js +13 -7
- package/dist/namespaces/storage.js +24 -24
- package/dist/offline-sync-changeset-generations.js +3 -3
- package/dist/offline-sync-embedding-generation.js +2 -2
- package/dist/offline-sync-impression-drain.js +2 -2
- package/dist/offline-sync-snapshot-stream.js +6 -6
- package/dist/offline-sync.js +5 -5
- package/dist/operator-doctor-corpus.js +31 -31
- package/dist/operator-doctor-replica.js +4 -4
- package/dist/operator-toolkit.js +49 -49
- package/dist/orchestration/backlog-scheduler.d.ts +3 -2
- package/dist/orchestration/backlog-scheduler.d.ts.map +1 -1
- package/dist/orchestration/backlog-scheduler.js +209 -205
- package/dist/orchestration/backlog-scheduler.js.map +1 -1
- package/dist/orchestration/buffer-drain-runner.d.ts +6 -1
- package/dist/orchestration/buffer-drain-runner.d.ts.map +1 -1
- package/dist/orchestration/buffer-drain-runner.js +199 -195
- package/dist/orchestration/extraction-persist.d.ts.map +1 -1
- package/dist/orchestration/fact-dedup-window.d.ts +1 -4
- package/dist/orchestration/fact-dedup-window.d.ts.map +1 -1
- package/dist/orchestration/maintenance.js +41 -41
- package/dist/orchestration/turn-ingestion.d.ts +2 -9
- package/dist/orchestration/turn-ingestion.d.ts.map +1 -1
- package/dist/orchestrator.js +198 -194
- package/dist/provenance.js +2 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-navigation-http-glue.js +2 -2
- package/dist/recall-navigation-operations.js +91 -89
- package/dist/recall-navigation.js +90 -88
- package/dist/recall-state-view-admission.js +5 -5
- package/dist/recall-why-service.js +5 -5
- package/dist/reconcile/manifest.js +2 -2
- package/dist/replica-divergence.js +3 -3
- package/dist/{resolution-BNWE5Y25.js → resolution-23ZBDM6A.js} +5 -5
- package/dist/resolution-23ZBDM6A.js.map +1 -0
- package/dist/resume-bundles.js +36 -36
- package/dist/salvage-envelope.js +4 -4
- package/dist/search/factory.js +6 -6
- package/dist/search/index.js +12 -12
- package/dist/semantic-consolidation.js +25 -25
- package/dist/semantic-rule-promotion.js +24 -24
- package/dist/semantic-rule-verifier.js +24 -24
- package/dist/source-agent-qualifier.d.ts +2 -0
- package/dist/source-agent-qualifier.d.ts.map +1 -1
- package/dist/source-agent-qualifier.js +36 -36
- package/dist/standup/build.js +25 -25
- package/dist/storage/buffer-drain-claims.d.ts +18 -6
- package/dist/storage/buffer-drain-claims.d.ts.map +1 -1
- package/dist/storage/buffer-drain-claims.js +2 -2
- package/dist/storage/buffer-session-files.js +2 -2
- package/dist/storage/content-hash-index.d.ts +8 -0
- package/dist/storage/content-hash-index.d.ts.map +1 -1
- package/dist/storage.d.ts +10 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +23 -23
- package/dist/subject-config.js +3 -3
- package/dist/summarizer.js +4 -4
- package/dist/support-passport/index.js +93 -91
- package/dist/tokens.js +3 -3
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-gunzip.d.ts +14 -0
- package/dist/transfer/capsule-gunzip.d.ts.map +1 -0
- package/dist/transfer/capsule-import.d.ts.map +1 -1
- package/dist/transfer/capsule-import.js +3 -2
- package/dist/transfer/capsule-merge.d.ts.map +1 -1
- package/dist/transfer/export-okf.js +24 -24
- package/dist/verified-recall.js +24 -24
- package/dist/who-knows-cli.js +26 -26
- package/dist/who-knows.js +25 -25
- package/dist/write-envelope.js +3 -3
- package/package.json +2 -2
- package/src/access-boundary.ts +15 -0
- package/src/access-errors.ts +22 -0
- package/src/access-fleet-wide-work-peer.test.ts +236 -0
- package/src/access-http-peer-fleet-wide.test.ts +192 -0
- package/src/access-http.test.ts +249 -4
- package/src/access-http.ts +114 -39
- package/src/access-mcp-frames.test.ts +47 -0
- package/src/access-mcp-frames.ts +74 -0
- package/src/access-mcp.test.ts +210 -0
- package/src/access-mcp.ts +47 -37
- package/src/access-observe-replay-durability.test.ts +40 -4
- package/src/access-observe-write-surface.ts +4 -4
- package/src/access-operations-batch.ts +23 -12
- package/src/access-proto-injection.test.ts +340 -0
- package/src/access-schema.ts +31 -5
- package/src/access-service-capsule-import.test.ts +235 -0
- package/src/access-service.ts +6 -45
- package/src/backlog-scheduler.test.ts +443 -3
- package/src/briefing-deadline.ts +5 -4
- package/src/buffer-admission.ts +45 -0
- package/src/buffer-eviction-backpressure.test.ts +211 -0
- package/src/buffer-eviction.ts +8 -14
- package/src/buffer-incremental-persistence.test.ts +25 -37
- package/src/buffer-persistence.ts +15 -6
- package/src/buffer-session.test.ts +32 -16
- package/src/buffer-turn-helpers.ts +47 -0
- package/src/buffer-types.ts +28 -1
- package/src/buffer.ts +83 -91
- package/src/capsule-import-gate.ts +109 -0
- package/src/cli.ts +4 -4
- package/src/extraction-quote-grounding.test.ts +125 -0
- package/src/extraction-quote-grounding.ts +99 -25
- package/src/extraction-source-grounding-rules.ts +6 -1
- package/src/extraction-source-grounding.ts +2 -0
- package/src/extraction.ts +3 -4
- package/src/fact-dedup-window.test.ts +103 -20
- package/src/namespaces/search.test.ts +480 -1
- package/src/namespaces/search.ts +93 -10
- package/src/orchestration/backlog-scheduler.ts +13 -12
- package/src/orchestration/buffer-drain-runner.ts +40 -16
- package/src/orchestration/extraction-persist.ts +2 -10
- package/src/orchestration/fact-dedup-window.ts +5 -12
- package/src/orchestration/turn-ingestion.ts +38 -39
- package/src/recall-navigation-operations.ts +9 -2
- package/src/source-agent-qualifier.ts +3 -0
- package/src/storage/buffer-drain-claims.test.ts +330 -6
- package/src/storage/buffer-drain-claims.ts +226 -80
- package/src/storage/buffer-session-files.ts +2 -2
- package/src/storage/content-hash-index.ts +9 -0
- package/src/storage.ts +15 -0
- package/src/transfer/capsule-gunzip.ts +39 -0
- package/src/transfer/capsule-import.test.ts +73 -0
- package/src/transfer/capsule-import.ts +2 -2
- package/src/transfer/capsule-merge.test.ts +34 -0
- package/src/transfer/capsule-merge.ts +2 -10
- package/dist/capsule-merge-XVTQJJ6R.js.map +0 -1
- package/dist/chunk-2XJZLSXE.js.map +0 -1
- package/dist/chunk-3JPTUCD7.js.map +0 -1
- package/dist/chunk-4KLQI3L2.js.map +0 -1
- package/dist/chunk-6LCWKS62.js.map +0 -1
- package/dist/chunk-77R7BQZ2.js.map +0 -1
- package/dist/chunk-7PMOCQOL.js.map +0 -1
- package/dist/chunk-B74NPUHT.js.map +0 -1
- package/dist/chunk-D5SSBCYY.js.map +0 -1
- package/dist/chunk-HLKUZW42.js.map +0 -1
- package/dist/chunk-HWHNQVRV.js.map +0 -1
- package/dist/chunk-KASJJGRG.js.map +0 -1
- package/dist/chunk-KQUSP6LB.js.map +0 -1
- package/dist/chunk-LGEH473S.js.map +0 -1
- package/dist/chunk-LU66I56Q.js.map +0 -1
- package/dist/chunk-MPDLLLOG.js.map +0 -1
- package/dist/chunk-MPGLM2VU.js.map +0 -1
- package/dist/chunk-QZBTIYKD.js.map +0 -1
- package/dist/chunk-VLMBSGQF.js.map +0 -1
- package/dist/chunk-WAD32CZG.js.map +0 -1
- package/dist/chunk-WC475JOG.js.map +0 -1
- package/dist/chunk-X2KO4FK5.js.map +0 -1
- package/dist/chunk-XYP5WBDO.js.map +0 -1
- package/dist/chunk-YK7GOPIE.js.map +0 -1
- package/dist/chunk-Z3DDQXM4.js.map +0 -1
- /package/dist/{capsule-crypto-YO5QJ6L3.js.map → access-mcp-frames.js.map} +0 -0
- /package/dist/{auto-sync-C7E6G7Y2.js.map → auto-sync-3AZW7MXI.js.map} +0 -0
- /package/dist/{graph-edge-decay-CXTNJ7IQ.js.map → buffer-admission.js.map} +0 -0
- /package/dist/{resolution-BNWE5Y25.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-MSIRVXQ3.js.map → chunk-2G4TV2ML.js.map} +0 -0
- /package/dist/{chunk-IR4C3DP2.js.map → chunk-2K3AUDH7.js.map} +0 -0
- /package/dist/{chunk-2IW5PT7U.js.map → chunk-2N4OUSIA.js.map} +0 -0
- /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-QZSIDSB2.js.map → chunk-2NUDHVYM.js.map} +0 -0
- /package/dist/{chunk-HPFVZPRH.js.map → chunk-2U4LMSEX.js.map} +0 -0
- /package/dist/{chunk-WHQXWFH7.js.map → chunk-2XOFVTTT.js.map} +0 -0
- /package/dist/{chunk-I6ORDT54.js.map → chunk-32CA7B6L.js.map} +0 -0
- /package/dist/{chunk-T77AX6DG.js.map → chunk-32YX7EJ3.js.map} +0 -0
- /package/dist/{chunk-HLWXCDUQ.js.map → chunk-3DAWHP5K.js.map} +0 -0
- /package/dist/{chunk-ZJJFUEPO.js.map → chunk-3PJEDHLD.js.map} +0 -0
- /package/dist/{chunk-PJYK7HH2.js.map → chunk-3UZ2VMKD.js.map} +0 -0
- /package/dist/{chunk-IN4OFAHX.js.map → chunk-3Y5X6YFH.js.map} +0 -0
- /package/dist/{chunk-YUTT4ZTI.js.map → chunk-45VUHDV2.js.map} +0 -0
- /package/dist/{chunk-T6T2RMWW.js.map → chunk-4GMI5HFH.js.map} +0 -0
- /package/dist/{chunk-YOEYL6CH.js.map → chunk-4LCVA2LW.js.map} +0 -0
- /package/dist/{chunk-66JOLMWS.js.map → chunk-4X7HQKAG.js.map} +0 -0
- /package/dist/{chunk-65SKM4BF.js.map → chunk-4XYAWK5H.js.map} +0 -0
- /package/dist/{chunk-H7BZBSP6.js.map → chunk-52II7PB6.js.map} +0 -0
- /package/dist/{chunk-TPX7XXY4.js.map → chunk-5SOSQTVE.js.map} +0 -0
- /package/dist/{chunk-G3T6YMBO.js.map → chunk-64S6X4IU.js.map} +0 -0
- /package/dist/{chunk-BK7AJUWB.js.map → chunk-6BCWFCDG.js.map} +0 -0
- /package/dist/{chunk-V27FK6D6.js.map → chunk-6XTUZKCZ.js.map} +0 -0
- /package/dist/{chunk-LECSS7EE.js.map → chunk-73UZZFJC.js.map} +0 -0
- /package/dist/{chunk-4EACCIPO.js.map → chunk-77PDJ4OE.js.map} +0 -0
- /package/dist/{chunk-GQZSGXR6.js.map → chunk-7GSL4LBG.js.map} +0 -0
- /package/dist/{chunk-B6SPPYGJ.js.map → chunk-7IWRLYFJ.js.map} +0 -0
- /package/dist/{chunk-R45L4TV6.js.map → chunk-7LCGFUMB.js.map} +0 -0
- /package/dist/{chunk-A7BM2JTH.js.map → chunk-AJHNXIQU.js.map} +0 -0
- /package/dist/{chunk-2D7BTSDW.js.map → chunk-ANZZLRUX.js.map} +0 -0
- /package/dist/{chunk-ZXF3O7P4.js.map → chunk-ARRTLPRC.js.map} +0 -0
- /package/dist/{chunk-S5CQI2KF.js.map → chunk-B3GKQ6DU.js.map} +0 -0
- /package/dist/{chunk-XRBHIR7Q.js.map → chunk-B56LORLY.js.map} +0 -0
- /package/dist/{chunk-KO3YBHOV.js.map → chunk-BIVKPQ6Q.js.map} +0 -0
- /package/dist/{chunk-54FDG7K7.js.map → chunk-C2HORX76.js.map} +0 -0
- /package/dist/{chunk-E33UJHY3.js.map → chunk-CN7Q3T2J.js.map} +0 -0
- /package/dist/{chunk-YUTG35M4.js.map → chunk-CYCEROPR.js.map} +0 -0
- /package/dist/{chunk-TFLPDNQV.js.map → chunk-D5EV6Y2L.js.map} +0 -0
- /package/dist/{chunk-BFBS7OFQ.js.map → chunk-DC55RIEZ.js.map} +0 -0
- /package/dist/{chunk-B4ZU34JQ.js.map → chunk-DT7SNJH6.js.map} +0 -0
- /package/dist/{chunk-FVRTCYZ3.js.map → chunk-EA2LA5RI.js.map} +0 -0
- /package/dist/{chunk-WBN66HPI.js.map → chunk-ELHJK7LM.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-YAUHSNPB.js.map → chunk-F74G4KIH.js.map} +0 -0
- /package/dist/{chunk-BV2BRHD4.js.map → chunk-FHGWKODN.js.map} +0 -0
- /package/dist/{chunk-KESJ5XX3.js.map → chunk-G54BOKZ6.js.map} +0 -0
- /package/dist/{chunk-K36RMINQ.js.map → chunk-GOZXQNIM.js.map} +0 -0
- /package/dist/{chunk-OQSSQOKQ.js.map → chunk-GULUWOA5.js.map} +0 -0
- /package/dist/{chunk-K6RTQZA4.js.map → chunk-HFUKXOUW.js.map} +0 -0
- /package/dist/{chunk-WV254W4V.js.map → chunk-HLN2HOXX.js.map} +0 -0
- /package/dist/{chunk-FUOAIJKQ.js.map → chunk-IBDWYRDR.js.map} +0 -0
- /package/dist/{chunk-AJG2TAMR.js.map → chunk-IEEV27BC.js.map} +0 -0
- /package/dist/{chunk-LTDLJCMQ.js.map → chunk-IJ3OEECW.js.map} +0 -0
- /package/dist/{chunk-BK4FBHZ3.js.map → chunk-IPD5GC7C.js.map} +0 -0
- /package/dist/{chunk-KFLD7ZZG.js.map → chunk-IUKYFTGW.js.map} +0 -0
- /package/dist/{chunk-GCAQ3VUJ.js.map → chunk-JM2YZKCQ.js.map} +0 -0
- /package/dist/{chunk-BNQJKWWZ.js.map → chunk-K3FH3LAQ.js.map} +0 -0
- /package/dist/{chunk-RZH5RVJC.js.map → chunk-MTTYIXSU.js.map} +0 -0
- /package/dist/{chunk-XHGYZRVW.js.map → chunk-NIVKG3DS.js.map} +0 -0
- /package/dist/{chunk-VZELUMKK.js.map → chunk-NQP4ZYGG.js.map} +0 -0
- /package/dist/{chunk-YO2JEX2Z.js.map → chunk-OGBQMY46.js.map} +0 -0
- /package/dist/{chunk-TLHF75OR.js.map → chunk-OL553AWT.js.map} +0 -0
- /package/dist/{chunk-CLVILSBR.js.map → chunk-OZNBZJ3S.js.map} +0 -0
- /package/dist/{chunk-VUROWXFL.js.map → chunk-P452SEKO.js.map} +0 -0
- /package/dist/{chunk-JX3E4XCW.js.map → chunk-PDOOUXCS.js.map} +0 -0
- /package/dist/{chunk-6QYPL6NI.js.map → chunk-PKZ274PI.js.map} +0 -0
- /package/dist/{chunk-KJCL2FZO.js.map → chunk-QD5R6U5J.js.map} +0 -0
- /package/dist/{chunk-JRVMCZE3.js.map → chunk-QEYTRFR3.js.map} +0 -0
- /package/dist/{chunk-VKDAJJQP.js.map → chunk-QEZ3DW5O.js.map} +0 -0
- /package/dist/{chunk-WYPCJK6K.js.map → chunk-QKERFEJS.js.map} +0 -0
- /package/dist/{chunk-BDN3TDGV.js.map → chunk-QKES7GU6.js.map} +0 -0
- /package/dist/{chunk-PCQWKMOL.js.map → chunk-QNSZYTSG.js.map} +0 -0
- /package/dist/{chunk-IZJQNDGI.js.map → chunk-R6HMAIKM.js.map} +0 -0
- /package/dist/{chunk-NUSAAN75.js.map → chunk-ROKDHO74.js.map} +0 -0
- /package/dist/{chunk-FF6N7BXC.js.map → chunk-S45INSV3.js.map} +0 -0
- /package/dist/{chunk-2RUTN7PR.js.map → chunk-S7GJNA3K.js.map} +0 -0
- /package/dist/{chunk-XT45WCKX.js.map → chunk-SYKJBS7S.js.map} +0 -0
- /package/dist/{chunk-5BE3FLKL.js.map → chunk-TAUHAP5J.js.map} +0 -0
- /package/dist/{chunk-RJWL3RHB.js.map → chunk-TFEHSPGQ.js.map} +0 -0
- /package/dist/{chunk-K3B72DKJ.js.map → chunk-TRMZHGIX.js.map} +0 -0
- /package/dist/{chunk-WBDIZWJQ.js.map → chunk-TSS3D7ZY.js.map} +0 -0
- /package/dist/{chunk-HQPFACXO.js.map → chunk-UH3FPX3L.js.map} +0 -0
- /package/dist/{chunk-GGJFRVRD.js.map → chunk-US7KPQA5.js.map} +0 -0
- /package/dist/{chunk-FJ2VJTGA.js.map → chunk-UWRHHRDK.js.map} +0 -0
- /package/dist/{chunk-SDESKFKT.js.map → chunk-UYHDMCY2.js.map} +0 -0
- /package/dist/{chunk-3T3VHXUH.js.map → chunk-VKILERSL.js.map} +0 -0
- /package/dist/{chunk-2TGIKMMZ.js.map → chunk-WXDTOE6F.js.map} +0 -0
- /package/dist/{chunk-KQLBXUUQ.js.map → chunk-WYG5UNDY.js.map} +0 -0
- /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
- /package/dist/{chunk-QA3Y2O6H.js.map → chunk-YAVIBVCU.js.map} +0 -0
- /package/dist/{chunk-VPEIWMUT.js.map → chunk-YLTU2DC4.js.map} +0 -0
- /package/dist/{chunk-EBOHFZI4.js.map → chunk-YRZPBN46.js.map} +0 -0
- /package/dist/{chunk-FMFCQRDM.js.map → chunk-ZANNIXXE.js.map} +0 -0
- /package/dist/{chunk-HQGATKG2.js.map → chunk-ZBFLV657.js.map} +0 -0
- /package/dist/{chunk-6L63IN3M.js.map → chunk-ZOJUWVAU.js.map} +0 -0
- /package/dist/{first-start-migration-QVD22WWS.js.map → first-start-migration-A6PHIBUQ.js.map} +0 -0
|
@@ -67,7 +67,18 @@ function normalizeWhitespaceWithMap(source: string): { text: string; originalInd
|
|
|
67
67
|
return { text: chars.join(""), originalIndex };
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function
|
|
70
|
+
function turnStartOffsets(source: string, turns: readonly string[]): readonly number[] | undefined {
|
|
71
|
+
const offsets: number[] = [];
|
|
72
|
+
let at = 0;
|
|
73
|
+
for (const turn of turns) {
|
|
74
|
+
if (!source.startsWith(turn, at)) return undefined;
|
|
75
|
+
offsets.push(at);
|
|
76
|
+
at += turn.length + TURN_SEPARATOR.length;
|
|
77
|
+
}
|
|
78
|
+
return at - TURN_SEPARATOR.length === source.length ? offsets : undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function findQuoteAnchors(quote: string, source: string, bounds?: readonly number[]): QuoteAnchor[] {
|
|
71
82
|
const needle = quote.replace(/\s+/gu, " ").trim();
|
|
72
83
|
if (needle.length < QUOTE_ANCHOR_MIN_CHARS) return [];
|
|
73
84
|
const normalized = normalizeWhitespaceWithMap(source);
|
|
@@ -79,17 +90,36 @@ function findQuoteAnchors(quote: string, source: string): QuoteAnchor[] {
|
|
|
79
90
|
from = at + 1;
|
|
80
91
|
const start = normalized.originalIndex[at]!;
|
|
81
92
|
const end = normalized.originalIndex[at + needle.length - 1]! + 1;
|
|
82
|
-
if (source.slice(start, end).includes(TURN_SEPARATOR)) continue;
|
|
83
|
-
|
|
84
|
-
let before = source.slice(Math.max(0, start - QUOTE_ANCHOR_CONTEXT_CHARS), start);
|
|
85
|
-
const turnStart = before.lastIndexOf(TURN_SEPARATOR);
|
|
86
|
-
if (turnStart >= 0) before = before.slice(turnStart + TURN_SEPARATOR.length);
|
|
87
|
-
else if (start > QUOTE_ANCHOR_CONTEXT_CHARS) before = before.replace(/^\S+/u, "");
|
|
88
93
|
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
if (
|
|
92
|
-
|
|
94
|
+
let before: string;
|
|
95
|
+
let after: string;
|
|
96
|
+
if (bounds === undefined) {
|
|
97
|
+
if (source.slice(start, end).includes(TURN_SEPARATOR)) continue;
|
|
98
|
+
before = source.slice(Math.max(0, start - QUOTE_ANCHOR_CONTEXT_CHARS), start);
|
|
99
|
+
const sepBefore = before.lastIndexOf(TURN_SEPARATOR);
|
|
100
|
+
if (sepBefore >= 0) before = before.slice(sepBefore + TURN_SEPARATOR.length);
|
|
101
|
+
else if (start > QUOTE_ANCHOR_CONTEXT_CHARS) before = before.replace(/^\S+/u, "");
|
|
102
|
+
after = source.slice(end, end + QUOTE_ANCHOR_CONTEXT_CHARS);
|
|
103
|
+
const sepAfter = after.indexOf(TURN_SEPARATOR);
|
|
104
|
+
if (sepAfter >= 0) after = after.slice(0, sepAfter);
|
|
105
|
+
else if (source.length - end > QUOTE_ANCHOR_CONTEXT_CHARS) after = after.replace(/\S+$/u, "");
|
|
106
|
+
} else {
|
|
107
|
+
let turnStart = 0;
|
|
108
|
+
let turnEnd = source.length;
|
|
109
|
+
for (const bound of bounds) {
|
|
110
|
+
if (bound <= start) turnStart = bound;
|
|
111
|
+
else {
|
|
112
|
+
turnEnd = bound - TURN_SEPARATOR.length;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (turnEnd < end) continue;
|
|
117
|
+
before = source.slice(Math.max(turnStart, start - QUOTE_ANCHOR_CONTEXT_CHARS), start);
|
|
118
|
+
if (start - QUOTE_ANCHOR_CONTEXT_CHARS > turnStart) before = before.replace(/^\S+/u, "");
|
|
119
|
+
const contextEnd = Math.min(turnEnd, end + QUOTE_ANCHOR_CONTEXT_CHARS);
|
|
120
|
+
after = source.slice(end, contextEnd);
|
|
121
|
+
if (end + QUOTE_ANCHOR_CONTEXT_CHARS < turnEnd) after = after.replace(/\S+$/u, "");
|
|
122
|
+
}
|
|
93
123
|
|
|
94
124
|
anchors.push({ quote: needle, window: `${before}${needle.replace(/;/gu, ",")}${after}` });
|
|
95
125
|
}
|
|
@@ -109,16 +139,22 @@ function findQuoteAnchors(quote: string, source: string): QuoteAnchor[] {
|
|
|
109
139
|
* `source` may have been rewritten before grounding (temporal anchoring,
|
|
110
140
|
* pronoun resolution) while the model quoted the original words. When the raw
|
|
111
141
|
* quote is not found, `transformQuote` applies the same rewrite to the quote.
|
|
142
|
+
*
|
|
143
|
+
* `turns` are the texts `source` was joined from; when they tile `source`
|
|
144
|
+
* exactly, quotes and windows cut at real turn boundaries instead of any
|
|
145
|
+
* blank line. Without them, every `TURN_SEPARATOR` run is a boundary.
|
|
112
146
|
*/
|
|
113
147
|
export function quoteAnchors(
|
|
114
148
|
quote: string | undefined,
|
|
115
149
|
source: string,
|
|
116
150
|
transformQuote?: (quote: string) => string,
|
|
151
|
+
turns?: readonly string[],
|
|
117
152
|
): QuoteAnchor[] {
|
|
118
153
|
if (typeof quote !== "string") return [];
|
|
119
|
-
const
|
|
154
|
+
const bounds = turns === undefined ? undefined : turnStartOffsets(source, turns);
|
|
155
|
+
const exact = findQuoteAnchors(quote, source, bounds);
|
|
120
156
|
if (exact.length > 0 || transformQuote === undefined) return exact;
|
|
121
|
-
return findQuoteAnchors(transformQuote(quote), source);
|
|
157
|
+
return findQuoteAnchors(transformQuote(quote), source, bounds);
|
|
122
158
|
}
|
|
123
159
|
|
|
124
160
|
export function tokenPool(tokens: ReadonlySet<string>): TokenPool {
|
|
@@ -130,24 +166,62 @@ function hasNegation(text: string): boolean {
|
|
|
130
166
|
return NEGATOR_PATTERN.test(text.replace(/[\u2018\u2019]/gu, "'")) || hasDenialReporting(text);
|
|
131
167
|
}
|
|
132
168
|
|
|
169
|
+
const CLAUSE_PATTERN = /[^;.!?\n]+[;.!?]*/gu;
|
|
170
|
+
/** Split "X, and Y" claim coordination without touching list commas. */
|
|
171
|
+
const CLAIM_COORD_SPLIT = /,\s{1,8}(?:and|but|or|nor)\s{1,8}/iu;
|
|
172
|
+
|
|
173
|
+
function splitClaimClauses(content: string): string[] {
|
|
174
|
+
return (content.match(CLAUSE_PATTERN) ?? [content]).flatMap((clause) => {
|
|
175
|
+
const parts = clause
|
|
176
|
+
.split(CLAIM_COORD_SPLIT)
|
|
177
|
+
.map((part) => part.trim())
|
|
178
|
+
.filter((part) => part.length > 0);
|
|
179
|
+
return parts.length > 0 ? parts : [clause];
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function clauseOverlap(clauseTokens: readonly string[], target: string) {
|
|
184
|
+
const has = tokenPool(tokenize(target));
|
|
185
|
+
const shared = clauseTokens.filter(has).length;
|
|
186
|
+
return { shared, ratio: clauseTokens.length === 0 ? 0 : shared / clauseTokens.length };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** What a quote clause's first negator governs: the words after it. */
|
|
190
|
+
function negatedScope(clause: string): string {
|
|
191
|
+
const match = NEGATOR_PATTERN.exec(clause.replace(/[\u2018\u2019]/gu, "'"));
|
|
192
|
+
return match ? clause.slice(match.index + match[0].length) : clause;
|
|
193
|
+
}
|
|
194
|
+
|
|
133
195
|
/**
|
|
134
196
|
* True when the claim asserts what a quote clause denies or does not assert:
|
|
135
197
|
* "did not approve the budget" or "denied approving it" restated as "approved
|
|
136
198
|
* the budget", "suspects Bob stole funds" or "Is Alice the CEO?" restated as a
|
|
137
|
-
* plain statement.
|
|
138
|
-
*
|
|
199
|
+
* plain statement. The claim must restate the quote clause, and none of its
|
|
200
|
+
* clauses that share a word with what the negator governs may keep the
|
|
201
|
+
* negator, exclusion word, or reporting marker ("do not X" reworded as "X is
|
|
202
|
+
* excluded", or "Alice reviewed it, but she did not approve it"). A negator in
|
|
203
|
+
* a clause about something else does not count, so a claim that keeps one
|
|
204
|
+
* quote negation can still misstate another quote clause, and a claim clause
|
|
205
|
+
* that shares only the subject does not satisfy the check.
|
|
139
206
|
*/
|
|
140
207
|
function misstatesQuote(content: string, quote: string): boolean {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
208
|
+
const claimClauses = splitClaimClauses(content);
|
|
209
|
+
return (quote.match(CLAUSE_PATTERN) ?? []).some((quoteClause) => {
|
|
210
|
+
const needsNegation = hasNegation(quoteClause);
|
|
211
|
+
const needsReporting = quoteClause.trim().endsWith("?") || hasNonAssertiveReporting(quoteClause);
|
|
212
|
+
if (!needsNegation && !needsReporting) return false;
|
|
213
|
+
const clauseTokens = [...tokenize(quoteClause)];
|
|
214
|
+
const whole = clauseOverlap(clauseTokens, content);
|
|
215
|
+
if (whole.shared < GROUNDING_MIN_SHARED_TOKENS || whole.ratio < 0.5) return false;
|
|
216
|
+
const clausesSharing = (tokens: readonly string[]) =>
|
|
217
|
+
claimClauses.filter((claimClause) => clauseOverlap(tokens, claimClause).shared > 0);
|
|
218
|
+
if (needsNegation) {
|
|
219
|
+
const scopeTokens = [...tokenize(negatedScope(quoteClause))];
|
|
220
|
+
const related = clausesSharing(scopeTokens.length > 0 ? scopeTokens : clauseTokens);
|
|
221
|
+
if (!related.some((text) => hasNegation(text) || EXCLUSION_PATTERN.test(text))) return true;
|
|
222
|
+
}
|
|
223
|
+
return needsReporting
|
|
224
|
+
&& !clausesSharing(clauseTokens).some((text) => hasNonAssertiveReporting(text) || text.trim().endsWith("?"));
|
|
151
225
|
});
|
|
152
226
|
}
|
|
153
227
|
|
|
@@ -43,6 +43,8 @@ export interface ExtractionSourceGroundingOptions {
|
|
|
43
43
|
spanMode?: "off" | "shadow" | "on";
|
|
44
44
|
/** Rewrite applied to the source before this stage, so a verbatim quote can still be located in it. */
|
|
45
45
|
quoteTransform?: (quote: string) => string;
|
|
46
|
+
/** Turn texts the sources were joined from, so quote anchors cut at real turn boundaries. */
|
|
47
|
+
turns?: readonly string[];
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export function applyExtractionSourceGrounding(
|
|
@@ -68,6 +70,7 @@ export function applyExtractionSourceGrounding(
|
|
|
68
70
|
? undefined
|
|
69
71
|
: anchorSource(roleAssertionSources.identity),
|
|
70
72
|
};
|
|
73
|
+
const anchoredTurns = options.turns === undefined ? undefined : options.turns.map((turn) => anchorSource(turn));
|
|
71
74
|
return filterExtractionResultBySource(
|
|
72
75
|
result,
|
|
73
76
|
anchorSource(sourceText),
|
|
@@ -78,6 +81,7 @@ export function applyExtractionSourceGrounding(
|
|
|
78
81
|
options.anchorTemporalExpressions
|
|
79
82
|
? (quote) => anchorSource(options.quoteTransform?.(quote) ?? quote)
|
|
80
83
|
: undefined,
|
|
84
|
+
anchoredTurns,
|
|
81
85
|
);
|
|
82
86
|
}
|
|
83
87
|
|
|
@@ -1117,6 +1121,7 @@ export function filterExtractionResultBySource(
|
|
|
1117
1121
|
eventTimeNormalizer?: (eventTime: string) => string,
|
|
1118
1122
|
spanMode: "off" | "shadow" | "on" = "off",
|
|
1119
1123
|
quoteTransform?: (quote: string) => string,
|
|
1124
|
+
turns?: readonly string[],
|
|
1120
1125
|
): ExtractionResult {
|
|
1121
1126
|
if (source.trim().length === 0) {
|
|
1122
1127
|
return {
|
|
@@ -1136,7 +1141,7 @@ export function filterExtractionResultBySource(
|
|
|
1136
1141
|
result.facts.some((fact) => typeof fact.quote === "string") ? tokenize(quoteSource) : new Set(),
|
|
1137
1142
|
);
|
|
1138
1143
|
const facts = result.facts.flatMap((fact) => {
|
|
1139
|
-
const anchors = quoteAnchors(fact.quote, quoteSource, quoteTransform);
|
|
1144
|
+
const anchors = quoteAnchors(fact.quote, quoteSource, quoteTransform, turns);
|
|
1140
1145
|
const grounded = filterGroundedFact(
|
|
1141
1146
|
fact,
|
|
1142
1147
|
source,
|
|
@@ -101,6 +101,7 @@ export function filterExtractionResultBySource(
|
|
|
101
101
|
eventTimeNormalizer?: (eventTime: string) => string,
|
|
102
102
|
spanMode: "off" | "shadow" | "on" = "off",
|
|
103
103
|
quoteTransform?: (quote: string) => string,
|
|
104
|
+
turns?: readonly string[],
|
|
104
105
|
): ExtractionResult {
|
|
105
106
|
return filterGroundingRules(
|
|
106
107
|
result,
|
|
@@ -110,5 +111,6 @@ export function filterExtractionResultBySource(
|
|
|
110
111
|
eventTimeNormalizer,
|
|
111
112
|
spanMode,
|
|
112
113
|
quoteTransform,
|
|
114
|
+
turns,
|
|
113
115
|
);
|
|
114
116
|
}
|
package/src/extraction.ts
CHANGED
|
@@ -1122,10 +1122,8 @@ export class ExtractionEngine {
|
|
|
1122
1122
|
const groundingSource = boundedTurns
|
|
1123
1123
|
.map((turn) => turn.content)
|
|
1124
1124
|
.join("\n\n");
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
.map((turn) => turn.content)
|
|
1128
|
-
.join("\n\n");
|
|
1125
|
+
const assertionTurns = boundedTurns.filter((turn) => turn.extractionContextOnly !== true);
|
|
1126
|
+
const assertionSource = assertionTurns.map((turn) => turn.content).join("\n\n");
|
|
1129
1127
|
const roleAssertionSources: ExtractionGroundingRoleSources = {
|
|
1130
1128
|
profile: boundedTurns
|
|
1131
1129
|
.filter((turn) => turn.role === "user" && turn.extractionContextOnly !== true)
|
|
@@ -1171,6 +1169,7 @@ export class ExtractionEngine {
|
|
|
1171
1169
|
sourceConnector,
|
|
1172
1170
|
ambientCapture,
|
|
1173
1171
|
scopeClassificationEnabled: lifecycleCaps.extractionScopeClassification,
|
|
1172
|
+
turns: assertionTurns.map((turn) => turn.content),
|
|
1174
1173
|
};
|
|
1175
1174
|
|
|
1176
1175
|
const traceId = crypto.randomUUID();
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import test from "node:test";
|
|
1
|
+
import test, { mock } from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import { mkdtemp, rm } from "node:fs/promises";
|
|
3
|
+
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { StorageManager } from "./storage.js";
|
|
7
7
|
import { withHeldFileLock } from "./utils/serialize-mutations.js";
|
|
8
8
|
import { confirmActiveFactDuplicate, persistUnderFactDedupWindow } from "./orchestration/fact-dedup-window.js";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const SKY_OPTS = {
|
|
11
|
+
category: "fact",
|
|
12
|
+
contentHashDedupKey: "the sky is blue",
|
|
13
|
+
connector: undefined,
|
|
14
|
+
citationEnabled: false,
|
|
15
|
+
citationTemplate: "",
|
|
16
|
+
} as const;
|
|
17
|
+
const CONTENDED_LOCK_OPTIONS = { maxWaitMs: 40, pollMs: 10, retryMaxAttempts: 2, retryBaseMs: 10 };
|
|
18
|
+
|
|
19
|
+
/** Hold a fresh fact-hash index lock the way a peer mid-publish does; returns the release. */
|
|
20
|
+
async function holdIndexLock(root: string): Promise<() => Promise<void>> {
|
|
21
|
+
const lockPath = path.join(root, "state", "fact-hashes.txt.lock");
|
|
22
|
+
await mkdir(path.dirname(lockPath), { recursive: true });
|
|
23
|
+
await writeFile(lockPath, `99999 peer-owner ${new Date().toISOString()}\n`);
|
|
24
|
+
return () => rm(lockPath, { force: true });
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
async function makeStorage(): Promise<{ storage: StorageManager; cleanup: () => Promise<void> }> {
|
|
@@ -19,14 +32,7 @@ async function makeStorage(): Promise<{ storage: StorageManager; cleanup: () =>
|
|
|
19
32
|
test("confirmActiveFactDuplicate sees a fact another session committed into the same namespace", async () => {
|
|
20
33
|
const { storage, cleanup } = await makeStorage();
|
|
21
34
|
try {
|
|
22
|
-
const recheck = () =>
|
|
23
|
-
confirmActiveFactDuplicate(probe(storage), storage, {
|
|
24
|
-
category: "fact",
|
|
25
|
-
contentHashDedupKey: "the sky is blue",
|
|
26
|
-
connector: undefined,
|
|
27
|
-
citationEnabled: false,
|
|
28
|
-
citationTemplate: "",
|
|
29
|
-
});
|
|
35
|
+
const recheck = () => confirmActiveFactDuplicate(storage, SKY_OPTS);
|
|
30
36
|
assert.equal(await recheck(), false, "clean namespace must not report a duplicate");
|
|
31
37
|
|
|
32
38
|
// A concurrent session (separate manager, same dir) commits the fact.
|
|
@@ -48,14 +54,7 @@ test("persistUnderFactDedupWindow suppresses on recheck hit and writes on a miss
|
|
|
48
54
|
await storage.writeMemory("fact", "the sky is blue");
|
|
49
55
|
return "written";
|
|
50
56
|
};
|
|
51
|
-
const recheck = () =>
|
|
52
|
-
confirmActiveFactDuplicate(probe(storage), storage, {
|
|
53
|
-
category: "fact",
|
|
54
|
-
contentHashDedupKey: "the sky is blue",
|
|
55
|
-
connector: undefined,
|
|
56
|
-
citationEnabled: false,
|
|
57
|
-
citationTemplate: "",
|
|
58
|
-
});
|
|
57
|
+
const recheck = () => confirmActiveFactDuplicate(storage, SKY_OPTS);
|
|
59
58
|
|
|
60
59
|
// First session: recheck misses, write proceeds.
|
|
61
60
|
const first = await persistUnderFactDedupWindow(storage["baseDir"], recheck, write);
|
|
@@ -114,3 +113,87 @@ test("persistUnderFactDedupWindow fails closed when a peer holds fact-dedup.lock
|
|
|
114
113
|
await cleanup();
|
|
115
114
|
}
|
|
116
115
|
});
|
|
116
|
+
|
|
117
|
+
test("lookupContentHash never pairs a stale MISS with authority while a peer holds the index lock", async () => {
|
|
118
|
+
const { storage, cleanup } = await makeStorage();
|
|
119
|
+
try {
|
|
120
|
+
storage.factHashIndexLockOptions = CONTENDED_LOCK_OPTIONS;
|
|
121
|
+
assert.equal(await storage.isFactContentHashAuthoritative(), true, "starts authoritative");
|
|
122
|
+
const peer = new StorageManager(storage["baseDir"]);
|
|
123
|
+
await peer.writeMemory("fact", "The sky is BLUE!");
|
|
124
|
+
const release = await holdIndexLock(storage["baseDir"]);
|
|
125
|
+
try {
|
|
126
|
+
assert.deepEqual(
|
|
127
|
+
await storage.lookupContentHash(SKY_OPTS.contentHashDedupKey),
|
|
128
|
+
{ present: false, authoritative: false },
|
|
129
|
+
"the rebuild cannot run, so the stale MISS must not claim authority",
|
|
130
|
+
);
|
|
131
|
+
assert.equal(await confirmActiveFactDuplicate(storage, SKY_OPTS), true, "the corpus confirms the peer's fact");
|
|
132
|
+
} finally {
|
|
133
|
+
await release();
|
|
134
|
+
}
|
|
135
|
+
assert.deepEqual(
|
|
136
|
+
await storage.lookupContentHash(SKY_OPTS.contentHashDedupKey),
|
|
137
|
+
{ present: true, authoritative: true },
|
|
138
|
+
"once the lock is free the rebuild publishes and the hit is authoritative",
|
|
139
|
+
);
|
|
140
|
+
} finally {
|
|
141
|
+
await cleanup();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test("confirmActiveFactDuplicate stays a duplicate when the peer releases the index lock right after the lookup", async () => {
|
|
146
|
+
const { storage, cleanup } = await makeStorage();
|
|
147
|
+
try {
|
|
148
|
+
storage.factHashIndexLockOptions = CONTENDED_LOCK_OPTIONS;
|
|
149
|
+
assert.equal(await storage.isFactContentHashAuthoritative(), true, "starts authoritative");
|
|
150
|
+
const peer = new StorageManager(storage["baseDir"]);
|
|
151
|
+
await peer.writeMemory("fact", "The sky is BLUE!");
|
|
152
|
+
const release = await holdIndexLock(storage["baseDir"]);
|
|
153
|
+
const lookup = storage.lookupContentHash.bind(storage);
|
|
154
|
+
mock.method(storage, "lookupContentHash", async (content: string) => {
|
|
155
|
+
const answer = await lookup(content);
|
|
156
|
+
await release();
|
|
157
|
+
return answer;
|
|
158
|
+
});
|
|
159
|
+
assert.equal(
|
|
160
|
+
await confirmActiveFactDuplicate(storage, SKY_OPTS),
|
|
161
|
+
true,
|
|
162
|
+
"a lock released after the lookup must not turn the stale MISS into a clean not-duplicate",
|
|
163
|
+
);
|
|
164
|
+
} finally {
|
|
165
|
+
await cleanup();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
test("two managers on one directory commit the same fact through the window exactly once", async () => {
|
|
170
|
+
const { storage, cleanup } = await makeStorage();
|
|
171
|
+
try {
|
|
172
|
+
const peer = new StorageManager(storage["baseDir"]);
|
|
173
|
+
const commit = (manager: StorageManager) =>
|
|
174
|
+
persistUnderFactDedupWindow(
|
|
175
|
+
manager.dir,
|
|
176
|
+
() => confirmActiveFactDuplicate(manager, SKY_OPTS),
|
|
177
|
+
() => manager.writeMemory("fact", "The sky is blue"),
|
|
178
|
+
);
|
|
179
|
+
const outcomes = await Promise.all([commit(storage), commit(peer)]);
|
|
180
|
+
assert.equal(outcomes.filter((outcome) => !outcome.suppressed).length, 1, "one writer wins, the other is suppressed");
|
|
181
|
+
const stored = await new StorageManager(storage["baseDir"]).readAllMemories();
|
|
182
|
+
assert.equal(stored.filter((memory) => memory.content.includes("sky is blue")).length, 1);
|
|
183
|
+
} finally {
|
|
184
|
+
await cleanup();
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
test("confirmActiveFactDuplicate keeps the authoritative MISS fast path", async () => {
|
|
189
|
+
const { storage, cleanup } = await makeStorage();
|
|
190
|
+
try {
|
|
191
|
+
assert.equal(await storage.isFactContentHashAuthoritative(), true, "warm the index so no rebuild reads the corpus");
|
|
192
|
+
const corpusReads = mock.method(storage, "readAllMemories");
|
|
193
|
+
assert.equal(await confirmActiveFactDuplicate(storage, SKY_OPTS), false);
|
|
194
|
+
assert.equal(corpusReads.mock.callCount(), 0, "authoritative MISS must not scan the corpus");
|
|
195
|
+
} finally {
|
|
196
|
+
await cleanup();
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
|