@md-code/follow-architecture 0.3.0 → 0.3.3

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 (382) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1341 -472
  3. package/dist/args.d.ts +4 -0
  4. package/dist/args.js +18 -1
  5. package/dist/bin/follow-architecture.js +3 -3
  6. package/dist/closure-project.d.ts +4 -0
  7. package/dist/closure-project.js +122 -0
  8. package/dist/code-entities/classify.d.ts +11 -0
  9. package/dist/code-entities/classify.js +45 -0
  10. package/dist/code-entities/connector.d.ts +8 -0
  11. package/dist/code-entities/connector.js +119 -0
  12. package/dist/code-entities/entities.d.ts +9 -0
  13. package/dist/{code-roles/roles.js → code-entities/entities.js} +81 -54
  14. package/dist/code-entities/project.d.ts +21 -0
  15. package/dist/code-entities/project.js +249 -0
  16. package/dist/code-entities/walk.d.ts +31 -0
  17. package/dist/code-entities/walk.js +95 -0
  18. package/dist/config-options.d.ts +23 -0
  19. package/dist/config-options.js +18 -1
  20. package/dist/config-project.js +10 -2
  21. package/dist/config-report.d.ts +1 -1
  22. package/dist/config-report.js +20 -3
  23. package/dist/config-rule.d.ts +25 -0
  24. package/dist/config-rule.js +89 -6
  25. package/dist/config-state.d.ts +14 -3
  26. package/dist/config-state.js +180 -17
  27. package/dist/config.d.ts +25 -0
  28. package/dist/css/index.d.ts +11 -7
  29. package/dist/css/index.js +124 -23
  30. package/dist/css/syntax/css/gate.js +5 -5
  31. package/dist/css/syntax/css/index.d.ts +1 -1
  32. package/dist/css/syntax/css/index.js +1 -1
  33. package/dist/css/syntax/css/reference.d.ts +1 -1
  34. package/dist/css/syntax/css/reference.js +15 -3
  35. package/dist/css/syntax/language.d.ts +1 -1
  36. package/dist/css/syntax/language.js +4 -2
  37. package/dist/css/syntax/scss/index.d.ts +2 -2
  38. package/dist/css/syntax/scss/index.js +1 -1
  39. package/dist/css/syntax/scss/reference.d.ts +1 -1
  40. package/dist/css/syntax/scss/reference.js +7 -1
  41. package/dist/css/syntax/styled/document.d.ts +3 -3
  42. package/dist/css/syntax/styled/document.js +17 -7
  43. package/dist/css/syntax/styled/markup.d.ts +1 -1
  44. package/dist/css/syntax/styled/markup.js +22 -14
  45. package/dist/css/syntax/styled/tags.d.ts +2 -0
  46. package/dist/css/syntax/styled/tags.js +22 -0
  47. package/dist/css/syntax/styled/template.js +10 -4
  48. package/dist/css/syntax/tailwind/tailwind.js +4 -4
  49. package/dist/css/value/check.d.ts +1 -1
  50. package/dist/css/value/check.js +1 -1
  51. package/dist/css/value/expression/arithmetic.d.ts +2 -2
  52. package/dist/css/value/expression/arithmetic.js +7 -3
  53. package/dist/css/value/expression/block.d.ts +2 -2
  54. package/dist/css/value/expression/block.js +4 -3
  55. package/dist/css/value/expression/conditional.d.ts +2 -2
  56. package/dist/css/value/expression/conditional.js +1 -1
  57. package/dist/css/value/expression/index.d.ts +2 -2
  58. package/dist/css/value/expression/index.js +10 -6
  59. package/dist/css/value/expression/map.d.ts +2 -2
  60. package/dist/css/value/expression/map.js +2 -2
  61. package/dist/css/value/object/index.d.ts +2 -2
  62. package/dist/css/value/object/index.js +14 -4
  63. package/dist/css/value/object/members.d.ts +2 -2
  64. package/dist/css/value/object/node.js +9 -4
  65. package/dist/css/value/object/path.d.ts +3 -3
  66. package/dist/css/value/object/path.js +10 -4
  67. package/dist/css/value/pieces.d.ts +3 -3
  68. package/dist/css/value/pieces.js +14 -4
  69. package/dist/css/value/resolve.js +15 -5
  70. package/dist/css/value/scope.d.ts +3 -2
  71. package/dist/css/value/scope.js +25 -7
  72. package/dist/css/value/substitute.js +43 -11
  73. package/dist/entities/architecture.d.ts +28 -25
  74. package/dist/entities/ast/assignments-raw.d.ts +1 -1
  75. package/dist/entities/ast/assignments-raw.js +61 -8
  76. package/dist/entities/ast/assignments-tagged.d.ts +1 -1
  77. package/dist/entities/ast/assignments-tagged.js +22 -7
  78. package/dist/entities/ast/assignments.d.ts +1 -1
  79. package/dist/entities/ast/assignments.js +6 -4
  80. package/dist/entities/ast/branches.d.ts +1 -1
  81. package/dist/entities/ast/calls.d.ts +1 -1
  82. package/dist/entities/ast/calls.js +19 -3
  83. package/dist/entities/ast/classes.d.ts +1 -1
  84. package/dist/entities/ast/classes.js +5 -1
  85. package/dist/entities/ast/comments.d.ts +3 -2
  86. package/dist/entities/ast/comments.js +47 -17
  87. package/dist/entities/ast/declaration.d.ts +1 -1
  88. package/dist/entities/ast/depth.d.ts +2 -2
  89. package/dist/entities/ast/depth.js +15 -8
  90. package/dist/entities/ast/enums.d.ts +1 -1
  91. package/dist/entities/ast/export-chain.d.ts +15 -0
  92. package/dist/entities/ast/export-chain.js +171 -0
  93. package/dist/entities/ast/file-exports.d.ts +1 -1
  94. package/dist/entities/ast/file-exports.js +26 -3
  95. package/dist/entities/ast/file-facts.d.ts +6 -3
  96. package/dist/entities/ast/file-facts.js +33 -4
  97. package/dist/entities/ast/file-imports.d.ts +1 -1
  98. package/dist/entities/ast/file-imports.js +26 -3
  99. package/dist/entities/ast/file.d.ts +2 -2
  100. package/dist/entities/ast/file.js +2 -1
  101. package/dist/entities/ast/functions.d.ts +1 -1
  102. package/dist/entities/ast/functions.js +13 -4
  103. package/dist/entities/ast/heritage.d.ts +1 -1
  104. package/dist/entities/ast/heritage.js +9 -1
  105. package/dist/entities/ast/index.d.ts +6 -3
  106. package/dist/entities/ast/index.js +82 -26
  107. package/dist/entities/ast/kind.d.ts +1 -1
  108. package/dist/entities/ast/kind.js +7 -1
  109. package/dist/entities/ast/modifiers.d.ts +1 -1
  110. package/dist/entities/ast/modifiers.js +4 -4
  111. package/dist/entities/ast/project.js +33 -2
  112. package/dist/entities/ast/properties.d.ts +1 -1
  113. package/dist/entities/ast/properties.js +10 -5
  114. package/dist/entities/ast/resolve.d.ts +1 -1
  115. package/dist/entities/ast/resolve.js +4 -4
  116. package/dist/entities/ast/tree.d.ts +4 -2
  117. package/dist/entities/ast/tree.js +184 -17
  118. package/dist/entities/ast/types.d.ts +1 -1
  119. package/dist/entities/ast/types.js +2 -1
  120. package/dist/entities/ast/usage.d.ts +1 -1
  121. package/dist/entities/ast/usage.js +1 -1
  122. package/dist/entities/ast/variables.d.ts +1 -1
  123. package/dist/entities/context.d.ts +4 -4
  124. package/dist/entities/facts.d.ts +36 -13
  125. package/dist/entities/findings.d.ts +3 -3
  126. package/dist/entities/kinds.d.ts +1 -1
  127. package/dist/entities/kinds.js +131 -30
  128. package/dist/entities/location/homes.d.ts +10 -10
  129. package/dist/entities/location/homes.js +74 -48
  130. package/dist/entities/location/place.d.ts +1 -1
  131. package/dist/entities/location/place.js +10 -3
  132. package/dist/entities/location/where.d.ts +8 -6
  133. package/dist/entities/location/where.js +79 -30
  134. package/dist/entities/location.d.ts +3 -3
  135. package/dist/entities/location.js +17 -17
  136. package/dist/entities/operators.js +1 -1
  137. package/dist/entities/overview/data.d.ts +6 -6
  138. package/dist/entities/overview/decision.d.ts +11 -11
  139. package/dist/entities/overview/finding.d.ts +10 -10
  140. package/dist/entities/overview/graph.d.ts +28 -11
  141. package/dist/entities/overview/input.d.ts +2 -2
  142. package/dist/entities/overview/summaries.d.ts +17 -15
  143. package/dist/entities/queries.d.ts +1 -1
  144. package/dist/entities/queries.js +72 -12
  145. package/dist/entities/repair.d.ts +1 -1
  146. package/dist/entities/repair.js +8 -2
  147. package/dist/entities/schema.d.ts +17 -3
  148. package/dist/entities/schema.js +74 -16
  149. package/dist/entities/story.d.ts +5 -5
  150. package/dist/entities/structure-facts.d.ts +1 -1
  151. package/dist/entities/token.d.ts +4 -4
  152. package/dist/entities/tree/build.d.ts +4 -3
  153. package/dist/entities/tree/build.js +95 -44
  154. package/dist/entities/tree/entries.d.ts +3 -3
  155. package/dist/entities/tree/entries.js +41 -16
  156. package/dist/entities/tree/index.d.ts +2 -2
  157. package/dist/entities/tree/index.js +1 -1
  158. package/dist/entities/tree/match.d.ts +2 -2
  159. package/dist/entities/tree/match.js +9 -5
  160. package/dist/fa-index.d.ts +16 -0
  161. package/dist/fa-index.js +165 -0
  162. package/dist/fa-open.d.ts +51 -0
  163. package/dist/fa-open.js +232 -0
  164. package/dist/fa-store.d.ts +22 -0
  165. package/dist/fa-store.js +222 -0
  166. package/dist/fa-values.d.ts +37 -0
  167. package/dist/fa-values.js +104 -0
  168. package/dist/facts-record.d.ts +45 -0
  169. package/dist/facts-record.js +287 -0
  170. package/dist/frameworks/angular/index.d.ts +2 -2
  171. package/dist/frameworks/angular/index.js +2 -1
  172. package/dist/frameworks/facet.d.ts +3 -1
  173. package/dist/frameworks/facet.js +13 -0
  174. package/dist/frameworks/index.d.ts +1 -1
  175. package/dist/frameworks/index.js +8 -4
  176. package/dist/frameworks/react/index.d.ts +2 -2
  177. package/dist/frameworks/react/index.js +33 -10
  178. package/dist/frameworks/test/index.d.ts +6 -0
  179. package/dist/frameworks/test/index.js +157 -0
  180. package/dist/frameworks/vue/index.d.ts +2 -2
  181. package/dist/frameworks/vue/index.js +2 -1
  182. package/dist/ignore.d.ts +3 -0
  183. package/dist/ignore.js +48 -0
  184. package/dist/index-file.d.ts +43 -0
  185. package/dist/index-file.js +218 -0
  186. package/dist/index-run.d.ts +39 -0
  187. package/dist/index-run.js +217 -0
  188. package/dist/index-zone.d.ts +25 -0
  189. package/dist/index-zone.js +209 -0
  190. package/dist/main.d.ts +5 -2
  191. package/dist/main.js +207 -34
  192. package/dist/nodes/child-entities.d.ts +3 -0
  193. package/dist/nodes/child-entities.js +12 -0
  194. package/dist/nodes/children.d.ts +4 -4
  195. package/dist/nodes/children.js +54 -11
  196. package/dist/nodes/finally/emit.d.ts +3 -3
  197. package/dist/nodes/finally/emit.js +26 -10
  198. package/dist/nodes/finally/entities.d.ts +13 -0
  199. package/dist/nodes/finally/entities.js +42 -0
  200. package/dist/nodes/finally/index.d.ts +6 -6
  201. package/dist/nodes/finally/index.js +8 -8
  202. package/dist/nodes/finally/queries.d.ts +2 -2
  203. package/dist/nodes/finally/queries.js +7 -4
  204. package/dist/nodes/finally/relations-access.d.ts +2 -2
  205. package/dist/nodes/finally/relations-access.js +22 -18
  206. package/dist/nodes/finally/relations-edge.d.ts +5 -5
  207. package/dist/nodes/finally/relations-edge.js +67 -44
  208. package/dist/nodes/finally/relations-group.d.ts +7 -7
  209. package/dist/nodes/finally/relations-group.js +28 -25
  210. package/dist/nodes/finally/relations.d.ts +2 -2
  211. package/dist/nodes/finally/relations.js +16 -12
  212. package/dist/nodes/finally/required.d.ts +3 -3
  213. package/dist/nodes/finally/required.js +9 -7
  214. package/dist/nodes/finally/violation.d.ts +2 -2
  215. package/dist/nodes/similar.d.ts +3 -3
  216. package/dist/nodes/similar.js +61 -49
  217. package/dist/piece-forms.d.ts +9 -0
  218. package/dist/piece-forms.js +68 -0
  219. package/dist/{pipeline-roles.d.ts → pipeline-entities.d.ts} +2 -2
  220. package/dist/{pipeline-roles.js → pipeline-entities.js} +32 -28
  221. package/dist/pipeline-facts.d.ts +4 -3
  222. package/dist/pipeline-facts.js +47 -55
  223. package/dist/{pipeline-unroled.d.ts → pipeline-unclassified.d.ts} +2 -2
  224. package/dist/{pipeline-unroled.js → pipeline-unclassified.js} +58 -63
  225. package/dist/pipeline.js +19 -64
  226. package/dist/release-file.d.ts +3 -0
  227. package/dist/release-file.js +13 -0
  228. package/dist/report/asks.d.ts +3 -3
  229. package/dist/report/asks.js +16 -6
  230. package/dist/report/configErrors.d.ts +55 -27
  231. package/dist/report/configErrors.js +81 -35
  232. package/dist/report/errorTypes/codes/structure.d.ts +1 -1
  233. package/dist/report/errorTypes/codes/structure.js +9 -9
  234. package/dist/report/errorTypes/decision-maker.d.ts +5 -5
  235. package/dist/report/errorTypes/decision-maker.js +4 -4
  236. package/dist/report/errorTypes/destinations.d.ts +5 -5
  237. package/dist/report/errorTypes/destinations.js +52 -34
  238. package/dist/report/errorTypes/finding-type.d.ts +3 -3
  239. package/dist/report/errorTypes/index.d.ts +1 -1
  240. package/dist/report/errorTypes/types/fileContents.d.ts +4 -4
  241. package/dist/report/errorTypes/types/fileContents.js +11 -5
  242. package/dist/report/errorTypes/types/unknownEntity.d.ts +9 -0
  243. package/dist/report/errorTypes/types/{unknownRole.js → unknownEntity.js} +12 -7
  244. package/dist/report/errorTypes/types/wrongAction.d.ts +5 -5
  245. package/dist/report/errorTypes/types/wrongAction.js +18 -13
  246. package/dist/report/errorTypes/types/wrongPlacement.d.ts +4 -4
  247. package/dist/report/errorTypes/types/wrongPlacement.js +19 -9
  248. package/dist/report/errorTypes/vocabulary/ids.d.ts +2 -2
  249. package/dist/report/errorTypes/vocabulary/ids.js +3 -3
  250. package/dist/report/errorTypes/vocabulary/phrases.d.ts +2 -2
  251. package/dist/report/errorTypes/vocabulary/phrases.js +39 -26
  252. package/dist/report/errorTypes/vocabulary/places.d.ts +3 -3
  253. package/dist/report/errorTypes/vocabulary/places.js +13 -13
  254. package/dist/report/finding-from.d.ts +3 -3
  255. package/dist/report/finding-from.js +14 -9
  256. package/dist/report/notices.d.ts +6 -1
  257. package/dist/report/notices.js +46 -20
  258. package/dist/report/observed.d.ts +19 -0
  259. package/dist/report/observed.js +87 -0
  260. package/dist/report/render-report.d.ts +1 -1
  261. package/dist/report/render-report.js +33 -30
  262. package/dist/report/user-report/build/bundle.js +9 -0
  263. package/dist/report/user-report/build/bundle.prebuilt.js +799 -297
  264. package/dist/report/user-report/data/collect.d.ts +2 -2
  265. package/dist/report/user-report/data/collect.js +15 -12
  266. package/dist/report/user-report/data/entities.d.ts +7 -0
  267. package/dist/report/user-report/data/{roles.js → entities.js} +27 -22
  268. package/dist/report/user-report/data/{role-examples.d.ts → entity-examples.d.ts} +3 -3
  269. package/dist/report/user-report/data/entity-examples.js +126 -0
  270. package/dist/report/user-report/data/{role-filters.d.ts → entity-filters.d.ts} +2 -2
  271. package/dist/report/user-report/data/{role-filters.js → entity-filters.js} +7 -7
  272. package/dist/report/user-report/data/entity-marks.d.ts +5 -0
  273. package/dist/report/user-report/data/{role-marks.js → entity-marks.js} +11 -11
  274. package/dist/report/user-report/data/file-tree.d.ts +3 -3
  275. package/dist/report/user-report/data/file-tree.js +13 -5
  276. package/dist/report/user-report/data/finding-boundary.d.ts +4 -4
  277. package/dist/report/user-report/data/finding-boundary.js +2 -2
  278. package/dist/report/user-report/data/finding-plan.d.ts +5 -5
  279. package/dist/report/user-report/data/finding-plan.js +10 -10
  280. package/dist/report/user-report/data/finding-title.d.ts +2 -2
  281. package/dist/report/user-report/data/finding-title.js +8 -8
  282. package/dist/report/user-report/data/findings.d.ts +4 -4
  283. package/dist/report/user-report/data/findings.js +30 -20
  284. package/dist/report/user-report/data/graph-edges.d.ts +4 -4
  285. package/dist/report/user-report/data/graph-edges.js +19 -19
  286. package/dist/report/user-report/data/graph-entities.d.ts +6 -0
  287. package/dist/report/user-report/data/graph-entities.js +158 -0
  288. package/dist/report/user-report/data/graph-helpers.d.ts +5 -5
  289. package/dist/report/user-report/data/graph-helpers.js +15 -15
  290. package/dist/report/user-report/data/graph.d.ts +5 -4
  291. package/dist/report/user-report/data/graph.js +28 -21
  292. package/dist/report/user-report/data/nodes.d.ts +2 -2
  293. package/dist/report/user-report/data/nodes.js +16 -16
  294. package/dist/report/user-report/data/rules.d.ts +7 -0
  295. package/dist/report/user-report/data/{invariants.js → rules.js} +13 -13
  296. package/dist/report/user-report/data/scan.d.ts +1 -1
  297. package/dist/report/user-report/data/scan.js +2 -2
  298. package/dist/report/user-report/html/shell.d.ts +1 -1
  299. package/dist/report/user-report/html/shell.js +1 -1
  300. package/dist/report/user-report/index.d.ts +1 -1
  301. package/dist/report/user-report/shared/describe.d.ts +1 -1
  302. package/dist/report/user-report/shared/describe.js +6 -6
  303. package/dist/rules/index.d.ts +7 -0
  304. package/dist/{invariants → rules}/index.js +85 -57
  305. package/dist/{invariants → rules}/list-vars.d.ts +2 -2
  306. package/dist/{invariants → rules}/list-vars.js +9 -3
  307. package/dist/{invariants → rules}/name.js +2 -2
  308. package/dist/rules/normalize.d.ts +5 -0
  309. package/dist/{invariants → rules}/normalize.js +35 -32
  310. package/dist/{invariants → rules}/vars.d.ts +9 -7
  311. package/dist/{invariants → rules}/vars.js +5 -5
  312. package/dist/scan-run.d.ts +20 -0
  313. package/dist/scan-run.js +130 -0
  314. package/dist/scripts/audit-report.js +2 -2
  315. package/dist/usage-index.d.ts +4 -0
  316. package/dist/usage-index.js +272 -0
  317. package/dist/usage-mode.d.ts +7 -0
  318. package/dist/usage-mode.js +16 -0
  319. package/dist/usage-pass.d.ts +19 -0
  320. package/dist/usage-pass.js +136 -0
  321. package/dist/usage-prepare.d.ts +2 -0
  322. package/dist/usage-prepare.js +22 -0
  323. package/dist/usage-sweep.d.ts +10 -0
  324. package/dist/usage-sweep.js +254 -0
  325. package/dist/utils/aliases.d.ts +22 -0
  326. package/dist/utils/aliases.js +163 -0
  327. package/dist/utils/classify.d.ts +2 -2
  328. package/dist/utils/classify.js +4 -4
  329. package/dist/utils/distinct.js +4 -2
  330. package/dist/utils/files.js +24 -30
  331. package/dist/utils/fixpoint.js +2 -2
  332. package/dist/utils/host.d.ts +1 -1
  333. package/dist/utils/host.js +4 -1
  334. package/dist/utils/imports.js +66 -12
  335. package/dist/utils/keyed.js +2 -2
  336. package/dist/utils/map-record.js +2 -2
  337. package/dist/utils/packages.d.ts +15 -0
  338. package/dist/utils/packages.js +197 -0
  339. package/dist/utils/path-label.js +3 -1
  340. package/dist/utils/pattern.d.ts +5 -4
  341. package/dist/utils/pattern.js +38 -8
  342. package/dist/utils/permission.d.ts +3 -3
  343. package/dist/utils/permission.js +4 -2
  344. package/dist/utils/plural.js +2 -2
  345. package/dist/utils/qualified.js +4 -4
  346. package/dist/utils/rank.js +2 -2
  347. package/dist/utils/record.js +1 -1
  348. package/dist/utils/search.js +7 -2
  349. package/dist/utils/speak.js +1 -1
  350. package/dist/utils/split.js +14 -1
  351. package/dist/utils/template.d.ts +1 -1
  352. package/dist/utils/template.js +1 -1
  353. package/dist/utils/tokenize.js +6 -1
  354. package/dist/utils/typed-field.js +2 -2
  355. package/dist/utils/verdicts.js +1 -1
  356. package/entities/operators.ts +1 -1
  357. package/package.json +101 -90
  358. package/report/errorTypes/vocabulary/ids.ts +7 -2
  359. package/report/errorTypes/vocabulary/phrases.ts +47 -27
  360. package/report/errorTypes/vocabulary/places.ts +21 -16
  361. package/report/user-report/shared/describe.ts +7 -7
  362. package/dist/code-roles/classify.d.ts +0 -11
  363. package/dist/code-roles/classify.js +0 -43
  364. package/dist/code-roles/connector.d.ts +0 -5
  365. package/dist/code-roles/connector.js +0 -114
  366. package/dist/code-roles/project.d.ts +0 -12
  367. package/dist/code-roles/project.js +0 -122
  368. package/dist/code-roles/roles.d.ts +0 -8
  369. package/dist/invariants/index.d.ts +0 -6
  370. package/dist/invariants/normalize.d.ts +0 -4
  371. package/dist/nodes/child-roles.d.ts +0 -3
  372. package/dist/nodes/child-roles.js +0 -12
  373. package/dist/nodes/finally/roles.d.ts +0 -13
  374. package/dist/nodes/finally/roles.js +0 -41
  375. package/dist/report/errorTypes/types/unknownRole.d.ts +0 -9
  376. package/dist/report/user-report/data/graph-roles.d.ts +0 -5
  377. package/dist/report/user-report/data/graph-roles.js +0 -71
  378. package/dist/report/user-report/data/invariants.d.ts +0 -7
  379. package/dist/report/user-report/data/role-examples.js +0 -94
  380. package/dist/report/user-report/data/role-marks.d.ts +0 -5
  381. package/dist/report/user-report/data/roles.d.ts +0 -7
  382. /package/dist/{invariants → rules}/name.d.ts +0 -0
