chaffjs 0.20.0 → 0.22.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 (762) hide show
  1. package/README.md +7 -5
  2. package/dist/api.d.ts +16 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js.map +1 -1
  5. package/dist/cli-text.d.ts +2 -0
  6. package/dist/cli-text.d.ts.map +1 -1
  7. package/dist/cli-text.js +18 -5
  8. package/dist/cli-text.js.map +1 -1
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +8 -11
  11. package/dist/cli.js.map +1 -1
  12. package/dist/command-help.d.ts +7 -0
  13. package/dist/command-help.d.ts.map +1 -0
  14. package/dist/command-help.js +18 -0
  15. package/dist/command-help.js.map +1 -0
  16. package/dist/commands/eval.js +2 -2
  17. package/dist/commands/eval.js.map +1 -1
  18. package/dist/commands/fix-plan.d.ts.map +1 -1
  19. package/dist/commands/fix-plan.js +11 -1
  20. package/dist/commands/fix-plan.js.map +1 -1
  21. package/dist/commands/help.d.ts +4 -0
  22. package/dist/commands/help.d.ts.map +1 -0
  23. package/dist/commands/help.js +7 -0
  24. package/dist/commands/help.js.map +1 -0
  25. package/dist/commands/init-command.d.ts +4 -0
  26. package/dist/commands/init-command.d.ts.map +1 -0
  27. package/dist/commands/init-command.js +15 -0
  28. package/dist/commands/init-command.js.map +1 -0
  29. package/dist/commands/plugin-init.d.ts +20 -0
  30. package/dist/commands/plugin-init.d.ts.map +1 -0
  31. package/dist/commands/plugin-init.js +129 -0
  32. package/dist/commands/plugin-init.js.map +1 -0
  33. package/dist/commands/plugin-test.d.ts +11 -0
  34. package/dist/commands/plugin-test.d.ts.map +1 -0
  35. package/dist/commands/plugin-test.js +81 -0
  36. package/dist/commands/plugin-test.js.map +1 -0
  37. package/dist/config/load.d.ts +2 -0
  38. package/dist/config/load.d.ts.map +1 -1
  39. package/dist/config/load.js +1 -0
  40. package/dist/config/load.js.map +1 -1
  41. package/dist/config/option-problems.js +2 -2
  42. package/dist/config/option-problems.js.map +1 -1
  43. package/dist/config/rule-problems.js +2 -2
  44. package/dist/config/rule-problems.js.map +1 -1
  45. package/dist/custom/checked.d.ts +9 -0
  46. package/dist/custom/checked.d.ts.map +1 -0
  47. package/dist/custom/checked.js +3 -0
  48. package/dist/custom/checked.js.map +1 -0
  49. package/dist/custom/dsl-fields.d.ts +27 -0
  50. package/dist/custom/dsl-fields.d.ts.map +1 -0
  51. package/dist/custom/dsl-fields.js +86 -0
  52. package/dist/custom/dsl-fields.js.map +1 -0
  53. package/dist/custom/load.d.ts.map +1 -1
  54. package/dist/custom/load.js +2 -0
  55. package/dist/custom/load.js.map +1 -1
  56. package/dist/custom/parse.d.ts +14 -3
  57. package/dist/custom/parse.d.ts.map +1 -1
  58. package/dist/custom/parse.js +44 -40
  59. package/dist/custom/parse.js.map +1 -1
  60. package/dist/custom/problems.d.ts.map +1 -1
  61. package/dist/custom/problems.js +10 -1
  62. package/dist/custom/problems.js.map +1 -1
  63. package/dist/detectors/amount-for-count.d.ts +21 -0
  64. package/dist/detectors/amount-for-count.d.ts.map +1 -0
  65. package/dist/detectors/amount-for-count.js +55 -0
  66. package/dist/detectors/amount-for-count.js.map +1 -0
  67. package/dist/detectors/blank-structure.d.ts.map +1 -1
  68. package/dist/detectors/blank-structure.js +6 -4
  69. package/dist/detectors/blank-structure.js.map +1 -1
  70. package/dist/detectors/clause-shape.d.ts +22 -0
  71. package/dist/detectors/clause-shape.d.ts.map +1 -0
  72. package/dist/detectors/clause-shape.js +149 -0
  73. package/dist/detectors/clause-shape.js.map +1 -0
  74. package/dist/detectors/code-fences.d.ts +34 -0
  75. package/dist/detectors/code-fences.d.ts.map +1 -0
  76. package/dist/detectors/code-fences.js +100 -0
  77. package/dist/detectors/code-fences.js.map +1 -0
  78. package/dist/detectors/cross-definitions.d.ts +4 -0
  79. package/dist/detectors/cross-definitions.d.ts.map +1 -0
  80. package/dist/detectors/cross-definitions.js +43 -0
  81. package/dist/detectors/cross-definitions.js.map +1 -0
  82. package/dist/detectors/cross-facts.d.ts +4 -0
  83. package/dist/detectors/cross-facts.d.ts.map +1 -0
  84. package/dist/detectors/cross-facts.js +53 -0
  85. package/dist/detectors/cross-facts.js.map +1 -0
  86. package/dist/detectors/cross-registry/cross-doc-duplicate-definition.d.ts +3 -0
  87. package/dist/detectors/cross-registry/cross-doc-duplicate-definition.d.ts.map +1 -0
  88. package/dist/detectors/cross-registry/cross-doc-duplicate-definition.js +3 -0
  89. package/dist/detectors/cross-registry/cross-doc-duplicate-definition.js.map +1 -0
  90. package/dist/detectors/cross-registry/cross-doc-fact-conflict.d.ts +3 -0
  91. package/dist/detectors/cross-registry/cross-doc-fact-conflict.d.ts.map +1 -0
  92. package/dist/detectors/cross-registry/cross-doc-fact-conflict.js +3 -0
  93. package/dist/detectors/cross-registry/cross-doc-fact-conflict.js.map +1 -0
  94. package/dist/detectors/currency-notation.d.ts +29 -0
  95. package/dist/detectors/currency-notation.d.ts.map +1 -0
  96. package/dist/detectors/currency-notation.js +58 -0
  97. package/dist/detectors/currency-notation.js.map +1 -0
  98. package/dist/detectors/custom.d.ts.map +1 -1
  99. package/dist/detectors/custom.js +4 -1
  100. package/dist/detectors/custom.js.map +1 -1
  101. package/dist/detectors/dangling-opener.d.ts +14 -0
  102. package/dist/detectors/dangling-opener.d.ts.map +1 -0
  103. package/dist/detectors/dangling-opener.js +55 -0
  104. package/dist/detectors/dangling-opener.js.map +1 -0
  105. package/dist/detectors/defined-term-form.d.ts +25 -0
  106. package/dist/detectors/defined-term-form.d.ts.map +1 -0
  107. package/dist/detectors/defined-term-form.js +170 -0
  108. package/dist/detectors/defined-term-form.js.map +1 -0
  109. package/dist/detectors/email-letter.d.ts +46 -0
  110. package/dist/detectors/email-letter.d.ts.map +1 -0
  111. package/dist/detectors/email-letter.js +234 -0
  112. package/dist/detectors/email-letter.js.map +1 -0
  113. package/dist/detectors/footnote-mismatch.d.ts +11 -0
  114. package/dist/detectors/footnote-mismatch.d.ts.map +1 -0
  115. package/dist/detectors/footnote-mismatch.js +55 -0
  116. package/dist/detectors/footnote-mismatch.js.map +1 -0
  117. package/dist/detectors/form-minority.d.ts +13 -0
  118. package/dist/detectors/form-minority.d.ts.map +1 -0
  119. package/dist/detectors/form-minority.js +19 -0
  120. package/dist/detectors/form-minority.js.map +1 -0
  121. package/dist/detectors/heading-end-mark.d.ts +10 -0
  122. package/dist/detectors/heading-end-mark.d.ts.map +1 -0
  123. package/dist/detectors/heading-end-mark.js +59 -0
  124. package/dist/detectors/heading-end-mark.js.map +1 -0
  125. package/dist/detectors/impossible-date.d.ts +20 -0
  126. package/dist/detectors/impossible-date.d.ts.map +1 -0
  127. package/dist/detectors/impossible-date.js +105 -0
  128. package/dist/detectors/impossible-date.js.map +1 -0
  129. package/dist/detectors/impossible-time.d.ts +18 -0
  130. package/dist/detectors/impossible-time.d.ts.map +1 -0
  131. package/dist/detectors/impossible-time.js +116 -0
  132. package/dist/detectors/impossible-time.js.map +1 -0
  133. package/dist/detectors/link-shape.d.ts +11 -0
  134. package/dist/detectors/link-shape.d.ts.map +1 -0
  135. package/dist/detectors/link-shape.js +56 -0
  136. package/dist/detectors/link-shape.js.map +1 -0
  137. package/dist/detectors/list-marker.d.ts +7 -0
  138. package/dist/detectors/list-marker.d.ts.map +1 -0
  139. package/dist/detectors/list-marker.js +50 -0
  140. package/dist/detectors/list-marker.js.map +1 -0
  141. package/dist/detectors/mark-shape.d.ts +53 -0
  142. package/dist/detectors/mark-shape.d.ts.map +1 -0
  143. package/dist/detectors/mark-shape.js +160 -0
  144. package/dist/detectors/mark-shape.js.map +1 -0
  145. package/dist/detectors/markdown-slip.d.ts +19 -0
  146. package/dist/detectors/markdown-slip.d.ts.map +1 -0
  147. package/dist/detectors/markdown-slip.js +122 -0
  148. package/dist/detectors/markdown-slip.js.map +1 -0
  149. package/dist/detectors/numeral-opener.d.ts +10 -0
  150. package/dist/detectors/numeral-opener.d.ts.map +1 -0
  151. package/dist/detectors/numeral-opener.js +65 -0
  152. package/dist/detectors/numeral-opener.js.map +1 -0
  153. package/dist/detectors/ordinal-suffix.d.ts +12 -0
  154. package/dist/detectors/ordinal-suffix.d.ts.map +1 -0
  155. package/dist/detectors/ordinal-suffix.js +33 -0
  156. package/dist/detectors/ordinal-suffix.js.map +1 -0
  157. package/dist/detectors/range-notation.d.ts +15 -0
  158. package/dist/detectors/range-notation.d.ts.map +1 -0
  159. package/dist/detectors/range-notation.js +58 -0
  160. package/dist/detectors/range-notation.js.map +1 -0
  161. package/dist/detectors/registry/adverb-polarity.d.ts +3 -0
  162. package/dist/detectors/registry/adverb-polarity.d.ts.map +1 -0
  163. package/dist/detectors/registry/adverb-polarity.js +3 -0
  164. package/dist/detectors/registry/adverb-polarity.js.map +1 -0
  165. package/dist/detectors/registry/amount-for-count.d.ts +3 -0
  166. package/dist/detectors/registry/amount-for-count.d.ts.map +1 -0
  167. package/dist/detectors/registry/amount-for-count.js +3 -0
  168. package/dist/detectors/registry/amount-for-count.js.map +1 -0
  169. package/dist/detectors/registry/attachment-missing.d.ts +3 -0
  170. package/dist/detectors/registry/attachment-missing.d.ts.map +1 -0
  171. package/dist/detectors/registry/attachment-missing.js +3 -0
  172. package/dist/detectors/registry/attachment-missing.js.map +1 -0
  173. package/dist/detectors/registry/bare-url-mix.d.ts +3 -0
  174. package/dist/detectors/registry/bare-url-mix.d.ts.map +1 -0
  175. package/dist/detectors/registry/bare-url-mix.js +3 -0
  176. package/dist/detectors/registry/bare-url-mix.js.map +1 -0
  177. package/dist/detectors/registry/caps-shouting.d.ts +3 -0
  178. package/dist/detectors/registry/caps-shouting.d.ts.map +1 -0
  179. package/dist/detectors/registry/caps-shouting.js +3 -0
  180. package/dist/detectors/registry/caps-shouting.js.map +1 -0
  181. package/dist/detectors/registry/code-fence-language.d.ts +3 -0
  182. package/dist/detectors/registry/code-fence-language.d.ts.map +1 -0
  183. package/dist/detectors/registry/code-fence-language.js +3 -0
  184. package/dist/detectors/registry/code-fence-language.js.map +1 -0
  185. package/dist/detectors/registry/currency-notation.d.ts +3 -0
  186. package/dist/detectors/registry/currency-notation.d.ts.map +1 -0
  187. package/dist/detectors/registry/currency-notation.js +3 -0
  188. package/dist/detectors/registry/currency-notation.js.map +1 -0
  189. package/dist/detectors/registry/dangling-opener.d.ts +3 -0
  190. package/dist/detectors/registry/dangling-opener.d.ts.map +1 -0
  191. package/dist/detectors/registry/dangling-opener.js +3 -0
  192. package/dist/detectors/registry/dangling-opener.js.map +1 -0
  193. package/dist/detectors/registry/defined-name-repeated.d.ts +3 -0
  194. package/dist/detectors/registry/defined-name-repeated.d.ts.map +1 -0
  195. package/dist/detectors/registry/defined-name-repeated.js +3 -0
  196. package/dist/detectors/registry/defined-name-repeated.js.map +1 -0
  197. package/dist/detectors/registry/defined-term-form.d.ts +3 -0
  198. package/dist/detectors/registry/defined-term-form.d.ts.map +1 -0
  199. package/dist/detectors/registry/defined-term-form.js +3 -0
  200. package/dist/detectors/registry/defined-term-form.js.map +1 -0
  201. package/dist/detectors/registry/email-frame.d.ts +3 -0
  202. package/dist/detectors/registry/email-frame.d.ts.map +1 -0
  203. package/dist/detectors/registry/email-frame.js +3 -0
  204. package/dist/detectors/registry/email-frame.js.map +1 -0
  205. package/dist/detectors/registry/email-subject.d.ts +3 -0
  206. package/dist/detectors/registry/email-subject.d.ts.map +1 -0
  207. package/dist/detectors/registry/email-subject.js +3 -0
  208. package/dist/detectors/registry/email-subject.js.map +1 -0
  209. package/dist/detectors/registry/ending-run.d.ts +3 -0
  210. package/dist/detectors/registry/ending-run.d.ts.map +1 -0
  211. package/dist/detectors/registry/ending-run.js +3 -0
  212. package/dist/detectors/registry/ending-run.js.map +1 -0
  213. package/dist/detectors/registry/footnote-mismatch.d.ts +3 -0
  214. package/dist/detectors/registry/footnote-mismatch.d.ts.map +1 -0
  215. package/dist/detectors/registry/footnote-mismatch.js +3 -0
  216. package/dist/detectors/registry/footnote-mismatch.js.map +1 -0
  217. package/dist/detectors/registry/heading-command.d.ts +3 -0
  218. package/dist/detectors/registry/heading-command.d.ts.map +1 -0
  219. package/dist/detectors/registry/heading-command.js +3 -0
  220. package/dist/detectors/registry/heading-command.js.map +1 -0
  221. package/dist/detectors/registry/heading-end-punctuation.d.ts +3 -0
  222. package/dist/detectors/registry/heading-end-punctuation.d.ts.map +1 -0
  223. package/dist/detectors/registry/heading-end-punctuation.js +3 -0
  224. package/dist/detectors/registry/heading-end-punctuation.js.map +1 -0
  225. package/dist/detectors/registry/hyphen-dash.d.ts +3 -0
  226. package/dist/detectors/registry/hyphen-dash.d.ts.map +1 -0
  227. package/dist/detectors/registry/hyphen-dash.js +3 -0
  228. package/dist/detectors/registry/hyphen-dash.js.map +1 -0
  229. package/dist/detectors/registry/image-file-name-alt.d.ts +3 -0
  230. package/dist/detectors/registry/image-file-name-alt.d.ts.map +1 -0
  231. package/dist/detectors/registry/image-file-name-alt.js +3 -0
  232. package/dist/detectors/registry/image-file-name-alt.js.map +1 -0
  233. package/dist/detectors/registry/impossible-date.d.ts +3 -0
  234. package/dist/detectors/registry/impossible-date.d.ts.map +1 -0
  235. package/dist/detectors/registry/impossible-date.js +3 -0
  236. package/dist/detectors/registry/impossible-date.js.map +1 -0
  237. package/dist/detectors/registry/impossible-time.d.ts +3 -0
  238. package/dist/detectors/registry/impossible-time.d.ts.map +1 -0
  239. package/dist/detectors/registry/impossible-time.js +3 -0
  240. package/dist/detectors/registry/impossible-time.js.map +1 -0
  241. package/dist/detectors/registry/latin-abbreviation.d.ts +3 -0
  242. package/dist/detectors/registry/latin-abbreviation.d.ts.map +1 -0
  243. package/dist/detectors/registry/latin-abbreviation.js +3 -0
  244. package/dist/detectors/registry/latin-abbreviation.js.map +1 -0
  245. package/dist/detectors/registry/link-text-url-mismatch.d.ts +3 -0
  246. package/dist/detectors/registry/link-text-url-mismatch.d.ts.map +1 -0
  247. package/dist/detectors/registry/link-text-url-mismatch.js +3 -0
  248. package/dist/detectors/registry/link-text-url-mismatch.js.map +1 -0
  249. package/dist/detectors/registry/list-marker.d.ts +3 -0
  250. package/dist/detectors/registry/list-marker.d.ts.map +1 -0
  251. package/dist/detectors/registry/list-marker.js +3 -0
  252. package/dist/detectors/registry/list-marker.js.map +1 -0
  253. package/dist/detectors/registry/mark-consistency.d.ts +3 -0
  254. package/dist/detectors/registry/mark-consistency.d.ts.map +1 -0
  255. package/dist/detectors/registry/mark-consistency.js +3 -0
  256. package/dist/detectors/registry/mark-consistency.js.map +1 -0
  257. package/dist/detectors/registry/numeral-opener.d.ts +3 -0
  258. package/dist/detectors/registry/numeral-opener.d.ts.map +1 -0
  259. package/dist/detectors/registry/numeral-opener.js +3 -0
  260. package/dist/detectors/registry/numeral-opener.js.map +1 -0
  261. package/dist/detectors/registry/ordinal-suffix.d.ts +3 -0
  262. package/dist/detectors/registry/ordinal-suffix.d.ts.map +1 -0
  263. package/dist/detectors/registry/ordinal-suffix.js +3 -0
  264. package/dist/detectors/registry/ordinal-suffix.js.map +1 -0
  265. package/dist/detectors/registry/origin-particle.d.ts +3 -0
  266. package/dist/detectors/registry/origin-particle.d.ts.map +1 -0
  267. package/dist/detectors/registry/origin-particle.js +3 -0
  268. package/dist/detectors/registry/origin-particle.js.map +1 -0
  269. package/dist/detectors/registry/range-notation.d.ts +3 -0
  270. package/dist/detectors/registry/range-notation.d.ts.map +1 -0
  271. package/dist/detectors/registry/range-notation.js +3 -0
  272. package/dist/detectors/registry/range-notation.js.map +1 -0
  273. package/dist/detectors/registry/relative-pronoun-mix.d.ts +3 -0
  274. package/dist/detectors/registry/relative-pronoun-mix.d.ts.map +1 -0
  275. package/dist/detectors/registry/relative-pronoun-mix.js +3 -0
  276. package/dist/detectors/registry/relative-pronoun-mix.js.map +1 -0
  277. package/dist/detectors/registry/request-without-deadline.d.ts +3 -0
  278. package/dist/detectors/registry/request-without-deadline.d.ts.map +1 -0
  279. package/dist/detectors/registry/request-without-deadline.js +3 -0
  280. package/dist/detectors/registry/request-without-deadline.js.map +1 -0
  281. package/dist/detectors/registry/sentence-spacing.d.ts +3 -0
  282. package/dist/detectors/registry/sentence-spacing.d.ts.map +1 -0
  283. package/dist/detectors/registry/sentence-spacing.js +3 -0
  284. package/dist/detectors/registry/sentence-spacing.js.map +1 -0
  285. package/dist/detectors/registry/share-over-hundred.d.ts +3 -0
  286. package/dist/detectors/registry/share-over-hundred.d.ts.map +1 -0
  287. package/dist/detectors/registry/share-over-hundred.js +3 -0
  288. package/dist/detectors/registry/share-over-hundred.js.map +1 -0
  289. package/dist/detectors/registry/shell-prompt.d.ts +3 -0
  290. package/dist/detectors/registry/shell-prompt.d.ts.map +1 -0
  291. package/dist/detectors/registry/shell-prompt.js +3 -0
  292. package/dist/detectors/registry/shell-prompt.js.map +1 -0
  293. package/dist/detectors/registry/step-reference.d.ts +3 -0
  294. package/dist/detectors/registry/step-reference.d.ts.map +1 -0
  295. package/dist/detectors/registry/step-reference.js +3 -0
  296. package/dist/detectors/registry/step-reference.js.map +1 -0
  297. package/dist/detectors/registry/step-statement.d.ts +3 -0
  298. package/dist/detectors/registry/step-statement.d.ts.map +1 -0
  299. package/dist/detectors/registry/step-statement.js +3 -0
  300. package/dist/detectors/registry/step-statement.js.map +1 -0
  301. package/dist/detectors/registry/table-row-overflow.d.ts +3 -0
  302. package/dist/detectors/registry/table-row-overflow.d.ts.map +1 -0
  303. package/dist/detectors/registry/table-row-overflow.js +3 -0
  304. package/dist/detectors/registry/table-row-overflow.js.map +1 -0
  305. package/dist/detectors/registry/toc-heading.d.ts +3 -0
  306. package/dist/detectors/registry/toc-heading.d.ts.map +1 -0
  307. package/dist/detectors/registry/toc-heading.js +3 -0
  308. package/dist/detectors/registry/toc-heading.js.map +1 -0
  309. package/dist/detectors/registry/unclosed-code-fence.d.ts +3 -0
  310. package/dist/detectors/registry/unclosed-code-fence.d.ts.map +1 -0
  311. package/dist/detectors/registry/unclosed-code-fence.js +3 -0
  312. package/dist/detectors/registry/unclosed-code-fence.js.map +1 -0
  313. package/dist/detectors/registry/unpaired-parallel.d.ts +3 -0
  314. package/dist/detectors/registry/unpaired-parallel.d.ts.map +1 -0
  315. package/dist/detectors/registry/unpaired-parallel.js +3 -0
  316. package/dist/detectors/registry/unpaired-parallel.js.map +1 -0
  317. package/dist/detectors/registry/unrendered-emphasis.d.ts +3 -0
  318. package/dist/detectors/registry/unrendered-emphasis.d.ts.map +1 -0
  319. package/dist/detectors/registry/unrendered-emphasis.js +3 -0
  320. package/dist/detectors/registry/unrendered-emphasis.js.map +1 -0
  321. package/dist/detectors/relative-pronoun-mix.d.ts +19 -0
  322. package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -0
  323. package/dist/detectors/relative-pronoun-mix.js +60 -0
  324. package/dist/detectors/relative-pronoun-mix.js.map +1 -0
  325. package/dist/detectors/request-owner.d.ts +23 -0
  326. package/dist/detectors/request-owner.d.ts.map +1 -0
  327. package/dist/detectors/request-owner.js +110 -0
  328. package/dist/detectors/request-owner.js.map +1 -0
  329. package/dist/detectors/share-over-hundred.d.ts +20 -0
  330. package/dist/detectors/share-over-hundred.d.ts.map +1 -0
  331. package/dist/detectors/share-over-hundred.js +55 -0
  332. package/dist/detectors/share-over-hundred.js.map +1 -0
  333. package/dist/detectors/step-reference.d.ts +20 -0
  334. package/dist/detectors/step-reference.d.ts.map +1 -0
  335. package/dist/detectors/step-reference.js +57 -0
  336. package/dist/detectors/step-reference.js.map +1 -0
  337. package/dist/detectors/technical-docs.d.ts +32 -0
  338. package/dist/detectors/technical-docs.d.ts.map +1 -0
  339. package/dist/detectors/technical-docs.js +199 -0
  340. package/dist/detectors/technical-docs.js.map +1 -0
  341. package/dist/detectors/toc-heading.d.ts +10 -0
  342. package/dist/detectors/toc-heading.d.ts.map +1 -0
  343. package/dist/detectors/toc-heading.js +99 -0
  344. package/dist/detectors/toc-heading.js.map +1 -0
  345. package/dist/extension/pack-read.d.ts +21 -0
  346. package/dist/extension/pack-read.d.ts.map +1 -0
  347. package/dist/extension/pack-read.js +117 -0
  348. package/dist/extension/pack-read.js.map +1 -0
  349. package/dist/extension/plugin-load.d.ts.map +1 -1
  350. package/dist/extension/plugin-load.js +44 -10
  351. package/dist/extension/plugin-load.js.map +1 -1
  352. package/dist/extension/plugin-parse.d.ts.map +1 -1
  353. package/dist/extension/plugin-parse.js +10 -3
  354. package/dist/extension/plugin-parse.js.map +1 -1
  355. package/dist/facts/address-values.d.ts +5 -0
  356. package/dist/facts/address-values.d.ts.map +1 -0
  357. package/dist/facts/address-values.js +64 -0
  358. package/dist/facts/address-values.js.map +1 -0
  359. package/dist/facts/cross-facts.d.ts +20 -0
  360. package/dist/facts/cross-facts.d.ts.map +1 -0
  361. package/dist/facts/cross-facts.js +41 -0
  362. package/dist/facts/cross-facts.js.map +1 -0
  363. package/dist/fix-plan/chosen-depth.d.ts +10 -0
  364. package/dist/fix-plan/chosen-depth.d.ts.map +1 -0
  365. package/dist/fix-plan/chosen-depth.js +24 -0
  366. package/dist/fix-plan/chosen-depth.js.map +1 -0
  367. package/dist/fix-plan/mode.d.ts +13 -4
  368. package/dist/fix-plan/mode.d.ts.map +1 -1
  369. package/dist/fix-plan/mode.js +38 -7
  370. package/dist/fix-plan/mode.js.map +1 -1
  371. package/dist/fix-plan/plan.d.ts +20 -0
  372. package/dist/fix-plan/plan.d.ts.map +1 -1
  373. package/dist/fix-plan/plan.js +23 -5
  374. package/dist/fix-plan/plan.js.map +1 -1
  375. package/dist/fix-plan/render.d.ts.map +1 -1
  376. package/dist/fix-plan/render.js +24 -0
  377. package/dist/fix-plan/render.js.map +1 -1
  378. package/dist/fix-plan/text.d.ts +8 -0
  379. package/dist/fix-plan/text.d.ts.map +1 -1
  380. package/dist/fix-plan/text.js +36 -10
  381. package/dist/fix-plan/text.js.map +1 -1
  382. package/dist/genre-load.d.ts +1 -1
  383. package/dist/genre-load.d.ts.map +1 -1
  384. package/dist/genre-load.js +7 -4
  385. package/dist/genre-load.js.map +1 -1
  386. package/dist/genre-parse.d.ts +6 -0
  387. package/dist/genre-parse.d.ts.map +1 -1
  388. package/dist/genre-parse.js +18 -0
  389. package/dist/genre-parse.js.map +1 -1
  390. package/dist/init.js +10 -10
  391. package/dist/init.js.map +1 -1
  392. package/dist/known-genres.d.ts +8 -0
  393. package/dist/known-genres.d.ts.map +1 -0
  394. package/dist/known-genres.js +17 -0
  395. package/dist/known-genres.js.map +1 -0
  396. package/dist/link-shape.d.ts +20 -0
  397. package/dist/link-shape.d.ts.map +1 -0
  398. package/dist/link-shape.js +58 -0
  399. package/dist/link-shape.js.map +1 -0
  400. package/dist/list-marks.d.ts +21 -0
  401. package/dist/list-marks.d.ts.map +1 -0
  402. package/dist/list-marks.js +82 -0
  403. package/dist/list-marks.js.map +1 -0
  404. package/dist/reasons.d.ts.map +1 -1
  405. package/dist/reasons.js +15 -4
  406. package/dist/reasons.js.map +1 -1
  407. package/dist/render/explain.d.ts.map +1 -1
  408. package/dist/render/explain.js +11 -2
  409. package/dist/render/explain.js.map +1 -1
  410. package/dist/render/friendly.js +1 -1
  411. package/dist/render/friendly.js.map +1 -1
  412. package/dist/render/rules-json.d.ts.map +1 -1
  413. package/dist/render/rules-json.js +12 -3
  414. package/dist/render/rules-json.js.map +1 -1
  415. package/dist/render/rules-table.js +6 -6
  416. package/dist/render/rules-table.js.map +1 -1
  417. package/dist/render/semantic.js +2 -2
  418. package/dist/render/semantic.js.map +1 -1
  419. package/dist/render/suppressions.js +2 -2
  420. package/dist/render/suppressions.js.map +1 -1
  421. package/dist/rewrite-depth.d.ts +22 -0
  422. package/dist/rewrite-depth.d.ts.map +1 -0
  423. package/dist/rewrite-depth.js +42 -0
  424. package/dist/rewrite-depth.js.map +1 -0
  425. package/dist/rule-fields.d.ts +28 -0
  426. package/dist/rule-fields.d.ts.map +1 -0
  427. package/dist/rule-fields.js +85 -0
  428. package/dist/rule-fields.js.map +1 -0
  429. package/dist/rule-guide.d.ts +3 -0
  430. package/dist/rule-guide.d.ts.map +1 -1
  431. package/dist/rule-guide.js +6 -0
  432. package/dist/rule-guide.js.map +1 -1
  433. package/dist/rule-load.d.ts.map +1 -1
  434. package/dist/rule-load.js +13 -5
  435. package/dist/rule-load.js.map +1 -1
  436. package/dist/rule-offs.d.ts +14 -0
  437. package/dist/rule-offs.d.ts.map +1 -0
  438. package/dist/rule-offs.js +45 -0
  439. package/dist/rule-offs.js.map +1 -0
  440. package/dist/structure/build.d.ts.map +1 -1
  441. package/dist/structure/build.js +14 -1
  442. package/dist/structure/build.js.map +1 -1
  443. package/dist/structure/cross-definitions.d.ts +23 -0
  444. package/dist/structure/cross-definitions.d.ts.map +1 -0
  445. package/dist/structure/cross-definitions.js +34 -0
  446. package/dist/structure/cross-definitions.js.map +1 -0
  447. package/genres.yaml +14 -313
  448. package/package.json +3 -3
  449. package/rules/absolute-exception.yaml +3 -1
  450. package/rules/abstract-length.yaml +7 -1
  451. package/rules/acronym-expansion-conflict.yaml +2 -1
  452. package/rules/adverb-overuse.yaml +7 -1
  453. package/rules/adverb-without-negation.yaml +60 -0
  454. package/rules/adversative-ga-repeat.yaml +2 -1
  455. package/rules/agentless-passive.yaml +10 -1
  456. package/rules/agreement-slip.yaml +4 -1
  457. package/rules/ai-generated-composite.yaml +6 -1
  458. package/rules/ai-structure.yaml +8 -2
  459. package/rules/ai-tell.yaml +7 -1
  460. package/rules/all-caps-shouting.yaml +61 -0
  461. package/rules/announced-count-mismatch.yaml +3 -1
  462. package/rules/announcing-opener.yaml +7 -1
  463. package/rules/article-sound.yaml +6 -2
  464. package/rules/assistant-residue.yaml +4 -1
  465. package/rules/attachment-not-attached.yaml +112 -0
  466. package/rules/baito-keigo.yaml +64 -0
  467. package/rules/bare-url-mix.yaml +86 -0
  468. package/rules/bold-density.yaml +1 -0
  469. package/rules/bold-label-list.yaml +9 -1
  470. package/rules/bracket-nesting.yaml +2 -1
  471. package/rules/bracket-width-consistency.yaml +64 -0
  472. package/rules/broken-link.yaml +1 -1
  473. package/rules/chat-citation-residue.yaml +2 -1
  474. package/rules/citation-reference-mismatch.yaml +7 -1
  475. package/rules/citation-style-mix.yaml +7 -1
  476. package/rules/clause-chain.yaml +6 -1
  477. package/rules/cliche.yaml +67 -0
  478. package/rules/closing-cliche.yaml +7 -0
  479. package/rules/code-fence-language-mix.yaml +176 -0
  480. package/rules/colloquial-opener.yaml +62 -0
  481. package/rules/colon-lead-in.yaml +7 -1
  482. package/rules/concrete-evidence-density.yaml +6 -0
  483. package/rules/contraction-consistency.yaml +4 -1
  484. package/rules/contrast-framing.yaml +7 -1
  485. package/rules/cross-doc-duplicate-definition.yaml +70 -0
  486. package/rules/cross-doc-fact-conflict.yaml +64 -0
  487. package/rules/currency-notation-consistency.yaml +77 -0
  488. package/rules/cushion-phrase-density.yaml +8 -1
  489. package/rules/dangling-figure-reference.yaml +3 -1
  490. package/rules/dangling-participle.yaml +58 -0
  491. package/rules/dangling-reference.yaml +3 -1
  492. package/rules/date-format-consistency.yaml +3 -2
  493. package/rules/date-order.yaml +3 -1
  494. package/rules/date-range-reversed.yaml +3 -1
  495. package/rules/date-weekday-mismatch.yaml +3 -1
  496. package/rules/date-without-year.yaml +4 -3
  497. package/rules/defined-name-repeated.yaml +97 -0
  498. package/rules/defined-term-form.yaml +113 -0
  499. package/rules/demonstrative-opener-run.yaml +2 -1
  500. package/rules/double-keigo.yaml +6 -1
  501. package/rules/double-negative.yaml +5 -1
  502. package/rules/doubled-nado.yaml +2 -1
  503. package/rules/doubled-punctuation.yaml +1 -1
  504. package/rules/doubled-word.yaml +4 -1
  505. package/rules/duplicate-definition.yaml +3 -1
  506. package/rules/duplicate-heading.yaml +1 -1
  507. package/rules/duration-mismatch.yaml +2 -1
  508. package/rules/elapsed-years-mismatch.yaml +4 -1
  509. package/rules/email-greeting-closing.yaml +122 -0
  510. package/rules/email-subject-length.yaml +112 -0
  511. package/rules/emoji-density.yaml +3 -1
  512. package/rules/emoji-heading.yaml +7 -1
  513. package/rules/empty-intensifier.yaml +4 -0
  514. package/rules/empty-list-item.yaml +2 -1
  515. package/rules/empty-section.yaml +1 -1
  516. package/rules/empty-table-cell.yaml +2 -1
  517. package/rules/excessive-hedging.yaml +7 -1
  518. package/rules/exclamation-width-consistency.yaml +64 -0
  519. package/rules/expletive-construction.yaml +7 -1
  520. package/rules/fact-conflict.yaml +4 -1
  521. package/rules/figure-reference-order.yaml +7 -1
  522. package/rules/footnote-mismatch.yaml +91 -0
  523. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  524. package/rules/hankaku-kana.yaml +1 -1
  525. package/rules/heading-command-missing.yaml +109 -0
  526. package/rules/heading-echo.yaml +6 -1
  527. package/rules/heading-end-punctuation-mix.yaml +158 -0
  528. package/rules/heading-level-skip.yaml +3 -3
  529. package/rules/heading-numbering-mix.yaml +4 -3
  530. package/rules/hiragana-fukushi.yaml +4 -1
  531. package/rules/homophone-slip.yaml +5 -1
  532. package/rules/humble-for-others.yaml +63 -0
  533. package/rules/hyphen-as-dash.yaml +59 -0
  534. package/rules/idiom-misuse.yaml +4 -1
  535. package/rules/image-file-name-alt.yaml +83 -0
  536. package/rules/impossible-date.yaml +79 -0
  537. package/rules/impossible-time.yaml +76 -0
  538. package/rules/internal-jargon.yaml +1 -1
  539. package/rules/invisible-character.yaml +1 -1
  540. package/rules/katakana-density.yaml +2 -1
  541. package/rules/katakana-long-vowel.yaml +1 -1
  542. package/rules/known-misspelling.yaml +2 -1
  543. package/rules/kutoten-consistency.yaml +1 -1
  544. package/rules/latin-abbreviation-form.yaml +58 -0
  545. package/rules/latin-spacing.yaml +6 -2
  546. package/rules/less-for-fewer.yaml +59 -0
  547. package/rules/link-text-url-mismatch.yaml +72 -0
  548. package/rules/list-item-form-mix.yaml +7 -1
  549. package/rules/list-marker-mix.yaml +111 -0
  550. package/rules/max-kanji-continuous.yaml +10 -2
  551. package/rules/max-paragraph-length.yaml +4 -1
  552. package/rules/max-sentence-length.yaml +29 -21
  553. package/rules/max-ten.yaml +4 -1
  554. package/rules/misconversion.yaml +2 -1
  555. package/rules/modal-conflict.yaml +2 -1
  556. package/rules/name-variant.yaml +4 -3
  557. package/rules/ngram-repetition.yaml +5 -0
  558. package/rules/no-doubled-joshi.yaml +5 -1
  559. package/rules/no-em-dash.yaml +4 -1
  560. package/rules/no-lead.yaml +6 -1
  561. package/rules/no-mixed-desumasu.yaml +5 -2
  562. package/rules/no-nakaguro-parallel.yaml +3 -0
  563. package/rules/nominalization.yaml +5 -1
  564. package/rules/nonstandard-word.yaml +80 -0
  565. package/rules/number-style-consistency.yaml +6 -1
  566. package/rules/number-without-unit.yaml +2 -1
  567. package/rules/numbering-gap.yaml +1 -1
  568. package/rules/numeral-sentence-start.yaml +56 -0
  569. package/rules/one-sentence-paragraph-run.yaml +5 -1
  570. package/rules/ordinal-suffix-mismatch.yaml +65 -0
  571. package/rules/orthographic-variant.yaml +4 -1
  572. package/rules/outside-announced-list.yaml +2 -1
  573. package/rules/oxford-comma-consistency.yaml +3 -1
  574. package/rules/padded-intro.yaml +7 -0
  575. package/rules/paragraph-length-variance.yaml +7 -1
  576. package/rules/paragraph-restatement.yaml +6 -1
  577. package/rules/percent-sum-mismatch.yaml +3 -1
  578. package/rules/person-consistency.yaml +4 -1
  579. package/rules/preamble-length.yaml +6 -0
  580. package/rules/preferred-term.yaml +1 -1
  581. package/rules/proper-noun-density.yaml +8 -1
  582. package/rules/quote-style-consistency.yaml +66 -0
  583. package/rules/ra-nuki.yaml +4 -1
  584. package/rules/range-notation-consistency.yaml +73 -0
  585. package/rules/redundant-expression.yaml +4 -1
  586. package/rules/reference-title-mismatch.yaml +4 -3
  587. package/rules/reference-topic-missing.yaml +2 -1
  588. package/rules/relative-date-mismatch.yaml +2 -1
  589. package/rules/repeated-conjunction.yaml +4 -1
  590. package/rules/repeated-sentence-ending.yaml +62 -0
  591. package/rules/repeated-sentence-head.yaml +4 -0
  592. package/rules/request-without-deadline.yaml +92 -0
  593. package/rules/required-sections.yaml +1 -1
  594. package/rules/requirement-modal.yaml +1 -1
  595. package/rules/requirement-smell.yaml +12 -4
  596. package/rules/rule-of-three.yaml +8 -1
  597. package/rules/sasete-itadaku.yaml +7 -1
  598. package/rules/section-length-uniformity.yaml +7 -1
  599. package/rules/sentence-initial-conjunction-run.yaml +5 -1
  600. package/rules/sentence-initial-so.yaml +6 -1
  601. package/rules/sentence-rhythm.yaml +8 -1
  602. package/rules/sentence-spacing-consistency.yaml +63 -0
  603. package/rules/share-over-hundred.yaml +65 -0
  604. package/rules/shell-prompt-mix.yaml +128 -0
  605. package/rules/space-before-punctuation.yaml +1 -1
  606. package/rules/spelling-consistency.yaml +3 -1
  607. package/rules/step-reference-missing.yaml +85 -0
  608. package/rules/step-statement-mix.yaml +76 -0
  609. package/rules/stock-transition.yaml +8 -1
  610. package/rules/stray-space.yaml +2 -2
  611. package/rules/summary-fact-mismatch.yaml +4 -1
  612. package/rules/table-header-variant.yaml +2 -1
  613. package/rules/table-row-overflow.yaml +90 -0
  614. package/rules/taigen-dome-in-prose.yaml +6 -0
  615. package/rules/tari-unpaired.yaml +58 -0
  616. package/rules/teki-overuse.yaml +2 -1
  617. package/rules/title-case-consistency.yaml +1 -1
  618. package/rules/title-length.yaml +7 -1
  619. package/rules/toc-heading-mismatch.yaml +136 -0
  620. package/rules/topic-predicate-distance.yaml +6 -1
  621. package/rules/total-mismatch.yaml +3 -1
  622. package/rules/translationese-density.yaml +4 -1
  623. package/rules/unbalanced-bracket.yaml +3 -3
  624. package/rules/unclosed-code-fence.yaml +107 -0
  625. package/rules/uncomparable-graded.yaml +65 -0
  626. package/rules/undefined-acronym.yaml +8 -1
  627. package/rules/unfilled-placeholder.yaml +1 -1
  628. package/rules/unit-mismatch.yaml +2 -1
  629. package/rules/unknown-word.yaml +4 -1
  630. package/rules/unqualified-superlative.yaml +6 -1
  631. package/rules/unrendered-emphasis.yaml +73 -0
  632. package/rules/unused-definition.yaml +4 -3
  633. package/rules/url-run-on.yaml +1 -1
  634. package/rules/use-before-definition.yaml +4 -3
  635. package/rules/vague-figure-reference.yaml +3 -1
  636. package/rules/vague-link-text.yaml +2 -1
  637. package/rules/vague-word-density.yaml +2 -1
  638. package/rules/very-adjective.yaml +5 -1
  639. package/rules/weasel-word.yaml +6 -1
  640. package/rules/which-that-consistency.yaml +64 -0
  641. package/rules/wordy-phrase.yaml +6 -1
  642. package/rules/yori-as-from.yaml +61 -0
  643. package/skills/chaff/SKILL.md +7 -7
  644. package/src/api.ts +13 -1
  645. package/src/cli-text.ts +22 -7
  646. package/src/cli.ts +8 -9
  647. package/src/command-help.ts +26 -0
  648. package/src/commands/eval.ts +2 -2
  649. package/src/commands/fix-plan.ts +13 -1
  650. package/src/commands/help.ts +8 -0
  651. package/src/commands/init-command.ts +13 -0
  652. package/src/commands/plugin-init.ts +150 -0
  653. package/src/commands/plugin-test.ts +111 -0
  654. package/src/config/load.ts +3 -0
  655. package/src/config/option-problems.ts +2 -2
  656. package/src/config/rule-problems.ts +2 -2
  657. package/src/custom/checked.ts +8 -0
  658. package/src/custom/dsl-fields.ts +102 -0
  659. package/src/custom/load.ts +2 -0
  660. package/src/custom/parse.ts +72 -50
  661. package/src/custom/problems.ts +16 -2
  662. package/src/detectors/amount-for-count.ts +90 -0
  663. package/src/detectors/blank-structure.ts +12 -4
  664. package/src/detectors/clause-shape.ts +199 -0
  665. package/src/detectors/code-fences.ts +113 -0
  666. package/src/detectors/cross-definitions.ts +49 -0
  667. package/src/detectors/cross-facts.ts +60 -0
  668. package/src/detectors/cross-registry/cross-doc-duplicate-definition.ts +4 -0
  669. package/src/detectors/cross-registry/cross-doc-fact-conflict.ts +4 -0
  670. package/src/detectors/currency-notation.ts +90 -0
  671. package/src/detectors/custom.ts +10 -2
  672. package/src/detectors/dangling-opener.ts +74 -0
  673. package/src/detectors/defined-term-form.ts +200 -0
  674. package/src/detectors/email-letter.ts +262 -0
  675. package/src/detectors/footnote-mismatch.ts +72 -0
  676. package/src/detectors/form-minority.ts +21 -0
  677. package/src/detectors/heading-end-mark.ts +82 -0
  678. package/src/detectors/impossible-date.ts +141 -0
  679. package/src/detectors/impossible-time.ts +151 -0
  680. package/src/detectors/link-shape.ts +70 -0
  681. package/src/detectors/list-marker.ts +60 -0
  682. package/src/detectors/mark-shape.ts +202 -0
  683. package/src/detectors/markdown-slip.ts +140 -0
  684. package/src/detectors/numeral-opener.ts +72 -0
  685. package/src/detectors/ordinal-suffix.ts +40 -0
  686. package/src/detectors/range-notation.ts +76 -0
  687. package/src/detectors/registry/adverb-polarity.ts +4 -0
  688. package/src/detectors/registry/amount-for-count.ts +4 -0
  689. package/src/detectors/registry/attachment-missing.ts +4 -0
  690. package/src/detectors/registry/bare-url-mix.ts +4 -0
  691. package/src/detectors/registry/caps-shouting.ts +4 -0
  692. package/src/detectors/registry/code-fence-language.ts +4 -0
  693. package/src/detectors/registry/currency-notation.ts +4 -0
  694. package/src/detectors/registry/dangling-opener.ts +4 -0
  695. package/src/detectors/registry/defined-name-repeated.ts +4 -0
  696. package/src/detectors/registry/defined-term-form.ts +4 -0
  697. package/src/detectors/registry/email-frame.ts +4 -0
  698. package/src/detectors/registry/email-subject.ts +4 -0
  699. package/src/detectors/registry/ending-run.ts +4 -0
  700. package/src/detectors/registry/footnote-mismatch.ts +4 -0
  701. package/src/detectors/registry/heading-command.ts +4 -0
  702. package/src/detectors/registry/heading-end-punctuation.ts +4 -0
  703. package/src/detectors/registry/hyphen-dash.ts +4 -0
  704. package/src/detectors/registry/image-file-name-alt.ts +4 -0
  705. package/src/detectors/registry/impossible-date.ts +4 -0
  706. package/src/detectors/registry/impossible-time.ts +4 -0
  707. package/src/detectors/registry/latin-abbreviation.ts +4 -0
  708. package/src/detectors/registry/link-text-url-mismatch.ts +4 -0
  709. package/src/detectors/registry/list-marker.ts +4 -0
  710. package/src/detectors/registry/mark-consistency.ts +4 -0
  711. package/src/detectors/registry/numeral-opener.ts +4 -0
  712. package/src/detectors/registry/ordinal-suffix.ts +4 -0
  713. package/src/detectors/registry/origin-particle.ts +4 -0
  714. package/src/detectors/registry/range-notation.ts +4 -0
  715. package/src/detectors/registry/relative-pronoun-mix.ts +4 -0
  716. package/src/detectors/registry/request-without-deadline.ts +4 -0
  717. package/src/detectors/registry/sentence-spacing.ts +4 -0
  718. package/src/detectors/registry/share-over-hundred.ts +4 -0
  719. package/src/detectors/registry/shell-prompt.ts +4 -0
  720. package/src/detectors/registry/step-reference.ts +4 -0
  721. package/src/detectors/registry/step-statement.ts +4 -0
  722. package/src/detectors/registry/table-row-overflow.ts +4 -0
  723. package/src/detectors/registry/toc-heading.ts +4 -0
  724. package/src/detectors/registry/unclosed-code-fence.ts +4 -0
  725. package/src/detectors/registry/unpaired-parallel.ts +4 -0
  726. package/src/detectors/registry/unrendered-emphasis.ts +4 -0
  727. package/src/detectors/relative-pronoun-mix.ts +79 -0
  728. package/src/detectors/request-owner.ts +141 -0
  729. package/src/detectors/share-over-hundred.ts +75 -0
  730. package/src/detectors/step-reference.ts +83 -0
  731. package/src/detectors/technical-docs.ts +230 -0
  732. package/src/detectors/toc-heading.ts +125 -0
  733. package/src/extension/pack-read.ts +128 -0
  734. package/src/extension/plugin-load.ts +49 -9
  735. package/src/extension/plugin-parse.ts +10 -3
  736. package/src/facts/address-values.ts +74 -0
  737. package/src/facts/cross-facts.ts +54 -0
  738. package/src/fix-plan/chosen-depth.ts +28 -0
  739. package/src/fix-plan/mode.ts +57 -11
  740. package/src/fix-plan/plan.ts +37 -5
  741. package/src/fix-plan/render.ts +24 -0
  742. package/src/fix-plan/text.ts +47 -10
  743. package/src/genre-load.ts +7 -4
  744. package/src/genre-parse.ts +19 -0
  745. package/src/init.ts +10 -10
  746. package/src/known-genres.ts +19 -0
  747. package/src/link-shape.ts +62 -0
  748. package/src/list-marks.ts +106 -0
  749. package/src/reasons.ts +16 -4
  750. package/src/render/explain.ts +14 -2
  751. package/src/render/friendly.ts +1 -1
  752. package/src/render/rules-json.ts +14 -3
  753. package/src/render/rules-table.ts +6 -6
  754. package/src/render/semantic.ts +2 -2
  755. package/src/render/suppressions.ts +2 -2
  756. package/src/rewrite-depth.ts +60 -0
  757. package/src/rule-fields.ts +123 -0
  758. package/src/rule-guide.ts +9 -0
  759. package/src/rule-load.ts +10 -4
  760. package/src/rule-offs.ts +50 -0
  761. package/src/structure/build.ts +21 -1
  762. package/src/structure/cross-definitions.ts +60 -0
