@driftsys/markspec 0.12.1 → 0.13.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 (279) hide show
  1. package/esm/ast/build.d.ts.map +1 -1
  2. package/esm/ast/build.js +19 -5
  3. package/esm/ast/equivalence.js +14 -2
  4. package/esm/ast/nodes.d.ts +15 -3
  5. package/esm/ast/nodes.d.ts.map +1 -1
  6. package/esm/compiler/inverses.d.ts.map +1 -1
  7. package/esm/compiler/inverses.js +18 -3
  8. package/esm/compiler/mod.d.ts +34 -1
  9. package/esm/compiler/mod.d.ts.map +1 -1
  10. package/esm/compiler/mod.js +112 -48
  11. package/esm/compiler/schema.d.ts +3 -2
  12. package/esm/compiler/schema.d.ts.map +1 -1
  13. package/esm/compiler/schema.js +6 -3
  14. package/esm/criteria/scenarios.d.ts +55 -0
  15. package/esm/criteria/scenarios.d.ts.map +1 -0
  16. package/esm/criteria/scenarios.js +133 -0
  17. package/esm/discovery/mod.d.ts +20 -1
  18. package/esm/discovery/mod.d.ts.map +1 -1
  19. package/esm/discovery/mod.js +105 -17
  20. package/esm/formatter/entry_body.d.ts +8 -5
  21. package/esm/formatter/entry_body.d.ts.map +1 -1
  22. package/esm/formatter/entry_body.js +12 -8
  23. package/esm/formatter/feature_file.d.ts +40 -0
  24. package/esm/formatter/feature_file.d.ts.map +1 -0
  25. package/esm/formatter/feature_file.js +88 -0
  26. package/esm/formatter/mod.d.ts +21 -2
  27. package/esm/formatter/mod.d.ts.map +1 -1
  28. package/esm/formatter/mod.js +64 -22
  29. package/esm/gates/mod.d.ts +2 -2
  30. package/esm/gates/mod.d.ts.map +1 -1
  31. package/esm/gates/mod.js +17 -2
  32. package/esm/gherkin/load.d.ts +35 -0
  33. package/esm/gherkin/load.d.ts.map +1 -0
  34. package/esm/gherkin/load.js +39 -0
  35. package/esm/gherkin/parse.d.ts +11 -0
  36. package/esm/gherkin/parse.d.ts.map +1 -0
  37. package/esm/gherkin/parse.js +311 -0
  38. package/esm/gherkin/position.d.ts +23 -0
  39. package/esm/gherkin/position.d.ts.map +1 -0
  40. package/esm/gherkin/position.js +21 -0
  41. package/esm/gherkin/procedure.d.ts +76 -0
  42. package/esm/gherkin/procedure.d.ts.map +1 -0
  43. package/esm/gherkin/procedure.js +164 -0
  44. package/esm/gherkin/project.d.ts +35 -0
  45. package/esm/gherkin/project.d.ts.map +1 -0
  46. package/esm/gherkin/project.js +64 -0
  47. package/esm/gherkin/role.d.ts +23 -0
  48. package/esm/gherkin/role.d.ts.map +1 -0
  49. package/esm/gherkin/role.js +28 -0
  50. package/esm/gherkin/types.d.ts +118 -0
  51. package/esm/gherkin/types.d.ts.map +1 -0
  52. package/esm/gherkin/types.js +12 -0
  53. package/esm/lock/acquire_compile.d.ts +12 -4
  54. package/esm/lock/acquire_compile.d.ts.map +1 -1
  55. package/esm/lock/acquire_compile.js +15 -5
  56. package/esm/lock/canonical_edges.d.ts +6 -2
  57. package/esm/lock/canonical_edges.d.ts.map +1 -1
  58. package/esm/lock/canonical_edges.js +10 -3
  59. package/esm/lock/model.d.ts +5 -0
  60. package/esm/lock/model.d.ts.map +1 -1
  61. package/esm/lock/parser.d.ts.map +1 -1
  62. package/esm/lock/parser.js +2 -0
  63. package/esm/lock/resolve.d.ts +6 -2
  64. package/esm/lock/resolve.d.ts.map +1 -1
  65. package/esm/lock/resolve.js +36 -4
  66. package/esm/lock/serializer.d.ts.map +1 -1
  67. package/esm/lock/serializer.js +7 -1
  68. package/esm/mod.d.ts +23 -6
  69. package/esm/mod.d.ts.map +1 -1
  70. package/esm/mod.js +18 -5
  71. package/esm/model/mod.d.ts +42 -1
  72. package/esm/model/mod.d.ts.map +1 -1
  73. package/esm/model/mod.js +1 -1
  74. package/esm/model/relations.d.ts +9 -0
  75. package/esm/model/relations.d.ts.map +1 -1
  76. package/esm/model/relations.js +16 -1
  77. package/esm/parser/attributes.d.ts +82 -3
  78. package/esm/parser/attributes.d.ts.map +1 -1
  79. package/esm/parser/attributes.js +199 -32
  80. package/esm/parser/body_tokens.d.ts +1 -1
  81. package/esm/parser/body_tokens.d.ts.map +1 -1
  82. package/esm/parser/body_tokens.js +49 -35
  83. package/esm/parser/feature_file.d.ts +116 -0
  84. package/esm/parser/feature_file.d.ts.map +1 -0
  85. package/esm/parser/feature_file.js +540 -0
  86. package/esm/parser/markdown.d.ts +7 -0
  87. package/esm/parser/markdown.d.ts.map +1 -1
  88. package/esm/parser/markdown.js +129 -40
  89. package/esm/parser/mod.d.ts +18 -0
  90. package/esm/parser/mod.d.ts.map +1 -1
  91. package/esm/parser/mod.js +51 -0
  92. package/esm/parser/translate.d.ts.map +1 -1
  93. package/esm/parser/translate.js +5 -0
  94. package/esm/refs/mod.d.ts +2 -1
  95. package/esm/refs/mod.d.ts.map +1 -1
  96. package/esm/refs/mod.js +12 -4
  97. package/esm/refs/split.d.ts +58 -0
  98. package/esm/refs/split.d.ts.map +1 -0
  99. package/esm/refs/split.js +137 -0
  100. package/esm/reporter/mod.d.ts +7 -0
  101. package/esm/reporter/mod.d.ts.map +1 -1
  102. package/esm/reporter/mod.js +113 -3
  103. package/esm/validator/attributes.d.ts.map +1 -1
  104. package/esm/validator/attributes.js +4 -1
  105. package/esm/validator/block_role.d.ts +40 -0
  106. package/esm/validator/block_role.d.ts.map +1 -0
  107. package/esm/validator/block_role.js +109 -0
  108. package/esm/validator/feature_ac.d.ts.map +1 -1
  109. package/esm/validator/feature_ac.js +6 -1
  110. package/esm/validator/feature_parse.d.ts +35 -0
  111. package/esm/validator/feature_parse.d.ts.map +1 -0
  112. package/esm/validator/feature_parse.js +69 -0
  113. package/esm/validator/locators.d.ts +36 -0
  114. package/esm/validator/locators.d.ts.map +1 -0
  115. package/esm/validator/locators.js +184 -0
  116. package/esm/validator/mod.d.ts +10 -1
  117. package/esm/validator/mod.d.ts.map +1 -1
  118. package/esm/validator/mod.js +38 -14
  119. package/esm/validator/normalize.d.ts.map +1 -1
  120. package/esm/validator/normalize.js +8 -3
  121. package/esm/validator/per_type_attrs.d.ts +3 -3
  122. package/esm/validator/per_type_attrs.js +3 -3
  123. package/esm/validator/pipeline.d.ts +4 -12
  124. package/esm/validator/pipeline.d.ts.map +1 -1
  125. package/esm/validator/pipeline.js +24 -5
  126. package/esm/validator/procedure.d.ts +22 -0
  127. package/esm/validator/procedure.d.ts.map +1 -0
  128. package/esm/validator/procedure.js +58 -0
  129. package/esm/validator/trace_types.d.ts.map +1 -1
  130. package/esm/validator/trace_types.js +4 -3
  131. package/esm/validator/traceability.d.ts.map +1 -1
  132. package/esm/validator/traceability.js +4 -1
  133. package/esm/validator/type_resolution.d.ts +5 -3
  134. package/esm/validator/type_resolution.d.ts.map +1 -1
  135. package/esm/validator/type_resolution.js +14 -2
  136. package/esm/validator/types.d.ts +11 -0
  137. package/esm/validator/types.d.ts.map +1 -1
  138. package/esm/validator/types.js +26 -4
  139. package/esm/validator/uxil_family.d.ts +1 -1
  140. package/package.json +3 -1
  141. package/script/ast/build.d.ts.map +1 -1
  142. package/script/ast/build.js +19 -5
  143. package/script/ast/equivalence.js +14 -2
  144. package/script/ast/nodes.d.ts +15 -3
  145. package/script/ast/nodes.d.ts.map +1 -1
  146. package/script/compiler/inverses.d.ts.map +1 -1
  147. package/script/compiler/inverses.js +18 -3
  148. package/script/compiler/mod.d.ts +34 -1
  149. package/script/compiler/mod.d.ts.map +1 -1
  150. package/script/compiler/mod.js +110 -46
  151. package/script/compiler/schema.d.ts +3 -2
  152. package/script/compiler/schema.d.ts.map +1 -1
  153. package/script/compiler/schema.js +6 -3
  154. package/script/criteria/scenarios.d.ts +55 -0
  155. package/script/criteria/scenarios.d.ts.map +1 -0
  156. package/script/criteria/scenarios.js +139 -0
  157. package/script/discovery/mod.d.ts +20 -1
  158. package/script/discovery/mod.d.ts.map +1 -1
  159. package/script/discovery/mod.js +106 -17
  160. package/script/formatter/entry_body.d.ts +8 -5
  161. package/script/formatter/entry_body.d.ts.map +1 -1
  162. package/script/formatter/entry_body.js +12 -8
  163. package/script/formatter/feature_file.d.ts +40 -0
  164. package/script/formatter/feature_file.d.ts.map +1 -0
  165. package/script/formatter/feature_file.js +92 -0
  166. package/script/formatter/mod.d.ts +21 -2
  167. package/script/formatter/mod.d.ts.map +1 -1
  168. package/script/formatter/mod.js +63 -21
  169. package/script/gates/mod.d.ts +2 -2
  170. package/script/gates/mod.d.ts.map +1 -1
  171. package/script/gates/mod.js +17 -2
  172. package/script/gherkin/load.d.ts +35 -0
  173. package/script/gherkin/load.d.ts.map +1 -0
  174. package/script/gherkin/load.js +76 -0
  175. package/script/gherkin/parse.d.ts +11 -0
  176. package/script/gherkin/parse.d.ts.map +1 -0
  177. package/script/gherkin/parse.js +314 -0
  178. package/script/gherkin/position.d.ts +23 -0
  179. package/script/gherkin/position.d.ts.map +1 -0
  180. package/script/gherkin/position.js +24 -0
  181. package/script/gherkin/procedure.d.ts +76 -0
  182. package/script/gherkin/procedure.d.ts.map +1 -0
  183. package/script/gherkin/procedure.js +169 -0
  184. package/script/gherkin/project.d.ts +35 -0
  185. package/script/gherkin/project.d.ts.map +1 -0
  186. package/script/gherkin/project.js +67 -0
  187. package/script/gherkin/role.d.ts +23 -0
  188. package/script/gherkin/role.d.ts.map +1 -0
  189. package/script/gherkin/role.js +31 -0
  190. package/script/gherkin/types.d.ts +118 -0
  191. package/script/gherkin/types.d.ts.map +1 -0
  192. package/script/gherkin/types.js +13 -0
  193. package/script/lock/acquire_compile.d.ts +12 -4
  194. package/script/lock/acquire_compile.d.ts.map +1 -1
  195. package/script/lock/acquire_compile.js +15 -5
  196. package/script/lock/canonical_edges.d.ts +6 -2
  197. package/script/lock/canonical_edges.d.ts.map +1 -1
  198. package/script/lock/canonical_edges.js +10 -3
  199. package/script/lock/model.d.ts +5 -0
  200. package/script/lock/model.d.ts.map +1 -1
  201. package/script/lock/parser.d.ts.map +1 -1
  202. package/script/lock/parser.js +2 -0
  203. package/script/lock/resolve.d.ts +6 -2
  204. package/script/lock/resolve.d.ts.map +1 -1
  205. package/script/lock/resolve.js +36 -4
  206. package/script/lock/serializer.d.ts.map +1 -1
  207. package/script/lock/serializer.js +7 -1
  208. package/script/mod.d.ts +23 -6
  209. package/script/mod.d.ts.map +1 -1
  210. package/script/mod.js +45 -6
  211. package/script/model/mod.d.ts +42 -1
  212. package/script/model/mod.d.ts.map +1 -1
  213. package/script/model/mod.js +2 -1
  214. package/script/model/relations.d.ts +9 -0
  215. package/script/model/relations.d.ts.map +1 -1
  216. package/script/model/relations.js +17 -1
  217. package/script/parser/attributes.d.ts +82 -3
  218. package/script/parser/attributes.d.ts.map +1 -1
  219. package/script/parser/attributes.js +205 -33
  220. package/script/parser/body_tokens.d.ts +1 -1
  221. package/script/parser/body_tokens.d.ts.map +1 -1
  222. package/script/parser/body_tokens.js +49 -35
  223. package/script/parser/feature_file.d.ts +116 -0
  224. package/script/parser/feature_file.d.ts.map +1 -0
  225. package/script/parser/feature_file.js +548 -0
  226. package/script/parser/markdown.d.ts +7 -0
  227. package/script/parser/markdown.d.ts.map +1 -1
  228. package/script/parser/markdown.js +128 -39
  229. package/script/parser/mod.d.ts +18 -0
  230. package/script/parser/mod.d.ts.map +1 -1
  231. package/script/parser/mod.js +52 -1
  232. package/script/parser/translate.d.ts.map +1 -1
  233. package/script/parser/translate.js +5 -0
  234. package/script/refs/mod.d.ts +2 -1
  235. package/script/refs/mod.d.ts.map +1 -1
  236. package/script/refs/mod.js +12 -4
  237. package/script/refs/split.d.ts +58 -0
  238. package/script/refs/split.d.ts.map +1 -0
  239. package/script/refs/split.js +145 -0
  240. package/script/reporter/mod.d.ts +7 -0
  241. package/script/reporter/mod.d.ts.map +1 -1
  242. package/script/reporter/mod.js +113 -3
  243. package/script/validator/attributes.d.ts.map +1 -1
  244. package/script/validator/attributes.js +4 -1
  245. package/script/validator/block_role.d.ts +40 -0
  246. package/script/validator/block_role.d.ts.map +1 -0
  247. package/script/validator/block_role.js +112 -0
  248. package/script/validator/feature_ac.d.ts.map +1 -1
  249. package/script/validator/feature_ac.js +6 -1
  250. package/script/validator/feature_parse.d.ts +35 -0
  251. package/script/validator/feature_parse.d.ts.map +1 -0
  252. package/script/validator/feature_parse.js +73 -0
  253. package/script/validator/locators.d.ts +36 -0
  254. package/script/validator/locators.d.ts.map +1 -0
  255. package/script/validator/locators.js +188 -0
  256. package/script/validator/mod.d.ts +10 -1
  257. package/script/validator/mod.d.ts.map +1 -1
  258. package/script/validator/mod.js +38 -14
  259. package/script/validator/normalize.d.ts.map +1 -1
  260. package/script/validator/normalize.js +8 -3
  261. package/script/validator/per_type_attrs.d.ts +3 -3
  262. package/script/validator/per_type_attrs.js +3 -3
  263. package/script/validator/pipeline.d.ts +4 -12
  264. package/script/validator/pipeline.d.ts.map +1 -1
  265. package/script/validator/pipeline.js +23 -5
  266. package/script/validator/procedure.d.ts +22 -0
  267. package/script/validator/procedure.d.ts.map +1 -0
  268. package/script/validator/procedure.js +61 -0
  269. package/script/validator/trace_types.d.ts.map +1 -1
  270. package/script/validator/trace_types.js +4 -3
  271. package/script/validator/traceability.d.ts.map +1 -1
  272. package/script/validator/traceability.js +4 -1
  273. package/script/validator/type_resolution.d.ts +5 -3
  274. package/script/validator/type_resolution.d.ts.map +1 -1
  275. package/script/validator/type_resolution.js +14 -2
  276. package/script/validator/types.d.ts +11 -0
  277. package/script/validator/types.d.ts.map +1 -1
  278. package/script/validator/types.js +27 -4
  279. package/script/validator/uxil_family.d.ts +1 -1
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.validateTraceTargetTypes = validateTraceTargetTypes;
17
17
  const mod_js_1 = require("../model/mod.js");
