@remnic/core 10.0.13 → 10.0.14

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.
Files changed (476) hide show
  1. package/dist/access-admin-ops-surface.js +86 -84
  2. package/dist/access-authorization-probe.js +87 -85
  3. package/dist/access-boundary.js +86 -84
  4. package/dist/access-cli.js +183 -180
  5. package/dist/access-cli.js.map +1 -1
  6. package/dist/access-extraction-force-flush.js +86 -84
  7. package/dist/access-http-briefing.js +87 -85
  8. package/dist/access-http-query.js +88 -86
  9. package/dist/access-http.js +110 -108
  10. package/dist/access-idempotency.js +3 -2
  11. package/dist/access-identity-continuity-surface.js +86 -84
  12. package/dist/access-lcm-surface.js +86 -84
  13. package/dist/access-mcp.js +99 -97
  14. package/dist/access-namespace-preflight.js +86 -84
  15. package/dist/access-observe-write-category.js +17 -17
  16. package/dist/access-observe-write-surface.js +86 -84
  17. package/dist/access-offline-manifest.js +16 -15
  18. package/dist/access-operations-batch.js +90 -88
  19. package/dist/access-operations.js +97 -95
  20. package/dist/access-recall-concurrency.js +86 -84
  21. package/dist/access-recall-diagnostics.js +2 -2
  22. package/dist/access-recall-response.js +86 -84
  23. package/dist/access-recall-surface.js +86 -84
  24. package/dist/access-schema.d.ts +2 -2
  25. package/dist/access-schema.js +12 -12
  26. package/dist/access-service.js +86 -84
  27. package/dist/access-surface-catalog.js +88 -86
  28. package/dist/access-surface-catalog.js.map +1 -1
  29. package/dist/active-recall.js +39 -37
  30. package/dist/active-recall.js.map +1 -1
  31. package/dist/adapters/index.js +4 -4
  32. package/dist/adapters/registry.js +2 -2
  33. package/dist/{auto-sync-DGJOZYGT.js → auto-sync-7WWAKW6F.js} +8 -8
  34. package/dist/briefing.js +29 -27
  35. package/dist/buffer.js +13 -13
  36. package/dist/{capsule-merge-M4HETD27.js → capsule-merge-LGYURS3C.js} +6 -5
  37. package/dist/{capsule-merge-M4HETD27.js.map → capsule-merge-LGYURS3C.js.map} +1 -1
  38. package/dist/capture-write-lock-backoff.d.ts +50 -0
  39. package/dist/capture-write-lock-backoff.d.ts.map +1 -0
  40. package/dist/capture-write-lock-backoff.js +30 -0
  41. package/dist/capture-write-lock.d.ts +6 -0
  42. package/dist/capture-write-lock.d.ts.map +1 -0
  43. package/dist/capture-write-lock.js +15 -0
  44. package/dist/causal-behavior.js +2 -2
  45. package/dist/causal-chain.js +2 -2
  46. package/dist/causal-consolidation.js +32 -30
  47. package/dist/causal-consolidation.js.map +1 -1
  48. package/dist/causal-retrieval.js +2 -2
  49. package/dist/causal-trajectory-graph.js +7 -6
  50. package/dist/causal-trajectory-graph.js.map +1 -1
  51. package/dist/causal-trajectory.js +1 -1
  52. package/dist/{chunk-ZUMXY4KA.js → chunk-22W2XWGH.js} +3 -3
  53. package/dist/{chunk-AV2OQF2O.js → chunk-3F3HA3R2.js} +2 -2
  54. package/dist/{chunk-QZZPUREO.js → chunk-3GYSZHMT.js} +3 -3
  55. package/dist/{chunk-QWWMS4AE.js → chunk-3MO4LWYU.js} +1 -1
  56. package/dist/chunk-3MO4LWYU.js.map +1 -0
  57. package/dist/{chunk-AL6EHLB5.js → chunk-3X3PNU3T.js} +2 -2
  58. package/dist/{chunk-BTJ6CAIA.js → chunk-4IYIGN53.js} +10 -10
  59. package/dist/{chunk-BZTRPCCH.js → chunk-4KY5GSMB.js} +2 -2
  60. package/dist/{chunk-UZSBCQEC.js → chunk-4OSG5Y6M.js} +2 -2
  61. package/dist/{chunk-EHRE7ZG3.js → chunk-5B5WYAHQ.js} +2 -2
  62. package/dist/{chunk-WCGJK4NQ.js → chunk-5FNZ3G6X.js} +10 -10
  63. package/dist/{chunk-Y6DZ33PA.js → chunk-5GX5457J.js} +4 -4
  64. package/dist/{chunk-OFCHT2TN.js → chunk-5LRV557D.js} +2 -2
  65. package/dist/{chunk-CKUUP64O.js → chunk-5WCJLQTM.js} +2 -2
  66. package/dist/{chunk-MZBWIJJN.js → chunk-63B2IZYE.js} +19 -19
  67. package/dist/{chunk-DGRMWDQY.js → chunk-66BCOVW2.js} +7 -7
  68. package/dist/chunk-6EDW54SQ.js +298 -0
  69. package/dist/chunk-6EDW54SQ.js.map +1 -0
  70. package/dist/{chunk-P2S6P7X6.js → chunk-6LG7BWKW.js} +2 -2
  71. package/dist/chunk-77R7BQZ2.js +152 -0
  72. package/dist/chunk-77R7BQZ2.js.map +1 -0
  73. package/dist/{chunk-IPLYGWQF.js → chunk-7LCGFUMB.js} +6 -6
  74. package/dist/{chunk-KYY4EACB.js → chunk-7Z3DLNSD.js} +2 -2
  75. package/dist/{chunk-LNH76ZJX.js → chunk-AIYXVWUH.js} +27 -2
  76. package/dist/{chunk-LNH76ZJX.js.map → chunk-AIYXVWUH.js.map} +1 -1
  77. package/dist/{chunk-O4KYRDRT.js → chunk-B665A6BO.js} +2 -2
  78. package/dist/{chunk-AKREOU5F.js → chunk-CB6ANA2I.js} +2 -2
  79. package/dist/{chunk-5JMI26Q7.js → chunk-CBH2Z4UA.js} +2 -2
  80. package/dist/{chunk-YRH3C2OJ.js → chunk-CIIHIAJ2.js} +13 -5
  81. package/dist/chunk-CIIHIAJ2.js.map +1 -0
  82. package/dist/{chunk-6M56RFFJ.js → chunk-CJRENHVZ.js} +3 -3
  83. package/dist/{chunk-EGDYVYU7.js → chunk-CLWBFR7Q.js} +3 -3
  84. package/dist/{chunk-375ARKRS.js → chunk-D5SSBCYY.js} +70 -59
  85. package/dist/chunk-D5SSBCYY.js.map +1 -0
  86. package/dist/{chunk-KI6UOSNR.js → chunk-DEY7B77Y.js} +2 -2
  87. package/dist/chunk-DEY7B77Y.js.map +1 -0
  88. package/dist/{chunk-6VAHJ2F6.js → chunk-DMDWFQMR.js} +2 -2
  89. package/dist/{chunk-6OQ6N5RP.js → chunk-DPR2WTN3.js} +20 -20
  90. package/dist/{chunk-K4QY55XV.js → chunk-EH4BQ7LT.js} +2 -2
  91. package/dist/chunk-EHHQJTAU.js +131 -0
  92. package/dist/chunk-EHHQJTAU.js.map +1 -0
  93. package/dist/{chunk-5JCLELOP.js → chunk-EPJDSQHF.js} +2 -2
  94. package/dist/{chunk-K2FSASGZ.js → chunk-EU534WGS.js} +2 -2
  95. package/dist/{chunk-GD7BWGIB.js → chunk-EU6IRUCY.js} +6 -4
  96. package/dist/{chunk-GD7BWGIB.js.map → chunk-EU6IRUCY.js.map} +1 -1
  97. package/dist/{chunk-IWHEJXR2.js → chunk-EUAIYYYR.js} +8 -8
  98. package/dist/{chunk-7KYJNHGM.js → chunk-EUCYTCFP.js} +2 -2
  99. package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
  100. package/dist/{chunk-ON4ILX3G.js → chunk-FFOVKNQV.js} +2 -2
  101. package/dist/{chunk-2KRNPFPK.js → chunk-FLI6DEIU.js} +2 -2
  102. package/dist/{chunk-4G4B3Z2B.js → chunk-FP4JYE66.js} +2 -2
  103. package/dist/{chunk-B7CANWCA.js → chunk-FSIMZNBC.js} +2 -2
  104. package/dist/{chunk-OAIWPB2I.js → chunk-FT4UQYOV.js} +2 -2
  105. package/dist/{chunk-X3VID2TT.js → chunk-FUFAXVBA.js} +3 -3
  106. package/dist/{chunk-HYNEDMYJ.js → chunk-G2OYFTUD.js} +2 -2
  107. package/dist/{chunk-XTN54NML.js → chunk-G3T6YMBO.js} +4 -4
  108. package/dist/{chunk-XHWJRUVP.js → chunk-GELS5Z5Z.js} +3 -3
  109. package/dist/{chunk-RT6D3WN7.js → chunk-GH7AOMJD.js} +2 -2
  110. package/dist/{chunk-2LUSQV4U.js → chunk-GKJJNO7C.js} +2 -2
  111. package/dist/{chunk-6Z2AZ4AJ.js → chunk-GMXWTJNU.js} +2 -2
  112. package/dist/{chunk-B657ZGDH.js → chunk-HQSK2INQ.js} +2 -2
  113. package/dist/{chunk-RWRQ67OR.js → chunk-I7S55EOB.js} +2 -2
  114. package/dist/{chunk-KZO43HPY.js → chunk-J7JWFZHI.js} +100 -100
  115. package/dist/{chunk-EMFBC7L3.js → chunk-JDZFIR2S.js} +2 -2
  116. package/dist/{chunk-4THZGKQ2.js → chunk-JIHMUOOS.js} +3 -3
  117. package/dist/{chunk-YYO447A7.js → chunk-JNIVZNIB.js} +41 -253
  118. package/dist/chunk-JNIVZNIB.js.map +1 -0
  119. package/dist/{chunk-FZB4TS2W.js → chunk-JPTPS4OB.js} +5 -5
  120. package/dist/{chunk-CS2JEHTB.js → chunk-JQ7XU625.js} +8 -8
  121. package/dist/{chunk-3I3U6FFT.js → chunk-K7BN34IA.js} +2 -2
  122. package/dist/{chunk-7OAIOE5P.js → chunk-KH2LKDX7.js} +2 -2
  123. package/dist/{chunk-DA2INEB5.js → chunk-KR6ZKECI.js} +4 -4
  124. package/dist/{chunk-5AOAQR37.js → chunk-L5DAHSEZ.js} +3 -3
  125. package/dist/{chunk-RP5SJ3XR.js → chunk-LCKVXX5F.js} +2 -2
  126. package/dist/{chunk-ZI7LMSNI.js → chunk-LLHZZOIB.js} +2 -2
  127. package/dist/{chunk-OYKQ6T4V.js → chunk-MATDGSJ7.js} +2 -2
  128. package/dist/{chunk-3NFN4Y4P.js → chunk-MGCKZWAE.js} +5 -5
  129. package/dist/{chunk-6OMUHXHP.js → chunk-ML7ZJAKJ.js} +2 -2
  130. package/dist/{chunk-YDH2FSDI.js → chunk-N45NEBOD.js} +2 -2
  131. package/dist/{chunk-A2E4WNW4.js → chunk-N4C7QKOG.js} +2 -2
  132. package/dist/{chunk-B43NMCGQ.js → chunk-N7KYEVLK.js} +2 -2
  133. package/dist/{chunk-HT2C4EXO.js → chunk-NIRQGDYC.js} +4 -4
  134. package/dist/{chunk-DXHVD4DS.js → chunk-NW2E4CI2.js} +3 -3
  135. package/dist/{chunk-4NDWE44P.js → chunk-NZFFGO5O.js} +2 -2
  136. package/dist/{chunk-KC46VZR5.js → chunk-O2IPAX26.js} +8 -8
  137. package/dist/{chunk-M7V65M6H.js → chunk-O4SGYW7H.js} +2 -2
  138. package/dist/{chunk-QUA7RLK6.js → chunk-OP6N4H6A.js} +2 -2
  139. package/dist/{chunk-ZSJGYC3C.js → chunk-OQJKY3Z5.js} +2 -2
  140. package/dist/{chunk-OFEHITAZ.js → chunk-OXNTOHL6.js} +2 -2
  141. package/dist/{chunk-FQD2KPQH.js → chunk-P55FACBG.js} +2 -2
  142. package/dist/{chunk-XERVJYH2.js → chunk-P5NQN4JE.js} +3 -3
  143. package/dist/{chunk-XZLWYZ7C.js → chunk-P7TOIOT7.js} +2 -2
  144. package/dist/{chunk-Y3VDGK2O.js → chunk-PAZ35RJ4.js} +44 -31
  145. package/dist/chunk-PAZ35RJ4.js.map +1 -0
  146. package/dist/chunk-PGRZ3FYC.js +34 -0
  147. package/dist/chunk-PGRZ3FYC.js.map +1 -0
  148. package/dist/{chunk-PBVNVKYN.js → chunk-PIN5OPBA.js} +2 -2
  149. package/dist/{chunk-CNG2XVZG.js → chunk-PZHQWFR3.js} +2 -2
  150. package/dist/{chunk-SVDU4OHO.js → chunk-Q35L7TYB.js} +2 -2
  151. package/dist/{chunk-YEM7K3KD.js → chunk-QODKDRSP.js} +6 -6
  152. package/dist/{chunk-IZT3BVDW.js → chunk-QOZJCSFO.js} +2 -2
  153. package/dist/{chunk-6T42L5FI.js → chunk-QS3OLP5I.js} +2 -2
  154. package/dist/{chunk-PAAJWQH5.js → chunk-QUMKDRCF.js} +2 -2
  155. package/dist/{chunk-JFVCDEIC.js → chunk-QX6JN3O4.js} +7 -7
  156. package/dist/{chunk-KZEMFD6E.js → chunk-R2H4ZFBJ.js} +3 -3
  157. package/dist/{chunk-GKIXBH7Y.js → chunk-RTKV5XHL.js} +4 -4
  158. package/dist/{chunk-ZQ3WU6JO.js → chunk-RXFCU3CY.js} +2 -2
  159. package/dist/{chunk-BOOFTFFE.js → chunk-S2I7DL5Q.js} +1 -1
  160. package/dist/{chunk-2NCBDGND.js → chunk-SA6GMZJY.js} +3 -3
  161. package/dist/{chunk-NSFOERZQ.js → chunk-SIIRTDJ4.js} +2 -2
  162. package/dist/{chunk-A6TVQ3QP.js → chunk-SS3IS2JR.js} +3 -3
  163. package/dist/{chunk-VFTK5WKI.js → chunk-STBX5X6B.js} +2 -2
  164. package/dist/{chunk-WVHRNAXL.js → chunk-SWWHIJUJ.js} +2 -2
  165. package/dist/{chunk-WADSXS4K.js → chunk-SX4QDWXK.js} +2 -2
  166. package/dist/{chunk-ZIZ2G47N.js → chunk-TITG2NBS.js} +2 -2
  167. package/dist/{chunk-LZKOVXMX.js → chunk-TRMJ6BYC.js} +2 -2
  168. package/dist/{chunk-U7VPOXVM.js → chunk-TZNDKTX5.js} +65 -65
  169. package/dist/{chunk-WWSRLS4M.js → chunk-UMTCNEVQ.js} +15 -15
  170. package/dist/{chunk-4TTGRETU.js → chunk-UQDG3YLN.js} +5 -5
  171. package/dist/{chunk-AAM66QCP.js → chunk-UZRSI6NX.js} +2 -2
  172. package/dist/{chunk-2CXQZXWM.js → chunk-V4MB5ONM.js} +6 -6
  173. package/dist/{chunk-CYEK6Z3P.js → chunk-VW6VIJOS.js} +2 -2
  174. package/dist/{chunk-5ZJYHOJT.js → chunk-W47S5TIH.js} +8 -8
  175. package/dist/{chunk-CBP4HWCL.js → chunk-W5MCEVUS.js} +3 -3
  176. package/dist/{chunk-WETFW255.js → chunk-WLMZ2L5P.js} +2 -2
  177. package/dist/{chunk-XRBHXUTQ.js → chunk-WSGPFRBH.js} +5 -5
  178. package/dist/{chunk-UOKPJFO3.js → chunk-WVADKFWV.js} +3 -3
  179. package/dist/{chunk-P34FDDB5.js → chunk-XISROV24.js} +2 -2
  180. package/dist/{chunk-FZVROZKC.js → chunk-XVZA6VXC.js} +4 -4
  181. package/dist/{chunk-JUWJYXI4.js → chunk-Y4NKEXQT.js} +4 -4
  182. package/dist/{chunk-2ZQJLBV6.js → chunk-YE36AJL7.js} +4 -4
  183. package/dist/chunk-YET735EZ.js +99 -0
  184. package/dist/chunk-YET735EZ.js.map +1 -0
  185. package/dist/{chunk-PCWXLAJY.js → chunk-YFMBHQRG.js} +2 -2
  186. package/dist/{chunk-RBJQYMMT.js → chunk-YRULQW5J.js} +4 -4
  187. package/dist/{chunk-QUNDYIYZ.js → chunk-YYEOR4XN.js} +3 -3
  188. package/dist/{chunk-VYPFEVOM.js → chunk-ZJVMUBYF.js} +2 -2
  189. package/dist/{chunk-5MDM7UE4.js → chunk-ZSH2NRDV.js} +2 -2
  190. package/dist/{chunk-3J5JKBYD.js → chunk-ZV65I6ME.js} +67 -67
  191. package/dist/cli.js +138 -136
  192. package/dist/coding/export-okf-codegraph.js +29 -27
  193. package/dist/coding/export-okf-codegraph.js.map +1 -1
  194. package/dist/coding/pre-action-gate.js +2 -2
  195. package/dist/compounding/engine.js +31 -29
  196. package/dist/config.js +39 -37
  197. package/dist/connectors/codex-materialize-runner.js +29 -27
  198. package/dist/connectors/index.js +29 -27
  199. package/dist/console/trace.d.ts +5 -14
  200. package/dist/console/trace.d.ts.map +1 -1
  201. package/dist/consolidation-provenance-check.js +7 -6
  202. package/dist/consolidation-undo.js +5 -4
  203. package/dist/consolidation-undo.js.map +1 -1
  204. package/dist/contradiction/index.js +7 -6
  205. package/dist/converge-config.d.ts +2 -0
  206. package/dist/converge-config.d.ts.map +1 -1
  207. package/dist/converge-config.js +7 -3
  208. package/dist/convergence-refresh.js +31 -29
  209. package/dist/corpus-watermark.js +31 -29
  210. package/dist/dashboard-runtime.js +2 -2
  211. package/dist/deep-recall-http-glue.js +13 -13
  212. package/dist/deep-recall.js +2 -2
  213. package/dist/embedding-fallback.js +5 -4
  214. package/dist/embedding-generation-lock.js +4 -3
  215. package/dist/entity-retrieval.js +30 -28
  216. package/dist/explicit-capture.js +11 -8
  217. package/dist/external-wiki-access.js +87 -85
  218. package/dist/extraction-quote-grounding.d.ts +67 -0
  219. package/dist/extraction-quote-grounding.d.ts.map +1 -0
  220. package/dist/extraction-quote-grounding.js +27 -0
  221. package/dist/extraction-quote-grounding.js.map +1 -0
  222. package/dist/extraction-source-grounding-helpers.d.ts +8 -0
  223. package/dist/extraction-source-grounding-helpers.d.ts.map +1 -1
  224. package/dist/extraction-source-grounding-helpers.js +11 -1
  225. package/dist/extraction-source-grounding-rules.d.ts +3 -1
  226. package/dist/extraction-source-grounding-rules.d.ts.map +1 -1
  227. package/dist/extraction-source-grounding-rules.js +3 -2
  228. package/dist/extraction-source-grounding.d.ts +1 -1
  229. package/dist/extraction-source-grounding.d.ts.map +1 -1
  230. package/dist/extraction-source-grounding.js +4 -3
  231. package/dist/extraction-span-materialize.js +2 -2
  232. package/dist/extraction.js +40 -37
  233. package/dist/{first-start-migration-HYAMKJ6V.js → first-start-migration-6A5BJPDW.js} +4 -4
  234. package/dist/{forget-OHAJ6PSU.js → forget-GXBWFKRC.js} +5 -4
  235. package/dist/{forget-OHAJ6PSU.js.map → forget-GXBWFKRC.js.map} +1 -1
  236. package/dist/{graph-edge-decay-CZ3SYLM4.js → graph-edge-decay-BYPZVJT4.js} +10 -9
  237. package/dist/graph-edge-decay-BYPZVJT4.js.map +1 -0
  238. package/dist/graph-jsonl.js +8 -7
  239. package/dist/graph-snapshot.js +8 -7
  240. package/dist/graph-write-lock.js +4 -3
  241. package/dist/graph.js +9 -8
  242. package/dist/harmonic-retrieval.js +29 -27
  243. package/dist/http-retry.js +2 -1
  244. package/dist/http-retry.js.map +1 -1
  245. package/dist/index.d.ts +1 -1
  246. package/dist/index.d.ts.map +1 -1
  247. package/dist/index.js +223 -218
  248. package/dist/lcm/engine.js +4 -4
  249. package/dist/lcm/index.js +12 -12
  250. package/dist/location/index.js +32 -30
  251. package/dist/maintenance/memory-governance.js +29 -27
  252. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +29 -27
  253. package/dist/maintenance/rebuild-memory-projection-runner.js +31 -29
  254. package/dist/maintenance/rebuild-memory-projection.js +30 -28
  255. package/dist/memory-browse-operations.js +87 -85
  256. package/dist/memory-browse.js +7 -7
  257. package/dist/memory-subject.js +5 -4
  258. package/dist/namespaces/migrate.js +30 -28
  259. package/dist/namespaces/search.js +9 -9
  260. package/dist/namespaces/storage.js +29 -27
  261. package/dist/offline-sync-changeset-generations.js +7 -6
  262. package/dist/offline-sync-embedding-generation.js +6 -5
  263. package/dist/offline-sync-impression-drain.js +4 -4
  264. package/dist/offline-sync-snapshot-stream.js +9 -9
  265. package/dist/offline-sync.js +10 -10
  266. package/dist/operator-doctor-corpus.js +32 -30
  267. package/dist/operator-toolkit.js +53 -51
  268. package/dist/orchestration/maintenance.js +41 -39
  269. package/dist/orchestrator.js +185 -182
  270. package/dist/page-versioning.js +5 -4
  271. package/dist/qmd-daemon-session.js +2 -2
  272. package/dist/qmd.js +4 -4
  273. package/dist/recall-explain-renderer.js +3 -3
  274. package/dist/recall-navigate-access.js +2 -2
  275. package/dist/recall-navigate-disclosure.js +2 -2
  276. package/dist/recall-navigate.js +2 -2
  277. package/dist/recall-navigation-operations.js +87 -85
  278. package/dist/recall-navigation.js +86 -84
  279. package/dist/recall-state-view-admission.js +7 -7
  280. package/dist/recall-state.js +4 -3
  281. package/dist/recall-why-service.js +7 -7
  282. package/dist/recall-xray-cli.js +4 -4
  283. package/dist/recall-xray-renderer.js +3 -3
  284. package/dist/recall-xray.js +2 -2
  285. package/dist/reconcile/cursor.js +4 -2
  286. package/dist/reconcile/cursor.js.map +1 -1
  287. package/dist/reconcile/manifest.js +9 -6
  288. package/dist/reconcile/plan.js +4 -2
  289. package/dist/{resolution-EKJHREVJ.js → resolution-7AY36LGJ.js} +8 -7
  290. package/dist/resolution-7AY36LGJ.js.map +1 -0
  291. package/dist/resume-bundles.js +40 -38
  292. package/dist/salvage-envelope.js +7 -6
  293. package/dist/search/factory.js +8 -8
  294. package/dist/search/index.js +14 -14
  295. package/dist/semantic-consolidation.js +34 -32
  296. package/dist/semantic-rule-promotion.js +29 -27
  297. package/dist/semantic-rule-verifier.js +29 -27
  298. package/dist/source-agent-qualifier.js +37 -34
  299. package/dist/standup/build.js +29 -27
  300. package/dist/storage/content-hash-index.d.ts +10 -0
  301. package/dist/storage/content-hash-index.d.ts.map +1 -1
  302. package/dist/storage/tombstone-blocked-capture-index.d.ts +3 -0
  303. package/dist/storage/tombstone-blocked-capture-index.d.ts.map +1 -1
  304. package/dist/storage/tombstone-blocked-capture-mutation.d.ts +23 -3
  305. package/dist/storage/tombstone-blocked-capture-mutation.d.ts.map +1 -1
  306. package/dist/storage.d.ts +6 -0
  307. package/dist/storage.d.ts.map +1 -1
  308. package/dist/storage.js +30 -28
  309. package/dist/subject-config.js +6 -5
  310. package/dist/summarizer.js +4 -4
  311. package/dist/summary-snapshot.js +4 -3
  312. package/dist/support-passport/index.js +89 -87
  313. package/dist/{trace-LXXCMZJA.js → trace-QBQVS5BC.js} +5 -21
  314. package/dist/trace-QBQVS5BC.js.map +1 -0
  315. package/dist/transfer/autodetect.js +1 -1
  316. package/dist/transfer/backup.js +1 -1
  317. package/dist/transfer/capsule-export.js +3 -3
  318. package/dist/transfer/capsule-import.js +7 -6
  319. package/dist/transfer/export-okf.js +29 -27
  320. package/dist/types.d.ts +9 -0
  321. package/dist/types.d.ts.map +1 -1
  322. package/dist/types.js +1 -1
  323. package/dist/utils/serialize-mutations.js +3 -2
  324. package/dist/utils/sleep.d.ts +6 -0
  325. package/dist/utils/sleep.d.ts.map +1 -1
  326. package/dist/verified-recall.js +29 -27
  327. package/dist/who-knows-cli.js +30 -28
  328. package/dist/who-knows.js +29 -27
  329. package/dist/write-envelope.js +6 -5
  330. package/package.json +22 -2
  331. package/src/capture-write-lock-backoff.test.ts +534 -0
  332. package/src/capture-write-lock-backoff.ts +140 -0
  333. package/src/capture-write-lock.ts +8 -0
  334. package/src/console/trace.ts +5 -36
  335. package/src/converge-config.ts +80 -1
  336. package/src/extraction-quote-grounding.test.ts +546 -0
  337. package/src/extraction-quote-grounding.ts +232 -0
  338. package/src/extraction-source-grounding-helpers.ts +35 -0
  339. package/src/extraction-source-grounding-rules.ts +90 -65
  340. package/src/extraction-source-grounding.ts +11 -2
  341. package/src/index.ts +1 -1
  342. package/src/providers/codex-subscription.test.ts +15 -3
  343. package/src/storage/content-hash-index.ts +10 -0
  344. package/src/storage/tombstone-blocked-capture-index.ts +8 -1
  345. package/src/storage/tombstone-blocked-capture-mutation.ts +133 -43
  346. package/src/storage.ts +13 -0
  347. package/src/types.ts +9 -0
  348. package/src/utils/sleep.ts +28 -0
  349. package/dist/chunk-375ARKRS.js.map +0 -1
  350. package/dist/chunk-6MINUTGJ.js +0 -64
  351. package/dist/chunk-6MINUTGJ.js.map +0 -1
  352. package/dist/chunk-7LEQREP2.js +0 -9
  353. package/dist/chunk-7LEQREP2.js.map +0 -1
  354. package/dist/chunk-KI6UOSNR.js.map +0 -1
  355. package/dist/chunk-QWWMS4AE.js.map +0 -1
  356. package/dist/chunk-Y3VDGK2O.js.map +0 -1
  357. package/dist/chunk-YRH3C2OJ.js.map +0 -1
  358. package/dist/chunk-YYO447A7.js.map +0 -1
  359. package/dist/trace-LXXCMZJA.js.map +0 -1
  360. /package/dist/{auto-sync-DGJOZYGT.js.map → auto-sync-7WWAKW6F.js.map} +0 -0
  361. /package/dist/{graph-edge-decay-CZ3SYLM4.js.map → capture-write-lock-backoff.js.map} +0 -0
  362. /package/dist/{resolution-EKJHREVJ.js.map → capture-write-lock.js.map} +0 -0
  363. /package/dist/{chunk-ZUMXY4KA.js.map → chunk-22W2XWGH.js.map} +0 -0
  364. /package/dist/{chunk-AV2OQF2O.js.map → chunk-3F3HA3R2.js.map} +0 -0
  365. /package/dist/{chunk-QZZPUREO.js.map → chunk-3GYSZHMT.js.map} +0 -0
  366. /package/dist/{chunk-AL6EHLB5.js.map → chunk-3X3PNU3T.js.map} +0 -0
  367. /package/dist/{chunk-BTJ6CAIA.js.map → chunk-4IYIGN53.js.map} +0 -0
  368. /package/dist/{chunk-BZTRPCCH.js.map → chunk-4KY5GSMB.js.map} +0 -0
  369. /package/dist/{chunk-UZSBCQEC.js.map → chunk-4OSG5Y6M.js.map} +0 -0
  370. /package/dist/{chunk-EHRE7ZG3.js.map → chunk-5B5WYAHQ.js.map} +0 -0
  371. /package/dist/{chunk-WCGJK4NQ.js.map → chunk-5FNZ3G6X.js.map} +0 -0
  372. /package/dist/{chunk-Y6DZ33PA.js.map → chunk-5GX5457J.js.map} +0 -0
  373. /package/dist/{chunk-OFCHT2TN.js.map → chunk-5LRV557D.js.map} +0 -0
  374. /package/dist/{chunk-CKUUP64O.js.map → chunk-5WCJLQTM.js.map} +0 -0
  375. /package/dist/{chunk-MZBWIJJN.js.map → chunk-63B2IZYE.js.map} +0 -0
  376. /package/dist/{chunk-DGRMWDQY.js.map → chunk-66BCOVW2.js.map} +0 -0
  377. /package/dist/{chunk-P2S6P7X6.js.map → chunk-6LG7BWKW.js.map} +0 -0
  378. /package/dist/{chunk-IPLYGWQF.js.map → chunk-7LCGFUMB.js.map} +0 -0
  379. /package/dist/{chunk-KYY4EACB.js.map → chunk-7Z3DLNSD.js.map} +0 -0
  380. /package/dist/{chunk-O4KYRDRT.js.map → chunk-B665A6BO.js.map} +0 -0
  381. /package/dist/{chunk-AKREOU5F.js.map → chunk-CB6ANA2I.js.map} +0 -0
  382. /package/dist/{chunk-5JMI26Q7.js.map → chunk-CBH2Z4UA.js.map} +0 -0
  383. /package/dist/{chunk-6M56RFFJ.js.map → chunk-CJRENHVZ.js.map} +0 -0
  384. /package/dist/{chunk-EGDYVYU7.js.map → chunk-CLWBFR7Q.js.map} +0 -0
  385. /package/dist/{chunk-6VAHJ2F6.js.map → chunk-DMDWFQMR.js.map} +0 -0
  386. /package/dist/{chunk-6OQ6N5RP.js.map → chunk-DPR2WTN3.js.map} +0 -0
  387. /package/dist/{chunk-K4QY55XV.js.map → chunk-EH4BQ7LT.js.map} +0 -0
  388. /package/dist/{chunk-5JCLELOP.js.map → chunk-EPJDSQHF.js.map} +0 -0
  389. /package/dist/{chunk-K2FSASGZ.js.map → chunk-EU534WGS.js.map} +0 -0
  390. /package/dist/{chunk-IWHEJXR2.js.map → chunk-EUAIYYYR.js.map} +0 -0
  391. /package/dist/{chunk-7KYJNHGM.js.map → chunk-EUCYTCFP.js.map} +0 -0
  392. /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
  393. /package/dist/{chunk-ON4ILX3G.js.map → chunk-FFOVKNQV.js.map} +0 -0
  394. /package/dist/{chunk-2KRNPFPK.js.map → chunk-FLI6DEIU.js.map} +0 -0
  395. /package/dist/{chunk-4G4B3Z2B.js.map → chunk-FP4JYE66.js.map} +0 -0
  396. /package/dist/{chunk-B7CANWCA.js.map → chunk-FSIMZNBC.js.map} +0 -0
  397. /package/dist/{chunk-OAIWPB2I.js.map → chunk-FT4UQYOV.js.map} +0 -0
  398. /package/dist/{chunk-X3VID2TT.js.map → chunk-FUFAXVBA.js.map} +0 -0
  399. /package/dist/{chunk-HYNEDMYJ.js.map → chunk-G2OYFTUD.js.map} +0 -0
  400. /package/dist/{chunk-XTN54NML.js.map → chunk-G3T6YMBO.js.map} +0 -0
  401. /package/dist/{chunk-XHWJRUVP.js.map → chunk-GELS5Z5Z.js.map} +0 -0
  402. /package/dist/{chunk-RT6D3WN7.js.map → chunk-GH7AOMJD.js.map} +0 -0
  403. /package/dist/{chunk-2LUSQV4U.js.map → chunk-GKJJNO7C.js.map} +0 -0
  404. /package/dist/{chunk-6Z2AZ4AJ.js.map → chunk-GMXWTJNU.js.map} +0 -0
  405. /package/dist/{chunk-B657ZGDH.js.map → chunk-HQSK2INQ.js.map} +0 -0
  406. /package/dist/{chunk-RWRQ67OR.js.map → chunk-I7S55EOB.js.map} +0 -0
  407. /package/dist/{chunk-KZO43HPY.js.map → chunk-J7JWFZHI.js.map} +0 -0
  408. /package/dist/{chunk-EMFBC7L3.js.map → chunk-JDZFIR2S.js.map} +0 -0
  409. /package/dist/{chunk-4THZGKQ2.js.map → chunk-JIHMUOOS.js.map} +0 -0
  410. /package/dist/{chunk-FZB4TS2W.js.map → chunk-JPTPS4OB.js.map} +0 -0
  411. /package/dist/{chunk-CS2JEHTB.js.map → chunk-JQ7XU625.js.map} +0 -0
  412. /package/dist/{chunk-3I3U6FFT.js.map → chunk-K7BN34IA.js.map} +0 -0
  413. /package/dist/{chunk-7OAIOE5P.js.map → chunk-KH2LKDX7.js.map} +0 -0
  414. /package/dist/{chunk-DA2INEB5.js.map → chunk-KR6ZKECI.js.map} +0 -0
  415. /package/dist/{chunk-5AOAQR37.js.map → chunk-L5DAHSEZ.js.map} +0 -0
  416. /package/dist/{chunk-RP5SJ3XR.js.map → chunk-LCKVXX5F.js.map} +0 -0
  417. /package/dist/{chunk-ZI7LMSNI.js.map → chunk-LLHZZOIB.js.map} +0 -0
  418. /package/dist/{chunk-OYKQ6T4V.js.map → chunk-MATDGSJ7.js.map} +0 -0
  419. /package/dist/{chunk-3NFN4Y4P.js.map → chunk-MGCKZWAE.js.map} +0 -0
  420. /package/dist/{chunk-6OMUHXHP.js.map → chunk-ML7ZJAKJ.js.map} +0 -0
  421. /package/dist/{chunk-YDH2FSDI.js.map → chunk-N45NEBOD.js.map} +0 -0
  422. /package/dist/{chunk-A2E4WNW4.js.map → chunk-N4C7QKOG.js.map} +0 -0
  423. /package/dist/{chunk-B43NMCGQ.js.map → chunk-N7KYEVLK.js.map} +0 -0
  424. /package/dist/{chunk-HT2C4EXO.js.map → chunk-NIRQGDYC.js.map} +0 -0
  425. /package/dist/{chunk-DXHVD4DS.js.map → chunk-NW2E4CI2.js.map} +0 -0
  426. /package/dist/{chunk-4NDWE44P.js.map → chunk-NZFFGO5O.js.map} +0 -0
  427. /package/dist/{chunk-KC46VZR5.js.map → chunk-O2IPAX26.js.map} +0 -0
  428. /package/dist/{chunk-M7V65M6H.js.map → chunk-O4SGYW7H.js.map} +0 -0
  429. /package/dist/{chunk-QUA7RLK6.js.map → chunk-OP6N4H6A.js.map} +0 -0
  430. /package/dist/{chunk-ZSJGYC3C.js.map → chunk-OQJKY3Z5.js.map} +0 -0
  431. /package/dist/{chunk-OFEHITAZ.js.map → chunk-OXNTOHL6.js.map} +0 -0
  432. /package/dist/{chunk-FQD2KPQH.js.map → chunk-P55FACBG.js.map} +0 -0
  433. /package/dist/{chunk-XERVJYH2.js.map → chunk-P5NQN4JE.js.map} +0 -0
  434. /package/dist/{chunk-XZLWYZ7C.js.map → chunk-P7TOIOT7.js.map} +0 -0
  435. /package/dist/{chunk-PBVNVKYN.js.map → chunk-PIN5OPBA.js.map} +0 -0
  436. /package/dist/{chunk-CNG2XVZG.js.map → chunk-PZHQWFR3.js.map} +0 -0
  437. /package/dist/{chunk-SVDU4OHO.js.map → chunk-Q35L7TYB.js.map} +0 -0
  438. /package/dist/{chunk-YEM7K3KD.js.map → chunk-QODKDRSP.js.map} +0 -0
  439. /package/dist/{chunk-IZT3BVDW.js.map → chunk-QOZJCSFO.js.map} +0 -0
  440. /package/dist/{chunk-6T42L5FI.js.map → chunk-QS3OLP5I.js.map} +0 -0
  441. /package/dist/{chunk-PAAJWQH5.js.map → chunk-QUMKDRCF.js.map} +0 -0
  442. /package/dist/{chunk-JFVCDEIC.js.map → chunk-QX6JN3O4.js.map} +0 -0
  443. /package/dist/{chunk-KZEMFD6E.js.map → chunk-R2H4ZFBJ.js.map} +0 -0
  444. /package/dist/{chunk-GKIXBH7Y.js.map → chunk-RTKV5XHL.js.map} +0 -0
  445. /package/dist/{chunk-ZQ3WU6JO.js.map → chunk-RXFCU3CY.js.map} +0 -0
  446. /package/dist/{chunk-BOOFTFFE.js.map → chunk-S2I7DL5Q.js.map} +0 -0
  447. /package/dist/{chunk-2NCBDGND.js.map → chunk-SA6GMZJY.js.map} +0 -0
  448. /package/dist/{chunk-NSFOERZQ.js.map → chunk-SIIRTDJ4.js.map} +0 -0
  449. /package/dist/{chunk-A6TVQ3QP.js.map → chunk-SS3IS2JR.js.map} +0 -0
  450. /package/dist/{chunk-VFTK5WKI.js.map → chunk-STBX5X6B.js.map} +0 -0
  451. /package/dist/{chunk-WVHRNAXL.js.map → chunk-SWWHIJUJ.js.map} +0 -0
  452. /package/dist/{chunk-WADSXS4K.js.map → chunk-SX4QDWXK.js.map} +0 -0
  453. /package/dist/{chunk-ZIZ2G47N.js.map → chunk-TITG2NBS.js.map} +0 -0
  454. /package/dist/{chunk-LZKOVXMX.js.map → chunk-TRMJ6BYC.js.map} +0 -0
  455. /package/dist/{chunk-U7VPOXVM.js.map → chunk-TZNDKTX5.js.map} +0 -0
  456. /package/dist/{chunk-WWSRLS4M.js.map → chunk-UMTCNEVQ.js.map} +0 -0
  457. /package/dist/{chunk-4TTGRETU.js.map → chunk-UQDG3YLN.js.map} +0 -0
  458. /package/dist/{chunk-AAM66QCP.js.map → chunk-UZRSI6NX.js.map} +0 -0
  459. /package/dist/{chunk-2CXQZXWM.js.map → chunk-V4MB5ONM.js.map} +0 -0
  460. /package/dist/{chunk-CYEK6Z3P.js.map → chunk-VW6VIJOS.js.map} +0 -0
  461. /package/dist/{chunk-5ZJYHOJT.js.map → chunk-W47S5TIH.js.map} +0 -0
  462. /package/dist/{chunk-CBP4HWCL.js.map → chunk-W5MCEVUS.js.map} +0 -0
  463. /package/dist/{chunk-WETFW255.js.map → chunk-WLMZ2L5P.js.map} +0 -0
  464. /package/dist/{chunk-XRBHXUTQ.js.map → chunk-WSGPFRBH.js.map} +0 -0
  465. /package/dist/{chunk-UOKPJFO3.js.map → chunk-WVADKFWV.js.map} +0 -0
  466. /package/dist/{chunk-P34FDDB5.js.map → chunk-XISROV24.js.map} +0 -0
  467. /package/dist/{chunk-FZVROZKC.js.map → chunk-XVZA6VXC.js.map} +0 -0
  468. /package/dist/{chunk-JUWJYXI4.js.map → chunk-Y4NKEXQT.js.map} +0 -0
  469. /package/dist/{chunk-2ZQJLBV6.js.map → chunk-YE36AJL7.js.map} +0 -0
  470. /package/dist/{chunk-PCWXLAJY.js.map → chunk-YFMBHQRG.js.map} +0 -0
  471. /package/dist/{chunk-RBJQYMMT.js.map → chunk-YRULQW5J.js.map} +0 -0
  472. /package/dist/{chunk-QUNDYIYZ.js.map → chunk-YYEOR4XN.js.map} +0 -0
  473. /package/dist/{chunk-VYPFEVOM.js.map → chunk-ZJVMUBYF.js.map} +0 -0
  474. /package/dist/{chunk-5MDM7UE4.js.map → chunk-ZSH2NRDV.js.map} +0 -0
  475. /package/dist/{chunk-3J5JKBYD.js.map → chunk-ZV65I6ME.js.map} +0 -0
  476. /package/dist/{first-start-migration-HYAMKJ6V.js.map → first-start-migration-6A5BJPDW.js.map} +0 -0