@@ -1,6 +1,6 @@
1
1
  id: vague-word-density
2
2
  layer: L2
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: vague-density
5
5
  word_list: vague-word
6
6
  uses: [pos]
@@ -59,6 +59,7 @@ level_meaning:
59
59
  ja: 1000 字あたりあいまいな語 {limit} 個まで
60
60
  en: up to {limit} vague words per 1000 words
61
61
  rewrite:
62
+ depth: light
62
63
  ja:
63
64
  direction: あいまいな語を、何を・どこまで・いつまでに置き換えてください。決まっていないなら、決まっていないことと、誰が決めるのかを書きます。
64
65
  pairs:
@@ -1,6 +1,6 @@
1
1
  id: very-adjective
2
2
  layer: L2
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: intensified-adjective
5
5
  word_list: very-intensifier
6
6
  extra_word_lists: [very-exception]
@@ -27,6 +27,9 @@ how_to_fix:
27
27
  levels: { strict: 1, normal: 2, relaxed: 4 }
28
28
 
29
29
  use_for: [business, technical, blog, legal, docs, academic, literature, speech]
30
+ off_for:
31
+ literature: 'Dialect and old usage ("an hospital") are the work''s voice, and dialogue leans on "very".'
32
+ speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
30
33
 
31
34
  group: wording
