@driftsys/markspec 0.3.0 → 0.5.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 (331) hide show
  1. package/esm/ast/build.d.ts +70 -0
  2. package/esm/ast/build.d.ts.map +1 -0
  3. package/esm/ast/build.js +605 -0
  4. package/esm/ast/equivalence.d.ts +18 -0
  5. package/esm/ast/equivalence.d.ts.map +1 -0
  6. package/esm/ast/equivalence.js +56 -0
  7. package/esm/ast/nodes.d.ts +221 -0
  8. package/esm/ast/nodes.d.ts.map +1 -0
  9. package/esm/ast/nodes.js +12 -0
  10. package/esm/ast/normalize.d.ts +67 -0
  11. package/esm/ast/normalize.d.ts.map +1 -0
  12. package/esm/ast/normalize.js +255 -0
  13. package/esm/ast/render.d.ts +34 -0
  14. package/esm/ast/render.d.ts.map +1 -0
  15. package/esm/ast/render.js +215 -0
  16. package/esm/compiler/inverses.d.ts +2 -8
  17. package/esm/compiler/inverses.d.ts.map +1 -1
  18. package/esm/compiler/inverses.js +50 -14
  19. package/esm/compiler/manifest.d.ts +59 -0
  20. package/esm/compiler/manifest.d.ts.map +1 -0
  21. package/esm/compiler/manifest.js +48 -0
  22. package/esm/compiler/mod.d.ts +9 -1
  23. package/esm/compiler/mod.d.ts.map +1 -1
  24. package/esm/compiler/mod.js +21 -2
  25. package/esm/compiler/ndjson_writer.d.ts +50 -0
  26. package/esm/compiler/ndjson_writer.d.ts.map +1 -0
  27. package/esm/compiler/ndjson_writer.js +73 -0
  28. package/esm/compiler/schema.d.ts +18 -1
  29. package/esm/compiler/schema.d.ts.map +1 -1
  30. package/esm/compiler/schema.js +18 -9
  31. package/esm/config/mod.d.ts.map +1 -1
  32. package/esm/config/mod.js +54 -0
  33. package/esm/formatter/mod.d.ts +56 -6
  34. package/esm/formatter/mod.d.ts.map +1 -1
  35. package/esm/formatter/mod.js +372 -41
  36. package/esm/formatter/synth_ulid.d.ts +21 -0
  37. package/esm/formatter/synth_ulid.d.ts.map +1 -0
  38. package/esm/formatter/synth_ulid.js +64 -0
  39. package/esm/lint/mod.d.ts +10 -0
  40. package/esm/lint/mod.d.ts.map +1 -0
  41. package/esm/lint/mod.js +7 -0
  42. package/esm/lint/rules/lexicon.d.ts +24 -0
  43. package/esm/lint/rules/lexicon.d.ts.map +1 -0
  44. package/esm/lint/rules/lexicon.js +236 -0
  45. package/esm/lint/rules/struct.d.ts +17 -0
  46. package/esm/lint/rules/struct.d.ts.map +1 -0
  47. package/esm/lint/rules/struct.js +55 -0
  48. package/esm/lint/rules/suppression.d.ts +19 -0
  49. package/esm/lint/rules/suppression.d.ts.map +1 -0
  50. package/esm/lint/rules/suppression.js +75 -0
  51. package/esm/lint/runner.d.ts +39 -0
  52. package/esm/lint/runner.d.ts.map +1 -0
  53. package/esm/lint/runner.js +112 -0
  54. package/esm/lint/types.d.ts +19 -0
  55. package/esm/lint/types.d.ts.map +1 -0
  56. package/esm/lint/types.js +9 -0
  57. package/esm/mod.d.ts +21 -8
  58. package/esm/mod.d.ts.map +1 -1
  59. package/esm/mod.js +16 -5
  60. package/esm/model/attributes.d.ts.map +1 -1
  61. package/esm/model/attributes.js +163 -2
  62. package/esm/model/discriminating_attr.d.ts +33 -0
  63. package/esm/model/discriminating_attr.d.ts.map +1 -0
  64. package/esm/model/discriminating_attr.js +74 -0
  65. package/esm/model/mod.d.ts +100 -3
  66. package/esm/model/mod.d.ts.map +1 -1
  67. package/esm/model/mod.js +58 -2
  68. package/esm/model/palette.d.ts +18 -0
  69. package/esm/model/palette.d.ts.map +1 -0
  70. package/esm/model/palette.js +23 -0
  71. package/esm/model/profile.d.ts +33 -27
  72. package/esm/model/profile.d.ts.map +1 -1
  73. package/esm/model/source_introspection.d.ts +26 -0
  74. package/esm/model/source_introspection.d.ts.map +1 -0
  75. package/esm/model/source_introspection.js +77 -0
  76. package/esm/model/type_hierarchy.d.ts +51 -0
  77. package/esm/model/type_hierarchy.d.ts.map +1 -0
  78. package/esm/model/type_hierarchy.js +126 -0
  79. package/esm/model/uri_scheme_map.d.ts +21 -0
  80. package/esm/model/uri_scheme_map.d.ts.map +1 -0
  81. package/esm/model/uri_scheme_map.js +66 -0
  82. package/esm/parser/attributes.d.ts.map +1 -1
  83. package/esm/parser/attributes.js +9 -6
  84. package/esm/parser/entity_refs.d.ts +53 -0
  85. package/esm/parser/entity_refs.d.ts.map +1 -0
  86. package/esm/parser/entity_refs.js +151 -0
  87. package/esm/parser/glossary.d.ts +43 -0
  88. package/esm/parser/glossary.d.ts.map +1 -0
  89. package/esm/parser/glossary.js +217 -0
  90. package/esm/parser/markdown.d.ts +10 -3
  91. package/esm/parser/markdown.d.ts.map +1 -1
  92. package/esm/parser/markdown.js +241 -11
  93. package/esm/parser/mod.d.ts +1 -0
  94. package/esm/parser/mod.d.ts.map +1 -1
  95. package/esm/parser/mod.js +4 -3
  96. package/esm/parser/source.d.ts +20 -0
  97. package/esm/parser/source.d.ts.map +1 -1
  98. package/esm/parser/source.js +4 -4
  99. package/esm/profile/chain.js +3 -13
  100. package/esm/profile/colors.d.ts +26 -0
  101. package/esm/profile/colors.d.ts.map +1 -0
  102. package/esm/profile/colors.js +46 -0
  103. package/esm/profile/introspect.d.ts +135 -0
  104. package/esm/profile/introspect.d.ts.map +1 -0
  105. package/esm/profile/introspect.js +378 -0
  106. package/esm/profile/load.d.ts.map +1 -1
  107. package/esm/profile/load.js +67 -0
  108. package/esm/profile/manifest.d.ts.map +1 -1
  109. package/esm/profile/manifest.js +278 -104
  110. package/esm/profile/merge.js +139 -39
  111. package/esm/profile/mod.d.ts +3 -4
  112. package/esm/profile/mod.d.ts.map +1 -1
  113. package/esm/profile/mod.js +6 -2
  114. package/esm/reporter/mod.js +4 -4
  115. package/esm/util/fence.d.ts +30 -0
  116. package/esm/util/fence.d.ts.map +1 -0
  117. package/esm/util/fence.js +40 -0
  118. package/esm/validator/attributes.d.ts +3 -3
  119. package/esm/validator/attributes.d.ts.map +1 -1
  120. package/esm/validator/attributes.js +1 -18
  121. package/esm/validator/body_blocks.d.ts +38 -0
  122. package/esm/validator/body_blocks.d.ts.map +1 -0
  123. package/esm/validator/body_blocks.js +218 -0
  124. package/esm/validator/caption_convention.d.ts +29 -0
  125. package/esm/validator/caption_convention.d.ts.map +1 -0
  126. package/esm/validator/caption_convention.js +58 -0
  127. package/esm/validator/captions.d.ts +22 -0
  128. package/esm/validator/captions.d.ts.map +1 -0
  129. package/esm/validator/captions.js +137 -0
  130. package/esm/validator/component_schemes.d.ts +73 -0
  131. package/esm/validator/component_schemes.d.ts.map +1 -0
  132. package/esm/validator/component_schemes.js +375 -0
  133. package/esm/validator/feature_ac.d.ts +28 -0
  134. package/esm/validator/feature_ac.d.ts.map +1 -0
  135. package/esm/validator/feature_ac.js +102 -0
  136. package/esm/validator/listing.d.ts +42 -0
  137. package/esm/validator/listing.d.ts.map +1 -0
  138. package/esm/validator/listing.js +295 -0
  139. package/esm/validator/mod.d.ts +2 -0
  140. package/esm/validator/mod.d.ts.map +1 -1
  141. package/esm/validator/mod.js +253 -12
  142. package/esm/validator/modal_keywords.d.ts +23 -0
  143. package/esm/validator/modal_keywords.d.ts.map +1 -0
  144. package/esm/validator/modal_keywords.js +137 -0
  145. package/esm/validator/per_type_attrs.d.ts +29 -0
  146. package/esm/validator/per_type_attrs.d.ts.map +1 -0
  147. package/esm/validator/per_type_attrs.js +75 -0
  148. package/esm/validator/pipeline.d.ts +7 -2
  149. package/esm/validator/pipeline.d.ts.map +1 -1
  150. package/esm/validator/pipeline.js +40 -7
  151. package/esm/validator/trace_types.d.ts +26 -0
  152. package/esm/validator/trace_types.d.ts.map +1 -0
  153. package/esm/validator/trace_types.js +232 -0
  154. package/esm/validator/traceability.d.ts +3 -4
  155. package/esm/validator/traceability.d.ts.map +1 -1
  156. package/esm/validator/traceability.js +5 -10
  157. package/esm/validator/type_resolution.d.ts +67 -0
  158. package/esm/validator/type_resolution.d.ts.map +1 -0
  159. package/esm/validator/type_resolution.js +140 -0
  160. package/esm/validator/types.d.ts +45 -0
  161. package/esm/validator/types.d.ts.map +1 -1
  162. package/esm/validator/types.js +128 -16
  163. package/esm/validator/value_types.d.ts +8 -0
  164. package/esm/validator/value_types.d.ts.map +1 -1
  165. package/esm/validator/value_types.js +8 -1
  166. package/package.json +1 -1
  167. package/script/ast/build.d.ts +70 -0
  168. package/script/ast/build.d.ts.map +1 -0
  169. package/script/ast/build.js +610 -0
  170. package/script/ast/equivalence.d.ts +18 -0
  171. package/script/ast/equivalence.d.ts.map +1 -0
  172. package/script/ast/equivalence.js +59 -0
  173. package/script/ast/nodes.d.ts +221 -0
  174. package/script/ast/nodes.d.ts.map +1 -0
  175. package/script/ast/nodes.js +13 -0
  176. package/script/ast/normalize.d.ts +67 -0
  177. package/script/ast/normalize.d.ts.map +1 -0
  178. package/script/ast/normalize.js +258 -0
  179. package/script/ast/render.d.ts +34 -0
  180. package/script/ast/render.d.ts.map +1 -0
  181. package/script/ast/render.js +218 -0
  182. package/script/compiler/inverses.d.ts +2 -8
  183. package/script/compiler/inverses.d.ts.map +1 -1
  184. package/script/compiler/inverses.js +50 -14
  185. package/script/compiler/manifest.d.ts +59 -0
  186. package/script/compiler/manifest.d.ts.map +1 -0
  187. package/script/compiler/manifest.js +51 -0
  188. package/script/compiler/mod.d.ts +9 -1
  189. package/script/compiler/mod.d.ts.map +1 -1
  190. package/script/compiler/mod.js +21 -2
  191. package/script/compiler/ndjson_writer.d.ts +50 -0
  192. package/script/compiler/ndjson_writer.d.ts.map +1 -0
  193. package/script/compiler/ndjson_writer.js +78 -0
  194. package/script/compiler/schema.d.ts +18 -1
  195. package/script/compiler/schema.d.ts.map +1 -1
  196. package/script/compiler/schema.js +18 -8
  197. package/script/config/mod.d.ts.map +1 -1
  198. package/script/config/mod.js +54 -0
  199. package/script/formatter/mod.d.ts +56 -6
  200. package/script/formatter/mod.d.ts.map +1 -1
  201. package/script/formatter/mod.js +375 -41
  202. package/script/formatter/synth_ulid.d.ts +21 -0
  203. package/script/formatter/synth_ulid.d.ts.map +1 -0
  204. package/script/formatter/synth_ulid.js +67 -0
  205. package/script/lint/mod.d.ts +10 -0
  206. package/script/lint/mod.d.ts.map +1 -0
  207. package/script/lint/mod.js +12 -0
  208. package/script/lint/rules/lexicon.d.ts +24 -0
  209. package/script/lint/rules/lexicon.d.ts.map +1 -0
  210. package/script/lint/rules/lexicon.js +240 -0
  211. package/script/lint/rules/struct.d.ts +17 -0
  212. package/script/lint/rules/struct.d.ts.map +1 -0
  213. package/script/lint/rules/struct.js +59 -0
  214. package/script/lint/rules/suppression.d.ts +19 -0
  215. package/script/lint/rules/suppression.d.ts.map +1 -0
  216. package/script/lint/rules/suppression.js +80 -0
  217. package/script/lint/runner.d.ts +39 -0
  218. package/script/lint/runner.d.ts.map +1 -0
  219. package/script/lint/runner.js +116 -0
  220. package/script/lint/types.d.ts +19 -0
  221. package/script/lint/types.d.ts.map +1 -0
  222. package/script/lint/types.js +10 -0
  223. package/script/mod.d.ts +21 -8
  224. package/script/mod.d.ts.map +1 -1
  225. package/script/mod.js +58 -32
  226. package/script/model/attributes.d.ts.map +1 -1
  227. package/script/model/attributes.js +163 -2
  228. package/script/model/discriminating_attr.d.ts +33 -0
  229. package/script/model/discriminating_attr.d.ts.map +1 -0
  230. package/script/model/discriminating_attr.js +77 -0
  231. package/script/model/mod.d.ts +100 -3
  232. package/script/model/mod.d.ts.map +1 -1
  233. package/script/model/mod.js +67 -3
  234. package/script/model/palette.d.ts +18 -0
  235. package/script/model/palette.d.ts.map +1 -0
  236. package/script/model/palette.js +26 -0
  237. package/script/model/profile.d.ts +33 -27
  238. package/script/model/profile.d.ts.map +1 -1
  239. package/script/model/source_introspection.d.ts +26 -0
  240. package/script/model/source_introspection.d.ts.map +1 -0
  241. package/script/model/source_introspection.js +80 -0
  242. package/script/model/type_hierarchy.d.ts +51 -0
  243. package/script/model/type_hierarchy.d.ts.map +1 -0
  244. package/script/model/type_hierarchy.js +130 -0
  245. package/script/model/uri_scheme_map.d.ts +21 -0
  246. package/script/model/uri_scheme_map.d.ts.map +1 -0
  247. package/script/model/uri_scheme_map.js +69 -0
  248. package/script/parser/attributes.d.ts.map +1 -1
  249. package/script/parser/attributes.js +9 -6
  250. package/script/parser/entity_refs.d.ts +53 -0
  251. package/script/parser/entity_refs.d.ts.map +1 -0
  252. package/script/parser/entity_refs.js +155 -0
  253. package/script/parser/glossary.d.ts +43 -0
  254. package/script/parser/glossary.d.ts.map +1 -0
  255. package/script/parser/glossary.js +221 -0
  256. package/script/parser/markdown.d.ts +10 -3
  257. package/script/parser/markdown.d.ts.map +1 -1
  258. package/script/parser/markdown.js +240 -10
  259. package/script/parser/mod.d.ts +1 -0
  260. package/script/parser/mod.d.ts.map +1 -1
  261. package/script/parser/mod.js +8 -4
  262. package/script/parser/source.d.ts +20 -0
  263. package/script/parser/source.d.ts.map +1 -1
  264. package/script/parser/source.js +4 -1
  265. package/script/profile/chain.js +3 -13
  266. package/script/profile/colors.d.ts +26 -0
  267. package/script/profile/colors.d.ts.map +1 -0
  268. package/script/profile/colors.js +49 -0
  269. package/script/profile/introspect.d.ts +135 -0
  270. package/script/profile/introspect.d.ts.map +1 -0
  271. package/script/profile/introspect.js +381 -0
  272. package/script/profile/load.d.ts.map +1 -1
  273. package/script/profile/load.js +67 -0
  274. package/script/profile/manifest.d.ts.map +1 -1
  275. package/script/profile/manifest.js +280 -106
  276. package/script/profile/merge.js +139 -39
  277. package/script/profile/mod.d.ts +3 -4
  278. package/script/profile/mod.d.ts.map +1 -1
  279. package/script/profile/mod.js +9 -6
  280. package/script/reporter/mod.js +4 -4
  281. package/script/util/fence.d.ts +30 -0
  282. package/script/util/fence.d.ts.map +1 -0
  283. package/script/util/fence.js +44 -0
  284. package/script/validator/attributes.d.ts +3 -3
  285. package/script/validator/attributes.d.ts.map +1 -1
  286. package/script/validator/attributes.js +1 -18
  287. package/script/validator/body_blocks.d.ts +38 -0
  288. package/script/validator/body_blocks.d.ts.map +1 -0
  289. package/script/validator/body_blocks.js +221 -0
  290. package/script/validator/caption_convention.d.ts +29 -0
  291. package/script/validator/caption_convention.d.ts.map +1 -0
  292. package/script/validator/caption_convention.js +61 -0
  293. package/script/validator/captions.d.ts +22 -0
  294. package/script/validator/captions.d.ts.map +1 -0
  295. package/script/validator/captions.js +140 -0
  296. package/script/validator/component_schemes.d.ts +73 -0
  297. package/script/validator/component_schemes.d.ts.map +1 -0
  298. package/script/validator/component_schemes.js +384 -0
  299. package/script/validator/feature_ac.d.ts +28 -0
  300. package/script/validator/feature_ac.d.ts.map +1 -0
  301. package/script/validator/feature_ac.js +105 -0
  302. package/script/validator/listing.d.ts +42 -0
  303. package/script/validator/listing.d.ts.map +1 -0
  304. package/script/validator/listing.js +298 -0
  305. package/script/validator/mod.d.ts +2 -0
  306. package/script/validator/mod.d.ts.map +1 -1
  307. package/script/validator/mod.js +256 -14
  308. package/script/validator/modal_keywords.d.ts +23 -0
  309. package/script/validator/modal_keywords.d.ts.map +1 -0
  310. package/script/validator/modal_keywords.js +140 -0
  311. package/script/validator/per_type_attrs.d.ts +29 -0
  312. package/script/validator/per_type_attrs.d.ts.map +1 -0
  313. package/script/validator/per_type_attrs.js +78 -0
  314. package/script/validator/pipeline.d.ts +7 -2
  315. package/script/validator/pipeline.d.ts.map +1 -1
  316. package/script/validator/pipeline.js +39 -6
  317. package/script/validator/trace_types.d.ts +26 -0
  318. package/script/validator/trace_types.d.ts.map +1 -0
  319. package/script/validator/trace_types.js +235 -0
  320. package/script/validator/traceability.d.ts +3 -4
  321. package/script/validator/traceability.d.ts.map +1 -1
  322. package/script/validator/traceability.js +5 -10
  323. package/script/validator/type_resolution.d.ts +67 -0
  324. package/script/validator/type_resolution.d.ts.map +1 -0
  325. package/script/validator/type_resolution.js +146 -0
  326. package/script/validator/types.d.ts +45 -0
  327. package/script/validator/types.d.ts.map +1 -1
  328. package/script/validator/types.js +131 -16
  329. package/script/validator/value_types.d.ts +8 -0
  330. package/script/validator/value_types.d.ts.map +1 -1
  331. package/script/validator/value_types.js +10 -2