@@ -0,0 +1,546 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+
4
+ import { quoteAnchors } from "./extraction-quote-grounding.js";
5
+ import {
6
+ applyExtractionSourceGrounding,
7
+ filterExtractionResultBySource,
8
+ } from "./extraction-source-grounding.js";
9
+ import type { ExtractionResult } from "./types.js";
10
+
11
+ // Minimal excerpts of a replayed dream run: the model's reworded `content` plus
12
+ // the exact `quote` it returned, over the source turns the quotes came from.
13
+ const TRAJECTORY_300_SOURCE = [
14
+ "Historical trajectory 300, part 1/1. Task: you're given packets.pcap (subset of DAPT2020 traffic). "
15
+ + "Compute the network statistics and fill in only the value column in network_stats.csv. "
16
+ + "protocol_ip_total counts packets that contain an IP layer.",
17
+ "Earlier attempt: the script created synthetic flows with missing ports for other protocols, and it "
18
+ + "tried to include ICMPv6 packets in the ICMP counter, so IPv6 had to be excluded.",
19
+ "Feedback for the next attempt: Use only the Scapy `IP` layer for `protocol_ip_total` and all IP-scoped "
20
+ + "address, entropy, graph, PCR, port, and flow metrics; do not broaden these metrics to IPv6. "
21
+ + "Construct unique five-tuples only from Scapy-`IP` TCP or UDP packets; do not synthesize zero-port "
22
+ + "ICMP or other-protocol flows. For `bidirectional_flows`, require the exact reversed five-tuple and "
23
+ + "count each distinct forward/reverse pair once rather than once per direction or via a separately "
24
+ + "populated reverse-key set. Do not infer port scanning from the dataset name or an aggregate count of "
25
+ + "many destination ports alone; require evidence that establishes aggressive scanning. Set "
26
+ + "`is_traffic_benign` from the supported attack flags rather than from the dataset name. Count "
27
+ + "`protocol_icmp` only when the Scapy `ICMP` layer is present; do not merge ICMPv6 classes into that "
28
+ + "counter.",
29
+ ].join("\n\n");
30
+
31
+ const TRAJECTORY_300_FACTS = [
32
+ {
33
+ content:
34
+ "For the DAPT2020 network-statistics task, use only packets containing Scapy's IP layer for "
35
+ + "protocol_ip_total and all IP-scoped address, entropy, graph, PCR, port, and flow metrics; exclude "
36
+ + "IPv6 from these metrics.",
37
+ quote:
38
+ "Use only the Scapy `IP` layer for `protocol_ip_total` and all IP-scoped address, entropy, graph, "
39
+ + "PCR, port, and flow metrics; do not broaden these metrics to IPv6.",
40
+ },
41
+ {
42
+ content:
43
+ "For the DAPT2020 network-statistics task, construct unique five-tuple flows only from TCP or UDP "
44
+ + "packets containing Scapy's IP layer. Do not create flows with synthetic missing or zero ports for "
45
+ + "ICMP or other protocols.",
46
+ quote:
47
+ "Construct unique five-tuples only from Scapy-`IP` TCP or UDP packets; do not synthesize zero-port "
48
+ + "ICMP or other-protocol flows.",
49
+ },
50
+ {
51
+ content:
52
+ "For the DAPT2020 network-statistics task, bidirectional_flows requires an existing exact reversed "
53
+ + "five-tuple and counts each distinct forward/reverse pair once, not once per direction or through a "
54
+ + "separately populated reverse-key set.",
55
+ quote:
56
+ "For `bidirectional_flows`, require the exact reversed five-tuple and count each distinct "
57
+ + "forward/reverse pair once rather than once per direction or via a separately populated "
58
+ + "reverse-key set.",
59
+ },
60
+ {
61
+ content:
62
+ "For the DAPT2020 network-statistics task, flag malicious port scanning only when evidence "
63
+ + "establishes aggressive scanning. The dataset name or an aggregate count of many destination ports "
64
+ + "alone is insufficient.",
65
+ quote:
66
+ "Do not infer port scanning from the dataset name or an aggregate count of many destination ports "
67
+ + "alone; require evidence that establishes aggressive scanning.",
68
+ },
69
+ {
70
+ content:
71
+ "For the DAPT2020 network-statistics task, derive is_traffic_benign from the supported attack flags "
72
+ + "rather than the dataset name.",
73
+ quote: "Set `is_traffic_benign` from the supported attack flags rather than from the dataset name.",
74
+ },
75
+ {
76
+ content:
77
+ "For the DAPT2020 network-statistics task, increment protocol_icmp only when Scapy's ICMP layer is "
78
+ + "present; do not include ICMPv6 classes in that counter.",
79
+ quote:
80
+ "Count `protocol_icmp` only when the Scapy `ICMP` layer is present; do not merge ICMPv6 classes "
81
+ + "into that counter.",
82
+ },
83
+ ];
84
+
85
+ const TRAJECTORY_376_SOURCE = [
86
+ "Task: OAuth1 parameter serialization is broken. The headers must serialize percent-encoded names and "
87
+ + "values as name=\"value\" pairs separated by commas. prepare_headers emits pairs with swapped names "
88
+ + "and values and separates pairs only with spaces. The repaired implementation must reconstruct the URI "
89
+ + "and keep the fix focused: do not introduce realm percent-encoding. The new module covers header "
90
+ + "formatting, OAuth value escaping, filtering non-OAuth parameters, and preservation of supplied headers "
91
+ + "and URI components.",
92
+ "Expected format: percent-encoded name=\"value\" pairs, not swapped names and values. Analysis: The OAuth1 "
93
+ + "parameter serialization bug has been fixed. Authorization headers now serialize "
94
+ + "OAuth parameter names and values in the correct order and use RFC 5849 comma separators. URI query "
95
+ + "signing now appends OAuth parameters while preserving scheme, authority/netloc, path, existing query "
96
+ + "parameters, and fragment. The fix is in oauthlib/oauth1/rfc5849/parameters.py, where "
97
+ + "prepare_request_uri_query calls _append_params(oauth_params, extract_params(query) or []) and "
98
+ + "rebuilds the URI with urlunparse((sch, net, path, par, query, fra)).",
99
+ "Plan: Update the test expectation for realm to preserve the existing unescaped quoted realm behavior "
100
+ + "while still testing OAuth parameter escaping. Add a new tests/oauth1/rfc5849/test_parameters.py "
101
+ + "with targeted header/query tests.",
102
+ ].join("\n\n");
103
+
104
+ const TRAJECTORY_118_SOURCE = [
105
+ "Request: I (James Wilson) and Carol White are working in the TechCorp Solutions Team, and we need to "
106
+ + "sign off on the Q4 launch checklist. Then, start an audio-only call with Carol White so we can go "
107
+ + "through the remaining blockers together. Start the call from my account: I want every call I ask "
108
+ + "for to be logged under me as the caller.",
109
+ "Workspace: the enterprise systems for this task are simulated.",
110
+ ].join("\n\n");
111
+
112
+ function resultOf(
113
+ facts: ReadonlyArray<{ content: string; quote?: string; entityRef?: string }>,
114
+ extra: Partial<ExtractionResult> = {},
115
+ ): ExtractionResult {
116
+ return {
117
+ facts: facts.map((fact) => ({ category: "fact", confidence: 0.9, tags: [], ...fact })),
118
+ profileUpdates: [],
119
+ entities: [],
120
+ questions: [],
121
+ relationships: [],
122
+ ...extra,
123
+ };
124
+ }
125
+
126
+ function keptContents(result: ExtractionResult): string[] {
127
+ return result.facts.map((fact) => fact.content);
128
+ }
129
+
130
+ test("trajectory 300: quote-valid reworded facts are kept, including quotes containing `;`", () => {
131
+ const grounded = filterExtractionResultBySource(
132
+ resultOf(TRAJECTORY_300_FACTS),
133
+ TRAJECTORY_300_SOURCE,
134
+ TRAJECTORY_300_SOURCE,
135
+ );
136
+ const [semicolonFact] = filterExtractionResultBySource(
137
+ resultOf([{ ...TRAJECTORY_300_FACTS[0]!, entityRef: "Scapy" }]),
138
+ TRAJECTORY_300_SOURCE,
139
+ TRAJECTORY_300_SOURCE,
140
+ ).facts;
141
+ assert.equal(semicolonFact?.entityRef, "Scapy", "an anchored fact keeps an entityRef found in its quote window");
142
+ assert.deepEqual(keptContents(grounded), TRAJECTORY_300_FACTS.map((fact) => fact.content));
143
+ });
144
+
145
+ test("trajectory 300: the same facts without their quote stay dropped by whole-source grounding", () => {
146
+ const unquoted = TRAJECTORY_300_FACTS.map(({ content }) => ({ content }));
147
+ const grounded = filterExtractionResultBySource(
148
+ resultOf(unquoted),
149
+ TRAJECTORY_300_SOURCE,
150
+ TRAJECTORY_300_SOURCE,
151
+ );
152
+ assert.equal(grounded.facts.length, 0);
153
+ });
154
+
155
+ test("trajectory 376: quote-valid facts and the entity they support are kept", () => {
156
+ const facts = [
157
+ {
158
+ content:
159
+ "OAuth1 Authorization headers must serialize percent-encoded parameter names and values as "
160
+ + "name=\"value\" pairs separated by commas, rather than swapping names and values or separating "
161
+ + "pairs only with spaces.",
162
+ quote:
163
+ "Authorization headers now serialize OAuth parameter names and values in the correct order and "
164
+ + "use RFC 5849 comma separators.",
165
+ },
166
+ {
167
+ content:
168
+ "In oauthlib/oauth1/rfc5849/parameters.py, prepare_request_uri_query must call "
169
+ + "_append_params(oauth_params, extract_params(query) or []) and reconstruct the URI with "
170
+ + "urlunparse((sch, net, path, par, query, fra)). The repaired implementation preserves URI "
171
+ + "components while appending OAuth parameters.",
172
+ quote:
173
+ "URI query signing now appends OAuth parameters while preserving scheme, authority/netloc, path, "
174
+ + "existing query parameters, and fragment.",
175
+ },
176
+ {
177
+ content:
178
+ "The oauthlib OAuth1 serialization repair preserves the existing unescaped, quoted realm behavior "
179
+ + "instead of introducing realm percent-encoding, keeping the fix focused on parameter "
180
+ + "serialization and separators.",
181
+ quote:
182
+ "Update the test expectation for realm to preserve the existing unescaped quoted realm behavior "
183
+ + "while still testing OAuth parameter escaping.",
184
+ },
185
+ {
186
+ content:
187
+ "The oauthlib regression module tests/oauth1/rfc5849/test_parameters.py covers RFC 5849 "
188
+ + "Authorization header formatting and URI query component preservation.",
189
+ quote: "Add a new tests/oauth1/rfc5849/test_parameters.py with targeted header/query tests.",
190
+ },
191
+ ];
192
+ const grounded = filterExtractionResultBySource(
193
+ resultOf(facts, {
194
+ entities: [
195
+ {
196
+ name: "oauthlib",
197
+ type: "project",
198
+ facts: ["Its OAuth1 parameter handling implementation is located in oauthlib/oauth1/rfc5849/parameters.py."],
199
+ structuredSections: [
200
+ {
201
+ key: "oauth1-parameter-handling",
202
+ title: "OAuth1 Parameter Handling",
203
+ facts: [
204
+ "URI query serialization preserves URI components and appends OAuth parameters after existing request parameters.",
205
+ "Authorization headers use correctly ordered, percent-encoded parameter names and values with comma separators.",
206
+ ],
207
+ },
208
+ ],
209
+ },
210
+ ],
211
+ }),
212
+ TRAJECTORY_376_SOURCE,
213
+ TRAJECTORY_376_SOURCE,
214
+ );
215
+ assert.equal(grounded.facts.length, 4);
216
+ assert.equal(grounded.entities.length, 1);
217
+ assert.equal(grounded.entities[0]!.structuredSections?.[0]?.facts.length, 2);
218
+ });
219
+
220
+ test("trajectory 118, part 1: quote-valid facts, entities and relationships are kept", () => {
221
+ const grounded = filterExtractionResultBySource(
222
+ resultOf(
223
+ [
224
+ {
225
+ content: "James Wilson wants every call he requests to originate from his account and be logged with him as the caller.",
226
+ quote: "Start the call from my account: I want every call I ask for to be logged under me as the caller.",
227
+ },
228
+ {
229
+ content: "James Wilson and Carol White work together in the TechCorp Solutions Team.",
230
+ quote: "I (James Wilson) and Carol White are working in the TechCorp Solutions Team",
231
+ },
232
+ ],
233
+ {
234
+ entities: [
235
+ {
236
+ name: "carol-white",
237
+ type: "person",
238
+ facts: ["Carol White works with James Wilson in the TechCorp Solutions Team."],
239
+ },
240
+ ],
241
+ relationships: [
242
+ { source: "james-wilson", target: "techcorp-solutions-team", label: "works in" },
243
+ { source: "james-wilson", target: "carol-white", label: "works with in the TechCorp Solutions Team" },
244
+ ],
245
+ },
246
+ ),
247
+ TRAJECTORY_118_SOURCE,
248
+ TRAJECTORY_118_SOURCE,
249
+ );
250
+ assert.equal(grounded.facts.length, 2);
251
+ assert.deepEqual(grounded.entities.map((entity) => entity.name), ["carol-white"]);
252
+ assert.equal(grounded.relationships?.length, 2);
253
+ });
254
+
255
+ test("a fabricated quote does not anchor anything", () => {
256
+ const grounded = filterExtractionResultBySource(
257
+ resultOf([
258
+ {
259
+ content: "James Wilson requires every call to be approved by a manager before it starts.",
260
+ quote: "Every call must be approved by a manager before it starts.",
261
+ },
262
+ ]),
263
+ TRAJECTORY_118_SOURCE,
264
+ TRAJECTORY_118_SOURCE,
265
+ );
266
+ assert.equal(grounded.facts.length, 0);
267
+ });
268
+
269
+ test("a real quote does not vouch for content that is about something else", () => {
270
+ const grounded = filterExtractionResultBySource(
271
+ resultOf([
272
+ {
273
+ content: "The nightly backup job copies the database snapshot to cold storage.",
274
+ quote: "Start the call from my account: I want every call I ask for to be logged under me as the caller.",
275
+ },
276
+ ]),
277
+ TRAJECTORY_118_SOURCE,
278
+ TRAJECTORY_118_SOURCE,
279
+ );
280
+ assert.equal(grounded.facts.length, 0);
281
+ });
282
+
283
+ test("a real quote does not vouch for content padded with words the source never used", () => {
284
+ const grounded = filterExtractionResultBySource(
285
+ resultOf([
286
+ {
287
+ content:
288
+ "James Wilson wants every call logged under his account, and finance reimburses encrypted "
289
+ + "satellite roaming surcharges quarterly through procurement.",
290
+ quote: "Start the call from my account: I want every call I ask for to be logged under me as the caller.",
291
+ },
292
+ ]),
293
+ TRAJECTORY_118_SOURCE,
294
+ TRAJECTORY_118_SOURCE,
295
+ );
296
+ assert.equal(grounded.facts.length, 0);
297
+ });
298
+
299
+ test("a quote too short to be evidence does not anchor", () => {
300
+ const grounded = filterExtractionResultBySource(
301
+ resultOf([
302
+ { content: "James Wilson owns the Q4 budget.", quote: "the caller" },
303
+ ]),
304
+ TRAJECTORY_118_SOURCE,
305
+ TRAJECTORY_118_SOURCE,
306
+ );
307
+ assert.equal(grounded.facts.length, 0);
308
+ });
309
+
310
+ test("a quote stitched across two turns is not one turn's words", () => {
311
+ const stitched = "logged under me as the caller. Workspace: the enterprise systems for this task are simulated.";
312
+ assert.deepEqual(quoteAnchors(stitched, TRAJECTORY_118_SOURCE), []);
313
+ const grounded = filterExtractionResultBySource(
314
+ resultOf([
315
+ { content: "Calls the caller logs are simulated by the enterprise systems for this task.", quote: stitched },
316
+ ]),
317
+ TRAJECTORY_118_SOURCE,
318
+ TRAJECTORY_118_SOURCE,
319
+ );
320
+ assert.equal(grounded.facts.length, 0);
321
+ });
322
+
323
+ test("entities and relationships need a kept quote: none is kept beside a fabricated quote", () => {
324
+ const grounded = filterExtractionResultBySource(
325
+ resultOf(
326
+ [
327
+ {
328
+ content: "James Wilson and Carol White work together in the TechCorp Solutions Team.",
329
+ quote: "James Wilson and Carol White both report to the TechCorp Solutions Team lead.",
330
+ },
331
+ ],
332
+ {
333
+ entities: [
334
+ {
335
+ name: "carol-white",
336
+ type: "person",
337
+ facts: ["Carol White works with James Wilson in the TechCorp Solutions Team."],
338
+ },
339
+ ],
340
+ relationships: [{ source: "james-wilson", target: "carol-white", label: "works with" }],
341
+ },
342
+ ),
343
+ TRAJECTORY_118_SOURCE,
344
+ TRAJECTORY_118_SOURCE,
345
+ );
346
+ assert.equal(grounded.entities.length, 0);
347
+ assert.equal(grounded.relationships?.length, 0);
348
+ });
349
+
350
+ test("entity facts and relationships unsupported by the anchor window are rejected", () => {
351
+ const grounded = filterExtractionResultBySource(
352
+ resultOf(
353
+ [
354
+ {
355
+ content: "James Wilson and Carol White work together in the TechCorp Solutions Team.",
356
+ quote: "I (James Wilson) and Carol White are working in the TechCorp Solutions Team",
357
+ },
358
+ ],
359
+ {
360
+ entities: [
361
+ {
362
+ name: "carol-white",
363
+ type: "person",
364
+ facts: ["Carol White approves the quarterly travel budget for the whole organization."],
365
+ },
366
+ ],
367
+ relationships: [{ source: "carol-white", target: "initech-corporation", label: "works in" }],
368
+ },
369
+ ),
370
+ TRAJECTORY_118_SOURCE,
371
+ TRAJECTORY_118_SOURCE,
372
+ );
373
+ assert.equal(grounded.facts.length, 1);
374
+ assert.equal(grounded.entities.length, 0);
375
+ assert.equal(grounded.relationships?.length, 0);
376
+ });
377
+
378
+ test("quoteAnchors matches across whitespace differences and keeps the window inside its turn", () => {
379
+ const anchors = quoteAnchors("Start the call from my\naccount:", TRAJECTORY_118_SOURCE);
380
+ assert.equal(anchors.length, 1);
381
+ assert.equal(anchors[0]!.quote, "Start the call from my account:");
382
+ assert.ok(anchors[0]!.window.includes("audio-only call with Carol White"));
383
+ assert.ok(!anchors[0]!.window.includes("Workspace:"));
384
+ });
385
+
386
+ test("quoteAnchors keeps a quote with `;` as one sentence", () => {
387
+ const [anchor] = quoteAnchors(
388
+ "Construct unique five-tuples only from Scapy-`IP` TCP or UDP packets; do not synthesize zero-port ICMP or other-protocol flows.",
389
+ TRAJECTORY_300_SOURCE,
390
+ );
391
+ assert.ok(anchor !== undefined);
392
+ assert.ok(anchor.quote.includes(";"));
393
+ assert.ok(anchor.window.includes("packets, do not synthesize"));
394
+ });
395
+
396
+ const BUDGET_SOURCE = [
397
+ "Notes: Alice did not approve the budget. Bob reviewed the budget with the finance team.",
398
+ ].join("\n\n");
399
+
400
+ test("a claim that inverts a negated quote is rejected, a restated exclusion is kept", () => {
401
+ const quote = "Alice did not approve the budget.";
402
+ const grounded = filterExtractionResultBySource(
403
+ resultOf([
404
+ { content: "Alice approved the budget after the finance review.", quote },
405
+ { content: "Alice would avoid approving the budget.", quote },
406
+ ]),
407
+ BUDGET_SOURCE,
408
+ BUDGET_SOURCE,
409
+ );
410
+ assert.deepEqual(keptContents(grounded), ["Alice would avoid approving the budget."]);
411
+ });
412
+
413
+ test("a claim that inverts a denial verb in the quote is rejected", () => {
414
+ const source = "Notes: Alice denied approving the budget. Bob reviewed it.";
415
+ const grounded = filterExtractionResultBySource(
416
+ resultOf([{ content: "Alice approved the budget.", quote: "Alice denied approving the budget." }]),
417
+ source,
418
+ source,
419
+ );
420
+ assert.equal(grounded.facts.length, 0);
421
+ });
422
+
423
+ test("a claim that states what the quote only suspects or asks is rejected", () => {
424
+ const source = "Notes: Alice suspects Bob stole funds. Is Alice the CEO at Acme? Carol audited the ledger.";
425
+ const grounded = filterExtractionResultBySource(
426
+ resultOf([
427
+ { content: "Bob stole funds.", quote: "Alice suspects Bob stole funds." },
428
+ { content: "Alice is the CEO at Acme.", quote: "Is Alice the CEO at Acme?" },
429
+ { content: "Alice suspects that Bob stole the funds.", quote: "Alice suspects Bob stole funds." },
430
+ ]),
431
+ source,
432
+ source,
433
+ );
434
+ assert.deepEqual(keptContents(grounded), ["Alice suspects that Bob stole the funds."]);
435
+ });
436
+
437
+ test("a curly apostrophe still counts as a negator", () => {
438
+ const source = "Notes: Alice didn\u2019t approve the budget. Bob reviewed it.";
439
+ const quote = "Alice didn\u2019t approve the budget.";
440
+ const grounded = filterExtractionResultBySource(
441
+ resultOf([
442
+ { content: "Alice approved the budget.", quote },
443
+ { content: "Alice would avoid approving the budget.", quote },
444
+ ]),
445
+ source,
446
+ source,
447
+ );
448
+ assert.deepEqual(keptContents(grounded), ["Alice would avoid approving the budget."]);
449
+ });
450
+
451
+ test("a reversed relationship is not kept", () => {
452
+ const source = "Notes: Alice uses PostgreSQL on the platform team. Carol audited the ledger.";
453
+ const grounded = filterExtractionResultBySource(
454
+ resultOf([{ content: "Alice uses PostgreSQL on the platform team.", quote: "Alice uses PostgreSQL on the platform team." }], {
455
+ relationships: [
456
+ { source: "alice", target: "postgresql", label: "uses" },
457
+ { source: "postgresql", target: "alice", label: "uses" },
458
+ ],
459
+ }),
460
+ source,
461
+ source,
462
+ );
463
+ assert.deepEqual(grounded.relationships, [{ source: "alice", target: "postgresql", label: "uses" }]);
464
+ });
465
+
466
+ test("an invented relationship label is not kept between two names in a kept quote window", () => {
467
+ const grounded = filterExtractionResultBySource(
468
+ resultOf(
469
+ [
470
+ {
471
+ content: "James Wilson and Carol White work together in the TechCorp Solutions Team.",
472
+ quote: "I (James Wilson) and Carol White are working in the TechCorp Solutions Team",
473
+ },
474
+ ],
475
+ {
476
+ relationships: [
477
+ { source: "james-wilson", target: "carol-white", label: "fired" },
478
+ { source: "james-wilson", target: "carol-white", label: "" },
479
+ { source: "james-wilson", target: "carol-white", label: "works with" },
480
+ ],
481
+ },
482
+ ),
483
+ TRAJECTORY_118_SOURCE,
484
+ TRAJECTORY_118_SOURCE,
485
+ );
486
+ assert.deepEqual(grounded.relationships?.map((relationship) => relationship.label), ["works with"]);
487
+ });
488
+
489
+ test("an entity keeps facts from both the whole-source path and the quote anchors", () => {
490
+ const grounded = filterExtractionResultBySource(
491
+ resultOf(
492
+ [
493
+ {
494
+ content: "James Wilson and Carol White work together in the TechCorp Solutions Team.",
495
+ quote: "I (James Wilson) and Carol White are working in the TechCorp Solutions Team",
496
+ },
497
+ ],
498
+ {
499
+ entities: [
500
+ {
501
+ name: "carol-white",
502
+ type: "person",
503
+ facts: [
504
+ "Carol White are working in the TechCorp Solutions Team",
505
+ "Carol White works with James Wilson in the TechCorp Solutions Team.",
506
+ ],
507
+ },
508
+ ],
509
+ },
510
+ ),
511
+ TRAJECTORY_118_SOURCE,
512
+ TRAJECTORY_118_SOURCE,
513
+ );
514
+ assert.equal(grounded.entities[0]?.facts.length, 2);
515
+ });
516
+
517
+ test("spanMode on keeps the embedded-quote path and does not use anchors", () => {
518
+ const grounded = filterExtractionResultBySource(
519
+ resultOf(TRAJECTORY_300_FACTS),
520
+ TRAJECTORY_300_SOURCE,
521
+ TRAJECTORY_300_SOURCE,
522
+ undefined,
523
+ undefined,
524
+ "on",
525
+ );
526
+ assert.equal(grounded.facts.length, 0);
527
+ });
528
+
529
+ test("a quote naming rewritten text is located after temporal anchoring", () => {
530
+ const source = "The deploy finished yesterday and the Atlas team signed off on the production rollout plan.";
531
+ const options = { sourceGrounding: true, anchorTemporalExpressions: true };
532
+ const grounded = applyExtractionSourceGrounding(
533
+ resultOf([
534
+ {
535
+ content: "The Atlas team approved the production rollout plan once the deploy finished.",
536
+ quote: "The deploy finished yesterday and the Atlas team signed off on the production rollout plan.",
537
+ },
538
+ ]),
539
+ source,
540
+ source,
541
+ undefined,
542
+ new Date("2026-10-20T12:00:00.000Z"),
543
+ options,
544
+ );
545
+ assert.equal(grounded.facts.length, 1);
546
+ });