@@ -1,6 +1,6 @@
1
- import type { DecisionCtx, Places } from "../../entities/overview/decision";
2
- import type { Story } from "../../entities/story";
3
- import type { StatedRepair } from "../../entities/repair";
1
+ import type { DecisionCtx, Places } from "@md-code/follow-architecture/entities/overview/decision";
2
+ import type { Story } from "@md-code/follow-architecture/entities/story";
3
+ import type { StatedRepair } from "@md-code/follow-architecture/entities/repair";
4
4
  type FindingType = {
5
5
  id: string;
6
6
  label: string;
@@ -1,7 +1,7 @@
1
1
  import { describe, TYPES } from "./decision-maker";
2
2
  import * as ids from "./vocabulary/ids";
3
3
  import * as wrongAction from "./types/wrongAction";
4
- import type { FieldValue } from "../../utils/field";
4
+ import type { FieldValue } from "@md-code/follow-architecture/utils/field";
5
5
  type Token = {
6
6
  code?: string;
7
7
  };
@@ -1,7 +1,7 @@
1
- import { FILE_CONTENTS } from "../vocabulary/ids";
2
- import type { FileContentsStory } from "../../../entities/story";
3
- import type { DecisionCtx, Places } from "../../../entities/overview/decision";
4
- import type { StatedRepair } from "../../../entities/repair";
1
+ import { FILE_CONTENTS } from "@md-code/follow-architecture/report/errorTypes/vocabulary/ids";
2
+ import type { FileContentsStory } from "@md-code/follow-architecture/entities/story";
3
+ import type { DecisionCtx, Places } from "@md-code/follow-architecture/entities/overview/decision";
4
+ import type { StatedRepair } from "@md-code/follow-architecture/entities/repair";
5
5
  declare const classify: (ctx: DecisionCtx, places: Places) => FileContentsStory;
6
6
  declare const message: () => null;
7
7
  declare const fixes: (story: FileContentsStory, ctx: DecisionCtx) => StatedRepair[];
@@ -4,11 +4,15 @@ exports.fixes = exports.message = exports.classify = exports.label = exports.id
4
4
  // The finding judges the file itself — no place, no relation. The repair is
5
5
  // whatever the rule that fired already said — and it is read from `data.repair`,
6
6
  // the ONE object the producer stated, never re-derived from the sentence.
7
- const ids_1 = require("../vocabulary/ids");
7
+ const ids_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/ids");
8
8
  Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ids_1.FILE_CONTENTS; } });