18
18
  const type_resolution_js_1 = require("./type_resolution.js");
19
+ const split_js_1 = require("../refs/split.js");
19
20
  const TRACE_RULES = mod_js_1.CORE_RELATIONS
20
21
  .filter((r) => r.targetTypes)
21
22
  .map((r) => ({ attr: r.attr, allowedTargetTypes: r.targetTypes }));
@@ -110,7 +111,7 @@ function validateTraceTargetTypes(emittable, all) {
110
111
  for (const attr of entry.rawAttributes) {
111
112
  if (attr.key !== "Supersedes")
112
113
  continue;
113
- const target = attr.value.trim();
114
+ const target = (0, split_js_1.traceTarget)(attr.value);
114
115
  const resolved = byId.get(target) ?? byDisplayId.get(target);
115
116
  if (!resolved)
116
117
  continue;
@@ -129,7 +130,7 @@ function validateTraceTargetTypes(emittable, all) {
129
130
  for (const attr of entry.rawAttributes) {
130
131
  if (attr.key !== rule.attr)
131
132
  continue;
132
- const target = attr.value.trim();
133
+ const target = (0, split_js_1.traceTarget)(attr.value);
133
134
  const resolved = byId.get(target) ?? byDisplayId.get(target);
134
135
  if (!resolved)
135
136
  continue;
@@ -169,7 +170,7 @@ function validateTraceTargetTypes(emittable, all) {
169
170
  for (const attr of entry.rawAttributes) {
170
171
  if (attr.key !== "Caused-by")
171
172
  continue;
172
- const target = attr.value.trim();
173
+ const target = (0, split_js_1.traceTarget)(attr.value);
173
174
  const resolved = byId.get(target) ?? byDisplayId.get(target);
174
175
  if (!resolved)
175
176
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,KAAK,EAEV,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAehC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,OAAO,CAST;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,WAAW,GAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAa,EACnD,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,UAAU,EAAE,CA+Gd"}
1
+ {"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,KAAK,EAEV,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAGzB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAehC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,OAAO,CAST;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,WAAW,GAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAa,EACnD,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,UAAU,EAAE,CAiHd"}
@@ -26,6 +26,7 @@ exports.effectiveTraceRules = effectiveTraceRules;
26
26
  exports.matchesAnyTarget = matchesAnyTarget;
27
27
  exports.validateTraceabilityForEntry = validateTraceabilityForEntry;
28
28
  const mod_js_1 = require("../model/mod.js");
29
+ const split_js_1 = require("../refs/split.js");
29
30
  /**
30
31
  * Effective trace rules for an entry: type-scope rules only.
31
32
  * Type-scope rules are applied only when the entry is classified.
@@ -132,7 +133,9 @@ function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new M
132
133
  // MSL-L004 target match + MSL-L006 existence, for each resolved value.
133
134
  // Resolve by ULID (graph) first, then by display ID (byDisplayId) — the
134
135
  // dual-resolution spine (issue #593).
135
- for (const v of values) {
136
+ // A bracket locator (`A [x]`) addresses part of the target; the
137
+ // existence check uses the target only (epic #915).
138
+ for (const v of values.map(split_js_1.traceTarget)) {
136
139
  const target = graph.get(v) ?? byDisplayId.get(v);
137
140
  if (!target) {
138
141
  // Scheme-qualified URIs are intentionally external — never local
@@ -14,6 +14,8 @@
14
14
  * 5. Reference-shape URI scheme inference (ADR-003 §Part 6).
15
15
  * 6. Discriminating-attribute presence (Verifies → Test,
16
16
  * Schema-language → Contract, …).
17
+ * 6a. `.feature` header entries only: Feature / Rule → Requirement,
18
+ * Scenario → Test.
17
19
  *
18
20
  * Step 7 (document directive) is not consulted here; step 8
19
21
  * (display-ID shape) has its own warning-emitting stage in
@@ -40,7 +42,7 @@ export declare function inferTypeFromDisplayIdPrefix(displayId: string): string
40
42
  export declare function explicitType(entry: Entry): string | undefined;
41
43
  /** Which step of the §1.3.1 chain resolved a type. Steps 7 and 8 are
42
44
  * not reported here; step 8 has its own warning-emitting stage. */
43
- export type TypeResolutionStep = 1 | 2 | 3 | 4 | 5 | 6;
45
+ export type TypeResolutionStep = 1 | 2 | 3 | 4 | 5 | 6 | "6a";
44
46
  /** A type together with the step of the §1.3.1 chain that resolved it. */
45
47
  export interface ResolvedTypeWithProvenance {
46
48
  readonly type: string;
@@ -49,7 +51,7 @@ export interface ResolvedTypeWithProvenance {
49
51
  /**
50
52
  * Resolve an entry's effective core type and report which step of the
51
53
  * spec §1.3.1 chain matched. First match wins. Returns `undefined` when
52
- * no step in {1..6} resolves to a known core type — callers may then
54
+ * no step in {1..6a} resolves to a known core type — callers may then
53
55
  * consult late-stage step-8 inference (`inferTypeFromDisplayIdShape`)
54
56
  * or treat the entry as unclassified (fallback to `Item`).
55
57
  */
@@ -59,7 +61,7 @@ export declare function resolvedCoreTypeWithProvenance(entry: Entry, profile?: E
59
61
  * wrapper around {@linkcode resolvedCoreTypeWithProvenance} for callers
60
62
  * that don't need to know which step matched.
61
63
  *
62
- * Returns `undefined` when no step in {1..6} resolves to a known core
64
+ * Returns `undefined` when no step in {1..6a} resolves to a known core
63
65
  * type. The caller decides whether to skip validation, fall back to a
64
66
  * less specific check, or report on the unclassified state.
65
67
  */
@@ -1 +1 @@
1
- {"version":3,"file":"type_resolution.d.ts","sourceRoot":"","sources":["../../src/validator/type_resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAuB/D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAO7D;AAYD;mEACmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvD,0EAA0E;AAC1E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAkBD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,0BAA0B,GAAG,SAAS,CA4CxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,GAAG,SAAS,CAEpB"}
1
+ {"version":3,"file":"type_resolution.d.ts","sourceRoot":"","sources":["../../src/validator/type_resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAuB/D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CAWpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAO7D;AAYD;mEACmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAE9D,0EAA0E;AAC1E,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAkBD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,0BAA0B,GAAG,SAAS,CAsDxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,GAAG,SAAS,CAEpB"}
@@ -15,6 +15,8 @@
15
15
  * 5. Reference-shape URI scheme inference (ADR-003 §Part 6).
16
16
  * 6. Discriminating-attribute presence (Verifies → Test,
17
17
  * Schema-language → Contract, …).
18
+ * 6a. `.feature` header entries only: Feature / Rule → Requirement,
19
+ * Scenario → Test.
18
20
  *
19
21
  * Step 7 (document directive) is not consulted here; step 8
20
22
  * (display-ID shape) has its own warning-emitting stage in
@@ -101,7 +103,7 @@ function profileTypeToCore(typeName, profile) {
101
103
  /**
102
104
  * Resolve an entry's effective core type and report which step of the
103
105
  * spec §1.3.1 chain matched. First match wins. Returns `undefined` when
104
- * no step in {1..6} resolves to a known core type — callers may then
106
+ * no step in {1..6a} resolves to a known core type — callers may then
105
107
  * consult late-stage step-8 inference (`inferTypeFromDisplayIdShape`)
106
108
  * or treat the entry as unclassified (fallback to `Item`).
107
109
  */
@@ -152,6 +154,16 @@ function resolvedCoreTypeWithProvenance(entry, profile) {
152
154
  if (fromDiscriminator && mod_js_1.CORE_TYPE_HIERARCHY[fromDiscriminator]) {
153
155
  return { type: fromDiscriminator, step: 6 };
154
156
  }
157
+ // Step 6a: node kind of a `.feature` header entry (epic #915 Case B) —
158
+ // Feature and Rule are Requirements, Scenario is a Test. Applies only to
159
+ // entries built from `.feature` files; Markdown and source-file entries
160
+ // never reach it.
161
+ if (entry.source.kind === "feature-file") {
162
+ return {
163
+ type: entry.source.node === "scenario" ? "Test" : "Requirement",
164
+ step: "6a",
165
+ };
166
+ }
155
167
  return undefined;
156
168
  }
157
169
  /**
@@ -159,7 +171,7 @@ function resolvedCoreTypeWithProvenance(entry, profile) {
159
171
  * wrapper around {@linkcode resolvedCoreTypeWithProvenance} for callers
160
172
  * that don't need to know which step matched.
161
173
  *
162
- * Returns `undefined` when no step in {1..6} resolves to a known core
174
+ * Returns `undefined` when no step in {1..6a} resolves to a known core
163
175
  * type. The caller decides whether to skip validation, fall back to a
164
176
  * less specific check, or report on the unclassified state.
165
177
  */
@@ -53,6 +53,15 @@ export declare function inferTypeFromLateStageChain(entry: Entry): readonly Diag
53
53
  * is plausibly a profile type, just unreachable in core-only mode.
54
54
  */
55
55
  export declare function validateCoreTypeAttribute(entry: Entry, profile: EffectiveProfile | null): readonly Diagnostic[];
56
+ /**
57
+ * The core type of a `.feature` header entry that no profile pattern
58
+ * classifies (epic #915 Case B). It is resolved through the type resolution
59
+ * chain without the profile, so `Source:` (step 3), the display-ID prefix
60
+ * (step 4) and a discriminating attribute (step 6) win over the node kind
61
+ * (step 6a: `Test` for a Scenario, `Requirement` for a Feature or a Rule).
62
+ * `undefined` for every other entry.
63
+ */
64
+ export declare function featureFileCoreType(entry: Entry): string | undefined;
56
65
  /** Result of classifying a single entry. */
57
66
  export interface ClassifyResult {
58
67
  /** The assigned type name, or `undefined` if un-classified. */
@@ -66,6 +75,8 @@ export interface ClassifyResult {
66
75
  * 1. Explicit `Type:` trailer attribute (if present).
67
76
  * 2. Display-ID pattern match across types whose `shape` matches
68
77
  * `entry.shape`.
78
+ * 3. For a `.feature` header entry that no pattern matched, the node
79
+ * kind (step 6a, {@linkcode featureFileCoreType}).
69
80
  *
70
81
  * Emits:
71
82
  * - `MSL-T001` when explicit `Type:` value is not in the profile's type
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validator/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAEhB,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAwBzB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAWvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAiBvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CAwBvB;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAiEhB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GACxB,mBAAmB,CAkCrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validator/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAEhB,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAwBzB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAWvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAkBvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CAwBvB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAwEhB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GACxB,mBAAmB,CAkCrB"}
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.inferTypeFromDisplayIdShape = inferTypeFromDisplayIdShape;
13
13
  exports.inferTypeFromLateStageChain = inferTypeFromLateStageChain;
14
14
  exports.validateCoreTypeAttribute = validateCoreTypeAttribute;
15
+ exports.featureFileCoreType = featureFileCoreType;
15
16
  exports.classifyEntry = classifyEntry;
16
17
  exports.classifyEntriesStage = classifyEntriesStage;
17
18
  const mod_js_1 = require("../model/mod.js");
@@ -81,7 +82,8 @@ function inferTypeFromLateStageChain(entry) {
81
82
  const resolved = (0, type_resolution_js_1.resolvedCoreTypeWithProvenance)(entry);
82
83
  if (!resolved)
83
84
  return [];
84
- if (resolved.step < 5)
85
+ // Step 6a is the silent default for `.feature` header entries.
86
+ if (resolved.step === "6a" || resolved.step < 5)
85
87
  return [];
86
88
  const source = resolved.step === 5
87
89
  ? "URI scheme"
@@ -133,6 +135,19 @@ function validateCoreTypeAttribute(entry, profile) {
133
135
  location: entry.location,
134
136
  }];
135
137
  }
138
+ /**
139
+ * The core type of a `.feature` header entry that no profile pattern
140
+ * classifies (epic #915 Case B). It is resolved through the type resolution
141
+ * chain without the profile, so `Source:` (step 3), the display-ID prefix
142
+ * (step 4) and a discriminating attribute (step 6) win over the node kind
143
+ * (step 6a: `Test` for a Scenario, `Requirement` for a Feature or a Rule).
144
+ * `undefined` for every other entry.
145
+ */
146
+ function featureFileCoreType(entry) {
147
+ if (entry.source.kind !== "feature-file")
148
+ return undefined;
149
+ return (0, type_resolution_js_1.resolvedCoreTypeWithProvenance)(entry)?.type;
150
+ }
136
151
  /**
137
152
  * Classify one {@linkcode Entry} against the profile's type vocabulary.
138
153
  *
@@ -140,6 +155,8 @@ function validateCoreTypeAttribute(entry, profile) {
140
155
  * 1. Explicit `Type:` trailer attribute (if present).
141
156
  * 2. Display-ID pattern match across types whose `shape` matches
142
157
  * `entry.shape`.
158
+ * 3. For a `.feature` header entry that no pattern matched, the node
159
+ * kind (step 6a, {@linkcode featureFileCoreType}).
143
160
  *
144
161
  * Emits:
145
162
  * - `MSL-T001` when explicit `Type:` value is not in the profile's type
@@ -167,8 +184,9 @@ function classifyEntry(entry, profile) {
167
184
  // 2. Display-ID pattern match across same-shape types (Authored only).
168
185
  // Reference entries use URI scheme or explicit Type: for classification;
169
186
  // matching display-id-patterns against their slug-style IDs is incorrect.
170
- if (entry.shape !== "Authored")
171
- return { type: undefined, diagnostics };
187
+ if (entry.shape !== "Authored") {
188
+ return { type: featureFileCoreType(entry), diagnostics };
189
+ }
172
190
  const matches = [];
173
191
  for (const [typeName, typeEntry] of profile.types) {
174
192
  const pattern = typeEntry.value.displayIdPattern.value;
@@ -196,7 +214,12 @@ function classifyEntry(entry, profile) {
196
214
  });
197
215
  return { type: undefined, diagnostics };
198
216
  }
199
- // 0 matches. Strict mode → MSL-T003; permissive → OK.
217
+ // 0 matches. A `.feature` header entry falls back to step 6a (Feature and
218
+ // Rule are Requirements, Scenario is a Test) and is never un-classified.
219
+ const fromNode = featureFileCoreType(entry);
220
+ if (fromNode !== undefined)
221
+ return { type: fromNode, diagnostics };
222
+ // Strict mode → MSL-T003; permissive → OK.
200
223
  if (profile.types.size > 0) {
201
224
  diagnostics.push({
202
225
  code: "MSL-T003",
@@ -24,7 +24,7 @@
24
24
  * Upstream entries are uxil-inert (the #771 `emittableEntries` partition,
25
25
  * mirroring validateTypl). Entries are gated by `entry.type` when the
26
26
  * pipeline's Stage 2 already classified them, else by `classifyEntry` —
27
- * so the LSP path (which never runs Stage 2) gates identically; the
27
+ * so a caller that passes unclassified entries gates identically; the
28
28
  * classification diagnostics are deliberately dropped here (the pipeline
29
29
  * owns emitting those).
30
30
  */