chaffjs 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (892) hide show
  1. package/README.ja.md +21 -4
  2. package/README.md +20 -2
  3. package/checks/ai-tells.yaml +153 -0
  4. package/dist/acronym-expansion.d.ts +4 -0
  5. package/dist/acronym-expansion.d.ts.map +1 -0
  6. package/dist/acronym-expansion.js +46 -0
  7. package/dist/acronym-expansion.js.map +1 -0
  8. package/dist/ai-score/human-shares.d.ts.map +1 -1
  9. package/dist/ai-score/human-shares.js +54 -12
  10. package/dist/ai-score/human-shares.js.map +1 -1
  11. package/dist/ai-score/of-document.d.ts.map +1 -1
  12. package/dist/ai-score/of-document.js +4 -2
  13. package/dist/ai-score/of-document.js.map +1 -1
  14. package/dist/alternative-words.d.ts +6 -0
  15. package/dist/alternative-words.d.ts.map +1 -1
  16. package/dist/alternative-words.js +10 -0
  17. package/dist/alternative-words.js.map +1 -1
  18. package/dist/body-section.d.ts +3 -1
  19. package/dist/body-section.d.ts.map +1 -1
  20. package/dist/body-section.js +9 -2
  21. package/dist/body-section.js.map +1 -1
  22. package/dist/capitals-with-small.d.ts +5 -0
  23. package/dist/capitals-with-small.d.ts.map +1 -1
  24. package/dist/capitals-with-small.js +15 -0
  25. package/dist/capitals-with-small.js.map +1 -1
  26. package/dist/checks.d.ts +11 -0
  27. package/dist/checks.d.ts.map +1 -1
  28. package/dist/checks.js +27 -1
  29. package/dist/checks.js.map +1 -1
  30. package/dist/cli-args.js +1 -1
  31. package/dist/cli-args.js.map +1 -1
  32. package/dist/cli-text.d.ts.map +1 -1
  33. package/dist/cli-text.js +4 -0
  34. package/dist/cli-text.js.map +1 -1
  35. package/dist/closing-code.d.ts +8 -0
  36. package/dist/closing-code.d.ts.map +1 -0
  37. package/dist/closing-code.js +18 -0
  38. package/dist/closing-code.js.map +1 -0
  39. package/dist/commands/fix-plan.d.ts.map +1 -1
  40. package/dist/commands/fix-plan.js +64 -4
  41. package/dist/commands/fix-plan.js.map +1 -1
  42. package/dist/commands/test.d.ts.map +1 -1
  43. package/dist/commands/test.js +16 -2
  44. package/dist/commands/test.js.map +1 -1
  45. package/dist/date-format.d.ts +19 -1
  46. package/dist/date-format.d.ts.map +1 -1
  47. package/dist/date-format.js +41 -5
  48. package/dist/date-format.js.map +1 -1
  49. package/dist/detectors/acronym-context.d.ts +5 -2
  50. package/dist/detectors/acronym-context.d.ts.map +1 -1
  51. package/dist/detectors/acronym-context.js +19 -4
  52. package/dist/detectors/acronym-context.js.map +1 -1
  53. package/dist/detectors/acronym-expansion.d.ts.map +1 -1
  54. package/dist/detectors/acronym-expansion.js +25 -0
  55. package/dist/detectors/acronym-expansion.js.map +1 -1
  56. package/dist/detectors/acronym-gloss.d.ts +19 -0
  57. package/dist/detectors/acronym-gloss.d.ts.map +1 -1
  58. package/dist/detectors/acronym-gloss.js +115 -0
  59. package/dist/detectors/acronym-gloss.js.map +1 -1
  60. package/dist/detectors/acronym-mention.d.ts +5 -0
  61. package/dist/detectors/acronym-mention.d.ts.map +1 -1
  62. package/dist/detectors/acronym-mention.js +16 -0
  63. package/dist/detectors/acronym-mention.js.map +1 -1
  64. package/dist/detectors/acronym-name.d.ts +14 -2
  65. package/dist/detectors/acronym-name.d.ts.map +1 -1
  66. package/dist/detectors/acronym-name.js +28 -3
  67. package/dist/detectors/acronym-name.js.map +1 -1
  68. package/dist/detectors/acronym-series.d.ts +7 -0
  69. package/dist/detectors/acronym-series.d.ts.map +1 -0
  70. package/dist/detectors/acronym-series.js +25 -0
  71. package/dist/detectors/acronym-series.js.map +1 -0
  72. package/dist/detectors/ai-phrasing.d.ts +3 -6
  73. package/dist/detectors/ai-phrasing.d.ts.map +1 -1
  74. package/dist/detectors/ai-phrasing.js +17 -16
  75. package/dist/detectors/ai-phrasing.js.map +1 -1
  76. package/dist/detectors/ai-structure.d.ts +1 -0
  77. package/dist/detectors/ai-structure.d.ts.map +1 -1
  78. package/dist/detectors/ai-structure.js +15 -4
  79. package/dist/detectors/ai-structure.js.map +1 -1
  80. package/dist/detectors/alnum-number.d.ts +1 -0
  81. package/dist/detectors/alnum-number.d.ts.map +1 -1
  82. package/dist/detectors/alnum-number.js +7 -3
  83. package/dist/detectors/alnum-number.js.map +1 -1
  84. package/dist/detectors/bare-comparative.d.ts +6 -0
  85. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  86. package/dist/detectors/bare-comparative.js +31 -12
  87. package/dist/detectors/bare-comparative.js.map +1 -1
  88. package/dist/detectors/blank-runs.d.ts +12 -0
  89. package/dist/detectors/blank-runs.d.ts.map +1 -0
  90. package/dist/detectors/blank-runs.js +27 -0
  91. package/dist/detectors/blank-runs.js.map +1 -0
  92. package/dist/detectors/bold-emphasis-form.d.ts +8 -0
  93. package/dist/detectors/bold-emphasis-form.d.ts.map +1 -0
  94. package/dist/detectors/bold-emphasis-form.js +40 -0
  95. package/dist/detectors/bold-emphasis-form.js.map +1 -0
  96. package/dist/detectors/bold-emphasis.d.ts +0 -1
  97. package/dist/detectors/bold-emphasis.d.ts.map +1 -1
  98. package/dist/detectors/bold-emphasis.js +14 -12
  99. package/dist/detectors/bold-emphasis.js.map +1 -1
  100. package/dist/detectors/bold-label.d.ts +3 -1
  101. package/dist/detectors/bold-label.d.ts.map +1 -1
  102. package/dist/detectors/bold-label.js +16 -6
  103. package/dist/detectors/bold-label.js.map +1 -1
  104. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  105. package/dist/detectors/capitalised-term.js +28 -9
  106. package/dist/detectors/capitalised-term.js.map +1 -1
  107. package/dist/detectors/caps-caption.d.ts +5 -0
  108. package/dist/detectors/caps-caption.d.ts.map +1 -1
  109. package/dist/detectors/caps-caption.js +20 -2
  110. package/dist/detectors/caps-caption.js.map +1 -1
  111. package/dist/detectors/char-shape.d.ts.map +1 -1
  112. package/dist/detectors/char-shape.js +86 -27
  113. package/dist/detectors/char-shape.js.map +1 -1
  114. package/dist/detectors/chat-log-line.d.ts +8 -0
  115. package/dist/detectors/chat-log-line.d.ts.map +1 -0
  116. package/dist/detectors/chat-log-line.js +13 -0
  117. package/dist/detectors/chat-log-line.js.map +1 -0
  118. package/dist/detectors/citation-string.d.ts +9 -0
  119. package/dist/detectors/citation-string.d.ts.map +1 -0
  120. package/dist/detectors/citation-string.js +86 -0
  121. package/dist/detectors/citation-string.js.map +1 -0
  122. package/dist/detectors/closing-cliche.d.ts +18 -0
  123. package/dist/detectors/closing-cliche.d.ts.map +1 -0
  124. package/dist/detectors/closing-cliche.js +58 -0
  125. package/dist/detectors/closing-cliche.js.map +1 -0
  126. package/dist/detectors/closing-exhortation.d.ts +18 -0
  127. package/dist/detectors/closing-exhortation.d.ts.map +1 -0
  128. package/dist/detectors/closing-exhortation.js +55 -0
  129. package/dist/detectors/closing-exhortation.js.map +1 -0
  130. package/dist/detectors/cold-open.d.ts +25 -0
  131. package/dist/detectors/cold-open.d.ts.map +1 -0
  132. package/dist/detectors/cold-open.js +121 -0
  133. package/dist/detectors/cold-open.js.map +1 -0
  134. package/dist/detectors/comparative-context.d.ts +21 -0
  135. package/dist/detectors/comparative-context.d.ts.map +1 -0
  136. package/dist/detectors/comparative-context.js +57 -0
  137. package/dist/detectors/comparative-context.js.map +1 -0
  138. package/dist/detectors/concrete-evidence-density.d.ts +3 -0
  139. package/dist/detectors/concrete-evidence-density.d.ts.map +1 -0
  140. package/dist/detectors/concrete-evidence-density.js +75 -0
  141. package/dist/detectors/concrete-evidence-density.js.map +1 -0
  142. package/dist/detectors/concrete-evidence.d.ts +14 -0
  143. package/dist/detectors/concrete-evidence.d.ts.map +1 -1
  144. package/dist/detectors/concrete-evidence.js +24 -0
  145. package/dist/detectors/concrete-evidence.js.map +1 -1
  146. package/dist/detectors/contraction-emphasis.d.ts +3 -0
  147. package/dist/detectors/contraction-emphasis.d.ts.map +1 -0
  148. package/dist/detectors/contraction-emphasis.js +24 -0
  149. package/dist/detectors/contraction-emphasis.js.map +1 -0
  150. package/dist/detectors/contraction-mention.d.ts +12 -1
  151. package/dist/detectors/contraction-mention.d.ts.map +1 -1
  152. package/dist/detectors/contraction-mention.js +39 -6
  153. package/dist/detectors/contraction-mention.js.map +1 -1
  154. package/dist/detectors/contraction-mix.d.ts +3 -0
  155. package/dist/detectors/contraction-mix.d.ts.map +1 -0
  156. package/dist/detectors/contraction-mix.js +69 -0
  157. package/dist/detectors/contraction-mix.js.map +1 -0
  158. package/dist/detectors/contrast-frame.d.ts +5 -0
  159. package/dist/detectors/contrast-frame.d.ts.map +1 -1
  160. package/dist/detectors/contrast-frame.js +53 -6
  161. package/dist/detectors/contrast-frame.js.map +1 -1
  162. package/dist/detectors/coordinate-adjective.d.ts +2 -1
  163. package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
  164. package/dist/detectors/coordinate-adjective.js +4 -2
  165. package/dist/detectors/coordinate-adjective.js.map +1 -1
  166. package/dist/detectors/date-format.d.ts.map +1 -1
  167. package/dist/detectors/date-format.js +13 -1
  168. package/dist/detectors/date-format.js.map +1 -1
  169. package/dist/detectors/duplicate-definition.d.ts +3 -0
  170. package/dist/detectors/duplicate-definition.d.ts.map +1 -0
  171. package/dist/detectors/duplicate-definition.js +16 -0
  172. package/dist/detectors/duplicate-definition.js.map +1 -0
  173. package/dist/detectors/duplicate-heading.d.ts +4 -2
  174. package/dist/detectors/duplicate-heading.d.ts.map +1 -1
  175. package/dist/detectors/duplicate-heading.js +35 -11
  176. package/dist/detectors/duplicate-heading.js.map +1 -1
  177. package/dist/detectors/email-frame-words.d.ts +10 -0
  178. package/dist/detectors/email-frame-words.d.ts.map +1 -0
  179. package/dist/detectors/email-frame-words.js +34 -0
  180. package/dist/detectors/email-frame-words.js.map +1 -0
  181. package/dist/detectors/email-letter.d.ts +3 -7
  182. package/dist/detectors/email-letter.d.ts.map +1 -1
  183. package/dist/detectors/email-letter.js +13 -21
  184. package/dist/detectors/email-letter.js.map +1 -1
  185. package/dist/detectors/final-period-captions.d.ts +15 -0
  186. package/dist/detectors/final-period-captions.d.ts.map +1 -0
  187. package/dist/detectors/final-period-captions.js +61 -0
  188. package/dist/detectors/final-period-captions.js.map +1 -0
  189. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  190. package/dist/detectors/fullwidth-alnum.js +20 -4
  191. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  192. package/dist/detectors/gram-furniture.d.ts +18 -1
  193. package/dist/detectors/gram-furniture.d.ts.map +1 -1
  194. package/dist/detectors/gram-furniture.js +71 -0
  195. package/dist/detectors/gram-furniture.js.map +1 -1
  196. package/dist/detectors/gram-openers.d.ts +16 -0
  197. package/dist/detectors/gram-openers.d.ts.map +1 -1
  198. package/dist/detectors/gram-openers.js +52 -0
  199. package/dist/detectors/gram-openers.js.map +1 -1
  200. package/dist/detectors/gram-predicate.d.ts.map +1 -1
  201. package/dist/detectors/gram-predicate.js +40 -7
  202. package/dist/detectors/gram-predicate.js.map +1 -1
  203. package/dist/detectors/gram-repetition.d.ts +3 -0
  204. package/dist/detectors/gram-repetition.d.ts.map +1 -0
  205. package/dist/detectors/gram-repetition.js +158 -0
  206. package/dist/detectors/gram-repetition.js.map +1 -0
  207. package/dist/detectors/heading-level-skip.d.ts +6 -0
  208. package/dist/detectors/heading-level-skip.d.ts.map +1 -1
  209. package/dist/detectors/heading-level-skip.js +24 -1
  210. package/dist/detectors/heading-level-skip.js.map +1 -1
  211. package/dist/detectors/heading-numbering.js +2 -2
  212. package/dist/detectors/heading-numbering.js.map +1 -1
  213. package/dist/detectors/heading-sentences.d.ts +10 -0
  214. package/dist/detectors/heading-sentences.d.ts.map +1 -0
  215. package/dist/detectors/heading-sentences.js +32 -0
  216. package/dist/detectors/heading-sentences.js.map +1 -0
  217. package/dist/detectors/hyphen-copied-text.d.ts +3 -0
  218. package/dist/detectors/hyphen-copied-text.d.ts.map +1 -0
  219. package/dist/detectors/hyphen-copied-text.js +49 -0
  220. package/dist/detectors/hyphen-copied-text.js.map +1 -0
  221. package/dist/detectors/kanji-name-edge.d.ts +15 -0
  222. package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
  223. package/dist/detectors/kanji-name-edge.js +30 -0
  224. package/dist/detectors/kanji-name-edge.js.map +1 -1
  225. package/dist/detectors/kanji-run-pieces.d.ts +7 -0
  226. package/dist/detectors/kanji-run-pieces.d.ts.map +1 -1
  227. package/dist/detectors/kanji-run-pieces.js +14 -4
  228. package/dist/detectors/kanji-run-pieces.js.map +1 -1
  229. package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
  230. package/dist/detectors/kutoten-consistency.js +22 -4
  231. package/dist/detectors/kutoten-consistency.js.map +1 -1
  232. package/dist/detectors/lead-in-dash.d.ts +5 -0
  233. package/dist/detectors/lead-in-dash.d.ts.map +1 -1
  234. package/dist/detectors/lead-in-dash.js +9 -0
  235. package/dist/detectors/lead-in-dash.js.map +1 -1
  236. package/dist/detectors/letter-joined-name.d.ts +2 -0
  237. package/dist/detectors/letter-joined-name.d.ts.map +1 -1
  238. package/dist/detectors/letter-joined-name.js +8 -0
  239. package/dist/detectors/letter-joined-name.js.map +1 -1
  240. package/dist/detectors/lexicon.d.ts +1 -2
  241. package/dist/detectors/lexicon.d.ts.map +1 -1
  242. package/dist/detectors/lexicon.js +16 -57
  243. package/dist/detectors/lexicon.js.map +1 -1
  244. package/dist/detectors/list-item.d.ts +14 -0
  245. package/dist/detectors/list-item.d.ts.map +1 -1
  246. package/dist/detectors/list-item.js +30 -1
  247. package/dist/detectors/list-item.js.map +1 -1
  248. package/dist/detectors/list-items.d.ts +1 -1
  249. package/dist/detectors/list-items.d.ts.map +1 -1
  250. package/dist/detectors/list-items.js +2 -0
  251. package/dist/detectors/list-items.js.map +1 -1
  252. package/dist/detectors/list-joint.d.ts +18 -0
  253. package/dist/detectors/list-joint.d.ts.map +1 -0
  254. package/dist/detectors/list-joint.js +42 -0
  255. package/dist/detectors/list-joint.js.map +1 -0
  256. package/dist/detectors/list-layout.d.ts +14 -0
  257. package/dist/detectors/list-layout.d.ts.map +1 -0
  258. package/dist/detectors/list-layout.js +29 -0
  259. package/dist/detectors/list-layout.js.map +1 -0
  260. package/dist/detectors/list-lead-in.d.ts +7 -2
  261. package/dist/detectors/list-lead-in.d.ts.map +1 -1
  262. package/dist/detectors/list-lead-in.js +67 -6
  263. package/dist/detectors/list-lead-in.js.map +1 -1
  264. package/dist/detectors/list-parallel.d.ts +6 -0
  265. package/dist/detectors/list-parallel.d.ts.map +1 -1
  266. package/dist/detectors/list-parallel.js +106 -13
  267. package/dist/detectors/list-parallel.js.map +1 -1
  268. package/dist/detectors/list-run.d.ts +13 -0
  269. package/dist/detectors/list-run.d.ts.map +1 -0
  270. package/dist/detectors/list-run.js +80 -0
  271. package/dist/detectors/list-run.js.map +1 -0
  272. package/dist/detectors/list-sentence.d.ts +11 -0
  273. package/dist/detectors/list-sentence.d.ts.map +1 -1
  274. package/dist/detectors/list-sentence.js +1 -0
  275. package/dist/detectors/list-sentence.js.map +1 -1
  276. package/dist/detectors/mark-shape.d.ts +2 -1
  277. package/dist/detectors/mark-shape.d.ts.map +1 -1
  278. package/dist/detectors/mark-shape.js +10 -6
  279. package/dist/detectors/mark-shape.js.map +1 -1
  280. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  281. package/dist/detectors/missing-final-period.js +3 -1
  282. package/dist/detectors/missing-final-period.js.map +1 -1
  283. package/dist/detectors/name-run.d.ts +2 -0
  284. package/dist/detectors/name-run.d.ts.map +1 -1
  285. package/dist/detectors/name-run.js +1 -1
  286. package/dist/detectors/name-run.js.map +1 -1
  287. package/dist/detectors/name-variant-two-things.d.ts +18 -0
  288. package/dist/detectors/name-variant-two-things.d.ts.map +1 -0
  289. package/dist/detectors/name-variant-two-things.js +84 -0
  290. package/dist/detectors/name-variant-two-things.js.map +1 -0
  291. package/dist/detectors/name-variant.d.ts.map +1 -1
  292. package/dist/detectors/name-variant.js +14 -15
  293. package/dist/detectors/name-variant.js.map +1 -1
  294. package/dist/detectors/numbering-readings.d.ts +2 -2
  295. package/dist/detectors/numbering-readings.d.ts.map +1 -1
  296. package/dist/detectors/numbering-readings.js +7 -0
  297. package/dist/detectors/numbering-readings.js.map +1 -1
  298. package/dist/detectors/open-end-anaphor.d.ts +8 -0
  299. package/dist/detectors/open-end-anaphor.d.ts.map +1 -0
  300. package/dist/detectors/open-end-anaphor.js +22 -0
  301. package/dist/detectors/open-end-anaphor.js.map +1 -0
  302. package/dist/detectors/open-end-lead.d.ts +4 -0
  303. package/dist/detectors/open-end-lead.d.ts.map +1 -0
  304. package/dist/detectors/open-end-lead.js +34 -0
  305. package/dist/detectors/open-end-lead.js.map +1 -0
  306. package/dist/detectors/open-end-scope.d.ts.map +1 -1
  307. package/dist/detectors/open-end-scope.js +7 -1
  308. package/dist/detectors/open-end-scope.js.map +1 -1
  309. package/dist/detectors/ordinal-run-gaps.d.ts +1 -0
  310. package/dist/detectors/ordinal-run-gaps.d.ts.map +1 -1
  311. package/dist/detectors/ordinal-run-gaps.js +1 -1
  312. package/dist/detectors/ordinal-run-gaps.js.map +1 -1
  313. package/dist/detectors/organisation-run.d.ts +6 -0
  314. package/dist/detectors/organisation-run.d.ts.map +1 -1
  315. package/dist/detectors/organisation-run.js +26 -2
  316. package/dist/detectors/organisation-run.js.map +1 -1
  317. package/dist/detectors/orthographic-variant-open.d.ts +37 -0
  318. package/dist/detectors/orthographic-variant-open.d.ts.map +1 -0
  319. package/dist/detectors/orthographic-variant-open.js +81 -0
  320. package/dist/detectors/orthographic-variant-open.js.map +1 -0
  321. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  322. package/dist/detectors/orthographic-variant.js +55 -59
  323. package/dist/detectors/orthographic-variant.js.map +1 -1
  324. package/dist/detectors/orthography.d.ts.map +1 -1
  325. package/dist/detectors/orthography.js +14 -5
  326. package/dist/detectors/orthography.js.map +1 -1
  327. package/dist/detectors/over-general-claim.d.ts.map +1 -1
  328. package/dist/detectors/over-general-claim.js +82 -4
  329. package/dist/detectors/over-general-claim.js.map +1 -1
  330. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  331. package/dist/detectors/oxford-comma.js +61 -27
  332. package/dist/detectors/oxford-comma.js.map +1 -1
  333. package/dist/detectors/particle-run-names.d.ts +8 -0
  334. package/dist/detectors/particle-run-names.d.ts.map +1 -0
  335. package/dist/detectors/particle-run-names.js +17 -0
  336. package/dist/detectors/particle-run-names.js.map +1 -0
  337. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  338. package/dist/detectors/placeholder-text.js +14 -2
  339. package/dist/detectors/placeholder-text.js.map +1 -1
  340. package/dist/detectors/proper-noun-density.d.ts +13 -0
  341. package/dist/detectors/proper-noun-density.d.ts.map +1 -0
  342. package/dist/detectors/proper-noun-density.js +97 -0
  343. package/dist/detectors/proper-noun-density.js.map +1 -0
  344. package/dist/detectors/quote-without-source.d.ts +6 -2
  345. package/dist/detectors/quote-without-source.d.ts.map +1 -1
  346. package/dist/detectors/quote-without-source.js +33 -8
  347. package/dist/detectors/quote-without-source.js.map +1 -1
  348. package/dist/detectors/quoted-excerpt.d.ts +13 -0
  349. package/dist/detectors/quoted-excerpt.d.ts.map +1 -0
  350. package/dist/detectors/quoted-excerpt.js +53 -0
  351. package/dist/detectors/quoted-excerpt.js.map +1 -0
  352. package/dist/detectors/reference-entry.d.ts +7 -0
  353. package/dist/detectors/reference-entry.d.ts.map +1 -0
  354. package/dist/detectors/reference-entry.js +35 -0
  355. package/dist/detectors/reference-entry.js.map +1 -0
  356. package/dist/detectors/register-neutral-shape.d.ts +5 -2
  357. package/dist/detectors/register-neutral-shape.d.ts.map +1 -1
  358. package/dist/detectors/register-neutral-shape.js +21 -4
  359. package/dist/detectors/register-neutral-shape.js.map +1 -1
  360. package/dist/detectors/register-separate-part.d.ts +7 -0
  361. package/dist/detectors/register-separate-part.d.ts.map +1 -0
  362. package/dist/detectors/register-separate-part.js +32 -0
  363. package/dist/detectors/register-separate-part.js.map +1 -0
  364. package/dist/detectors/register-set-apart.d.ts +24 -0
  365. package/dist/detectors/register-set-apart.d.ts.map +1 -0
  366. package/dist/detectors/register-set-apart.js +102 -0
  367. package/dist/detectors/register-set-apart.js.map +1 -0
  368. package/dist/detectors/register-voice.d.ts +14 -0
  369. package/dist/detectors/register-voice.d.ts.map +1 -0
  370. package/dist/detectors/register-voice.js +47 -0
  371. package/dist/detectors/register-voice.js.map +1 -0
  372. package/dist/detectors/register.d.ts +5 -0
  373. package/dist/detectors/register.d.ts.map +1 -1
  374. package/dist/detectors/register.js +13 -0
  375. package/dist/detectors/register.js.map +1 -1
  376. package/dist/detectors/registry/closing-cliche.d.ts +3 -0
  377. package/dist/detectors/registry/closing-cliche.d.ts.map +1 -0
  378. package/dist/detectors/registry/closing-cliche.js +3 -0
  379. package/dist/detectors/registry/closing-cliche.js.map +1 -0
  380. package/dist/detectors/registry/closing-exhortation.d.ts +3 -0
  381. package/dist/detectors/registry/closing-exhortation.d.ts.map +1 -0
  382. package/dist/detectors/registry/closing-exhortation.js +3 -0
  383. package/dist/detectors/registry/closing-exhortation.js.map +1 -0
  384. package/dist/detectors/registry/cold-open.d.ts +3 -0
  385. package/dist/detectors/registry/cold-open.d.ts.map +1 -0
  386. package/dist/detectors/registry/cold-open.js +3 -0
  387. package/dist/detectors/registry/cold-open.js.map +1 -0
  388. package/dist/detectors/registry/colon-lead-in.js +1 -1
  389. package/dist/detectors/registry/colon-lead-in.js.map +1 -1
  390. package/dist/detectors/registry/concrete-evidence.js +1 -1
  391. package/dist/detectors/registry/concrete-evidence.js.map +1 -1
  392. package/dist/detectors/registry/contraction-mix.js +1 -1
  393. package/dist/detectors/registry/contraction-mix.js.map +1 -1
  394. package/dist/detectors/registry/duplicate-definition.js +1 -1
  395. package/dist/detectors/registry/duplicate-definition.js.map +1 -1
  396. package/dist/detectors/registry/ngram-repetition.js +1 -1
  397. package/dist/detectors/registry/ngram-repetition.js.map +1 -1
  398. package/dist/detectors/registry/proper-noun-density.js +1 -1
  399. package/dist/detectors/registry/proper-noun-density.js.map +1 -1
  400. package/dist/detectors/registry/topic-predicate-distance.js +1 -1
  401. package/dist/detectors/registry/topic-predicate-distance.js.map +1 -1
  402. package/dist/detectors/registry/unprompted-denial.d.ts +3 -0
  403. package/dist/detectors/registry/unprompted-denial.d.ts.map +1 -0
  404. package/dist/detectors/registry/unprompted-denial.js +3 -0
  405. package/dist/detectors/registry/unprompted-denial.js.map +1 -0
  406. package/dist/detectors/reproduced-text.d.ts +5 -0
  407. package/dist/detectors/reproduced-text.d.ts.map +1 -0
  408. package/dist/detectors/reproduced-text.js +19 -0
  409. package/dist/detectors/reproduced-text.js.map +1 -0
  410. package/dist/detectors/request-owner.d.ts +2 -1
  411. package/dist/detectors/request-owner.d.ts.map +1 -1
  412. package/dist/detectors/request-owner.js +31 -7
  413. package/dist/detectors/request-owner.js.map +1 -1
  414. package/dist/detectors/requirement-smell.d.ts.map +1 -1
  415. package/dist/detectors/requirement-smell.js +16 -5
  416. package/dist/detectors/requirement-smell.js.map +1 -1
  417. package/dist/detectors/sentence-counts.d.ts +2 -1
  418. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  419. package/dist/detectors/sentence-counts.js +23 -7
  420. package/dist/detectors/sentence-counts.js.map +1 -1
  421. package/dist/detectors/sentence-ending.d.ts +7 -1
  422. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  423. package/dist/detectors/sentence-ending.js +47 -11
  424. package/dist/detectors/sentence-ending.js.map +1 -1
  425. package/dist/detectors/sentence-length.d.ts.map +1 -1
  426. package/dist/detectors/sentence-length.js +37 -12
  427. package/dist/detectors/sentence-length.js.map +1 -1
  428. package/dist/detectors/sentence-load.d.ts +5 -3
  429. package/dist/detectors/sentence-load.d.ts.map +1 -1
  430. package/dist/detectors/sentence-load.js +3 -5
  431. package/dist/detectors/sentence-load.js.map +1 -1
  432. package/dist/detectors/sentence-parts.d.ts +11 -0
  433. package/dist/detectors/sentence-parts.d.ts.map +1 -0
  434. package/dist/detectors/sentence-parts.js +64 -0
  435. package/dist/detectors/sentence-parts.js.map +1 -0
  436. package/dist/detectors/sentence-title.d.ts +3 -0
  437. package/dist/detectors/sentence-title.d.ts.map +1 -1
  438. package/dist/detectors/sentence-title.js +10 -0
  439. package/dist/detectors/sentence-title.js.map +1 -1
  440. package/dist/detectors/signals.d.ts +0 -2
  441. package/dist/detectors/signals.d.ts.map +1 -1
  442. package/dist/detectors/signals.js +18 -167
  443. package/dist/detectors/signals.js.map +1 -1
  444. package/dist/detectors/spelling-variety.d.ts.map +1 -1
  445. package/dist/detectors/spelling-variety.js +20 -2
  446. package/dist/detectors/spelling-variety.js.map +1 -1
  447. package/dist/detectors/structure-tree.d.ts +2 -1
  448. package/dist/detectors/structure-tree.d.ts.map +1 -1
  449. package/dist/detectors/structure-tree.js +3 -8
  450. package/dist/detectors/structure-tree.js.map +1 -1
  451. package/dist/detectors/structure.d.ts +9 -1
  452. package/dist/detectors/structure.d.ts.map +1 -1
  453. package/dist/detectors/structure.js +43 -16
  454. package/dist/detectors/structure.js.map +1 -1
  455. package/dist/detectors/superlative-clause.d.ts.map +1 -1
  456. package/dist/detectors/superlative-clause.js +19 -2
  457. package/dist/detectors/superlative-clause.js.map +1 -1
  458. package/dist/detectors/superlative-context.d.ts +35 -0
  459. package/dist/detectors/superlative-context.d.ts.map +1 -0
  460. package/dist/detectors/superlative-context.js +71 -0
  461. package/dist/detectors/superlative-context.js.map +1 -0
  462. package/dist/detectors/superlative-scope.d.ts +6 -2
  463. package/dist/detectors/superlative-scope.d.ts.map +1 -1
  464. package/dist/detectors/superlative-scope.js +20 -6
  465. package/dist/detectors/superlative-scope.js.map +1 -1
  466. package/dist/detectors/team.d.ts +0 -1
  467. package/dist/detectors/team.d.ts.map +1 -1
  468. package/dist/detectors/team.js +0 -46
  469. package/dist/detectors/team.js.map +1 -1
  470. package/dist/detectors/titled-code-citation.d.ts +12 -0
  471. package/dist/detectors/titled-code-citation.d.ts.map +1 -0
  472. package/dist/detectors/titled-code-citation.js +11 -0
  473. package/dist/detectors/titled-code-citation.js.map +1 -0
  474. package/dist/detectors/titled-run.d.ts +8 -1
  475. package/dist/detectors/titled-run.d.ts.map +1 -1
  476. package/dist/detectors/titled-run.js +14 -4
  477. package/dist/detectors/titled-run.js.map +1 -1
  478. package/dist/detectors/token-shape.d.ts.map +1 -1
  479. package/dist/detectors/token-shape.js +33 -16
  480. package/dist/detectors/token-shape.js.map +1 -1
  481. package/dist/detectors/topic-predicate-distance.d.ts +4 -0
  482. package/dist/detectors/topic-predicate-distance.d.ts.map +1 -0
  483. package/dist/detectors/topic-predicate-distance.js +22 -0
  484. package/dist/detectors/topic-predicate-distance.js.map +1 -0
  485. package/dist/detectors/undefined-term.d.ts +5 -0
  486. package/dist/detectors/undefined-term.d.ts.map +1 -1
  487. package/dist/detectors/undefined-term.js +22 -1
  488. package/dist/detectors/undefined-term.js.map +1 -1
  489. package/dist/detectors/unfilled-placeholder.d.ts.map +1 -1
  490. package/dist/detectors/unfilled-placeholder.js +15 -1
  491. package/dist/detectors/unfilled-placeholder.js.map +1 -1
  492. package/dist/detectors/unknown-word-context.d.ts +35 -0
  493. package/dist/detectors/unknown-word-context.d.ts.map +1 -0
  494. package/dist/detectors/unknown-word-context.js +100 -0
  495. package/dist/detectors/unknown-word-context.js.map +1 -0
  496. package/dist/detectors/unknown-word.d.ts +0 -5
  497. package/dist/detectors/unknown-word.d.ts.map +1 -1
  498. package/dist/detectors/unknown-word.js +17 -19
  499. package/dist/detectors/unknown-word.js.map +1 -1
  500. package/dist/detectors/unprompted-denial.d.ts +25 -0
  501. package/dist/detectors/unprompted-denial.d.ts.map +1 -0
  502. package/dist/detectors/unprompted-denial.js +100 -0
  503. package/dist/detectors/unprompted-denial.js.map +1 -0
  504. package/dist/document-sections.d.ts.map +1 -1
  505. package/dist/document-sections.js +3 -1
  506. package/dist/document-sections.js.map +1 -1
  507. package/dist/fix-plan/all-signs.d.ts +17 -0
  508. package/dist/fix-plan/all-signs.d.ts.map +1 -0
  509. package/dist/fix-plan/all-signs.js +26 -0
  510. package/dist/fix-plan/all-signs.js.map +1 -0
  511. package/dist/fix-plan/plan.d.ts +31 -0
  512. package/dist/fix-plan/plan.d.ts.map +1 -1
  513. package/dist/fix-plan/plan.js +23 -3
  514. package/dist/fix-plan/plan.js.map +1 -1
  515. package/dist/fix-plan/render.d.ts.map +1 -1
  516. package/dist/fix-plan/render.js +31 -2
  517. package/dist/fix-plan/render.js.map +1 -1
  518. package/dist/fix-plan/risen.d.ts +10 -0
  519. package/dist/fix-plan/risen.d.ts.map +1 -0
  520. package/dist/fix-plan/risen.js +7 -0
  521. package/dist/fix-plan/risen.js.map +1 -0
  522. package/dist/fix-plan/text.d.ts +15 -0
  523. package/dist/fix-plan/text.d.ts.map +1 -1
  524. package/dist/fix-plan/text.js +38 -2
  525. package/dist/fix-plan/text.js.map +1 -1
  526. package/dist/heading-numbering.d.ts +2 -1
  527. package/dist/heading-numbering.d.ts.map +1 -1
  528. package/dist/heading-numbering.js +40 -10
  529. package/dist/heading-numbering.js.map +1 -1
  530. package/dist/html/html-site-chrome.d.ts.map +1 -1
  531. package/dist/html/html-site-chrome.js +7 -2
  532. package/dist/html/html-site-chrome.js.map +1 -1
  533. package/dist/latin-spacing-source.d.ts +12 -0
  534. package/dist/latin-spacing-source.d.ts.map +1 -0
  535. package/dist/latin-spacing-source.js +25 -0
  536. package/dist/latin-spacing-source.js.map +1 -0
  537. package/dist/law-title.d.ts +7 -0
  538. package/dist/law-title.d.ts.map +1 -0
  539. package/dist/law-title.js +29 -0
  540. package/dist/law-title.js.map +1 -0
  541. package/dist/name-ending-run.d.ts +11 -0
  542. package/dist/name-ending-run.d.ts.map +1 -0
  543. package/dist/name-ending-run.js +37 -0
  544. package/dist/name-ending-run.js.map +1 -0
  545. package/dist/name-separator.d.ts.map +1 -1
  546. package/dist/name-separator.js +4 -1
  547. package/dist/name-separator.js.map +1 -1
  548. package/dist/name-title-slip.d.ts +11 -0
  549. package/dist/name-title-slip.d.ts.map +1 -0
  550. package/dist/name-title-slip.js +51 -0
  551. package/dist/name-title-slip.js.map +1 -0
  552. package/dist/name-variant-shapes.d.ts +14 -0
  553. package/dist/name-variant-shapes.d.ts.map +1 -0
  554. package/dist/name-variant-shapes.js +43 -0
  555. package/dist/name-variant-shapes.js.map +1 -0
  556. package/dist/name-word-use.d.ts +5 -0
  557. package/dist/name-word-use.d.ts.map +1 -0
  558. package/dist/name-word-use.js +12 -0
  559. package/dist/name-word-use.js.map +1 -0
  560. package/dist/opening-passage.d.ts +8 -0
  561. package/dist/opening-passage.d.ts.map +1 -0
  562. package/dist/opening-passage.js +24 -0
  563. package/dist/opening-passage.js.map +1 -0
  564. package/dist/paragraph-length.d.ts +14 -0
  565. package/dist/paragraph-length.d.ts.map +1 -1
  566. package/dist/paragraph-length.js +25 -0
  567. package/dist/paragraph-length.js.map +1 -1
  568. package/dist/paragraph-runs.d.ts +2 -2
  569. package/dist/paragraph-runs.d.ts.map +1 -1
  570. package/dist/paragraph-runs.js +65 -14
  571. package/dist/paragraph-runs.js.map +1 -1
  572. package/dist/plugin.d.ts +2 -0
  573. package/dist/plugin.d.ts.map +1 -1
  574. package/dist/quote-echo.d.ts +6 -0
  575. package/dist/quote-echo.d.ts.map +1 -0
  576. package/dist/quote-echo.js +14 -0
  577. package/dist/quote-echo.js.map +1 -0
  578. package/dist/quote-gloss.d.ts +4 -0
  579. package/dist/quote-gloss.d.ts.map +1 -0
  580. package/dist/quote-gloss.js +7 -0
  581. package/dist/quote-gloss.js.map +1 -0
  582. package/dist/quoted-spelling.d.ts +17 -0
  583. package/dist/quoted-spelling.d.ts.map +1 -0
  584. package/dist/quoted-spelling.js +27 -0
  585. package/dist/quoted-spelling.js.map +1 -0
  586. package/dist/render/semantic.d.ts +1 -1
  587. package/dist/render/semantic.d.ts.map +1 -1
  588. package/dist/render/semantic.js +2 -1
  589. package/dist/render/semantic.js.map +1 -1
  590. package/dist/rule-of-three.d.ts +19 -0
  591. package/dist/rule-of-three.d.ts.map +1 -0
  592. package/dist/rule-of-three.js +33 -0
  593. package/dist/rule-of-three.js.map +1 -0
  594. package/dist/run-semantic.d.ts.map +1 -1
  595. package/dist/run-semantic.js +2 -2
  596. package/dist/run-semantic.js.map +1 -1
  597. package/dist/section-levels.d.ts +18 -0
  598. package/dist/section-levels.d.ts.map +1 -0
  599. package/dist/section-levels.js +80 -0
  600. package/dist/section-levels.js.map +1 -0
  601. package/dist/semantic.d.ts +2 -0
  602. package/dist/semantic.d.ts.map +1 -1
  603. package/dist/semantic.js +15 -2
  604. package/dist/semantic.js.map +1 -1
  605. package/dist/sentence-load.d.ts +2 -1
  606. package/dist/sentence-load.d.ts.map +1 -1
  607. package/dist/sentence-load.js +4 -2
  608. package/dist/sentence-load.js.map +1 -1
  609. package/dist/set-phrase-particles.d.ts +4 -0
  610. package/dist/set-phrase-particles.d.ts.map +1 -0
  611. package/dist/set-phrase-particles.js +26 -0
  612. package/dist/set-phrase-particles.js.map +1 -0
  613. package/dist/spelling.d.ts +11 -0
  614. package/dist/spelling.d.ts.map +1 -1
  615. package/dist/spelling.js +19 -5
  616. package/dist/spelling.js.map +1 -1
  617. package/dist/structure/alternative-clause.d.ts +7 -0
  618. package/dist/structure/alternative-clause.d.ts.map +1 -1
  619. package/dist/structure/alternative-clause.js +23 -8
  620. package/dist/structure/alternative-clause.js.map +1 -1
  621. package/dist/structure/cited-document-section.d.ts +2 -0
  622. package/dist/structure/cited-document-section.d.ts.map +1 -1
  623. package/dist/structure/cited-document-section.js +23 -1
  624. package/dist/structure/cited-document-section.js.map +1 -1
  625. package/dist/structure/issues.d.ts +4 -2
  626. package/dist/structure/issues.d.ts.map +1 -1
  627. package/dist/structure/issues.js +17 -9
  628. package/dist/structure/issues.js.map +1 -1
  629. package/dist/structure/numbering.d.ts +10 -1
  630. package/dist/structure/numbering.d.ts.map +1 -1
  631. package/dist/structure/numbering.js +41 -4
  632. package/dist/structure/numbering.js.map +1 -1
  633. package/dist/structure/unread-label.d.ts +13 -0
  634. package/dist/structure/unread-label.d.ts.map +1 -0
  635. package/dist/structure/unread-label.js +70 -0
  636. package/dist/structure/unread-label.js.map +1 -0
  637. package/dist/structure-shape/template-outline.d.ts +11 -0
  638. package/dist/structure-shape/template-outline.d.ts.map +1 -0
  639. package/dist/structure-shape/template-outline.js +25 -0
  640. package/dist/structure-shape/template-outline.js.map +1 -0
  641. package/dist/title-case-name.d.ts +12 -0
  642. package/dist/title-case-name.d.ts.map +1 -0
  643. package/dist/title-case-name.js +37 -0
  644. package/dist/title-case-name.js.map +1 -0
  645. package/dist/topic-clause.d.ts +6 -1
  646. package/dist/topic-clause.d.ts.map +1 -1
  647. package/dist/topic-clause.js +90 -3
  648. package/dist/topic-clause.js.map +1 -1
  649. package/dist/word-use.d.ts +12 -4
  650. package/dist/word-use.d.ts.map +1 -1
  651. package/dist/word-use.js +47 -5
  652. package/dist/word-use.js.map +1 -1
  653. package/package.json +4 -3
  654. package/rules/ai-generated-composite.yaml +12 -3
  655. package/rules/ai-structure.yaml +7 -6
  656. package/rules/ai-tell.yaml +10 -6
  657. package/rules/all-caps-shouting.yaml +2 -2
  658. package/rules/bold-emphasis.yaml +5 -4
  659. package/rules/bold-label-list.yaml +6 -6
  660. package/rules/closing-cliche.yaml +4 -5
  661. package/rules/closing-exhortation.yaml +74 -0
  662. package/rules/cold-open.yaml +95 -0
  663. package/rules/colon-lead-in.yaml +68 -10
  664. package/rules/comparative-without-baseline.yaml +2 -2
  665. package/rules/concrete-evidence-density.yaml +2 -2
  666. package/rules/contraction-consistency.yaml +2 -2
  667. package/rules/contrast-framing.yaml +16 -13
  668. package/rules/dangling-reference.yaml +2 -2
  669. package/rules/date-format-consistency.yaml +2 -2
  670. package/rules/duplicate-definition.yaml +2 -2
  671. package/rules/duplicate-heading.yaml +5 -2
  672. package/rules/email-greeting-closing.yaml +2 -2
  673. package/rules/email-stock-courtesy.yaml +62 -0
  674. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  675. package/rules/generic-opening.yaml +63 -0
  676. package/rules/heading-level-skip.yaml +2 -2
  677. package/rules/heading-numbering-mix.yaml +20 -20
  678. package/rules/honesty-marker.yaml +84 -0
  679. package/rules/hyphen-as-dash.yaml +2 -2
  680. package/rules/kutoten-consistency.yaml +4 -4
  681. package/rules/latin-spacing.yaml +6 -4
  682. package/rules/list-item-form-mix.yaml +2 -2
  683. package/rules/max-kanji-continuous.yaml +7 -3
  684. package/rules/max-paragraph-length.yaml +2 -2
  685. package/rules/max-sentence-length.yaml +6 -2
  686. package/rules/missing-final-period.yaml +2 -2
  687. package/rules/name-variant.yaml +5 -2
  688. package/rules/ngram-repetition.yaml +2 -2
  689. package/rules/no-doubled-joshi.yaml +2 -2
  690. package/rules/no-em-dash.yaml +2 -2
  691. package/rules/no-mixed-desumasu.yaml +16 -3
  692. package/rules/nominalization.yaml +1 -1
  693. package/rules/numbering-gap.yaml +2 -2
  694. package/rules/one-sentence-paragraph-run.yaml +2 -2
  695. package/rules/orthographic-variant.yaml +2 -2
  696. package/rules/over-general-claim.yaml +2 -2
  697. package/rules/oxford-comma-consistency.yaml +15 -3
  698. package/rules/proper-noun-density.yaml +14 -7
  699. package/rules/quote-without-source.yaml +2 -2
  700. package/rules/request-without-deadline.yaml +2 -2
  701. package/rules/requirement-smell.yaml +2 -2
  702. package/rules/rule-of-three.yaml +3 -3
  703. package/rules/section-length-uniformity.yaml +2 -2
  704. package/rules/spelling-consistency.yaml +4 -4
  705. package/rules/teki-overuse.yaml +2 -2
  706. package/rules/topic-predicate-distance.yaml +3 -2
  707. package/rules/undefined-acronym.yaml +9 -2
  708. package/rules/undefined-term.yaml +2 -2
  709. package/rules/unfilled-placeholder.yaml +2 -2
  710. package/rules/unknown-word.yaml +2 -2
  711. package/rules/unprompted-denial.yaml +88 -0
  712. package/rules/unqualified-superlative.yaml +8 -2
  713. package/skills/chaff/SKILL.md +39 -6
  714. package/src/acronym-expansion.ts +57 -0
  715. package/src/ai-score/human-shares.ts +54 -12
  716. package/src/ai-score/of-document.ts +5 -2
  717. package/src/alternative-words.ts +15 -0
  718. package/src/body-section.ts +11 -2
  719. package/src/capitals-with-small.ts +16 -0
  720. package/src/checks.ts +32 -1
  721. package/src/cli-args.ts +1 -1
  722. package/src/cli-text.ts +4 -0
  723. package/src/closing-code.ts +21 -0
  724. package/src/commands/fix-plan.ts +72 -5
  725. package/src/commands/test.ts +18 -2
  726. package/src/date-format.ts +54 -7
  727. package/src/detectors/acronym-context.ts +23 -4
  728. package/src/detectors/acronym-expansion.ts +26 -0
  729. package/src/detectors/acronym-gloss.ts +123 -0
  730. package/src/detectors/acronym-mention.ts +17 -0
  731. package/src/detectors/acronym-name.ts +40 -3
  732. package/src/detectors/acronym-series.ts +27 -0
  733. package/src/detectors/ai-phrasing.ts +18 -17
  734. package/src/detectors/ai-structure.ts +23 -6
  735. package/src/detectors/alnum-number.ts +8 -3
  736. package/src/detectors/bare-comparative.ts +41 -13
  737. package/src/detectors/blank-runs.ts +30 -0
  738. package/src/detectors/bold-emphasis-form.ts +58 -0
  739. package/src/detectors/bold-emphasis.ts +16 -17
  740. package/src/detectors/bold-label.ts +22 -6
  741. package/src/detectors/capitalised-term.ts +36 -9
  742. package/src/detectors/caps-caption.ts +24 -2
  743. package/src/detectors/char-shape.ts +118 -29
  744. package/src/detectors/chat-log-line.ts +17 -0
  745. package/src/detectors/citation-string.ts +93 -0
  746. package/src/detectors/closing-cliche.ts +74 -0
  747. package/src/detectors/closing-exhortation.ts +74 -0
  748. package/src/detectors/cold-open.ts +145 -0
  749. package/src/detectors/comparative-context.ts +74 -0
  750. package/src/detectors/concrete-evidence-density.ts +99 -0
  751. package/src/detectors/concrete-evidence.ts +40 -0
  752. package/src/detectors/contraction-emphasis.ts +46 -0
  753. package/src/detectors/contraction-mention.ts +52 -6
  754. package/src/detectors/contraction-mix.ts +94 -0
  755. package/src/detectors/contrast-frame.ts +65 -7
  756. package/src/detectors/coordinate-adjective.ts +4 -2
  757. package/src/detectors/date-format.ts +18 -2
  758. package/src/detectors/duplicate-definition.ts +21 -0
  759. package/src/detectors/duplicate-heading.ts +44 -15
  760. package/src/detectors/email-frame-words.ts +39 -0
  761. package/src/detectors/email-letter.ts +15 -20
  762. package/src/detectors/final-period-captions.ts +78 -0
  763. package/src/detectors/fullwidth-alnum.ts +24 -4
  764. package/src/detectors/gram-furniture.ts +87 -1
  765. package/src/detectors/gram-openers.ts +71 -0
  766. package/src/detectors/gram-predicate.ts +49 -6
  767. package/src/detectors/gram-repetition.ts +199 -0
  768. package/src/detectors/heading-level-skip.ts +31 -1
  769. package/src/detectors/heading-numbering.ts +2 -2
  770. package/src/detectors/heading-sentences.ts +36 -0
  771. package/src/detectors/hyphen-copied-text.ts +65 -0
  772. package/src/detectors/kanji-name-edge.ts +31 -0
  773. package/src/detectors/kanji-run-pieces.ts +26 -0
  774. package/src/detectors/kutoten-consistency.ts +24 -4
  775. package/src/detectors/lead-in-dash.ts +11 -0
  776. package/src/detectors/letter-joined-name.ts +14 -0
  777. package/src/detectors/lexicon.ts +20 -63
  778. package/src/detectors/list-item.ts +37 -1
  779. package/src/detectors/list-items.ts +4 -1
  780. package/src/detectors/list-joint.ts +44 -0
  781. package/src/detectors/list-layout.ts +39 -0
  782. package/src/detectors/list-lead-in.ts +88 -7
  783. package/src/detectors/list-parallel.ts +119 -13
  784. package/src/detectors/list-run.ts +86 -0
  785. package/src/detectors/list-sentence.ts +11 -0
  786. package/src/detectors/mark-shape.ts +12 -7
  787. package/src/detectors/missing-final-period.ts +9 -1
  788. package/src/detectors/name-run.ts +2 -1
  789. package/src/detectors/name-variant-two-things.ts +136 -0
  790. package/src/detectors/name-variant.ts +14 -19
  791. package/src/detectors/numbering-readings.ts +10 -2
  792. package/src/detectors/open-end-anaphor.ts +31 -0
  793. package/src/detectors/open-end-lead.ts +46 -0
  794. package/src/detectors/open-end-scope.ts +8 -1
  795. package/src/detectors/ordinal-run-gaps.ts +1 -1
  796. package/src/detectors/organisation-run.ts +26 -2
  797. package/src/detectors/orthographic-variant-open.ts +124 -0
  798. package/src/detectors/orthographic-variant.ts +82 -82
  799. package/src/detectors/orthography.ts +20 -7
  800. package/src/detectors/over-general-claim.ts +106 -5
  801. package/src/detectors/oxford-comma.ts +68 -28
  802. package/src/detectors/particle-run-names.ts +17 -0
  803. package/src/detectors/placeholder-text.ts +21 -4
  804. package/src/detectors/proper-noun-density.ts +109 -0
  805. package/src/detectors/quote-without-source.ts +52 -10
  806. package/src/detectors/quoted-excerpt.ts +68 -0
  807. package/src/detectors/reference-entry.ts +42 -0
  808. package/src/detectors/register-neutral-shape.ts +26 -6
  809. package/src/detectors/register-separate-part.ts +42 -0
  810. package/src/detectors/register-set-apart.ts +124 -0
  811. package/src/detectors/register-voice.ts +63 -0
  812. package/src/detectors/register.ts +15 -0
  813. package/src/detectors/registry/closing-cliche.ts +4 -0
  814. package/src/detectors/registry/closing-exhortation.ts +4 -0
  815. package/src/detectors/registry/cold-open.ts +4 -0
  816. package/src/detectors/registry/colon-lead-in.ts +1 -1
  817. package/src/detectors/registry/concrete-evidence.ts +1 -1
  818. package/src/detectors/registry/contraction-mix.ts +1 -1
  819. package/src/detectors/registry/duplicate-definition.ts +1 -1
  820. package/src/detectors/registry/ngram-repetition.ts +1 -1
  821. package/src/detectors/registry/proper-noun-density.ts +1 -1
  822. package/src/detectors/registry/topic-predicate-distance.ts +1 -1
  823. package/src/detectors/registry/unprompted-denial.ts +4 -0
  824. package/src/detectors/reproduced-text.ts +33 -0
  825. package/src/detectors/request-owner.ts +31 -8
  826. package/src/detectors/requirement-smell.ts +21 -5
  827. package/src/detectors/sentence-counts.ts +27 -7
  828. package/src/detectors/sentence-ending.ts +66 -14
  829. package/src/detectors/sentence-length.ts +43 -11
  830. package/src/detectors/sentence-load.ts +3 -6
  831. package/src/detectors/sentence-parts.ts +73 -0
  832. package/src/detectors/sentence-title.ts +14 -0
  833. package/src/detectors/signals.ts +20 -202
  834. package/src/detectors/spelling-variety.ts +26 -2
  835. package/src/detectors/structure-tree.ts +5 -9
  836. package/src/detectors/structure.ts +47 -19
  837. package/src/detectors/superlative-clause.ts +21 -2
  838. package/src/detectors/superlative-context.ts +99 -0
  839. package/src/detectors/superlative-scope.ts +27 -9
  840. package/src/detectors/team.ts +1 -50
  841. package/src/detectors/titled-code-citation.ts +19 -0
  842. package/src/detectors/titled-run.ts +22 -5
  843. package/src/detectors/token-shape.ts +40 -18
  844. package/src/detectors/topic-predicate-distance.ts +25 -0
  845. package/src/detectors/undefined-term.ts +26 -1
  846. package/src/detectors/unfilled-placeholder.ts +20 -2
  847. package/src/detectors/unknown-word-context.ts +129 -0
  848. package/src/detectors/unknown-word.ts +29 -20
  849. package/src/detectors/unprompted-denial.ts +133 -0
  850. package/src/document-sections.ts +3 -1
  851. package/src/fix-plan/all-signs.ts +35 -0
  852. package/src/fix-plan/plan.ts +50 -3
  853. package/src/fix-plan/render.ts +41 -3
  854. package/src/fix-plan/risen.ts +13 -0
  855. package/src/fix-plan/text.ts +56 -2
  856. package/src/heading-numbering.ts +44 -10
  857. package/src/html/html-site-chrome.ts +9 -2
  858. package/src/latin-spacing-source.ts +33 -0
  859. package/src/law-title.ts +38 -0
  860. package/src/name-ending-run.ts +49 -0
  861. package/src/name-separator.ts +4 -1
  862. package/src/name-title-slip.ts +59 -0
  863. package/src/name-variant-shapes.ts +58 -0
  864. package/src/name-word-use.ts +17 -0
  865. package/src/opening-passage.ts +31 -0
  866. package/src/paragraph-length.ts +31 -0
  867. package/src/paragraph-runs.ts +71 -13
  868. package/src/plugin.ts +2 -0
  869. package/src/quote-echo.ts +18 -0
  870. package/src/quote-gloss.ts +11 -0
  871. package/src/quoted-spelling.ts +48 -0
  872. package/src/render/semantic.ts +2 -2
  873. package/src/rule-of-three.ts +50 -0
  874. package/src/run-semantic.ts +2 -2
  875. package/src/section-levels.ts +98 -0
  876. package/src/semantic.ts +16 -3
  877. package/src/sentence-load.ts +5 -3
  878. package/src/set-phrase-particles.ts +32 -0
  879. package/src/spelling.ts +37 -7
  880. package/src/structure/alternative-clause.ts +32 -7
  881. package/src/structure/cited-document-section.ts +24 -1
  882. package/src/structure/issues.ts +29 -10
  883. package/src/structure/numbering.ts +50 -3
  884. package/src/structure/unread-label.ts +74 -0
  885. package/src/structure-shape/template-outline.ts +34 -0
  886. package/src/title-case-name.ts +55 -0
  887. package/src/topic-clause.ts +110 -5
  888. package/src/word-use.ts +57 -6
  889. package/dist/legal-address.d.ts +0 -2
  890. package/dist/legal-address.d.ts.map +0 -1
  891. package/dist/legal-address.js +0 -16
  892. package/dist/legal-address.js.map +0 -1