9
- const field_1 = require("../../../utils/field");
10
- const read_field_1 = require("../../../utils/read-field");
11
- const classify = (ctx, places) => ({ type: ids_1.FILE_CONTENTS, from: places.folderOf(ctx.ownerNode?.slug), to: [] });
9
+ const field_1 = require("@md-code/follow-architecture/utils/field");
10
+ const read_field_1 = require("@md-code/follow-architecture/utils/read-field");
11
+ const classify = (ctx, places) => ({
12
+ type: ids_1.FILE_CONTENTS,
13
+ from: places.folderOf(ctx.ownerNode?.slug),
14
+ to: [],
15
+ });
12
16
  exports.classify = classify;
13
17
  const message = () => null;
14
18
  exports.message = message;
@@ -18,7 +22,9 @@ exports.message = message;
18
22
  // only `to` is resolved here.
19
23
  const statedFix = (stated, ctx) => {
20
24
  const to = (0, read_field_1.stringListField)(stated, "to");
21
- const boxes = to.length ? to : [ctx.places.nodeAtPath((0, read_field_1.stringField)(stated, "path") || null)].filter((b) => Boolean(b));
25
+ const boxes = to.length
26
+ ? to
27
+ : [ctx.places.nodeAtPath((0, read_field_1.stringField)(stated, "path") || null)].filter((b) => Boolean(b));
22
28
  return { ...stated, to: boxes };
23
29
  };