32
35
  summary:
@@ -47,6 +50,7 @@ level_meaning:
47
50
  ja: very + 形容詞が 1000 語あたり {limit} 個まで
48
51
  en: up to {limit} "very" + adjective per 1000 words
49
52
  rewrite:
53
+ depth: light
50
54
  en:
51
55
  direction: Replace "very" + adjective with a stronger single word, or with what the text says about how much. If the text says nothing more, a plain adjective without "very" will do.
52
56
  pairs:
@@ -1,6 +1,6 @@
1
1
  id: weasel-word
2
2
  layer: L2
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: phrase-match
5
5
  word_list: weasel-word
6
6
  requires: [pos]
@@ -26,6 +26,10 @@ how_to_fix:
26
26
  levels: { strict: 1, normal: 1, relaxed: 2 }
27
27
 
28
28
  use_for: [business, technical, blog, legal, docs, academic, literature, speech]
29
+ off_for:
30
+ legal: "Legal drafting repeats its terms and its sentence heads on purpose, puts the actor in the passive (shall be deemed), and joins long noun compounds (個人情報取扱事業者). This rule would only flag the form."
31
+ literature: 'A narrator and a character speak as they speak: dialect ("would of"), "So," and hearsay are the voice.'
32
+ speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
29
33
 
30
34
  group: wording