@@ -63,22 +63,11 @@ function foldTier(base, tier, diagnostics) {
63
63
  const origin = tier.id;
64
64
  const m = tier.manifest;
65
65
  // Universal additive.
66
- const required = unionList(base.required, m.universalRequired, origin);
67
- const labels = unionList(base.labels, m.labels, origin);
66
+ const labels = unionLabelMap(base.labels, m.labels, origin, diagnostics);
67
+ const conventions = unionConventionsMap(base.conventions, m.conventions, origin);
68
68
  const attributes = unionAttrMap(base.attributes, m.universalAttributes, origin, diagnostics);
69
69
  // Colors map: last-write-wins per key, additive across tiers.
70
70
  const colors = unionColorsMap(base.colors, m.colors, origin);
71
- // Shape scopes — same additive pattern.
72
- const identified = {
73
- required: unionList(base.identified.required, m.identified.required, origin),
74
- attributes: unionAttrMap(base.identified.attributes, m.identified.attributes, origin, diagnostics),
75
- traceability: unionTraceMap(base.identified.traceability, m.identified.traceability, origin, diagnostics),
76
- };
77
- const referenced = {
78
- required: unionList(base.referenced.required, m.referenced.required, origin),
79
- attributes: unionAttrMap(base.referenced.attributes, m.referenced.attributes, origin, diagnostics),
80
- traceability: base.referenced.traceability, // always empty
81
- };
82
71
  // Types — add new types, fold existing ones.
83
72
  const types = new Map(base.types);
84
73
  for (const [name, td] of m.types) {
@@ -87,7 +76,7 @@ function foldTier(base, tier, diagnostics) {
87
76
  // Fresh type contributed by this tier.
88
77
  const eff = {
89
78
  name,
90
- shape: td.shape,
79
+ extends: td.extends,
91
80
  displayIdPattern: { value: td.displayIdPattern, origin },
92
81
  displayIdPatternEnforcement: {
93
82
  value: td.displayIdPatternEnforcement,
@@ -97,6 +86,9 @@ function foldTier(base, tier, diagnostics) {
97
86
  required: { value: td.required, origin },
98
87
  attributes: mapFromAttrList(td.attributes, origin),
99
88
  traceability: mapFromTrace(td.traceability, origin),
89
+ description: { value: td.description, origin },
90
+ attrDescriptions: mapFromAttrDescriptions(td.attributes, origin),
91
+ relationDescriptions: mapFromTraceDescriptions(td.traceability, origin),
100
92
  };
101
93
  types.set(name, { value: eff, origin });
102
94
  }
@@ -118,12 +110,10 @@ function foldTier(base, tier, diagnostics) {
118
110
  }
119
111
  const frontMatter = unionAttrMap(base.documents.frontMatter, m.documents.frontMatter, origin, diagnostics);
120
112
  const result = {
121
- required,
122
113
  attributes,
123
114
  labels,
115
+ conventions,
124
116
  colors,
125
- identified,
126
- referenced,
127
117
  types,
128
118
  documents: {
129
119
  types: docTypes,
@@ -229,7 +219,7 @@ function tightenAttr(existing, child, childOrigin, diagnostics) {
229
219
  const parent = existing.value;
230
220
  // Value-type must match exactly.
231
221
  if (parent.type !== child.type) {
232
- diagnostics.push(mergeRelaxation(`attribute '${parent.name}'`, "type", `${parent.type} (${existing.origin})`, `${child.type} (${childOrigin})`));
222
+ diagnostics.push(mergeRelaxation(`attribute '${parent.name}'`, "type", `${parent.type} (${existing.origin})`, `${child.type} (${childOrigin})`, "PROFILE-MERGE-011"));
233
223
  return undefined;
234
224
  }
235
225
  // Cardinality: child lower ≥ parent lower AND child upper ≤ parent upper.
@@ -265,6 +255,9 @@ function tightenAttr(existing, child, childOrigin, diagnostics) {
265
255
  cardinality: child.cardinality,
266
256
  values: parent.type === "enum" ? child.values : parent.values,
267
257
  inverse: child.inverse ?? parent.inverse,
258
+ description: child.description !== undefined
259
+ ? child.description
260
+ : parent.description,
268
261
  };
269
262
  const overrides = [
270
263
  ...(existing.overrides ?? []),
@@ -281,9 +274,9 @@ const ENFORCEMENT_ORDER = { off: 0, warn: 1, error: 2 };
281
274
  function tightenType(existing, child, childOrigin, diagnostics) {
282
275
  const name = child.name;
283
276
  const effExisting = existing.value;
284
- // Shape must match.
285
- if (effExisting.shape !== child.shape) {
286
- diagnostics.push(mergeRelaxation(`type '${name}'`, "shape", `${effExisting.shape} (${existing.origin})`, `${child.shape} (${childOrigin})`));
277
+ // extends: must match — conflicting core-type targets is a merge error.
278
+ if (effExisting.extends !== child.extends) {
279
+ diagnostics.push(mergeRelaxation(`type '${name}'`, "extends", `${effExisting.extends} (${existing.origin})`, `${child.extends} (${childOrigin})`, "PROFILE-MERGE-012"));
287
280
  return undefined;
288
281
  }
289
282
  // Display-ID pattern: if parent set one, child cannot change it. If parent
@@ -323,15 +316,27 @@ function tightenType(existing, child, childOrigin, diagnostics) {
323
316
  const color = child.color !== undefined
324
317
  ? { value: child.color, origin: childOrigin }
325
318
  : effExisting.color;
319
+ // Description: child wins when set; else inherit parent provenance unchanged.
320
+ const description = child.description !== undefined
321
+ ? { value: child.description, origin: childOrigin }
322
+ : effExisting.description;
323
+ const attrDescriptions = mergeDescriptionMap(effExisting.attrDescriptions, child.attributes.map((a) => ({ name: a.name, desc: a.description })), childOrigin);
324
+ const relationDescriptions = mergeDescriptionMap(effExisting.relationDescriptions, [...child.traceability.entries()].map(([name, r]) => ({
325
+ name,
326
+ desc: r.description,
327
+ })), childOrigin);
326
328
  const merged = {
327
329
  name,
328
- shape: effExisting.shape,
330
+ extends: effExisting.extends,
329
331
  displayIdPattern,
330
332
  displayIdPatternEnforcement: enforcement,
331
333
  color,
332
334
  required,
333
335
  attributes,
334
336
  traceability,
337
+ description,
338
+ attrDescriptions,
339
+ relationDescriptions,
335
340
  };
336
341
  const overrides = [
337
342
  ...(existing.overrides ?? []),
@@ -339,9 +344,9 @@ function tightenType(existing, child, childOrigin, diagnostics) {
339
344
  ];
340
345
  return { value: merged, origin: childOrigin, overrides };
341
346
  }
342
- function mergeRelaxation(subject, field, parentView, childView) {
347
+ function mergeRelaxation(subject, field, parentView, childView, code = "PROFILE-MERGE-010") {
343
348
  return {
344
- code: "PROFILE-MERGE-001",
349
+ code,
345
350
  severity: "error",
346
351
  message: `${subject}: field '${field}' relaxed by child (parent: ${parentView}, child: ${childView})`,
347
352
  location: { file: "<merge>", line: 1, column: 1 },
@@ -444,16 +449,10 @@ function seedFromTier(tier) {
444
449
  const origin = tier.id;
445
450
  const m = tier.manifest;
446
451
  return {
447
- required: { value: m.universalRequired, origin },
448
452
  attributes: mapFromAttrList(m.universalAttributes, origin),
449
- labels: { value: m.labels, origin },
453
+ labels: mapFromLabelConcerns(m.labels, origin),
454
+ conventions: mapFromConventions(m.conventions, origin),
450
455
  colors: mapFromColors(m.colors, origin),
451
- identified: buildShapeScope(m.identified, origin),
452
- referenced: {
453
- required: { value: m.referenced.required, origin },
454
- attributes: mapFromAttrList(m.referenced.attributes, origin),
455
- traceability: new Map(),
456
- },
457
456
  types: mapFromTypes(m.types, origin),
458
457
  documents: {
459
458
  types: mapFromDocTypes(m.documents.types, origin),
@@ -468,12 +467,76 @@ function mapFromColors(colors, origin) {
468
467
  }
469
468
  return out;
470
469
  }
471
- function buildShapeScope(raw, origin) {
472
- return {
473
- required: { value: raw.required, origin },
474
- attributes: mapFromAttrList(raw.attributes, origin),
475
- traceability: mapFromTrace(raw.traceability, origin),
476
- };
470
+ function mapFromLabelConcerns(concerns, origin) {
471
+ const out = new Map();
472
+ for (const c of concerns) {
473
+ out.set(c.name, { value: c, origin });
474
+ }
475
+ return out;
476
+ }
477
+ function mapFromConventions(conventions, origin) {
478
+ const out = new Map();
479
+ for (const c of conventions) {
480
+ out.set(c.name, { value: c, origin });
481
+ }
482
+ return out;
483
+ }
484
+ function unionLabelMap(parent, childConcerns, childOrigin, diagnostics) {
485
+ if (childConcerns.length === 0)
486
+ return parent;
487
+ const out = new Map(parent);
488
+ for (const c of childConcerns) {
489
+ const existing = out.get(c.name);
490
+ if (!existing) {
491
+ out.set(c.name, { value: c, origin: childOrigin });
492
+ continue;
493
+ }
494
+ if (existing.value.kind !== c.kind) {
495
+ diagnostics.push({
496
+ code: "PROFILE-LOAD-003",
497
+ severity: "error",
498
+ message: `label concern '${c.name}': kind '${c.kind}' (${childOrigin}) conflicts with '${existing.value.kind}' (${existing.origin})`,
499
+ location: { file: "<merge>", line: 1, column: 1 },
500
+ });
501
+ continue;
502
+ }
503
+ // Union values; child description wins when set.
504
+ const parentValueNames = new Set(existing.value.values.map((v) => v.name));
505
+ const mergedValues = [
506
+ ...existing.value.values,
507
+ ...c.values.filter((v) => !parentValueNames.has(v.name)),
508
+ ];
509
+ const merged = {
510
+ name: c.name,
511
+ kind: c.kind,
512
+ description: c.description !== undefined
513
+ ? c.description
514
+ : existing.value.description,
515
+ values: mergedValues,
516
+ };
517
+ out.set(c.name, {
518
+ value: merged,
519
+ origin: childOrigin,
520
+ overrides: [...(existing.overrides ?? []), existing.origin],
521
+ });
522
+ }
523
+ return out;
524
+ }
525
+ function unionConventionsMap(parent, childConventions, childOrigin) {
526
+ if (childConventions.length === 0)
527
+ return parent;
528
+ const out = new Map(parent);
529
+ for (const c of childConventions) {
530
+ const existing = out.get(c.name);
531
+ out.set(c.name, {
532
+ value: c,
533
+ origin: childOrigin,
534
+ overrides: existing
535
+ ? [...(existing.overrides ?? []), existing.origin]
536
+ : undefined,
537
+ });
538
+ }
539
+ return out;
477
540
  }
478
541
  function mapFromAttrList(attrs, origin) {
479
542
  const out = new Map();
@@ -489,12 +552,46 @@ function mapFromTrace(trace, origin) {
489
552
  }
490
553
  return out;
491
554
  }
555
+ function mapFromAttrDescriptions(attrs, origin) {
556
+ const out = new Map();
557
+ for (const a of attrs) {
558
+ if (a.description !== undefined) {
559
+ out.set(a.name, { value: a.description, origin });
560
+ }
561
+ }
562
+ return out;
563
+ }
564
+ function mapFromTraceDescriptions(trace, origin) {
565
+ const out = new Map();
566
+ for (const [name, rule] of trace) {
567
+ if (rule.description !== undefined) {
568
+ out.set(name, { value: rule.description, origin });
569
+ }
570
+ }
571
+ return out;
572
+ }
573
+ function mergeDescriptionMap(parent, childItems, childOrigin) {
574
+ const out = new Map(parent);
575
+ for (const { name, desc } of childItems) {
576
+ if (desc !== undefined) {
577
+ const existing = out.get(name);
578
+ out.set(name, {
579
+ value: desc,
580
+ origin: childOrigin,
581
+ overrides: existing
582
+ ? [...(existing.overrides ?? []), existing.origin]
583
+ : undefined,
584
+ });
585
+ }
586
+ }
587
+ return out;
588
+ }
492
589
  function mapFromTypes(types, origin) {
493
590
  const out = new Map();
494
591
  for (const [name, td] of types) {
495
592
  const eff = {
496
593
  name,
497
- shape: td.shape,
594
+ extends: td.extends,
498
595
  displayIdPattern: { value: td.displayIdPattern, origin },
499
596
  displayIdPatternEnforcement: {
500
597
  value: td.displayIdPatternEnforcement,
@@ -504,6 +601,9 @@ function mapFromTypes(types, origin) {
504
601
  required: { value: td.required, origin },
505
602
  attributes: mapFromAttrList(td.attributes, origin),
506
603
  traceability: mapFromTrace(td.traceability, origin),
604
+ description: { value: td.description, origin },
605
+ attrDescriptions: mapFromAttrDescriptions(td.attributes, origin),
606
+ relationDescriptions: mapFromTraceDescriptions(td.traceability, origin),
507
607
  };
508
608
  out.set(name, { value: eff, origin });
509
609
  }
@@ -16,8 +16,7 @@ export { loadProfileForCommand } from "./load.js";
16
16
  export type { LoadProfileForCommandResult } from "./load.js";
17
17
  export { mergeChain } from "./merge.js";
18
18
  export type { MergeResult } from "./merge.js";
19
- export { cacheDir } from "./cache.js";
20
- export type { CacheEnv } from "./cache.js";
21
- export { defaultRunNpm, resolveNpmSpecifier } from "./npm.js";
22
- export type { ResolveNpmOptions, RunNpm } from "./npm.js";
19
+ export { resolveEntryColor } from "./colors.js";
20
+ export { buildProfileIntrospection } from "./introspect.js";
21
+ export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./introspect.js";
23
22
  //# sourceMappingURL=mod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/profile/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/profile/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC"}
@@ -10,5 +10,9 @@ export { computeCacheKey, computeCacheLocation, defaultAppendFile, defaultRunGit
10
10
  export { loadChain } from "./chain.js";
11
11
  export { loadProfileForCommand } from "./load.js";
12
12
  export { mergeChain } from "./merge.js";
13
- export { cacheDir } from "./cache.js";
14
- export { defaultRunNpm, resolveNpmSpecifier } from "./npm.js";
13
+ // cacheDir, CacheEnv, defaultRunNpm, resolveNpmSpecifier, ResolveNpmOptions,
14
+ // and RunNpm are internal implementation details of the NPM resolver — they
15
+ // are not part of the public profile API and are not re-exported from
16
+ // core/mod.ts. Consumers use loadChain / loadProfileForCommand instead.
17
+ export { resolveEntryColor } from "./colors.js";
18
+ export { buildProfileIntrospection } from "./introspect.js";
@@ -27,8 +27,8 @@ function filterEntries(result, scope, label) {
27
27
  if (scope) {
28
28
  const scopeUpper = scope.toUpperCase();
29
29
  entries = entries.filter((e) => {
30
- const parts = e.displayId.split("_");
31
- return parts.length >= 2 && parts[1] === scopeUpper;
30
+ const parts = e.displayId.split(/[_-]/);
31
+ return parts.some((p) => p === scopeUpper);
32
32
  });
33
33
  }
34
34
  if (label) {
@@ -91,7 +91,7 @@ function computeCoverage(result, entries) {
91
91
  let withoutSatisfies = 0;
92
92
  for (const entry of entries) {
93
93
  // Bucket by profile-declared type when available, fall back to shape.
94
- const t = entry.type ?? (entry.shape === "referenced" ? "ref" : "untyped");
94
+ const t = entry.type ?? (entry.shape === "Reference" ? "ref" : "untyped");
95
95
  byType[t] = (byType[t] ?? 0) + 1;
96
96
  const fwd = result.forward.get(entry.displayId) ?? [];
97
97
  const rev = result.reverse.get(entry.displayId) ?? [];
@@ -99,7 +99,7 @@ function computeCoverage(result, entries) {
99
99
  if (hasSatisfies) {
100
100
  withSatisfies++;
101
101
  }
102
- else if (entry.shape === "identified") {
102
+ else if (entry.shape === "Authored") {
103
103
  withoutSatisfies++;
104
104
  orphans.push(entry.displayId);
105
105
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @module core/util/fence
3
+ *
4
+ * Prose-line walker that skips lines inside fenced code blocks.
5
+ * Several validator and formatter passes (body-block exclusions,
6
+ * caption adjacency, `$Identifier` extraction, modal-keyword
7
+ * normalisation) all needed to walk an entry body line-by-line while
8
+ * treating fenced code as verbatim. This helper centralises that
9
+ * pattern so the fence-toggle semantics stay consistent.
10
+ *
11
+ * Fence detection follows CommonMark §4.5 — a line whose first
12
+ * non-whitespace content is three or more backticks or tildes opens
13
+ * (or closes) a fenced block. The language tag that may follow the
14
+ * opening fence does not affect detection: we toggle on every fence
15
+ * marker regardless. (Mismatched marker types — ``` opener / ~~~
16
+ * closer — are accepted by the walker because real Markdown parsers
17
+ * already reject those upstream.)
18
+ */
19
+ /** Three or more backticks or tildes at the start of a line. */
20
+ export declare const FENCE_RE: RegExp;
21
+ /** Callback for {@linkcode walkProseLines}. Receives one line + its 0-based index. */
22
+ export type ProseLineCallback = (line: string, index: number) => void;
23
+ /**
24
+ * Walk `body` line by line, invoking `cb` for every line that's NOT
25
+ * inside a fenced code block. The first fence marker opens the block;
26
+ * the next closes it. The fence-marker lines themselves are also
27
+ * skipped (they're structural, not prose).
28
+ */
29
+ export declare function walkProseLines(body: string, cb: ProseLineCallback): void;
30
+ //# sourceMappingURL=fence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../src/util/fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAkB,CAAC;AAExC,sFAAsF;AACtF,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEtE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAYxE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @module core/util/fence
3
+ *
4
+ * Prose-line walker that skips lines inside fenced code blocks.
5
+ * Several validator and formatter passes (body-block exclusions,
6
+ * caption adjacency, `$Identifier` extraction, modal-keyword
7
+ * normalisation) all needed to walk an entry body line-by-line while
8
+ * treating fenced code as verbatim. This helper centralises that
9
+ * pattern so the fence-toggle semantics stay consistent.
10
+ *
11
+ * Fence detection follows CommonMark §4.5 — a line whose first
12
+ * non-whitespace content is three or more backticks or tildes opens
13
+ * (or closes) a fenced block. The language tag that may follow the
14
+ * opening fence does not affect detection: we toggle on every fence
15
+ * marker regardless. (Mismatched marker types — ``` opener / ~~~
16
+ * closer — are accepted by the walker because real Markdown parsers
17
+ * already reject those upstream.)
18
+ */
19
+ /** Three or more backticks or tildes at the start of a line. */
20
+ export const FENCE_RE = /^\s*(```|~~~)/;
21
+ /**
22
+ * Walk `body` line by line, invoking `cb` for every line that's NOT
23
+ * inside a fenced code block. The first fence marker opens the block;
24
+ * the next closes it. The fence-marker lines themselves are also
25
+ * skipped (they're structural, not prose).
26
+ */
27
+ export function walkProseLines(body, cb) {
28
+ const lines = body.split("\n");
29
+ let inFence = false;
30
+ for (let i = 0; i < lines.length; i++) {
31
+ const line = lines[i];
32
+ if (FENCE_RE.test(line)) {
33
+ inFence = !inFence;
34
+ continue;
35
+ }
36
+ if (inFence)
37
+ continue;
38
+ cb(line, i);
39
+ }
40
+ }
@@ -13,10 +13,10 @@
13
13
  import type { AttrDecl, Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
14
14
  /**
15
15
  * Effective attribute declarations and required list for an entry, derived
16
- * from the profile's universal, shape, and (when classified) type scopes.
16
+ * from the profile's universal and (when classified) type scopes.
17
17
  *
18
18
  * Scope layering (outer → inner):
19
- * universal → shape.identified/referenced → types.<T>
19
+ * universal → types.<T>
20
20
  *
21
21
  * Name collisions: inner scope wins. Required lists are concatenated in
22
22
  * scope order (universal first, type last) preserving duplicates across
@@ -28,7 +28,7 @@ export interface EffectiveAttrScope {
28
28
  }
29
29
  /**
30
30
  * Compute the effective attribute scope for a given entry against the
31
- * profile. Uses universal + shape scope always; adds type scope only when
31
+ * profile. Uses universal scope always; adds type scope only when
32
32
  * `entry.type` is set and the type is declared in the profile.
33
33
  */
34
34
  export declare function effectiveScope(entry: Entry, profile: EffectiveProfile): EffectiveAttrScope;
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/validator/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;AAWzB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,kBAAkB,CAsDpB;AAqBD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,UAAU,EAAE,CA4Ed"}
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../src/validator/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;AAWzB;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,kBAAkB,CAoCpB;AAqBD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,UAAU,EAAE,CA4Ed"}
@@ -20,25 +20,16 @@ const CORE_RESERVED_KEYS = new Set([
20
20
  ]);
21
21
  /**
22
22
  * Compute the effective attribute scope for a given entry against the
23
- * profile. Uses universal + shape scope always; adds type scope only when
23
+ * profile. Uses universal scope always; adds type scope only when
24
24
  * `entry.type` is set and the type is declared in the profile.
25
25
  */
26
26
  export function effectiveScope(entry, profile) {
27
27
  const required = [];
28
28
  const attributes = new Map();
29
29
  // Universal scope.
30
- required.push(...profile.required.value);
31
30
  for (const [name, attrEntry] of profile.attributes) {
32
31
  attributes.set(name, attrEntry.value);
33
32
  }
34
- // Shape scope.
35
- const shapeScope = entry.shape === "identified"
36
- ? profile.identified
37
- : profile.referenced;
38
- required.push(...shapeScope.required.value);
39
- for (const [name, e] of shapeScope.attributes) {
40
- attributes.set(name, e.value);
41
- }
42
33
  // Type scope (only when classified).
43
34
  if (entry.type !== undefined) {
44
35
  const typeEntry = profile.types.get(entry.type);
@@ -53,14 +44,6 @@ export function effectiveScope(entry, profile) {
53
44
  // names that aren't explicitly declared as attributes. A trace rule IS an
54
45
  // id-list attribute by definition — profile authors shouldn't have to
55
46
  // declare it in both places.
56
- const shapeTrace = entry.shape === "identified"
57
- ? profile.identified.traceability
58
- : profile.referenced.traceability;
59
- for (const [name] of shapeTrace) {
60
- if (!attributes.has(name)) {
61
- attributes.set(name, synthesizedLinkAttr(name));
62
- }
63
- }
64
47
  if (entry.type !== undefined) {
65
48
  const typeEntry = profile.types.get(entry.type);
66
49
  if (typeEntry !== undefined) {
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @module core/validator/body_blocks
3
+ *
4
+ * Body-block exclusion validator (spec §2.4.1). Detects constructs
5
+ * forbidden inside entry bodies:
6
+ *
7
+ * - MSL-B040 — headings
8
+ * - MSL-B041 — horizontal rules
9
+ * - MSL-B042 — task lists
10
+ * - MSL-B043 — raw HTML other than `<!-- markspec:* -->` directive
11
+ * comments
12
+ *
13
+ * Each excluded construct maps to a distinct AST node kind or property:
14
+ *
15
+ * - Headings → `UnknownNode` with `subkind: "heading"`
16
+ * - HR → `UnknownNode` with `subkind: "thematic-break"`
17
+ * - Task list → `ListNode` with `hasTaskItems: true`
18
+ * - Block HTML → `UnknownNode` with `subkind: "html"` (raw checked for
19
+ * the markspec-directive carve-out)
20
+ * - Inline HTML — remains inside `ParagraphNode.content.text` (remark
21
+ * does not extract inline HTML nodes into block-level nodes); each
22
+ * paragraph's text is scanned line-by-line using the same regex
23
+ * approach as the old walkProseLines path, but bounded to prose-only
24
+ * nodes (code/feature/math blocks are automatically excluded because
25
+ * the builder does not emit prose-bearing nodes for verbatim content).
26
+ *
27
+ * Code, Feature, and Math blocks are automatically excluded because the
28
+ * builder emits opaque nodes for verbatim content — no prose text to scan.
29
+ */
30
+ import type { Diagnostic, Entry } from "../model/mod.js";
31
+ /**
32
+ * Validate that an entry's body contains none of the excluded body
33
+ * constructs. Emits at most one diagnostic per excluded construct per
34
+ * line (so a paragraph with `<div>foo</div><span>bar</span>` still
35
+ * fires MSL-B043 once for that line).
36
+ */
37
+ export declare function validateBodyBlocks(entry: Entry): readonly Diagnostic[];
38
+ //# sourceMappingURL=body_blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body_blocks.d.ts","sourceRoot":"","sources":["../../src/validator/body_blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAkMzD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU,EAAE,CAsBtE"}