24
30
  const fixes = (story, ctx) => {
@@ -0,0 +1,9 @@
1
+ import { UNKNOWN_ENTITY } from "@md-code/follow-architecture/report/errorTypes/vocabulary/ids";
2
+ import type { UnknownEntityStory } from "@md-code/follow-architecture/entities/story";
3
+ import type { DecisionCtx, Places } from "@md-code/follow-architecture/entities/overview/decision";
4
+ import type { StatedRepair } from "@md-code/follow-architecture/entities/repair";
5
+ declare const classify: (ctx: DecisionCtx, places: Places) => UnknownEntityStory | null;
6
+ declare const message: () => null;
7
+ declare const fixes: (story: UnknownEntityStory) => StatedRepair[];
8
+ declare const __exported_label = "No entity describes this code";
9
+ export { UNKNOWN_ENTITY as id, __exported_label as label, classify, message, fixes };
@@ -3,20 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixes = exports.message = exports.classify = exports.label = exports.id = void 0;
4
4
  // Nothing declares this kind of code here. One repair, because there is one
5
5
  // thing the reader can do with code the architecture does not describe.
6
- const ids_1 = require("../vocabulary/ids");
7
- Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ids_1.UNKNOWN_ROLE; } });
8
- const qualified_1 = require("../../../utils/qualified");
9
- // The finding is an unroled piece AND its box can be drawn: both guards must
6
+ const ids_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/ids");
7
+ Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ids_1.UNKNOWN_ENTITY; } });
8
+ const qualified_1 = require("@md-code/follow-architecture/utils/qualified");
9
+ // The finding is an unclassified piece AND its box can be drawn: both guards must
10
10
  // pass before the story is told (the shared qualified-answer walk).
11
- const classify = (ctx, places) => (0, qualified_1.answerWhenAllPass)(ctx, [(c) => /:unroled:/.test(c.key ?? ""), (c) => Boolean(places.folderOf(c.ownerNode?.slug))], (c) => ({ type: ids_1.UNKNOWN_ROLE, from: places.folderOf(c.ownerNode?.slug), to: [] }));
11
+ const classify = (ctx, places) => (0, qualified_1.answerWhenAllPass)(ctx, [(c) => /:unclassified:/.test(c.key ?? ""), (c) => Boolean(places.folderOf(c.ownerNode?.slug))], (c) => ({ type: ids_1.UNKNOWN_ENTITY, from: places.folderOf(c.ownerNode?.slug), to: [] }));
12
12
  exports.classify = classify;
13
13
  const message = () => null;
14
14
  exports.message = message;