31
35
  summary:
@@ -45,6 +49,7 @@ level_meaning:
45
49
  ja: 当てはまる言い回しが {limit} 箇所あれば指摘
46
50
  en: reported once there are {limit}
47
51
  rewrite:
52
+ depth: light
48
53
  en:
49
54
  direction: Replace the unnamed crowd ("many experts", "studies") with the person or study the text or its sources name. If they name none, do not invent one; ask the writer, or state the claim as the writer's own.
50
55
  pairs:
@@ -0,0 +1,64 @@
1
+ id: which-that-consistency
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: relative-pronoun-mix
5
+ requires: [pos]
6
+ languages: [en]
7
+ severity: info
8
+
9
+ name:
10
+ ja: 限定の関係節の which と that が揃っていない
11
+ en: Restrictive "which" and "that" mixed
12
+
13
+ why:
14
+ ja: 英語の限定の関係節(the file that contains the keys)は、that で書く人と which で書く人がいます。米国の手引きは that を勧め、英国の手引きはどちらも認めます。どちらが正しいかは決めません。一つの文書で混ざっていると、読み手は which の節が補足(読点のある非限定の節)なのかと迷います。読点を挟まない「名詞 + which / that + 動詞」だけを数え、少ないほうを指します。
15
+ en: 'A restrictive relative clause ("the file that contains the keys") opens with "that" for some writers and "which" for others. American guides prefer "that"; British ones accept both. chaff does not pick a side. Mixed in one document, a reader wonders whether a "which" clause is meant as an aside (the non-restrictive kind, set off by a comma). Only "noun + which/that + verb" with no comma between is counted, and the fewer form is pointed at.'
16
+
17
+ message:
18
+ ja: 限定の関係節を「{word}」で書いています(この文書はふつう「{usual}」)
19
+ en: 'This restrictive clause opens with "{word}"; the document mostly uses "{usual}"'
20
+
21
+ how_to_fix:
22
+ ja: 文書の多いほうに揃えてください。補足の節にするなら、前に読点を置いて which で書きます。
23
+ en: Match the rest of the document. If the clause is meant as an aside, set it off with a comma and use "which".
24
+
25
+ # 少ないほうが何箇所までなら「混在」と見るか。これを超えたら、文書が使い分けている。
26
+ levels: { strict: 4, normal: 2, relaxed: 1 }
27
+
28
+ use_for: [business, technical, blog, legal, docs, academic, literature, speech]
29
+ off_for:
30
+ literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
31
+ speech: "A transcript keeps the speaker's words."
32
+
33
+ group: consistency
34
+ summary:
35
+ ja: 英語で、限定の関係節を which で書く所と that で書く所が混ざっている所
36
+ en: Restrictive clauses opened with "which" in some places and "that" in others
37
+
38
+ example:
39
+ en:
40
+ before: |
41
+ The job that builds the site runs nightly. The script that checks links runs hourly. The task that sends mail runs daily. The file which stores the keys is encrypted.
42
+ after: |
43
+ The job that builds the site runs nightly. The script that checks links runs hourly. The task that sends mail runs daily. The file that stores the keys is encrypted.
44
+
45
+ not_flagged:
46
+ ja: 読点のある非限定の節(the rule, which we added,)、前置詞の後ろの which(in which)、that の後ろに主語が来る節(the report that we wrote、the fact that it works)、多いほうが 3 箇所に満たない文書、少ないほうが水準の数を超える文書(使い分けている)は指しません。
47
+ en: 'A non-restrictive clause set off by a comma ("the rule, which we added,"), "which" after a preposition ("in which"), a "that" followed by its own subject ("the report that we wrote", "the fact that it works"), a document where the usual form appears fewer than 3 times, and one where the fewer form passes the level (used on purpose) are not reported.'
48
+ level_meaning:
49
+ ja: 少ないほうの書き方が {limit} 箇所以下のとき指摘
50
+ en: reported when the fewer form appears {limit} times or fewer
51
+
52
+ rewrite:
53
+ depth: light
54
+ en:
55
+ direction: Change the flagged "which" or "that" to the form the rest of the document uses. If the clause is an aside, add a comma before it and keep "which".
56
+ pairs:
57
+ - before: The file which stores the keys is encrypted.
58
+ after: The file that stores the keys is encrypted.
59
+ - before: The step which signs the build runs last.
60
+ after: The step that signs the build runs last.
61
+ keep:
62
+ - the clause itself and the rest of the sentence
63
+ avoid:
64
+ - changing a "which" clause set off by commas, which is an aside
@@ -1,6 +1,6 @@
1
1
  id: wordy-phrase
