@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.
- package/esm/ast/build.d.ts.map +1 -1
- package/esm/ast/build.js +19 -5
- package/esm/ast/equivalence.js +14 -2
- package/esm/ast/nodes.d.ts +15 -3
- package/esm/ast/nodes.d.ts.map +1 -1
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +18 -3
- package/esm/compiler/mod.d.ts +34 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +112 -48
- package/esm/compiler/schema.d.ts +3 -2
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +6 -3
- package/esm/criteria/scenarios.d.ts +55 -0
- package/esm/criteria/scenarios.d.ts.map +1 -0
- package/esm/criteria/scenarios.js +133 -0
- package/esm/discovery/mod.d.ts +20 -1
- package/esm/discovery/mod.d.ts.map +1 -1
- package/esm/discovery/mod.js +105 -17
- package/esm/formatter/entry_body.d.ts +8 -5
- package/esm/formatter/entry_body.d.ts.map +1 -1
- package/esm/formatter/entry_body.js +12 -8
- package/esm/formatter/feature_file.d.ts +40 -0
- package/esm/formatter/feature_file.d.ts.map +1 -0
- package/esm/formatter/feature_file.js +88 -0
- package/esm/formatter/mod.d.ts +21 -2
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +64 -22
- package/esm/gates/mod.d.ts +2 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +17 -2
- package/esm/gherkin/load.d.ts +35 -0
- package/esm/gherkin/load.d.ts.map +1 -0
- package/esm/gherkin/load.js +39 -0
- package/esm/gherkin/parse.d.ts +11 -0
- package/esm/gherkin/parse.d.ts.map +1 -0
- package/esm/gherkin/parse.js +311 -0
- package/esm/gherkin/position.d.ts +23 -0
- package/esm/gherkin/position.d.ts.map +1 -0
- package/esm/gherkin/position.js +21 -0
- package/esm/gherkin/procedure.d.ts +76 -0
- package/esm/gherkin/procedure.d.ts.map +1 -0
- package/esm/gherkin/procedure.js +164 -0
- package/esm/gherkin/project.d.ts +35 -0
- package/esm/gherkin/project.d.ts.map +1 -0
- package/esm/gherkin/project.js +64 -0
- package/esm/gherkin/role.d.ts +23 -0
- package/esm/gherkin/role.d.ts.map +1 -0
- package/esm/gherkin/role.js +28 -0
- package/esm/gherkin/types.d.ts +118 -0
- package/esm/gherkin/types.d.ts.map +1 -0
- package/esm/gherkin/types.js +12 -0
- package/esm/lock/acquire_compile.d.ts +12 -4
- package/esm/lock/acquire_compile.d.ts.map +1 -1
- package/esm/lock/acquire_compile.js +15 -5
- package/esm/lock/canonical_edges.d.ts +6 -2
- package/esm/lock/canonical_edges.d.ts.map +1 -1
- package/esm/lock/canonical_edges.js +10 -3
- package/esm/lock/model.d.ts +5 -0
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +2 -0
- package/esm/lock/resolve.d.ts +6 -2
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +36 -4
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +7 -1
- package/esm/mod.d.ts +23 -6
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +18 -5
- package/esm/model/mod.d.ts +42 -1
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +1 -1
- package/esm/model/relations.d.ts +9 -0
- package/esm/model/relations.d.ts.map +1 -1
- package/esm/model/relations.js +16 -1
- package/esm/parser/attributes.d.ts +82 -3
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +199 -32
- package/esm/parser/body_tokens.d.ts +1 -1
- package/esm/parser/body_tokens.d.ts.map +1 -1
- package/esm/parser/body_tokens.js +49 -35
- package/esm/parser/feature_file.d.ts +116 -0
- package/esm/parser/feature_file.d.ts.map +1 -0
- package/esm/parser/feature_file.js +540 -0
- package/esm/parser/markdown.d.ts +7 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +129 -40
- package/esm/parser/mod.d.ts +18 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +51 -0
- package/esm/parser/translate.d.ts.map +1 -1
- package/esm/parser/translate.js +5 -0
- package/esm/refs/mod.d.ts +2 -1
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +12 -4
- package/esm/refs/split.d.ts +58 -0
- package/esm/refs/split.d.ts.map +1 -0
- package/esm/refs/split.js +137 -0
- package/esm/reporter/mod.d.ts +7 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +113 -3
- package/esm/validator/attributes.d.ts.map +1 -1
- package/esm/validator/attributes.js +4 -1
- package/esm/validator/block_role.d.ts +40 -0
- package/esm/validator/block_role.d.ts.map +1 -0
- package/esm/validator/block_role.js +109 -0
- package/esm/validator/feature_ac.d.ts.map +1 -1
- package/esm/validator/feature_ac.js +6 -1
- package/esm/validator/feature_parse.d.ts +35 -0
- package/esm/validator/feature_parse.d.ts.map +1 -0
- package/esm/validator/feature_parse.js +69 -0
- package/esm/validator/locators.d.ts +36 -0
- package/esm/validator/locators.d.ts.map +1 -0
- package/esm/validator/locators.js +184 -0
- package/esm/validator/mod.d.ts +10 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +38 -14
- package/esm/validator/normalize.d.ts.map +1 -1
- package/esm/validator/normalize.js +8 -3
- package/esm/validator/per_type_attrs.d.ts +3 -3
- package/esm/validator/per_type_attrs.js +3 -3
- package/esm/validator/pipeline.d.ts +4 -12
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +24 -5
- package/esm/validator/procedure.d.ts +22 -0
- package/esm/validator/procedure.d.ts.map +1 -0
- package/esm/validator/procedure.js +58 -0
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +4 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +4 -1
- package/esm/validator/type_resolution.d.ts +5 -3
- package/esm/validator/type_resolution.d.ts.map +1 -1
- package/esm/validator/type_resolution.js +14 -2
- package/esm/validator/types.d.ts +11 -0
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +26 -4
- package/esm/validator/uxil_family.d.ts +1 -1
- package/package.json +3 -1
- package/script/ast/build.d.ts.map +1 -1
- package/script/ast/build.js +19 -5
- package/script/ast/equivalence.js +14 -2
- package/script/ast/nodes.d.ts +15 -3
- package/script/ast/nodes.d.ts.map +1 -1
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +18 -3
- package/script/compiler/mod.d.ts +34 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +110 -46
- package/script/compiler/schema.d.ts +3 -2
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +6 -3
- package/script/criteria/scenarios.d.ts +55 -0
- package/script/criteria/scenarios.d.ts.map +1 -0
- package/script/criteria/scenarios.js +139 -0
- package/script/discovery/mod.d.ts +20 -1
- package/script/discovery/mod.d.ts.map +1 -1
- package/script/discovery/mod.js +106 -17
- package/script/formatter/entry_body.d.ts +8 -5
- package/script/formatter/entry_body.d.ts.map +1 -1
- package/script/formatter/entry_body.js +12 -8
- package/script/formatter/feature_file.d.ts +40 -0
- package/script/formatter/feature_file.d.ts.map +1 -0
- package/script/formatter/feature_file.js +92 -0
- package/script/formatter/mod.d.ts +21 -2
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +63 -21
- package/script/gates/mod.d.ts +2 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +17 -2
- package/script/gherkin/load.d.ts +35 -0
- package/script/gherkin/load.d.ts.map +1 -0
- package/script/gherkin/load.js +76 -0
- package/script/gherkin/parse.d.ts +11 -0
- package/script/gherkin/parse.d.ts.map +1 -0
- package/script/gherkin/parse.js +314 -0
- package/script/gherkin/position.d.ts +23 -0
- package/script/gherkin/position.d.ts.map +1 -0
- package/script/gherkin/position.js +24 -0
- package/script/gherkin/procedure.d.ts +76 -0
- package/script/gherkin/procedure.d.ts.map +1 -0
- package/script/gherkin/procedure.js +169 -0
- package/script/gherkin/project.d.ts +35 -0
- package/script/gherkin/project.d.ts.map +1 -0
- package/script/gherkin/project.js +67 -0
- package/script/gherkin/role.d.ts +23 -0
- package/script/gherkin/role.d.ts.map +1 -0
- package/script/gherkin/role.js +31 -0
- package/script/gherkin/types.d.ts +118 -0
- package/script/gherkin/types.d.ts.map +1 -0
- package/script/gherkin/types.js +13 -0
- package/script/lock/acquire_compile.d.ts +12 -4
- package/script/lock/acquire_compile.d.ts.map +1 -1
- package/script/lock/acquire_compile.js +15 -5
- package/script/lock/canonical_edges.d.ts +6 -2
- package/script/lock/canonical_edges.d.ts.map +1 -1
- package/script/lock/canonical_edges.js +10 -3
- package/script/lock/model.d.ts +5 -0
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +2 -0
- package/script/lock/resolve.d.ts +6 -2
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +36 -4
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +7 -1
- package/script/mod.d.ts +23 -6
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +45 -6
- package/script/model/mod.d.ts +42 -1
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +2 -1
- package/script/model/relations.d.ts +9 -0
- package/script/model/relations.d.ts.map +1 -1
- package/script/model/relations.js +17 -1
- package/script/parser/attributes.d.ts +82 -3
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +205 -33
- package/script/parser/body_tokens.d.ts +1 -1
- package/script/parser/body_tokens.d.ts.map +1 -1
- package/script/parser/body_tokens.js +49 -35
- package/script/parser/feature_file.d.ts +116 -0
- package/script/parser/feature_file.d.ts.map +1 -0
- package/script/parser/feature_file.js +548 -0
- package/script/parser/markdown.d.ts +7 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +128 -39
- package/script/parser/mod.d.ts +18 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +52 -1
- package/script/parser/translate.d.ts.map +1 -1
- package/script/parser/translate.js +5 -0
- package/script/refs/mod.d.ts +2 -1
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +12 -4
- package/script/refs/split.d.ts +58 -0
- package/script/refs/split.d.ts.map +1 -0
- package/script/refs/split.js +145 -0
- package/script/reporter/mod.d.ts +7 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +113 -3
- package/script/validator/attributes.d.ts.map +1 -1
- package/script/validator/attributes.js +4 -1
- package/script/validator/block_role.d.ts +40 -0
- package/script/validator/block_role.d.ts.map +1 -0
- package/script/validator/block_role.js +112 -0
- package/script/validator/feature_ac.d.ts.map +1 -1
- package/script/validator/feature_ac.js +6 -1
- package/script/validator/feature_parse.d.ts +35 -0
- package/script/validator/feature_parse.d.ts.map +1 -0
- package/script/validator/feature_parse.js +73 -0
- package/script/validator/locators.d.ts +36 -0
- package/script/validator/locators.d.ts.map +1 -0
- package/script/validator/locators.js +188 -0
- package/script/validator/mod.d.ts +10 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +38 -14
- package/script/validator/normalize.d.ts.map +1 -1
- package/script/validator/normalize.js +8 -3
- package/script/validator/per_type_attrs.d.ts +3 -3
- package/script/validator/per_type_attrs.js +3 -3
- package/script/validator/pipeline.d.ts +4 -12
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +23 -5
- package/script/validator/procedure.d.ts +22 -0
- package/script/validator/procedure.d.ts.map +1 -0
- package/script/validator/procedure.js +61 -0
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +4 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +4 -1
- package/script/validator/type_resolution.d.ts +5 -3
- package/script/validator/type_resolution.d.ts.map +1 -1
- package/script/validator/type_resolution.js +14 -2
- package/script/validator/types.d.ts +11 -0
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +27 -4
- 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
|
|
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
|
|
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
|
|
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;
|
|
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
|
-
|
|
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..
|
|
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..
|
|
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
|
|
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..
|
|
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..
|
|
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,
|
|
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
|
-
|
|
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:
|
|
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.
|
|
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
|
|
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
|
*/
|