15
15
  const fixes = (story) => [
16
16
  // `from` = the box the code sits in: the picture crosses it out, so "Delete"
17
17
  // is drawn, not only printed.
18
- { code: "delete", to: [], from: story.from, text: "Delete it — nothing in the architecture describes this code, so nothing may rely on it." },
18
+ {
19
+ code: "delete",
20
+ to: [],
21
+ from: story.from,
22
+ text: "Delete it — nothing in the architecture describes this code, so nothing may rely on it.",
23
+ },
19
24
  ];
20
25
  exports.fixes = fixes;
21
- const __exported_label = "No role describes this code";
26
+ const __exported_label = "No entity describes this code";
22
27
  exports.label = __exported_label;
@@ -1,8 +1,8 @@
1
- import { WRONG_ACTION } from "../vocabulary/ids";
2
- import type { WrongActionStory } from "../../../entities/story";
3
- import type { RelationToken } from "../../../entities/token";
4
- import type { DecisionCtx, Places } from "../../../entities/overview/decision";
5
- import type { StatedRepair } from "../../../entities/repair";
1
+ import { WRONG_ACTION } from "@md-code/follow-architecture/report/errorTypes/vocabulary/ids";
2
+ import type { WrongActionStory } from "@md-code/follow-architecture/entities/story";
3
+ import type { RelationToken } from "@md-code/follow-architecture/entities/token";
4
+ import type { DecisionCtx, Places } from "@md-code/follow-architecture/entities/overview/decision";
5
+ import type { StatedRepair } from "@md-code/follow-architecture/entities/repair";
6
6
  declare const classify: (ctx: DecisionCtx, places: Places) => WrongActionStory | null;
7
7
  declare const message: (story: WrongActionStory, ctx: DecisionCtx) => string | null;
8
8
  declare const fixes: (story: WrongActionStory, ctx: {
@@ -6,14 +6,14 @@ exports.describeToken = exports.fixes = exports.message = exports.classify = exp
6
6
  // The repairs are OBJECTS, not sentences: `{ code, text, to }`. The `to` array
7
7
  // is the same one the picture draws, so a repair with three destinations is
8
8
  // three arrows in the graph and three lines in the text — computed once.
9
- const ids_1 = require("../vocabulary/ids");
9
+ const ids_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/ids");
10
10
  Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ids_1.WRONG_ACTION; } });
11
- const verbs_1 = require("../vocabulary/verbs");
12
- const kinds_1 = require("../../../entities/kinds");
13
- const phrases_1 = require("../vocabulary/phrases");
14
- const field_1 = require("../../../utils/field");
15
- const read_field_1 = require("../../../utils/read-field");
16
- const qualified_1 = require("../../../utils/qualified");
11
+ const verbs_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/verbs");
12
+ const kinds_1 = require("@md-code/follow-architecture/entities/kinds");
13
+ const phrases_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/phrases");
14
+ const field_1 = require("@md-code/follow-architecture/utils/field");
15
+ const read_field_1 = require("@md-code/follow-architecture/utils/read-field");
16
+ const qualified_1 = require("@md-code/follow-architecture/utils/qualified");
17
17
  // The target a refused relation names: the exact path when the engine saw one,
18
18
  // else the box's own path. `exact` says whether the path is a file or a pattern.
19
19
  const targetPaths = (targetNode, targetPath, places) => {
@@ -45,7 +45,7 @@ const classify = (ctx, places) => {
45
45
  to: [p.to],
46
46
  line: (0, read_field_1.numberField)(violation, "line", 0) || null,
47
47
  target: targetOf(targetNode, (0, read_field_1.stringField)(violation, "targetPath") || null, places),
48
- actors: (0, read_field_1.stringListField)((0, field_1.fieldOf)(violation, "token"), "why.roles").filter(Boolean),
48
+ actors: (0, read_field_1.stringListField)((0, field_1.fieldOf)(violation, "token"), "why.entities").filter(Boolean),
49
49
  token: violation?.token ?? null,
50
50
  }));
51
51
  };
@@ -62,15 +62,15 @@ const fallbackMessage = (story, file) => {
62
62
  };
63
63
  const message = (story, ctx) => story.token?.fact ? (0, phrases_1.relationMessage)(story.token, { file: ctx.file }) : fallbackMessage(story, ctx.file);
64
64
  exports.message = message;
65
- // WHERE IT BELONGS — already decided by the decision maker, from code roles.
65
+ // WHERE IT BELONGS — already decided by the decision maker, from code entities.
66
66
  // Each place is one arrow and one line; the percentage is the decision's own
67
67
  // confidence, so the reader sees why this box and not another.
68
68
  const moveFixes = (story, them) => (story.destinations ?? []).map((place) => ({
69
69
  code: "move",
70
- text: `Move ${them} into \`${place.path}\` — that is where a \`${place.role}\` lives (fit ${Math.round(place.confidence * 100)}%).`,
70
+ text: `Move ${them} into \`${place.path}\` — that is where a \`${place.entity}\` lives (fit ${Math.round(place.confidence * 100)}%).`,
71
71
  to: [place.node],
72
72
  }));
73
- // The repair for a write with no destination: the code must leave, but no role
73
+ // The repair for a write with no destination: the code must leave, but no entity
74
74
  // owns it here, so the repair only marks the code that has to go.
75
75
  const writeOutFix = (them, plural, from) => ({
76
76
  code: "move",
@@ -96,7 +96,12 @@ const fixes = (story, ctx) => {
96
96
  else if (touched) {
97
97
  // `from` is what a removal POINTS AT: the box whose code goes away. The
98
98
  // picture marks it, so a sentence with "Remove" is never drawn as nothing.
99
- out.push({ code: "remove", text: `Remove the ${noun} of \`${touched}\` from \`${ctx.file}\` — this relation is not allowed here.`, to: [], from: story.from });
99
+ out.push({
100
+ code: "remove",
101
+ text: `Remove the ${noun} of \`${touched}\` from \`${ctx.file}\` — this relation is not allowed here.`,
102
+ to: [],
103
+ from: story.from,
104
+ });
100
105
  }
101
106
  return out;
102
107
  };
@@ -114,7 +119,7 @@ const tokenStory = (token, targetPath) => {
114
119
  to: [],
115
120
  line: null,
116
121
  target: { node: (0, read_field_1.stringField)(why, "targetNode") || null, paths, exact: Boolean(targetPath) },
117
- actors: (0, read_field_1.stringListField)(why, "roles"),
122
+ actors: (0, read_field_1.stringListField)(why, "entities"),
118
123
  token,
119
124
  };
120
125
  };
@@ -1,7 +1,7 @@
1
- import { WRONG_PLACEMENT } from "../vocabulary/ids";
2
- import type { WrongPlacementStory } from "../../../entities/story";
3
- import type { DecisionCtx } from "../../../entities/overview/decision";
4
- import type { StatedRepair } from "../../../entities/repair";
1
+ import { WRONG_PLACEMENT } from "@md-code/follow-architecture/report/errorTypes/vocabulary/ids";
2
+ import type { WrongPlacementStory } from "@md-code/follow-architecture/entities/story";
3
+ import type { DecisionCtx } from "@md-code/follow-architecture/entities/overview/decision";
4
+ import type { StatedRepair } from "@md-code/follow-architecture/entities/repair";
5
5
  declare const classify: (ctx: DecisionCtx) => WrongPlacementStory | null;
6
6
  declare const message: () => null;
7
7
  declare const fixes: (story: WrongPlacementStory, ctx: DecisionCtx) => StatedRepair[];
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixes = exports.message = exports.classify = exports.label = exports.id = void 0;
4
4
  // The code sits where it may not: one destination (move) or many (split).
5
5
  // Repairs are objects `{ code, text, to }` — the picture draws `to`.
6
- const ids_1 = require("../vocabulary/ids");
6
+ const ids_1 = require("@md-code/follow-architecture/report/errorTypes/vocabulary/ids");
7
7
  Object.defineProperty(exports, "id", { enumerable: true, get: function () { return ids_1.WRONG_PLACEMENT; } });
8
8
  // The destination is the STRUCTURED one the producer stated (`fix.location` →
9
9
  // `plan.after`, a violation's `destination`), never a path scraped out of the
@@ -21,8 +21,8 @@ const classify = (ctx) => {
21
21
  shape: "move",
22
22
  from: before,
23
23
  to: [to],
24
- // An invariant states a rule; a folder walk states where this file goes.
25
- invariant: ctx.invariant ?? null,
24
+ // A rule states a rule; a folder walk states where this file goes.
25
+ rule: ctx.rule ?? null,
26
26
  };
27
27
  };