2
2
  layer: L2
3
- status: experimental
3
+ status: stable
4
4
  how_to_find: phrase-match
5
5
  word_list: wordy-phrase
6
6
  requires: [pos]
@@ -27,6 +27,10 @@ how_to_fix:
27
27
  levels: { strict: 1, normal: 2, relaxed: 4 }
28
28
 
29
29
  use_for: [business, technical, blog, legal, docs, academic, literature, speech]
30
+ off_for:
31
+ legal: 'Drafting writes "in the event that" and "for the purpose of" on purpose.'
32
+ literature: 'A narrator and a character speak as they speak: dialect ("would of"), "So," and hearsay are the voice.'
33
+ speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
30
34
 
31
35
  group: wording
32
36
  summary:
@@ -46,6 +50,7 @@ level_meaning:
46
50
  ja: 回りくどい言い回しを含む文が {limit} 文あれば指摘
47
51
  en: reported once {limit} sentences hold one
48
52
  rewrite:
53
+ depth: light
49
54
  en:
50
55
  direction: Replace the wordy phrase with its short form from the lexicon. Leave the rest of the sentence alone.
51
56
  pairs:
@@ -0,0 +1,61 @@
1
+ id: yori-as-from
2
+ layer: L3
3
+ status: stable
4
+ how_to_find: origin-particle
5
+ word_list: origin-particle
6
+ extra_word_lists: [origin-head]
7
+ requires: [pos]
8
+ languages: [ja]
9
+ severity: info
10
+
11
+ name:
12
+ ja: 起点を言う「より」
13
+ en: より used for "from"
14
+
15
+ why:
16
+ ja: 公用文では、「より」は比べるときだけに使い、時や所の起点は「から」で書きます。「4月1日より開始」「担当者よりご連絡します」の「より」は起点です。比べる「より」(昨年より増えた)と同じ字なので、読み手は一瞬どちらかを考えます。「より」の後に始まり・送り・来ることを言う語(開始、連絡、参る)が続くときだけ指します。
17
+ en: Japanese official style uses より only for comparison ("more than") and から for a starting point ("from"). In 4月1日より開始 ("starting from 1 April") より marks a start, and the reader has to work out which より it is. chaff reports より only when a word for starting, sending or coming (開始, 連絡, 参る) follows it.
18
+
19
+ message:
20
+ ja: 起点の「{word}」は「{suggestion}」と書けます
21
+ en: '"{word}" marks a starting point here; write "{suggestion}"'
22
+
23
+ how_to_fix:
24
+ ja: 起点なら「から」にしてください(4月1日より開始 → 4月1日から開始)。
25
+ en: For a starting point, write から (4月1日より開始 → 4月1日から開始).
26
+
27
+ levels: { strict: warning, normal: info, relaxed: info }
28
+
29
+ use_for: [business, technical, legal, docs, academic, literature, speech]
30
+ off_for:
31
+ literature: "Spoken 全然大丈夫, なので and より in a character's voice; classical verse has a たり that does not list."
32
+ speech: "Spoken Japanese says 全然大丈夫, opens with なので and greets with より参りました."
33
+ sources: [koyobun-2022]
34
+
35
+ group: wording
36
+ summary:
37
+ ja: 「4月1日より開始」のように、起点を「から」でなく「より」で書いた所
38
+ en: より written for a starting point (4月1日より開始) where Japanese official style writes から
39
+ example:
40
+ ja:
41
+ before: |
42
+ 新しい窓口は4月1日より受付を開始します。
43
+ after: |
44
+ 新しい窓口は4月1日から受付を開始します。
45
+
46
+ not_flagged:
47
+ ja: 比べる「より」(昨年より増えた、これより大きい)と「により」「より一層」は指しません。名詞が続くときは、それが「を」か「する」「いたす」を伴う動作のときだけ指します(昨年より販売が増えた、は指しません)。鉤括弧で引いた中は見ません。
48
+ en: Comparison (昨年より増えた, "more than last year"), により ("by") and より一層 are not reported. A following noun counts only when it is an action taking を or a light verb, so 昨年より販売が増えた is not reported. Nothing quoted in 「」 is checked.
49
+ rewrite:
50
+ depth: light
51
+ ja:
52
+ direction: 起点を言う「より」を「から」に替えてください。替えるのはその一語だけです。
53
+ pairs:
54
+ - before: 新しい窓口は4月1日より受付を開始します。
55
+ after: 新しい窓口は4月1日から受付を開始します。
56
+ - before: 詳細は担当者よりご連絡いたします。
57
+ after: 詳細は担当者からご連絡いたします。
58
+ keep:
59
+ - 日付、名前、敬語の形
60
+ avoid:
61
+ - 比べる「より」まで替える
@@ -32,7 +32,7 @@ choice, not a gap; turn it back on (`rules:` in `chaff.yaml`) only when the pers
32
32
  ```sh
33
33
  npx chaffjs --genre <genre> <file|dir|glob>... # human-readable, one block per finding (a folder or glob picks up .md / .markdown / .mdx; name a .txt file directly)
34
34
  npx chaffjs . --compact # two lines per finding: line:col severity message, then the rule id
35
- npx chaffjs <file> --experimental # also the experimental rules
35
+ npx chaffjs <file> --experimental # also the experimental rules (new ones, not yet measured)
36
36
  ```