@@ -1,7 +1,8 @@
1
- import { isKnownWord, isSplitWord, suggestionFor, wordsToCheck } from "../spelling.js";
1
+ import { hasTwoEndings, isKnownWord, isSplitWord, suggestionFor, wordsToCheck } from "../spelling.js";
2
2
  import { parse } from "../markdown-read.js";
3
3
  import { eachPreOrder } from "../tree-walk.js";
4
4
  import { quoteAt } from "./structure-tree.js";
5
+ import { addressWordsOf, beforeVersion, besideForeignWord, hasDrugStem, hasSiblingName, inSearchTermList, isClosedCompound, isMention, usedOnce, } from "./unknown-word-context.js";
5
6
  /** これより短い語は見ない。短い語は一字違いの語が多すぎて言い直しが決まらず(tost は test か toast か)、略した語(impl)も多い。 */
6
7
  const MIN_LENGTH = 5;
7
8
  /** これより長い字の並びは語でなく、符号化したデータ(base64、ハッシュ)。一字違いの形を作ると長さの二乗で重くなる。 */
@@ -10,15 +11,14 @@ const patternsOf = (doc, name) => (doc.lexicons[name] ?? []).map((entry) => entr
10
11
  /** 辞書と、語彙表 extra-word の語と、チームの names と、別の rule が言う誤り(known-misspelling)を足した語。 */
11
12
  export const spellerOf = (doc, dictionary) => ({
12
13
  words: [dictionary, new Set([...patternsOf(doc, "extra-word"), ...(doc.names ?? []).map((name) => name.toLowerCase())])],
13
- suffixes: (doc.lexicons["word-suffix"] ?? []).map((entry) => ({ suffix: entry.pattern, replacement: entry.instead_of ?? "" })),
14
+ suffixes: (doc.lexicons["word-suffix"] ?? []).map((entry) => ({
15
+ suffix: entry.pattern,
16
+ replacement: entry.instead_of ?? "",
17
+ inflection: entry.group === "inflection",
18
+ })),
14
19
  prefixes: patternsOf(doc, "word-prefix"),
20
+ uninflected: new Set(patternsOf(doc, "uninflected-word")),
15
21
  });
16
- /** 文書で一度だけ使った語。二度以上使う語は、打ち間違いより、その文書の用語であることが多い。 */
17
- const usedOnce = (words) => {
18
- const counts = new Map();
19
- words.forEach(({ word }) => counts.set(word, (counts.get(word) ?? 0) + 1));
20
- return words.filter(({ word }) => counts.get(word) === 1);
21
- };
22
22
  const LETTERS = /\p{L}+/gu;
23
23
  /** 文書がコード(コードの区画と `…`)に書いた語。コードに書いた名前(`tidyq check` の tidyq)は、地の文でも打ち間違いではない。 */
24
24
  export const codeWordsOf = (source) => {
@@ -32,14 +32,10 @@ export const codeWordsOf = (source) => {
32
32
  });
33
33
  return words;
34
34
  };