28
28
  exports.classify = classify;
@@ -31,24 +31,34 @@ const message = () => null;
31
31
  exports.message = message;
32
32
  const splitFix = (story, from, to) => {
33
33
  if (to.length === 1) {
34
- return { code: "split", to: story.to, text: `Split the file: the code that belongs in ${to[0]} goes there, the rest stays in ${from} — one file may hold one role.` };
34
+ return {
35
+ code: "split",
36
+ to: story.to,
37
+ text: `Split the file: the code that belongs in ${to[0]} goes there, the rest stays in ${from} — one file may hold one entity.`,
38
+ };
35
39
  }
36
40
  return {
37
41
  code: "split",
38
42
  to: story.to,
39
- text: `Split the file by role: the part that belongs in ${to.slice(0, -1).join(", ")} and ${to[to.length - 1]} moves there, the part that is allowed in ${from} stays — one file may hold one role.`,
43
+ text: `Split the file by entity: the part that belongs in ${to.slice(0, -1).join(", ")} and ${to[to.length - 1]} moves there, the part that is allowed in ${from} stays — one file may hold one entity.`,
40
44
  };
41
45
  };
42
46
  const fixes = (story, ctx) => {
43
47
  const pathOf = (slug) => ctx.places.pathOf(slug);
44
48
  const from = `\`${pathOf(story.from ?? "")}\``;
45
49
  const to = story.to.map((slug) => `\`${pathOf(slug)}\``);
46
- // An invariant cannot be satisfied by moving a file: it describes a rule that
47
- // spans folders (`one file, one role`), so the only repair is to divide it.
48
- if (story.invariant)
50
+ // A rule cannot be satisfied by moving a file: it describes a rule that
51
+ // spans folders (`one file, one entity`), so the only repair is to divide it.
52
+ if (story.rule)
49
53
  return [splitFix(story, from, to)];
50
54
  if (story.shape === "split") {
51
- return [{ code: "split", to: story.to, text: `Divide the file: each part goes to its own destination (${to.join(", ")}), and nothing stays in ${from}.` }];
55
+ return [
56
+ {
57
+ code: "split",
58
+ to: story.to,
59
+ text: `Divide the file: each part goes to its own destination (${to.join(", ")}), and nothing stays in ${from}.`,
60
+ },
61
+ ];
52
62
  }
53
63
  return [{ code: "move", to: story.to, text: `Move the whole file to ${to[0]} — nothing of it stays in ${from}.` }];
54
64
  };
@@ -1,5 +1,5 @@
1
1
  declare const __exported_WRONG_ACTION = "wrongAction";
2
2
  declare const __exported_WRONG_PLACEMENT = "wrongPlacement";
3
- declare const __exported_UNKNOWN_ROLE = "unknownRole";
3
+ declare const __exported_UNKNOWN_ENTITY = "unknownEntity";
4
4
  declare const __exported_FILE_CONTENTS = "fileContents";
5
- export { __exported_WRONG_ACTION as WRONG_ACTION, __exported_WRONG_PLACEMENT as WRONG_PLACEMENT, __exported_UNKNOWN_ROLE as UNKNOWN_ROLE, __exported_FILE_CONTENTS as FILE_CONTENTS };
5
+ export { __exported_WRONG_ACTION as WRONG_ACTION, __exported_WRONG_PLACEMENT as WRONG_PLACEMENT, __exported_UNKNOWN_ENTITY as UNKNOWN_ENTITY, __exported_FILE_CONTENTS as FILE_CONTENTS, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FILE_CONTENTS = exports.UNKNOWN_ROLE = exports.WRONG_PLACEMENT = exports.WRONG_ACTION = void 0;
3
+ exports.FILE_CONTENTS = exports.UNKNOWN_ENTITY = exports.WRONG_PLACEMENT = exports.WRONG_ACTION = void 0;
4
4
  // The ids shared by the report and the picture.
5
5
  // a relation the architecture forbids
6
6
  // the code is in the wrong place (move, or split between places)
@@ -10,7 +10,7 @@ const __exported_WRONG_ACTION = "wrongAction";
10
10
  exports.WRONG_ACTION = __exported_WRONG_ACTION;
11
11
  const __exported_WRONG_PLACEMENT = "wrongPlacement";
12
12
  exports.WRONG_PLACEMENT = __exported_WRONG_PLACEMENT;
13
- const __exported_UNKNOWN_ROLE = "unknownRole";
14
- exports.UNKNOWN_ROLE = __exported_UNKNOWN_ROLE;
13
+ const __exported_UNKNOWN_ENTITY = "unknownEntity";
14
+ exports.UNKNOWN_ENTITY = __exported_UNKNOWN_ENTITY;
15
15
  const __exported_FILE_CONTENTS = "fileContents";
16
16
  exports.FILE_CONTENTS = __exported_FILE_CONTENTS;
@@ -1,5 +1,5 @@
1
- import { type FieldValue } from "../../../utils/field";
2
- import { article } from "../../../utils/article";
1
+ import { type FieldValue } from "@md-code/follow-architecture/utils/field";
2
+ import { article } from "@md-code/follow-architecture/utils/article";
3
3
  declare const pluralize: (text: string) => string;
4
4
  declare const factText: (fact: FieldValue) => string;
5
5
  declare const subjectText: (subject: FieldValue, file: string) => string;
@@ -5,10 +5,10 @@ exports.article = exports.pluralize = exports.relationMessage = exports.whyText
5
5
  // The fact is the engine's own (`entities/kinds` producers); the words here are
6
6
  // the ONE spelling the text and the picture read. Every field is read through
7
7
  // the shared field readers — a fact is plain data, never an `any`.
8
- const kinds_1 = require("../../../entities/kinds");
9
- const field_1 = require("../../../utils/field");
10
- const read_field_1 = require("../../../utils/read-field");
11
- const article_1 = require("../../../utils/article");
8
+ const kinds_1 = require("@md-code/follow-architecture/entities/kinds");
9
+ const field_1 = require("@md-code/follow-architecture/utils/field");
10
+ const read_field_1 = require("@md-code/follow-architecture/utils/read-field");
11
+ const article_1 = require("@md-code/follow-architecture/utils/article");
12
12
  Object.defineProperty(exports, "article", { enumerable: true, get: function () { return article_1.article; } });
13
13
  const q = (s) => (s == null ? "—" : `\`${s}\``);
14
14
  const list = (xs) => xs.map(q).join(", ");
@@ -81,9 +81,9 @@ const callText = (fact) => `calls ${q((0, field_1.fieldOf)(fact, "action"))} of
81
81
  const mutateText = (fact) => {
82
82
  if ((0, read_field_1.booleanField)(fact, "onThis"))
83
83
  return `changes ${q((0, field_1.fieldOf)(fact, "target"))} of its own file`;
84
- const ownerRole = (0, field_1.fieldOf)(fact, "ownerRole");
85
- if (ownerRole)
86
- return `changes ${q((0, field_1.fieldOf)(fact, "target"))} of the ${q(ownerRole)} (${q((0, field_1.fieldOf)(fact, "module"))})`;
84
+ const ownerEntity = (0, field_1.fieldOf)(fact, "ownerEntity");
85
+ if (ownerEntity)
86
+ return `changes ${q((0, field_1.fieldOf)(fact, "target"))} of the ${q(ownerEntity)} (${q((0, field_1.fieldOf)(fact, "module"))})`;
87
87
  return `changes ${q((0, field_1.fieldOf)(fact, "target"))} of ${q((0, field_1.fieldOf)(fact, "module"))}`;
88
88
  };
89
89
  const declareText = (fact) => {
@@ -92,7 +92,18 @@ const declareText = (fact) => {
92
92
  return `re-declares ${q((0, field_1.fieldOf)(renames, "action"))} of ${q((0, field_1.fieldOf)(renames, "module"))}`;
93
93
  return "is declared here";
94
94
  };
95
- const importText = (fact) => (0, read_field_1.stringField)(fact, "form") === "statement" ? `imports ${q((0, field_1.fieldOf)(fact, "resolved"))}` : `requires ${q((0, field_1.fieldOf)(fact, "source"))}`;
95
+ // A named import names the SYMBOLS it takes (and the file that declares them):
96
+ // `imports `codeEditor` of `packages/styles/themes/editor.ts``. A module-level
97
+ // import keeps its one-word form.
98
+ const importText = (fact) => {
99
+ if ((0, read_field_1.stringField)(fact, "form") !== "statement")
100
+ return `requires ${q((0, field_1.fieldOf)(fact, "source"))}`;
101
+ const names = (0, field_1.fieldOf)(fact, "names");
102
+ const symbols = Array.isArray(names) ? names.filter((name) => typeof name === "string") : [];
103
+ return symbols.length
104
+ ? `imports ${list(symbols)} of ${q((0, field_1.fieldOf)(fact, "resolved"))}`
105
+ : `imports ${q((0, field_1.fieldOf)(fact, "resolved"))}`;
106
+ };
96
107
  const assignText = (fact) => {
97
108
  const method = (0, field_1.fieldOf)(fact, "method");
98
109
  return `writes into ${q((0, field_1.fieldOf)(fact, "target"))}${method ? ` through ${q(`${method}()`)}` : ""}`;
@@ -124,23 +135,23 @@ const factText = (fact) => {
124
135
  return `does a \`${kind}\` the architecture does not describe`;
125
136
  };