37
37
 
38
38
  A run exits 1 when a finding is an `error`. It also exits 1 when it could not check anything: no file to
@@ -106,10 +106,10 @@ Use this section when asked to make a text sound less generated: 「AIっぽさ
106
106
 
107
107
  chaff marks the shapes common in generated text (group "Signs of generated text" in `npx chaffjs rules`: `ai-tell`,
108
108
  `contrast-framing`, `stock-transition`, `announcing-opener`, `colon-lead-in` (Japanese only), `assistant-residue`, and the signals
109
- `ai-generated-composite` reads). Most are experimental: run with `--experimental`. None of them says the text was
109
+ `ai-generated-composite` reads). They run by default outside legal, manual, literary and spoken genres. None of them says the text was
110
110
  generated. chaff never rewrites; the rewriting is yours.
111
111
 
112
- **Start with the plan.** Run `npx chaffjs fix-plan <file> --experimental` (with the genre's `--genre`; `--json` to
112
+ **Start with the plan.** Run `npx chaffjs fix-plan <file>` (with the genre's `--genre`; `--json` to
113
113
  read it as data). It prints, in the document's language:
114
114
 
115
115
  - the constraints: keep facts, numbers, conditions and names; add no fact; ask the writer instead of inventing a
@@ -140,7 +140,7 @@ repeats the body. The writer usually wants the structure changed, not only the s
140
140
 
141
141
  **Light** (only the flagged spots):
142
142
 
143
- 1. `npx chaffjs fix-plan <file> --experimental` (or with the genre's `--genre`).
143
+ 1. `npx chaffjs fix-plan <file>` (or with the genre's `--genre`).
144
144
  2. Rewrite only the flagged spots, each by its rule's direction in the plan. Keep the meaning, numbers, conditions and
145
145
  technical constraints.
146
146
  3. Run chaff again. At most two rewrite passes.
@@ -148,7 +148,7 @@ repeats the body. The writer usually wants the structure changed, not only the s
148
148
 
149
149
  **Bold** (section by section, outline kept):
150
150
 
151
- 1. Run chaff with `--experimental` and note the document-level signals: the `ai-generated-composite` inputs,
151
+ 1. Run chaff and note the document-level signals: the `ai-generated-composite` inputs,
152
152
  `bold-density`, `contrast-framing`, `stock-transition`, `sentence-rhythm`.
153
153
  2. Rewrite each section toward a human voice: less bold; one-line paragraphs and punchlines folded back into
154
154
  paragraphs; no "X ではありません。Y です" / "It's not X. It's Y" frames; lists turned back into sentences where the
@@ -204,7 +204,7 @@ repeats the body. The writer usually wants the structure changed, not only the s
204
204
  `chaff compare` catches an added number or name, but not added wording such as 「朝会で冗談が出るようになり」, so
205
205
  this one is yours to keep.
206
206
  5. **Check.**
207
- - `npx chaffjs <old> --experimental` and `npx chaffjs <new> --experimental`: the AI signals before and after.
207
+ - `npx chaffjs <old>` and `npx chaffjs <new>`: the AI signals before and after.
208
208
  - `npx chaffjs outline <old> <new>`: headings, average section length, text in lists, bold, and the structure score
209
209
  and each structure measure, before and after. A restructure shows up here, not only in rule counts.
210
210
  - `npx chaffjs compare <old> <new> --distinct --allow-dropped heading --allow-added heading`: the headings are the
@@ -249,7 +249,7 @@ output before and after.
249
249
  ## Structured documents
250
250
 
251
251
  - `npx chaffjs tree <file>` shows a contract or specification as a tree of addresses (`3.2` for 第3条第2項 or
252
- Section 3.2). `--experimental` adds the structure rules: references to missing provisions, numbering gaps,
252
+ Section 3.2). A check reads the same tree to find references to missing provisions, numbering gaps and
253
253
  terms defined twice.
254
254
  - `npx chaffjs cite <source> <quotes.json>` checks that quotations (`[{ "address", "quote" }]`) are really in
255
255
  the source; exit 1 if any is not. Use it to back every quotation you put in an answer or a summary.
package/src/api.ts CHANGED
@@ -107,9 +107,21 @@ export type RuleSpec = {
107
107
  readonly name?: Text;
108
108
  readonly why?: Text;
109
109
  readonly how_to_fix?: Text;
110
- readonly example?: { readonly before: Text; readonly after: Text };
110
+ /** { before, after }, or one pair per language as chaff's own rules write it: { ja: { before, after }, en: … }. */
111
+ readonly example?: { readonly before: Text; readonly after: Text } | Readonly<Record<string, { readonly before: string; readonly after: string }>>;
111
112
  readonly message?: Text;
113
+ /** One severity for normal; strict is one heavier and relaxed one lighter. Or levels, not both. */
112
114
  readonly level?: Severity;
115
+ /** A severity for each level, as chaff's rules with nothing to count write them. normal is required. */
116
+ readonly levels?: Readonly<Partial<Record<"strict" | "normal" | "relaxed", Severity>>>;
117
+ /** The genres the rule is for, or their first part (business, business/report). Without it, every genre. */
118
+ readonly use_for?: readonly string[];
119
+ /** Where the rule reference lists it (readability, wording, …). Without it, team. */
120
+ readonly group?: string;
121
+ /** What the rule finds, in one line. Without it, the name. */
122
+ readonly summary?: Text;
123
+ /** How chaff fix-plan rewrites what the rule flags: depth (light / structure / register) and, by language, direction, pairs, keep and avoid. */
124
+ readonly rewrite?: Readonly<Record<string, unknown>>;
113
125
  /** The languages the rule checks. Without it, every language. */
114
126
  readonly languages?: readonly string[];
115
127
  /** A word list by name; the detector gets it as options.lexicon. A plugin's own lists are named without the plugin's prefix. */
package/src/cli-text.ts CHANGED
@@ -5,6 +5,11 @@ import { counted, formFor } from "./render/plural.ts";
5
5
  import type { GenreSetting } from "./genre-check.ts";
6
6
  import type { ProfileSetting } from "./profile/check.ts";
7
7
 
8
+ const ASCII_AT = /[\x21-\x7e]/u;
9
+
10
+ /** A word set in Japanese text with a space on each side where it starts or ends with Latin text, as the guide writes it. */
11
+ const spacedInJapanese = (word: string): string => `${ASCII_AT.test(word.at(0) ?? "") ? " " : ""}${word}${ASCII_AT.test(word.at(-1) ?? "") ? " " : ""}`;
12
+
8
13
  /** What a folder walk looked for, and how to look for more. Markdown always; include adds file-name globs. */
9
14
  const lookedForJa = (include: readonly string[]): string => {
10
15
  const also = include.length > 0 ? `と ${include.join(" ")}` : "";
@@ -26,6 +31,8 @@ const USAGE_JA = `chaff — 文章の読みにくいところを見つけます
26
31
  chaff test <file|dir>... 意味を読む検査も動かす(API key が要ります)
27
32
  判定役は chaff.yaml の ai_backend で選びます
28
33
  chaff init chaff.yaml を作る(端末ならジャンルを尋ねる。--genre <ジャンル> でも選べる)
34
+ chaff init --plugin <名前> YAML だけのルールの束(chaff-plugin-<名前>/)を作る
35
+ chaff plugin-test [フォルダ] プラグインの各ルールを、そのルールの例にかけて確かめる
29
36
  chaff --version chaffjs と言語パッケージの版
30
37
  chaff eval <dir> 手元の文書で閾値を測り直す
31
38
  chaff explain <rule> そのルールの意図と根拠を読む
@@ -69,6 +76,8 @@ const USAGE_EN = `chaff — finds what makes writing hard to read. It never rewr
69
76
  chaff test <file|dir>... also run the checks that read meaning (needs an API key)
70
77
  the judge is chosen by ai_backend in chaff.yaml
71
78
  chaff init create chaff.yaml (asks for the genre at a terminal; --genre <genre> chooses it)
79
+ chaff init --plugin <name> create a YAML rule pack, chaff-plugin-<name>/
80
+ chaff plugin-test [folder] run each rule of a plugin on the rule's own example
72
81
  chaff --version the version of chaffjs and its language packages
73
82
  chaff eval <dir> re-measure the limits on your own documents
74
83
  chaff explain <rule> read what a rule is for and why
@@ -107,6 +116,8 @@ A rule's level is one of strict / normal / relaxed / off.
107
116
 
108
117
  export type CliText = {
109
118
  readonly usage: string;
119
+ /** Under one command's lines of the usage, for `chaff <command> --help`. */
120
+ readonly moreHelp: string;
110
121
  readonly languageName: (language: string) => string;
111
122
  readonly genreSource: Readonly<Record<GenreSource, string>>;
112
123
  readonly header: (path: string, genre: string, language: string, from: string, shelved: number, hushed: number) => string;
@@ -135,6 +146,7 @@ export type CliText = {
135
146
  export const CLI_TEXT: Texts<CliText> = {
136
147
  ja: {
137
148
  usage: USAGE_JA,
149
+ moreHelp: "すべてのコマンドと共通の指定は npx chaffjs --help で出ます。",
138
150
  languageName: (language) => (language === "ja" ? "日本語" : "英語"),
139
151
  genreSource: {
140
152
  "--genre": "--genre",
@@ -146,9 +158,11 @@ export const CLI_TEXT: Texts<CliText> = {
146
158
  content: "内容",
147
159
  },
148
160
  header: (path, genre, language, from, shelved, hushed) =>
149
- [`${path} ${genre} · ${language} ジャンルは${from}から`, shelved > 0 ? ` 棚上げ ${shelved} 件` : "", hushed > 0 ? ` stet ${hushed} 件` : ""].join(
150
- "",
151
- ),
161
+ [
162
+ `${path} ${genre} · ${language} ジャンルは${spacedInJapanese(from)}から`,
163
+ shelved > 0 ? ` 棚上げ ${shelved} 件` : "",
164
+ hushed > 0 ? ` stet ${hushed} 件` : "",
165
+ ].join(""),
152
166
  suggested: (name, genre) => ` ${name}のようです。--genre ${genre} を試せます`,
153
167
  suggestedNote: (name, genre, used) =>
154
168
  ` ジャンルを決めていないので、${used} として見ました。${name}なら、--genre ${genre} でその種類の書き方に合わせて見ます(npx chaffjs genres で一覧)。`,
@@ -156,7 +170,7 @@ export const CLI_TEXT: Texts<CliText> = {
156
170
  noMarkdownHere: (include) => `検査するファイルが 1 つも見つかりませんでした。\n${lookedForJa(include)}`,
157
171
  noAdapter: (language) => `言語 "${language}" のアダプタがありません。`,
158
172
  unknownGenre: (genre, where, known) =>
159
- `ジャンル "${genre}" はありません(${where})。使えるのは ${known.join("、")} です。npx chaff genres で一覧が出ます。`,
173
+ `ジャンル "${genre}" はありません(${where})。使えるのは ${known.join("、")} です。npx chaffjs genres で一覧が出ます。`,
160
174
  genreWhere: (where, files) => {
161
175
  if (where === "config") return "chaff.yaml の genre";
162
176
  return where === "by_path" ? `chaff.yaml の by_path、files: ${files.join(", ")}` : "--genre";
@@ -166,7 +180,7 @@ export const CLI_TEXT: Texts<CliText> = {
166
180
  unknownProfile: (profile, where, known) =>
167
181
  `文書の種類 "${profile}" はありません(${where})。使えるのは ${known.join("、")} と、種類を使わない none です。`,
168
182
  profileWhere: (where, files) => (where === "config" ? "chaff.yaml の profile" : `chaff.yaml の by_path、files: ${files.join(", ")}`),
169
- unknownRule: (id) => `${id} というルールはありません。npx chaff rules で一覧が出ます。`,
183
+ unknownRule: (id) => `${id} というルールはありません。npx chaffjs rules で一覧が出ます。`,
170
184
  unknownRuleWithList: (id, list) => `${id} というルールはありません。\n一覧:\n${list}`,
171
185
  unnamed: "(名前なし)",
172
186
  sarifWritten: (path, count) => `\n SARIF を書きました: ${path}(${count} 件)`,
@@ -187,6 +201,7 @@ export const CLI_TEXT: Texts<CliText> = {
187
201
  },
188
202
  en: {
189
203
  usage: USAGE_EN,
204
+ moreHelp: "npx chaffjs --help lists every command and the options they share.",
190
205
  languageName: (language) => (language === "ja" ? "Japanese" : "English"),
191
206
  genreSource: {
192
207
  "--genre": "--genre",
@@ -205,7 +220,7 @@ export const CLI_TEXT: Texts<CliText> = {
205
220
  noMarkdown: (targets, include) => `No files to check found: ${targets}\n${lookedForEn(include)}`,
206
221
  noMarkdownHere: (include) => `No files to check found.\n${lookedForEn(include)}`,
207
222
  noAdapter: (language) => `No language package for "${language}".`,
208
- unknownGenre: (genre, where, known) => `There is no genre "${genre}" (${where}). The genres are ${known.join(", ")}. npx chaff genres lists them.`,
223
+ unknownGenre: (genre, where, known) => `There is no genre "${genre}" (${where}). The genres are ${known.join(", ")}. npx chaffjs genres lists them.`,
209
224
  genreWhere: (where, files) => {
210
225
  if (where === "config") return "genre in chaff.yaml";
211
226
  return where === "by_path" ? `by_path in chaff.yaml, files: ${files.join(", ")}` : "--genre";
@@ -215,7 +230,7 @@ export const CLI_TEXT: Texts<CliText> = {
215
230
  unknownProfile: (profile, where, known) =>
216
231
  `There is no document profile "${profile}" (${where}). The profiles are ${known.join(", ")}; none uses no profile.`,
217
232
  profileWhere: (where, files) => (where === "config" ? "profile in chaff.yaml" : `by_path in chaff.yaml, files: ${files.join(", ")}`),
218
- unknownRule: (id) => `There is no rule named ${id}. npx chaff rules lists them.`,
233
+ unknownRule: (id) => `There is no rule named ${id}. npx chaffjs rules lists them.`,
219
234
  unknownRuleWithList: (id, list) => `There is no rule named ${id}.\nRules:\n${list}`,
220
235
  unnamed: "(no name)",
221
236
  sarifWritten: (path, count) => `\n Wrote SARIF: ${path} (${counted(count, "finding")})`,
package/src/cli.ts CHANGED
@@ -13,8 +13,8 @@ import { runEval } from "./commands/eval.ts";
13
13
  import { runTest } from "./commands/test.ts";
14
14
  import { GENRES } from "./genre.ts";
15
15
  import { resolveGenre } from "./resolve-genre.ts";
16
- import { runInit } from "./init.ts";
17
- import { initGenre } from "./commands/init-ask.ts";
16
+ import { runInitCommand } from "./commands/init-command.ts";
17
+ import { runPluginTest } from "./commands/plugin-test.ts";
18
18
  import { targetsOf, withExperimental, withIncludes } from "./cli-args.ts";
19
19
  import { rulesOf } from "./custom/load.ts";
20
20
  import { renderCompact } from "./render/compact.ts";
@@ -29,6 +29,8 @@ import { renderSarif } from "./render/sarif.ts";
29
29
  import { VERSION, VERSION_LINES } from "./version.ts";
30
30
  import type { TreeContext } from "./commands/tree.ts";
31
31
  import { DOCUMENT_COMMANDS } from "./commands/document-commands.ts";
32
+ import { asksForHelp } from "./command-help.ts";
33
+ import { printCommandHelp } from "./commands/help.ts";
32
34
  import { runSkill } from "./commands/skill.ts";
33
35
  import { GRADE_EXIT, runGrade } from "./commands/grade.ts";
34
36
  import { fixPlanTargets, runFixPlan } from "./commands/fix-plan.ts";
@@ -280,19 +282,15 @@ const measureContext = (argv: readonly string[], config: Config): { config: Conf
280
282
 
281
283
  /** 分岐を数珠つなぎにせず表にする。足すときに main を太らせない。 */
282
284
  const HANDLERS: Readonly<Record<string, Handler>> = {
283
- init: async (argv, config) => {
284
- const ui = hostLanguage(config.language, process.env);
285
- const chosen = await initGenre(flag(argv, "--genre"), ui, process.cwd());
286
- if ("error" in chosen) console.error(chosen.error);
287
- else runInit(process.cwd(), chosen.genre, ui).forEach((line) => console.log(line));
288
- return "error" in chosen ? 1 : 0;
289
- },
285
+ init: (argv, config) => runInitCommand((name) => flag(argv, name), argv.includes("--plugin"), hostLanguage(config.language, process.env), process.cwd()),
290
286
  genres: (_argv, config) => showGenres(config),
291
287
  rules: showRules,
292
288
  explain: (argv, config) => explain(config, argv[1], flag(argv, "--genre")),
293
289
  eval: (argv, config) => runEval(positional(argv), argv, { ...measureContext(argv, config), flag }),
294
290
  ...Object.fromEntries(Object.entries(DOCUMENT_COMMANDS).map(([name, run]): [string, Handler] => [name, (argv, config) => run(argv, treeContext(config))])),
295
291
  test: (argv, config) => runTest(positional(argv), argv, { ...measureContext(argv, config), inspect }),
292
+ "plugin-test": (argv, config) =>
293
+ runPluginTest(positional(argv)[0], { ui: hostLanguage(config.language, process.env), check: async (...args) => (await inspect(...args)).checked }),
296
294
  "fix-plan": (argv, config) =>
297
295
  runFixPlan(fixPlanTargets(argv), argv, { ...treeContext(config), check: async (path) => (await inspectAll(config, argv)(path)).checked }),
298
296
  baseline: (argv, config) => runBaseline(positional(argv), argv, config),
@@ -338,6 +336,7 @@ const dispatch = async (argv: readonly string[]): Promise<number> => {
338
336
  console.log(VERSION_LINES.join("\n"));
339
337
  return 0;
340
338
  }
339
+ if ((first === "lint" || HANDLERS[first] !== undefined) && asksForHelp(argv)) return printCommandHelp(hostText(readConfig()), first);
341
340
  // 知らないジャンルではどの rule も当たらず、知らない文書の種類では種類の知識が外れる。どちらも素通りに見えるので、何かする前に止める。
342
341
  const config = withIncludes(await withExtensions(readConfig()), argv);
343
342
  const problems = settingProblems(first, flag(argv, "--genre"), config, hostText(config), hostLanguage(config.language, process.env));
@@ -0,0 +1,26 @@
1
+ // Pure: what `chaff <command> --help` prints, taken from the usage that `chaff --help` prints, so the two cannot drift.
2
+
3
+ const ENTRY = /^ {2}chaff (\S+)/u;
4
+ const CONTINUATION = /^ {3,}\S/u;
5
+ const HELP_FLAGS: ReadonlySet<string> = new Set(["--help", "-h"]);
6
+
7
+ /** Whether the arguments after the command ask for its help. */
8
+ export const asksForHelp = (argv: readonly string[]): boolean => argv.slice(1).some((arg) => HELP_FLAGS.has(arg));
9
+
10
+ const namesOf = (line: string): readonly string[] => ENTRY.exec(line)?.[1]?.split("|") ?? [];
11
+
12
+ /** The usage's lines for one command: each line naming it (" chaff relax|strict|off …"), with the lines indented under it. */
13
+ export const commandUsage = (usage: string, command: string): string[] =>
14
+ usage.split("\n").reduce<{ owned: boolean; lines: string[] }>(
15
+ (state, line) => {
16
+ const owned = ENTRY.test(line) ? namesOf(line).includes(command) : state.owned && CONTINUATION.test(line);
17
+ return { owned, lines: owned ? [...state.lines, line] : state.lines };
18
+ },
19
+ { owned: false, lines: [] },
20
+ ).lines;
21
+
22
+ /** `chaff <command> --help`: the command's lines of the usage and where the rest is, or the whole usage when it has none. */
23
+ export const commandHelp = (usage: string, command: string, moreHelp: string): string => {
24
+ const lines = commandUsage(usage, command);
25
+ return lines.length === 0 ? usage : [...lines, "", moreHelp].join("\n");
26
+ };
@@ -20,11 +20,11 @@ const TEXT: Texts<{
20
20
  readonly unknownRule: (id: string) => string;
21
21
  }> = {
22
22
  ja: {
23
- mixed: (mixes) => `言語かジャンルが混ざっています: ${mixes}\n1 つに絞って測ってください(例: npx chaff eval examples/blog-ja/)。`,
23
+ mixed: (mixes) => `言語かジャンルが混ざっています: ${mixes}\n1 つに絞って測ってください(例: npx chaffjs eval examples/blog-ja/)。`,
24
24
  unknownRule: (id) => `${id} という rule はありません。`,
25
25
  },
26
26
  en: {
27
- mixed: (mixes) => `Languages or genres are mixed: ${mixes}\nMeasure one at a time (for example npx chaff eval examples/blog-en/).`,
27
+ mixed: (mixes) => `Languages or genres are mixed: ${mixes}\nMeasure one at a time (for example npx chaffjs eval examples/blog-en/).`,
28
28
  unknownRule: (id) => `There is no rule named ${id}.`,
29
29
  },
30
30
  };
@@ -4,12 +4,17 @@ import { structureOf } from "../structure-shape/of-document.ts";
4
4
  import { buildFixPlan } from "../fix-plan/plan.ts";
5
5
  import { renderFixPlanJson, renderFixPlanMarkdown } from "../fix-plan/render.ts";
6
6
  import { FIX_PLAN_TEXT } from "../fix-plan/text.ts";
7
+ import { chosenDepthOf } from "../fix-plan/chosen-depth.ts";
7
8
  import type { Checked } from "./feedback.ts";
8
9
  import { readDocument } from "./read-document.ts";
9
10
  import type { TreeContext } from "./tree.ts";
10
11
 
11
12
  /** Options whose value is the next argument. That value is not a file. */
12
- const VALUED: ReadonlySet<string> = new Set(["--language", "--genre"]);
13
+ const VALUED: ReadonlySet<string> = new Set(["--language", "--genre", "--depth"]);
14
+
15
+ /** --depth's value: undefined when not given, empty when given with nothing after it (which is then reported). */
16
+ const depthFlag = (argv: readonly string[], context: FixPlanContext): string | undefined =>
17
+ argv.includes("--depth") ? (context.flag(argv, "--depth") ?? "") : undefined;
13
18
 
14
19
  export const fixPlanTargets = (argv: readonly string[]): string[] =>
15
20
  argv.slice(1).filter((arg, index, all) => !arg.startsWith("--") && !VALUED.has(all[index - 1] ?? ""));
@@ -24,6 +29,12 @@ export type FixPlanContext = TreeContext & {
24
29
  * the document-level signals, the structure targets from human articles, a recommended mode and the checks to run after. Deterministic; sends nothing anywhere.
25
30
  */
26
31
  export const runFixPlan = async (targets: readonly string[], argv: readonly string[], context: FixPlanContext): Promise<number> => {
32
+ // Checked first: a file name written after --depth by mistake is reported as the depth it was read as.
33
+ const depth = chosenDepthOf(depthFlag(argv, context), context.config.fixPlan, context.ui ?? "ja");
34
+ if ("problem" in depth) {
35
+ console.error(`chaff: ${depth.problem}`);
36
+ return 1;
37
+ }
27
38
  const [path] = targets;
28
39
  if (path === undefined || targets.length > 1) {
29
40
  console.error(FIX_PLAN_TEXT[context.ui ?? "ja"].usage);
@@ -49,6 +60,7 @@ export const runFixPlan = async (targets: readonly string[], argv: readonly stri
49
60
  outline: outlineOf(prose.doc),
50
61
  structure: structureOf(prose.doc),
51
62
  phrases: prose.doc.lexicons["ai-tell"] ?? [],
63
+ chosenDepth: depth.chosen,
52
64
  });
53
65
  console.log(argv.includes("--json") ? renderFixPlanJson(plan) : renderFixPlanMarkdown(plan));
54
66
  return 0;
@@ -0,0 +1,8 @@
1
+ import { commandHelp } from "../command-help.ts";
2
+ import type { CliText } from "../cli-text.ts";
3
+
4
+ /** `chaff <command> --help` prints the command's usage and runs nothing: `init --help` must not write chaff.yaml. */
5
+ export const printCommandHelp = (text: CliText, command: string): number => {
6
+ console.log(commandHelp(text.usage, command, text.moreHelp));
7
+ return 0;
8
+ };
@@ -0,0 +1,13 @@
1
+ import { runInit } from "../init.ts";
2
+ import type { UiLanguage } from "../ui.ts";
3
+ import { initGenre } from "./init-ask.ts";
4
+ import { runInitPlugin } from "./plugin-init.ts";
5
+
6
+ /** chaff init: chaff.yaml for a project, or with --plugin, a rule pack to start from. flag reads an option's value. */
7
+ export const runInitCommand = async (flag: (name: string) => string | undefined, plugin: boolean, ui: UiLanguage, dir: string): Promise<number> => {
8
+ if (plugin) return runInitPlugin(dir, flag("--plugin"), ui);
9
+ const chosen = await initGenre(flag("--genre"), ui, dir);
10
+ if ("error" in chosen) console.error(chosen.error);
11
+ else runInit(dir, chosen.genre, ui).forEach((line) => console.log(line));
12
+ return "error" in chosen ? 1 : 0;
13
+ };