35
- /**
36
- * A search stem with a wildcard in a list of terms (ukrain*, vaccin*): the word ends in a * that closes no emphasis
37
- * (nothing opens one before the word), and a separator or the line's end follows it, not a word as after a footnote's *.
38
- */
39
- export const isSearchStem = (source, offset, word) => {
40
- const end = offset + word.length;
41
- return source[end] === "*" && source[offset - 1] !== "*" && /^[ \t]*(?:[,;|)\]]|\r?\n|$)/u.test(source.slice(end + 1));
42
- };
35
+ /** 辞書の語か、派生した語に活用の語尾を付けた語(operationalises、rightsized)か、四字以上の辞書の語二つを続けた語(crowdwork)。 */
36
+ const isFormedWord = (word, speller) => isKnownWord(word, speller) || hasTwoEndings(word, speller) || isClosedCompound(word, speller);
37
+ /** 置かれた場所から、名前や用語と分かる語。名指した語("mailto"、(jchaplin))、検索語の並び(vaccin*)、外国語の句(bête noire)、版の番号の前(golang 1.21.5)。 */
38
+ const isTermByPlace = (source, offset, word) => isMention(source, offset, word) || inSearchTermList(source, offset) || besideForeignWord(source, offset, word) || beforeVersion(source, offset, word);
43
39
  /**
44
40
  * 辞書に無い英語の語で、一字違いの辞書の語があるもの(recieve → receive)。辞書は adapter が持ち、無い言語では動かない。
45
41
  * 大文字を含む語(固有名詞・略語)、コード・URL の中、頭の字を分けた語の残り、二度以上使う語、言い直しの無い語、
@@ -49,11 +45,13 @@ export const unknownWord = (doc) => {
49
45
  if (doc.dictionary === undefined)
50
46
  return [];
51
47
  const speller = spellerOf(doc, doc.dictionary());
52
- const known = new Set([...patternsOf(doc, "known-misspelling"), ...codeWordsOf(doc.source)]);
48
+ const known = new Set([...patternsOf(doc, "known-misspelling"), ...codeWordsOf(doc.source), ...addressWordsOf(doc.source)]);
49
+ const drugStems = patternsOf(doc, "drug-stem");
53
50
  const words = wordsToCheck(doc.prose ?? doc.source, MIN_LENGTH, MAX_LENGTH).filter(({ offset }) => !isSplitWord(doc.source, offset));
54
51
  const used = new Set(words.map(({ word }) => word).filter((word) => isKnownWord(word, speller)));
55
- return usedOnce(words).flatMap(({ offset, word }) => {
56
- if (known.has(word) || isKnownWord(word, speller) || isSearchStem(doc.source, offset, word))
52
+ const unformed = new Set(words.map(({ word }) => word).filter((word) => !known.has(word) && !isFormedWord(word, speller)));
53
+ return usedOnce(words, speller).flatMap(({ offset, word }) => {
54
+ if (!unformed.has(word) || hasDrugStem(word, drugStems) || hasSiblingName(word, unformed) || isTermByPlace(doc.source, offset, word))
57
55
  return [];
58
56
  const suggestion = suggestionFor(word, speller, used);
59
57
  if (suggestion === undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"unknown-word.js","sourceRoot":"","sources":["../../src/detectors/unknown-word.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAkC,MAAM,gBAAgB,CAAC;AACvH,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,iFAAiF;AACjF,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,kEAAkE;AAClE,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,UAA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../plugin.ts";
2
+ import { type ContrastWords } from "./contrast-frame.ts";
3
+ export type DenialWords = {
4
+ readonly ends: Lexicon;
5
+ readonly exempts: Lexicon;
6
+ readonly opens: Lexicon;
7
+ readonly follows: Lexicon;
8
+ readonly bases: Lexicon;
9
+ readonly reasons: Lexicon;
10
+ readonly premises: Lexicon;
11
+ readonly questions: Lexicon;
12
+ };
13
+ export declare const denialWords: (lexicon: Lexicon) => DenialWords;
14
+ export type Denial = {
15
+ readonly sentence: Sentence;
16
+ readonly matched: string;
17
+ };
18
+ /**
19
+ * 前提を打ち消して終わる文。理由を添えた文、前の文に答える文、対比の枠の文は除く。
20
+ * contrast は contrast-framing が数える文で、打ち消しの隣に言い直しがある。
21
+ */
22
+ export declare const unpromptedDenials: (sentences: readonly Sentence[], words: DenialWords, contrast: ContrastWords) => Denial[];
23
+ /** 前提を打ち消して終わる文の、文書の言語の文に占める割合(%)が上限を超えたら、その文をすべて言う。 */
24
+ export declare const unpromptedDenial: Detector;
25
+ //# sourceMappingURL=unprompted-denial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unprompted-denial.d.ts","sourceRoot":"","sources":["../../src/detectors/unprompted-denial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAW,OAAO,EAA+B,QAAQ,EAAE,MAAM,cAAc,CAAC;AAItG,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAa5E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B,CAAC;AAIF,eAAO,MAAM,WAAW,GAAI,SAAS,OAAO,KAAG,WAS7C,CAAC;AAqDH,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,QAAQ,EAAE,EAAE,OAAO,WAAW,EAAE,UAAU,aAAa,KAAG,MAAM,EAQrH,CAAC;AAWF,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,QAc9B,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { wordsOf } from "./structure.js";
2
+ import { MIN_DOCUMENT_LENGTH } from "./signals.js";
3
+ import { comparableText, comparableWords, entryCloses, entryIn, entryOpens, entryRanges } from "./lexicon-match.js";
4
+ import { contrastSentences } from "./contrast-frame.js";
5
+ import { contrastShare } from "./ai-phrasing.js";
6
+ const groupOf = (lexicon, group) => lexicon.filter((entry) => entry.group === group);
7
+ export const denialWords = (lexicon) => ({
8
+ ends: groupOf(lexicon, "end"),
9
+ exempts: groupOf(lexicon, "exempt"),
10
+ opens: groupOf(lexicon, "open"),
11
+ follows: groupOf(lexicon, "follow"),
12
+ bases: groupOf(lexicon, "basis"),
13
+ reasons: groupOf(lexicon, "reason"),
14
+ premises: groupOf(lexicon, "premise"),
15
+ questions: groupOf(lexicon, "question"),
16
+ });
17
+ /** 文が end の語で閉じ、その直前が exempt の語でないなら、その end の語。 */
18
+ const closingDenial = (sentence, words) => {
19
+ const end = words.ends.find((entry) => entryCloses(sentence, entry));
20
+ if (end === undefined)
21
+ return undefined;
22
+ const exempt = words.exempts.some((entry) => words.ends.some((other) => entryCloses(sentence, { pattern: `${entry.pattern}${other.pattern}` })));
23
+ return exempt ? undefined : end;
24
+ };
25
+ const LETTER = /\p{L}/u;
26
+ /** 品詞が無いときは文字列で、open の語の直後の語を見る。 */
27
+ const textFollows = (sentence, open, follows) => {
28
+ const text = comparableText(sentence);
29
+ const head = comparableWords(open.pattern);
30
+ if (!text.startsWith(head))
31
+ return false;
32
+ const rest = text.slice(head.length).trimStart();
33
+ return follows.some((entry) => {
34
+ const word = comparableWords(entry.pattern);
35
+ return rest.startsWith(word) && !LETTER.test(rest.charAt(word.length));
36
+ });
37
+ };
38
+ /** 文が open の語で始まり、次の語が follow の語か。 */
39
+ const opensWithFollow = (sentence, open, follows) => {
40
+ if (!entryOpens(sentence, open))
41
+ return false;
42
+ const tokens = sentence.tokens;
43
+ if (tokens === undefined || open.tokens === undefined)
44
+ return textFollows(sentence, open, follows);
45
+ const range = entryRanges(sentence, open)[0];
46
+ const next = range === undefined ? undefined : tokens[range.end]?.surface.toLowerCase();
47
+ return next !== undefined && follows.some((entry) => comparableWords(entry.pattern) === next);
48
+ };
49
+ /** A comma or semicolon carries a second clause: the denial does not end the sentence. */
50
+ const CLAUSE_BREAK = /[,;:、,;]/u;
51
+ const openingDenial = (sentence, words) => CLAUSE_BREAK.test(sentence.text) ? undefined : words.opens.find((entry) => opensWithFollow(sentence, entry, words.follows));
52
+ /** 理由を添えた打ち消しか。理由そのものを打ち消す文(〜だから並ぶのではありません)は除く。 */
53
+ const givesBasis = (sentence, words) => !words.reasons.some((entry) => entryCloses(sentence, entry)) && words.bases.some((entry) => entryIn(sentence, entry));
54
+ const QUESTION_MARK = /[??]["'”’」』))\s]*$/u;
55
+ /** 前の文が打ち消す相手を言っているか(問い、〜と思うかもしれません)。 */
56
+ const answersPrevious = (previous, words) => previous !== undefined &&
57
+ (QUESTION_MARK.test(previous.text) ||
58
+ words.questions.some((entry) => entryCloses(previous, entry)) ||
59
+ words.premises.some((entry) => entryIn(previous, entry)));
60
+ /**
61
+ * 前提を打ち消して終わる文。理由を添えた文、前の文に答える文、対比の枠の文は除く。
62
+ * contrast は contrast-framing が数える文で、打ち消しの隣に言い直しがある。
63
+ */
64
+ export const unpromptedDenials = (sentences, words, contrast) => {
65
+ const framed = new Set(contrastSentences(sentences, contrast));
66
+ return sentences.flatMap((sentence, index) => {
67
+ const denial = closingDenial(sentence, words) ?? openingDenial(sentence, words);
68
+ if (denial === undefined || framed.has(sentence))
69
+ return [];
70
+ if (givesBasis(sentence, words) || answersPrevious(sentences[index - 1], words))
71
+ return [];
72
+ return [{ sentence, matched: denial.pattern }];
73
+ });
74
+ };
75
+ /** 一つ二つの打ち消しは論の運び。三つ目から数える。 */
76
+ const MIN_DENIALS = 3;
77
+ const contrastWordsOf = (doc) => ({
78
+ frames: doc.lexicons["contrast-frame"] ?? [],
79
+ leads: doc.lexicons["contrast-lead"] ?? [],
80
+ turns: doc.lexicons["contrast-turn"] ?? [],
81
+ });
82
+ /** 前提を打ち消して終わる文の、文書の言語の文に占める割合(%)が上限を超えたら、その文をすべて言う。 */
83
+ export const unpromptedDenial = (doc, options) => {
84
+ const own = doc.sentences.filter((sentence) => sentence.embeddedLanguage === undefined);
85
+ const hits = unpromptedDenials(own, denialWords(options.lexicon ?? []), contrastWordsOf(doc));
86
+ if (hits.length < MIN_DENIALS || wordsOf(doc) < MIN_DOCUMENT_LENGTH[doc.lengthUnit])
87
+ return [];
88
+ const share = contrastShare(doc, hits.length);
89
+ if (share <= options.limit)
90
+ return [];
91
+ return hits.map((hit) => ({
92
+ rule: "",
93
+ severity: "info",
94
+ line: 0,
95
+ column: 0,
96
+ quote: hit.sentence.text.trim(),
97
+ values: { matched: hit.matched, count: hits.length, share, limit: options.limit, offset: hit.sentence.span.start },
98
+ }));
99
+ };
100
+ //# sourceMappingURL=unprompted-denial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unprompted-denial.js","sourceRoot":"","sources":["../../src/detectors/unprompted-denial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,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AAC,IAAI,EAAE;QAC/B,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE;KACnH,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"document-sections.d.ts","sourceRoot":"","sources":["../src/document-sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAQnF,KAAK,cAAc,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,aAAa,CAAC,EAAE,SAAS,KAAK,EAAE,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,MAAM,CAAA;CAAE,CAAC;AAEhK,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,GAAI,SAAS,eAAe,EAAE,QAAQ,OAAO,EAAE,UAAU,eAAe,CAAC,UAAU,CAAC,KAAG,cAGlH,CAAC;AAEH,eAAO,MAAM,UAAU,GACrB,UAAU,SAAS,OAAO,EAAE,EAC5B,WAAW,SAAS,QAAQ,EAAE,EAC9B,SAAS,SAAS,IAAI,EAAE,EACxB,QAAQ,MAAM,EACd,SAAS,cAAc,KACtB,OAAO,EAqBT,CAAC"}
1
+ {"version":3,"file":"document-sections.d.ts","sourceRoot":"","sources":["../src/document-sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAQnF,KAAK,cAAc,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,aAAa,CAAC,EAAE,SAAS,KAAK,EAAE,CAAA;KAAE,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,MAAM,CAAA;CAAE,CAAC;AAEhK,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,GAAI,SAAS,eAAe,EAAE,QAAQ,OAAO,EAAE,UAAU,eAAe,CAAC,UAAU,CAAC,KAAG,cAGlH,CAAC;AAEH,eAAO,MAAM,UAAU,GACrB,UAAU,SAAS,OAAO,EAAE,EAC5B,WAAW,SAAS,QAAQ,EAAE,EAC9B,SAAS,SAAS,IAAI,EAAE,EACxB,QAAQ,MAAM,EACd,SAAS,cAAc,KACtB,OAAO,EAuBT,CAAC"}
@@ -15,6 +15,7 @@ export const sectionsOf = (headings, sentences, strongs, length, readers) => {
15
15
  .map(({ heading, from, to }) => {
16
16
  const inside = sentences.filter((sentence) => within(sentence.span, from, to));
17
17
  const unlabeled = readers.unlabeledOf(heading.text);
18
+ const strongsInside = strongs.filter((span) => within(span, from, to));
18
19
  return {
19
20
  depth: heading.depth,
20
21
  heading: heading.text,
@@ -24,7 +25,8 @@ export const sectionsOf = (headings, sentences, strongs, length, readers) => {
24
25
  },
25
26
  span: { start: from, end: to },
26
27
  sentences: inside,
27
- strongCount: strongs.filter((span) => within(span, from, to)).length,
28
+ strongCount: strongsInside.length,
29
+ strongs: strongsInside,
28
30
  firstSentence: inside[0],
29
31
  };
30
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"document-sections.js","sourceRoot":"","sources":["../src/document-sections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,MAAM,GAAG,CAAC,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,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Finding, ProseDocument, RuleDefinition } from "../plugin.ts";
2
+ import { type Skipped } from "../run.ts";
3
+ /** What lint found: the findings and the rules that did not run. */
4
+ export type LintResult = {
5
+ readonly findings: readonly Finding[];
6
+ readonly skipped: readonly Skipped[];
7
+ };
8
+ /** Every AI-likeness rule for the language: group ai-tells, the composite's inputs and the AI markup shapes. */
9
+ export declare const allSignRules: (rules: readonly RuleDefinition[], language: string) => RuleDefinition[];
10
+ /**
11
+ * Every AI-likeness rule run on the document whatever the genre or chaff.yaml turns off: at the genre's level where it
12
+ * runs, at normal where it does not (the levels ai-score measures at), and in the genre even when use_for leaves it out.
13
+ */
14
+ export declare const runAllSigns: (doc: ProseDocument, rules: readonly RuleDefinition[], genre: string) => LintResult;
15
+ /** Lint's findings with the AI-likeness rules' own replaced by the all-signs run's, which sees them in every genre. */
16
+ export declare const withAllSigns: (lint: LintResult, signs: LintResult, signIds: ReadonlySet<string>) => LintResult;
17
+ //# sourceMappingURL=all-signs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-signs.d.ts","sourceRoot":"","sources":["../../src/fix-plan/all-signs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAGvD,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,CAAC;AAKzG,gHAAgH;AAChH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,cAAc,EAAE,EAAE,UAAU,MAAM,KAAG,cAAc,EAI/F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,aAAa,EAAE,OAAO,SAAS,cAAc,EAAE,EAAE,OAAO,MAAM,KAAG,UAIjG,CAAC;AAIF,uHAAuH;AACvH,eAAO,MAAM,YAAY,GAAI,MAAM,UAAU,EAAE,OAAO,UAAU,EAAE,SAAS,WAAW,CAAC,MAAM,CAAC,KAAG,UAG/F,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { presetLevels } from "../genre-load.js";
2
+ import { runRulesWith } from "../run.js";
3
+ import { aiShapeRuleIds, measuredLevelsOf } from "../ai-score/signals.js";
4
+ const ofLanguage = (rules, language) => rules.filter((rule) => rule.languages === undefined || rule.languages.includes(language));
5
+ /** Every AI-likeness rule for the language: group ai-tells, the composite's inputs and the AI markup shapes. */
6
+ export const allSignRules = (rules, language) => {
7
+ const forLanguage = ofLanguage(rules, language);
8
+ const ids = new Set(aiShapeRuleIds(forLanguage));
9
+ return forLanguage.filter((rule) => ids.has(rule.id));
10
+ };
11
+ /**
12
+ * Every AI-likeness rule run on the document whatever the genre or chaff.yaml turns off: at the genre's level where it
13
+ * runs, at normal where it does not (the levels ai-score measures at), and in the genre even when use_for leaves it out.
14
+ */
15
+ export const runAllSigns = (doc, rules, genre) => {
16
+ const signRules = allSignRules(rules, doc.language).map((rule) => ({ ...rule, use_for: [genre] }));
17
+ const result = runRulesWith(doc, signRules, { settings: measuredLevelsOf(signRules, presetLevels(genre)), experimental: true, genre });
18
+ return { findings: result.findings, skipped: result.skipped };
19
+ };
20
+ const byLine = (left, right) => left.line - right.line || left.column - right.column;
21
+ /** Lint's findings with the AI-likeness rules' own replaced by the all-signs run's, which sees them in every genre. */
22
+ export const withAllSigns = (lint, signs, signIds) => ({
23
+ findings: [...lint.findings.filter((finding) => !signIds.has(finding.rule)), ...signs.findings].toSorted(byLine),
24
+ skipped: [...lint.skipped.filter((skipped) => !signIds.has(skipped.rule)), ...signs.skipped],
25
+ });
26
+ //# sourceMappingURL=all-signs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-signs.js","sourceRoot":"","sources":["../../src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,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACvI,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,IAAa,EAAE,KAAc,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;AAE/G,uHAAuH;AACvH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAgB,EAAE,KAAiB,EAAE,OAA4B,EAAc,EAAE,CAAC,CAAC;IAC9G,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChH,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;CAC7F,CAAC,CAAC"}
@@ -7,6 +7,7 @@ import type { StructureScore } from "../structure-shape/score.ts";
7
7
  import { type StructureTarget } from "./structure-targets.ts";
8
8
  import { type RewriteDepth } from "../rewrite-depth.ts";
9
9
  import type { ReportedGuide } from "../genre-guide/report.ts";
10
+ import type { RisenRule } from "./risen.ts";
10
11
  /** One flagged spot, where it is and what chaff said about it. */
11
12
  export type PlanSpot = {
12
13
  readonly line: number;
@@ -46,6 +47,20 @@ export type DeeperRule = {
46
47
  readonly depth: RewriteDepth;
47
48
  readonly spots: number;
48
49
  };
50
+ /** The AI-likeness quick score in short: its level (or why none), the signs and the ones that showed. */
51
+ export type AiScoreSummary = {
52
+ readonly level: string | null;
53
+ readonly notScored: string | null;
54
+ readonly signs: number;
55
+ readonly compared: number;
56
+ readonly shown: readonly string[];
57
+ };
58
+ /** The original a rewrite is checked against (--before): the rules whose findings rose, and the original's score. */
59
+ export type SincePlan = {
60
+ readonly path: string;
61
+ readonly risen: readonly RisenRule[];
62
+ readonly aiScore: AiScoreSummary | null;
63
+ };
49
64
  /** The depth chosen for the plan, and where: --depth on the command line, or fix_plan.depth in chaff.yaml. */
50
65
  export type ChosenDepth = {
51
66
  readonly depth: RewriteDepth;
@@ -60,6 +75,14 @@ export type FixPlan = {
60
75
  /** What a good document of the genre does, to rewrite against; null when the genre was not set or the guide is off. */
61
76
  readonly guide: ReportedGuide | null;
62
77
  readonly experimental: boolean;
78
+ /** --all-ai-signs: every AI-likeness rule ran, whatever the genre turns off, and the plan loops to the stop conditions. */
79
+ readonly allSigns: boolean;
80
+ /** The document's AI-likeness score; null without --all-ai-signs. */
81
+ readonly aiScore: AiScoreSummary | null;
82
+ /** With --all-ai-signs, the AI-likeness rules that have a finding, in the order the plan lists them; empty is done. */
83
+ readonly aiRules: readonly string[];
84
+ /** The comparison with the original given by --before; null without it. */
85
+ readonly since: SincePlan | null;
63
86
  readonly mode: ModeChoice;
64
87
  /** None when chaff recommends the depth itself. */
65
88
  readonly chosenDepth: ChosenDepth | undefined;
@@ -100,6 +123,12 @@ export type PlanInput = {
100
123
  readonly phrases: Lexicon;
101
124
  readonly chosenDepth?: ChosenDepth | undefined;
102
125
  readonly guide?: ReportedGuide | undefined;
126
+ /** Given with --all-ai-signs: the findings already hold every AI-likeness rule's, and this is the document's score. */
127
+ readonly allSigns?: {
128
+ readonly aiScore: AiScoreSummary;
129
+ readonly ruleIds: ReadonlySet<string>;
130
+ } | undefined;
131
+ readonly since?: SincePlan | undefined;
103
132
  };
104
133
  /** article.md → article.rewritten.md, beside the original. */
105
134
  export declare const rewrittenPathOf: (path: string) => string;
@@ -107,6 +136,8 @@ export declare const rewrittenPathOf: (path: string) => string;
107
136
  export declare const shellPath: (path: string) => string;
108
137
  /** The ai-tell phrases the finding names that carry a hint of their own. */
109
138
  export declare const phraseHintsOf: (finding: Finding, phrases: Lexicon, language: string) => PhraseHint[];
139
+ /** The bundled judgement checks for the AI-likeness tells only a reader can see (packages/chaff/checks/). */
140
+ export declare const AI_TELLS_CHECKS = "ai-tells";
110
141
  /** The plan for one document: deterministic, from chaff's findings, the rule files and the human baseline alone. */
111
142
  export declare const buildFixPlan: (input: PlanInput) => FixPlan;
112
143
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/fix-plan/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ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AS,CAAC;CACxC,CAAC;AAYF,8DAA8D;AAC9D,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAI9C,CAAC;AAOF,0EAA0E;AAC1E,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,MAAuF,CAAC;AAEjI,4EAA4E;AAC5E,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,EAAE,SAAS,OAAO,EAAE,UAAU,MAAM,KAAG,UAAU,EAK9F,CAAC;AAyEF,6GAA6G;AAC7G,eAAO,MAAM,eAAe,aAAa,CAAC;AAqC1C,oHAAoH;AACpH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,KAAG,OA8B/C,CAAC"}
@@ -84,21 +84,37 @@ const notRunOf = (input, signalRules) => {
84
84
  const watched = new Set(forThisLanguage.filter((rule) => hasRewrite(rule) || rule.id === COMPOSITE_RULE || signalRules.has(rule.id)).map((rule) => rule.id));
85
85
  return input.skipped.filter((skipped) => watched.has(skipped.rule));
86
86
  };
87
- /** The commands to run on the rewrite. A rewrite past light cuts repeats and rebuilds headings, which compare is told. */
87
+ /** The bundled judgement checks for the AI-likeness tells only a reader can see (packages/chaff/checks/). */
88
+ export const AI_TELLS_CHECKS = "ai-tells";
89
+ /**
90
+ * The commands to run on the rewrite. A rewrite past light cuts repeats and rebuilds headings, which compare is told.
91
+ * With --all-ai-signs the first is the same plan for the rewrite, set against the original, and the last sends the
92
+ * judgement tells (shown with --dry-run first: the passages would leave the machine).
93
+ */
88
94
  const checksOf = (input, choice) => {
89
95
  const original = shellPath(input.path);
90
96
  const rewritten = shellPath(rewrittenPathOf(input.path));
91
- const lintFlags = [...(input.experimental ? ["--experimental"] : []), ...(input.genreFlag === undefined ? [] : ["--genre", input.genreFlag])];
97
+ const genreFlags = input.genreFlag === undefined ? [] : ["--genre", input.genreFlag];
98
+ const lintFlags = [...(input.experimental ? ["--experimental"] : []), ...genreFlags];
92
99
  const compareFlags = choice.depth !== undefined && choice.depth !== "light" ? ["--distinct", "--allow-dropped heading", "--allow-added heading"] : [];
100
+ const first = input.allSigns === undefined
101
+ ? ["npx chaffjs", rewritten, ...lintFlags]
102
+ : ["npx chaffjs fix-plan", rewritten, "--all-ai-signs --before", original, ...lintFlags, "--json"];
93
103
  return [
94
- ["npx chaffjs", rewritten, ...lintFlags].join(" "),
104
+ first.join(" "),
95
105
  ["npx chaffjs compare", original, rewritten, ...compareFlags].join(" "),
96
106
  ["npx chaffjs outline", original, rewritten].join(" "),
107
+ ...(input.allSigns === undefined ? [] : [["npx chaffjs test", rewritten, "--checks", AI_TELLS_CHECKS, ...genreFlags, "--dry-run"].join(" ")]),
97
108
  ];
98
109
  };
99
110
  /** The count ai-structure fires at by default: the same line decides when the plan rewrites from the outline. */
100
111
  const structureLimitOf = (rules) => rules.find((rule) => rule.id === STRUCTURE_RULE)?.levels.normal ?? DEFAULT_STRUCTURE_LIMIT;
101
112
  const documentLength = (outline) => outline.entries.reduce((sum, entry) => sum + entry.length, 0);
113
+ /** The AI-likeness rules with a finding, the composite included; none without --all-ai-signs. */
114
+ const aiRulesFired = (input) => {
115
+ const ids = input.allSigns?.ruleIds;
116
+ return ids === undefined ? [] : [...new Set(input.findings.map((finding) => finding.rule))].filter((rule) => ids.has(rule));
117
+ };
102
118
  /** The plan for one document: deterministic, from chaff's findings, the rule files and the human baseline alone. */
103
119
  export const buildFixPlan = (input) => {
104
120
  const signalRules = signalRulesOf(input.rules);
@@ -116,6 +132,10 @@ export const buildFixPlan = (input) => {
116
132
  genre: input.genre,
117
133
  guide: input.guide ?? null,
118
134
  experimental: input.experimental,
135
+ allSigns: input.allSigns !== undefined,
136
+ aiScore: input.allSigns?.aiScore ?? null,
137
+ aiRules: aiRulesFired(input),
138
+ since: input.since ?? null,
119
139
  mode,
120
140
  chosenDepth: input.chosenDepth,
121
141
  signals: signalsOf(input, signalRules),
@@ -1 +1 @@
1
- {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/fix-plan/plan.ts"],"names":[],"mappings":"AA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M,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;KAC9B,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/fix-plan/render.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAkC,MAAM,WAAW,CAAC;AAyIzE,8FAA8F;AAC9F,eAAO,MAAM,qBAAqB,GAAI,MAAM,OAAO,KAAG,MAsBrD,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,KAAG,MAWjD,CAAC"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/fix-plan/render.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,OAAO,EAAkC,MAAM,WAAW,CAAC;AA2KzF,8FAA8F;AAC9F,eAAO,MAAM,qBAAqB,GAAI,MAAM,OAAO,KAAG,MAyBrD,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,KAAG,MAYjD,CAAC"}
@@ -114,6 +114,31 @@ const guideLines = (plan, text) => {
114
114
  const rules = guide.rules.length === 0 ? [] : ["", text.guideRules(guide.rules.map((rule) => `\`${rule}\``).join(", "))];
115
115
  return [`## ${text.guideHeading(guide.name, guide.genre)}`, "", text.guideLead, "", ...bullets(guide.lines), ...rules, ""];
116
116
  };
117
+ const scoreText = (score, text) => score.level === null ? text.notScoredLine(score.notScored ?? "") : text.aiScoreLine(score.level, score.signs, score.compared, score.shown.join(", "));
118
+ /** The score's level, or the reason it has none, for the before → after line. */
119
+ const levelText = (score) => score?.level ?? score?.notScored ?? "-";
120
+ const aiScoreLines = (plan, text) => plan.aiScore === null
121
+ ? []
122
+ : [
123
+ "",
124
+ `## ${text.aiScoreHeading}`,
125
+ "",
126
+ ...bullets([scoreText(plan.aiScore, text), text.aiRulesLine(plan.aiRules.map((rule) => `\`${rule}\``).join(", "))]),
127
+ ];
128
+ /** What the rewrite changed against --before's original: the score before and after, and every rule whose findings rose. */
129
+ const sinceLines = (plan, text) => {
130
+ const { since } = plan;
131
+ if (since === null)
132
+ return [];
133
+ const score = plan.aiScore === null ? [] : [text.sinceScore(levelText(since.aiScore), levelText(plan.aiScore)), ""];
134
+ const risen = since.risen.length === 0
135
+ ? [text.noneRisen]
136
+ : [text.risenLead, "", ...bullets(since.risen.map((rule) => `\`${rule.rule}\`: ${text.risenLine(rule.before, rule.after)}`))];
137
+ return ["", `## ${text.sinceHeading(since.path)}`, "", ...score, ...risen];
138
+ };
139
+ const stopLines = (plan, text) => (plan.allSigns ? ["", `## ${text.stopHeading}`, "", ...bullets(text.stopLines)] : []);
140
+ /** The constraints; with --all-ai-signs the last one loops to the stop conditions instead of stopping at two passes. */
141
+ const constraintsOf = (plan, text) => plan.allSigns ? [...text.constraints.slice(0, -1), text.loopConstraint] : text.constraints;
117
142
  const textOf = (plan) => FIX_PLAN_TEXT[uiLanguageOf(plan.language)];
118
143
  /** The plan as Markdown, in the document's language: what an agent reads before rewriting. */
119
144
  export const renderFixPlanMarkdown = (plan) => {
@@ -128,15 +153,18 @@ export const renderFixPlanMarkdown = (plan) => {
128
153
  ...guideLines(plan, text),
129
154
  `## ${text.constraintsHeading}`,
130
155
  "",
131
- ...text.constraints.map((constraint, index) => `${String(index + 1)}. ${constraint}`),
156
+ ...constraintsOf(plan, text).map((constraint, index) => `${String(index + 1)}. ${constraint}`),
132
157
  ...modeLines(plan, text),
133
158
  ...signalLines(plan, text),
159
+ ...aiScoreLines(plan, text),
160
+ ...sinceLines(plan, text),
134
161
  ...structureLines(plan),
135
162
  ...(plan.rules.length === 0 ? [] : ["", `## ${text.rulesHeading}`]),
136
163
  ...plan.rules.flatMap((rule) => rulePlanLines(rule, text, plan.language)),
137
164
  ...deeperLines(plan, text),
138
165
  ...notRunLines(plan, text),
139
166
  ...checkLines(plan, text),
167
+ ...stopLines(plan, text),
140
168
  ].join("\n");
141
169
  };
142
170
  /** The same plan as JSON, with the constraints and the mode's reason in the document's language. */
@@ -144,8 +172,9 @@ export const renderFixPlanJson = (plan) => {
144
172
  const text = textOf(plan);
145
173
  return JSON.stringify({
146
174
  ...plan,
147
- constraints: text.constraints,
175
+ constraints: constraintsOf(plan, text),
148
176
  mode: { ...plan.mode, name: text.modeName[plan.mode.mode], why: text.modeReason[plan.mode.reason] },
177
+ ...(plan.allSigns ? { stop: text.stopLines } : {}),
149
178
  }, null, 2);
150
179
  };
151
180
  //# sourceMappingURL=render.js.map