126
137
  exports.factText = factText;
127
- const rolesSuffix = (roles) => {
128
- if (!roles.length)
138
+ const entitiesSuffix = (entities) => {
139
+ if (!entities.length)
129
140
  return "";
130
- return roles.length === 1 ? ` (${roles[0]})` : ` (${roles.join(" / ")})`;
141
+ return entities.length === 1 ? ` (${entities[0]})` : ` (${entities.join(" / ")})`;
131
142
  };
132
143
  const subjectText = (subject, file) => {
133
- const roleNames = (0, read_field_1.stringListField)(subject, "roles").filter(Boolean);
134
- const roles = roleNames.map(q);
135
- const rolesPart = rolesSuffix(roles);
144
+ const entityNames = (0, read_field_1.stringListField)(subject, "entities").filter(Boolean);
145
+ const entities = entityNames.map(q);
146
+ const entitiesPart = entitiesSuffix(entities);
136
147
  if (!(0, field_1.isObj)(subject) || (0, read_field_1.booleanField)(subject, "scope")) {
137
- return `the module scope of ${q(file)}${rolesPart}`;
148
+ return `the module scope of ${q(file)}${entitiesPart}`;
138
149
  }
139
150
  const pieces = (0, read_field_1.stringListField)(subject, "pieces").filter(Boolean).map(q);
140
151
  if (!pieces.length)
141
- return `the module scope of ${q(file)}${rolesPart}`;
142
- const who = roleNames.length === 1 ? ` (${(0, article_1.article)(roleNames[0])} ${q(roleNames[0])})` : rolesPart;
143
- return `${pieces.join(", ")}${who || " (which no role describes)"}`;
152
+ return `the module scope of ${q(file)}${entitiesPart}`;
153
+ const who = entityNames.length === 1 ? ` (${(0, article_1.article)(entityNames[0])} ${q(entityNames[0])})` : entitiesPart;
154
+ return `${pieces.join(", ")}${who || " (which no entity describes)"}`;
144
155
  };
145
156
  exports.subjectText = subjectText;
146
157
  // WHY it is refused — a code from the engine, not a sentence.
@@ -149,19 +160,21 @@ const whyText = (why) => {
149
160
  return "it is not allowed";
150
161
  if ((0, read_field_1.stringField)(why, "code") === "silent")
151
162
  return "nothing in the architecture allows it";
152
- const same = new Set((0, read_field_1.stringListField)(why, "sameRoles"));
153
- // A role the rule limits to the SAME feature instance says so: without the
154
- // limit the sentence reads as "this role may not do it at all", which is the
163
+ const same = new Set((0, read_field_1.stringListField)(why, "sameEntities"));
164
+ // An entity the rule limits to the SAME feature instance says so: without the
165
+ // limit the sentence reads as "this entity may not do it at all", which is the
155
166
  // opposite of what the architecture declares.
156
- const roles = (0, read_field_1.stringListField)(why, "roles").filter(Boolean).map((r) => (same.has(r) ? `${q(r)} in the same feature` : q(r)));
157
- // The role DOES allow the call — what it refuses is the value handed over.
167
+ const entities = (0, read_field_1.stringListField)(why, "entities")
168
+ .filter(Boolean)
169
+ .map((r) => (same.has(r) ? `${q(r)} in the same feature` : q(r)));
170
+ // The entity DOES allow the call — what it refuses is the value handed over.
158
171
  if ((0, read_field_1.booleanField)(why, "outward"))
159
172
  return "that value may not be handed to it";
160
- if (!roles.length)
173
+ if (!entities.length)
161
174
  return (0, read_field_1.stringField)(why, "code") === "nobody" ? "no code may do it" : "it is not allowed";
162
175
  if ((0, read_field_1.booleanField)(why, "self"))
163
- return `only ${roles.join(", ")} may do it`;
164
- return `only ${roles.join(", ")} may do it with ${q((0, field_1.fieldOf)(why, "targetNode"))} code`;
176
+ return `only ${entities.join(", ")} may do it`;
177
+ return `only ${entities.join(", ")} may do it with ${q((0, field_1.fieldOf)(why, "targetNode"))} code`;
165
178
  };
166
179
  exports.whyText = whyText;
167
180
  // The one sentence a refused relation gets.
@@ -1,6 +1,6 @@
1
- import type { Arch } from "../../../entities/architecture";
2
- import type { NodeSummary } from "../../../entities/overview/summaries";
3
- import type { Places } from "../../../entities/overview/decision";
1
+ import type { Arch } from "@md-code/follow-architecture/entities/architecture";
2
+ import type { NodeSummary } from "@md-code/follow-architecture/entities/overview/summaries";
3
+ import type { Places } from "@md-code/follow-architecture/entities/overview/decision";
4
4
  declare const make: ({ nodes, arch }: {
5
5
  nodes: NodeSummary[];
6
6
  arch: Arch;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.make = void 0;
4
- // Engine names → report names: role → box, place → node.
4
+ // Engine names → report names: entity → box, place → node.
5
5
  // ONE source for every place question. `homeFor`, `nodeAtPath`, `homeTemplates`
6
6
  // and `pathOf` used to be spelled again here, in a second wording, next to the
7
7
  // real ones in `entities/location.js` — the report and the engine then disagreed
8
- // about where a role lives. This file only NAMES things now.
9
- const location_1 = require("../../../entities/location");
8
+ // about where an entity lives. This file only NAMES things now.
9
+ const location_1 = require("@md-code/follow-architecture/entities/location");
10
10
  const make = ({ nodes, arch }) => {
11
11
  const folderOf = (slug) => {
12
12
  if (!slug)
@@ -17,20 +17,20 @@ const make = ({ nodes, arch }) => {
17
17
  };
18
18
  // A node slug as the path a human recognises.
19
19
  const pathOf = (slug) => nodes.find((n) => n.slug === slug)?.paths?.[0] ?? slug;
20
- // EVERY role that declares a place — the candidate set a destination decision
21
- // may choose from ("какие есть").
22
- const roles = () => Object.keys(arch.nodes.roleHomes);
23
- // Roles whose declared home covers this path, most specific first: what this
20
+ // EVERY entity that declares a place — the set a destination decision chooses
21
+ // from: everything the tree says could be here.
22
+ const entities = () => Object.keys(arch.nodes.entityHomes);
23
+ // Entities whose declared home covers this path, most specific first: what this
24
24
  // file already IS, according to the tree.
25
- const rolesAtPath = (rel) => (0, location_1.rolesAtPath)(arch, rel);
26
- // The path templates a role declares (`…/constants.ts`, `…/actions/**`).
27
- const homeTemplates = (role) => (0, location_1.homesOf)(arch, role).map((h) => h.template);
28
- // Where this role's code belongs FOR THIS FILE, and the box that hosts it —
25
+ const entitiesAtPath = (rel) => (0, location_1.entitiesAtPath)(arch, rel);
26
+ // The path templates an entity declares (`…/constants.ts`, `…/actions/**`).
27
+ const homeTemplates = (entity) => (0, location_1.homesOf)(arch, entity).map((h) => h.template);
28
+ // Where this entity's code belongs FOR THIS FILE, and the box that hosts it —
29
29
  // the engine's own answer, never a folder invented here.
30
- const homeFor = (role, rel) => (0, location_1.homeForRole)(arch, role, rel);
30
+ const homeFor = (entity, rel) => (0, location_1.homeForEntity)(arch, entity, rel);
31
31
  // The box that HOLDS a path — `apps/backend/document/store.ts` → the node that
32
32
  // owns `apps/backend/document`.
33
33
  const nodeAtPath = (path) => (0, location_1.boxOfPlace)(arch, path);
34
- return { folderOf, pathOf, roles, rolesAtPath, homeTemplates, homeFor, nodeAtPath };
34
+ return { folderOf, pathOf, entities, entitiesAtPath, homeTemplates, homeFor, nodeAtPath };
35
35
  };
36
36
  exports.make = make;
@@ -1,6 +1,6 @@
1
- import { substitute, type TemplateVars } from "../utils/template";
2
- import type { FindingFrom } from "../entities/findings";
3
- import type { ReportObject } from "../entities/architecture";
1
+ import { substitute, type TemplateVars } from "@md-code/follow-architecture/utils/template";
2
+ import type { FindingFrom } from "@md-code/follow-architecture/entities/findings";
3
+ import type { ReportObject } from "@md-code/follow-architecture/entities/architecture";
4
4
  declare const renderSpec: (spec: ReportObject | string, vars: TemplateVars) => {
5
5
  message: string | null;
6
6
  fix: string | null;
@@ -10,11 +10,11 @@ exports.substitute = exports.renderSpec = exports.findingFrom = void 0;
10
10
  // The report spec is the engine's own (`ReportObject`); the substitution is the
11
11
  // shared template walk; the repair shape is the ONE contract in entities/repair.
12
12
  const asks_1 = require("./asks");
13
- const template_1 = require("../utils/template");
13
+ const template_1 = require("@md-code/follow-architecture/utils/template");
14
14
  Object.defineProperty(exports, "substitute", { enumerable: true, get: function () { return template_1.substitute; } });
15
- const field_1 = require("../utils/field");
16
- const read_field_1 = require("../utils/read-field");
17
- const resolve_1 = require("../utils/resolve");
15
+ const field_1 = require("@md-code/follow-architecture/utils/field");
16
+ const read_field_1 = require("@md-code/follow-architecture/utils/read-field");
17
+ const resolve_1 = require("@md-code/follow-architecture/utils/resolve");
18
18
  // The fix text a spec states: a bare string, or the structured `{ message }`.
19
19
  const fixTextOf = (spec) => {
20
20
  const fix = spec.fix;
@@ -27,7 +27,10 @@ const renderSpec = (spec, vars) => {
27
27
  return { message: (0, template_1.substitute)(spec, vars), fix: null };
28
28
  const message = spec.description ?? spec.message ?? null;
29
29
  const fixText = fixTextOf(spec);
30
- return { message: message != null ? (0, template_1.substitute)(message, vars) : null, fix: fixText != null ? (0, template_1.substitute)(fixText, vars) : null };
30
+ return {
31
+ message: message != null ? (0, template_1.substitute)(message, vars) : null,
32
+ fix: fixText != null ? (0, template_1.substitute)(fixText, vars) : null,
33
+ };
31
34
  };
32
35
  exports.renderSpec = renderSpec;
33
36
  // The spec a finding item carries: an explicit `report`, or the legacy flat
@@ -46,14 +49,14 @@ const specOf = (item) => {
46
49
  // The place a spec names: `place` (already resolved) or `path`, never parsed
47
50
  // out of the sentence. A string spec names no place.
48
51
  const placeOf = (spec) => (0, resolve_1.resolveReference)(spec, (s) => (typeof s === "string" ? null : s), (s) => s.place ?? s.path ?? null);
49
- // The finding's identity and subject: what it is about, and which role.
52
+ // The finding's identity and subject: what it is about, and which entity.
50
53
  const subjectOf = (item, key, vars) => ({
51
54
  what: (0, read_field_1.stringField)(vars, "what") || null,
52
- role: /^role:([^:]+)/.exec(key)?.[1] ?? item.role ?? null,
55
+ entity: /^entity:([^:]+)/.exec(key)?.[1] ?? item.entity ?? null,
53
56
  });
54
57
  // The message and fix sentences a finding carries: the rendered spec's, or the
55
58
  // run's own vars, or the fallback.
56
- const scopeOf = (vars, place) => (place ? { ...vars, destination: place } : vars);
59
+ const scopeOf = (vars, place) => place ? { ...vars, destination: place } : vars;
57
60
  const sentencesOf = (item, vars) => {
58
61
  const spec = specOf(item);
59
62
  const place = placeOf(spec);
@@ -68,7 +71,9 @@ const sentencesOf = (item, vars) => {
68
71
  // The evidence bag with the stated repair attached — the SAME object the CLI
69
72
  // prints and the picture draws.
70
73
  const dataOf = (item, spec, fix, place) => {
71
- const stated = spec != null ? (0, asks_1.repair)({ code: spec.code ?? spec.ask, fix }, { to: spec.to ?? [], from: spec.from ?? null, path: place }) : null;
74
+ const stated = spec != null
75
+ ? (0, asks_1.repair)({ code: spec.code ?? spec.ask, fix }, { to: spec.to ?? [], from: spec.from ?? null, path: place })
76
+ : null;
72
77
  const evidence = (0, field_1.isObj)(item.data) ? item.data : null;
73
78
  return stated ? { ...(evidence ?? {}), repair: { ...stated, text: fix } } : evidence;
74
79
  };
@@ -1,4 +1,9 @@
1
1
  declare const notice: (subject: string, reason: string) => string;
2
+ declare const beginNotices: () => {
3
+ lines: string[];
4
+ end: () => string[];
5
+ };
6
+ declare const replayNotices: (lines: readonly string[] | null | undefined) => void;
2
7
  declare const takeNotices: () => string[];
3
8
  declare const resetNotices: () => void;
4
- export { notice, takeNotices, resetNotices };
9
+ export { notice, beginNotices, replayNotices, takeNotices, resetNotices };