@driftsys/markspec 0.12.0 → 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/config/markspec.d.ts +2 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +47 -5
- 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/discovery/projects.d.ts +6 -4
- package/esm/discovery/projects.d.ts.map +1 -1
- package/esm/discovery/projects.js +27 -17
- package/esm/formatter/entry_body.d.ts +13 -12
- package/esm/formatter/entry_body.d.ts.map +1 -1
- package/esm/formatter/entry_body.js +25 -17
- 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/md_equiv.d.ts +6 -5
- package/esm/formatter/md_equiv.d.ts.map +1 -1
- package/esm/formatter/md_equiv.js +6 -5
- package/esm/formatter/mod.d.ts +25 -3
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +267 -27
- package/esm/formatter/tab_markers.d.ts +15 -0
- package/esm/formatter/tab_markers.d.ts.map +1 -0
- package/esm/formatter/tab_markers.js +133 -0
- package/esm/gates/mod.d.ts +2 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +18 -3
- 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/lock/upstream_deps.js +1 -1
- package/esm/mod.d.ts +24 -6
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +19 -5
- package/esm/model/mod.d.ts +43 -2
- 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 +8 -3
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +20 -7
- 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/sync/mapping.d.ts +4 -3
- package/esm/sync/mapping.d.ts.map +1 -1
- package/esm/sync/mapping.js +52 -9
- package/esm/util/display_id.d.ts +20 -0
- package/esm/util/display_id.d.ts.map +1 -0
- package/esm/util/display_id.js +19 -0
- 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 +10 -16
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +37 -16
- 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/config/markspec.d.ts +2 -2
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +47 -5
- 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/discovery/projects.d.ts +6 -4
- package/script/discovery/projects.d.ts.map +1 -1
- package/script/discovery/projects.js +27 -17
- package/script/formatter/entry_body.d.ts +13 -12
- package/script/formatter/entry_body.d.ts.map +1 -1
- package/script/formatter/entry_body.js +25 -17
- 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/md_equiv.d.ts +6 -5
- package/script/formatter/md_equiv.d.ts.map +1 -1
- package/script/formatter/md_equiv.js +6 -5
- package/script/formatter/mod.d.ts +25 -3
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +266 -26
- package/script/formatter/tab_markers.d.ts +15 -0
- package/script/formatter/tab_markers.d.ts.map +1 -0
- package/script/formatter/tab_markers.js +141 -0
- package/script/gates/mod.d.ts +2 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +18 -3
- 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/lock/upstream_deps.js +1 -1
- package/script/mod.d.ts +24 -6
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +48 -6
- package/script/model/mod.d.ts +43 -2
- 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 +8 -3
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +20 -7
- 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/sync/mapping.d.ts +4 -3
- package/script/sync/mapping.d.ts.map +1 -1
- package/script/sync/mapping.js +52 -9
- package/script/util/display_id.d.ts +20 -0
- package/script/util/display_id.d.ts.map +1 -0
- package/script/util/display_id.js +22 -0
- 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 +10 -16
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +36 -16
- 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
package/esm/ast/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ast/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAKV,IAAI,EAKL,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/ast/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAKV,IAAI,EAKL,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAGV,SAAS,EAeV,MAAM,YAAY,CAAC;AAwCpB;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE;IACH,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,GAAG,SAAS,GACZ,MAAM,CAgCR;AAkdD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GACX;IAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAkBrC"}
|
package/esm/ast/build.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { processor } from "../parser/remark.js";
|
|
11
11
|
import { normalizeLineEndings } from "../util/line_endings.js";
|
|
12
|
+
import { loadedGherkin } from "../gherkin/load.js";
|
|
13
|
+
import { parseFeature } from "../gherkin/parse.js";
|
|
12
14
|
/**
|
|
13
15
|
* Build an InlineContent from verbatim source prose.
|
|
14
16
|
* `storedText` is the verbatim source prose that `render` emits (§5.1
|
|
@@ -386,11 +388,23 @@ function mapMdastNode(node, body) {
|
|
|
386
388
|
case "code": {
|
|
387
389
|
const lang = node.lang ?? undefined; // empty string → undefined
|
|
388
390
|
if (lang === "gherkin" || lang === "feature") {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
range
|
|
393
|
-
|
|
391
|
+
const source = node.value ?? "";
|
|
392
|
+
const api = loadedGherkin();
|
|
393
|
+
if (!api)
|
|
394
|
+
return { kind: "feature", source, range };
|
|
395
|
+
const parsed = parseFeature(api, source);
|
|
396
|
+
return parsed.ok
|
|
397
|
+
? { kind: "feature", source, feature: parsed.feature, range }
|
|
398
|
+
: {
|
|
399
|
+
kind: "feature",
|
|
400
|
+
source,
|
|
401
|
+
parseError: {
|
|
402
|
+
line: parsed.line,
|
|
403
|
+
column: parsed.column,
|
|
404
|
+
message: parsed.message,
|
|
405
|
+
},
|
|
406
|
+
range,
|
|
407
|
+
};
|
|
394
408
|
}
|
|
395
409
|
return {
|
|
396
410
|
kind: "code",
|
package/esm/ast/equivalence.js
CHANGED
|
@@ -38,8 +38,8 @@ function deepEqualIgnoringRanges(a, b) {
|
|
|
38
38
|
if (typeof a === "object" && typeof b === "object") {
|
|
39
39
|
const ao = a;
|
|
40
40
|
const bo = b;
|
|
41
|
-
const ak =
|
|
42
|
-
const bk =
|
|
41
|
+
const ak = comparedKeys(ao);
|
|
42
|
+
const bk = comparedKeys(bo);
|
|
43
43
|
if (ak.length !== bk.length)
|
|
44
44
|
return false;
|
|
45
45
|
for (let i = 0; i < ak.length; i++) {
|
|
@@ -54,3 +54,15 @@ function deepEqualIgnoringRanges(a, b) {
|
|
|
54
54
|
}
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Keys compared for one object: every key except `range`. A `FeatureNode`
|
|
59
|
+
* also skips `feature` and `parseError`: both are pure functions of
|
|
60
|
+
* `source`, which is compared, and they exist only while the Gherkin parser
|
|
61
|
+
* is loaded. Comparing them would make equivalence depend on load timing.
|
|
62
|
+
*/
|
|
63
|
+
function comparedKeys(node) {
|
|
64
|
+
const derived = node.kind === "feature";
|
|
65
|
+
return Object.keys(node)
|
|
66
|
+
.filter((k) => k !== "range" && !(derived && (k === "feature" || k === "parseError")))
|
|
67
|
+
.sort();
|
|
68
|
+
}
|
package/esm/ast/nodes.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* see `core/parser/body_tokens.ts`. `InlineContent` now carries only
|
|
15
15
|
* verbatim source text.
|
|
16
16
|
*/
|
|
17
|
+
import type { FeatureAst } from "../gherkin/types.js";
|
|
17
18
|
/** Body-relative source span. 1-based line/column, matching the
|
|
18
19
|
* codebase's {@link SourceLocation} convention. No `file`: that
|
|
19
20
|
* lives on the owning {@link Entry}. */
|
|
@@ -113,12 +114,23 @@ export interface CodeNode {
|
|
|
113
114
|
readonly text: string;
|
|
114
115
|
readonly range: SourceRange;
|
|
115
116
|
}
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
117
|
+
/**
|
|
118
|
+
* Fenced code with info-string `gherkin` or `feature`. `source` is the
|
|
119
|
+
* authored text, kept verbatim. When the Gherkin parser is loaded, exactly
|
|
120
|
+
* one of `feature` (the normalized AST) and `parseError` is set; when it is
|
|
121
|
+
* not loaded, neither is set. Both are pure functions of `source`.
|
|
122
|
+
*/
|
|
119
123
|
export interface FeatureNode {
|
|
120
124
|
readonly kind: "feature";
|
|
121
125
|
readonly source: string;
|
|
126
|
+
/** Normalized AST of the block; ranges are relative to `source`. */
|
|
127
|
+
readonly feature?: FeatureAst;
|
|
128
|
+
/** First parser error; line 1 is the first line of `source`. */
|
|
129
|
+
readonly parseError?: {
|
|
130
|
+
readonly line: number;
|
|
131
|
+
readonly column: number;
|
|
132
|
+
readonly message: string;
|
|
133
|
+
};
|
|
122
134
|
readonly range: SourceRange;
|
|
123
135
|
}
|
|
124
136
|
/** `$$ … $$` math block (spec §2.4). */
|
package/esm/ast/nodes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../src/ast/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;wCAEwC;AACxC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;CACpC;AAED,wDAAwD;AACxD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,KAAK,GACL,WAAW,GACX,SAAS,GACT,SAAS,CAAC;AAEd,wCAAwC;AACxC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,I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AC;CAC7B;AAED;;sDAEsD;AACtD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,UAAU,GACV,MAAM,CAAC;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED;qEACqE;AACrE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,gBAAgB,GAAG,MAAM,CAAC;IACzD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,uEAAuE;AACvE,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,QAAQ,GACR,SAAS,GACT,UAAU,GACV,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,kBAAkB,GAClB,QAAQ,GACR,cAAc,GACd,WAAW,GACX,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverses.d.ts","sourceRoot":"","sources":["../../src/compiler/inverses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,KAAK,EAEL,IAAI,EACL,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"inverses.d.ts","sourceRoot":"","sources":["../../src/compiler/inverses.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,KAAK,EAEL,IAAI,EACL,MAAM,iBAAiB,CAAC;AAIzB,oCAAoC;AACpC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAcD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GACxB,sBAAsB,CAgKxB"}
|
package/esm/compiler/inverses.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* entries.
|
|
7
7
|
*/
|
|
8
8
|
import { ATTR_TO_LINK_KIND } from "./constants.js";
|
|
9
|
+
import { parseTraceValue } from "../refs/split.js";
|
|
9
10
|
/**
|
|
10
11
|
* Generate inverse (back-link) attributes from forward link declarations.
|
|
11
12
|
*
|
|
@@ -32,6 +33,8 @@ export function generateInverses(entries, profile) {
|
|
|
32
33
|
// Step 3–5: Walk entries, accumulate back-links
|
|
33
34
|
// Map: targetId → Map<inverseAttrName, Set<sourceId>>
|
|
34
35
|
const generated = new Map();
|
|
36
|
+
/** Keys of the generated edges already emitted. */
|
|
37
|
+
const edgeKeys = new Set();
|
|
35
38
|
// Parallel list of raw generated-edge data for Link emission.
|
|
36
39
|
const generatedEdges = [];
|
|
37
40
|
for (const source of entries) {
|
|
@@ -42,7 +45,13 @@ export function generateInverses(entries, profile) {
|
|
|
42
45
|
const forwardValues = source.typedAttributes.get(spec.attrName);
|
|
43
46
|
if (!forwardValues)
|
|
44
47
|
continue;
|
|
45
|
-
for (const
|
|
48
|
+
for (const forwardValue of forwardValues) {
|
|
49
|
+
// A value may carry a locator (`<ULID> [Scenario name]`); the
|
|
50
|
+
// target is the part before it and the locator is copied to the
|
|
51
|
+
// generated link.
|
|
52
|
+
const parsed = parseTraceValue(forwardValue);
|
|
53
|
+
const locator = parsed.locator;
|
|
54
|
+
const targetId = parsed.target;
|
|
46
55
|
const target = byId.get(targetId);
|
|
47
56
|
if (!target || target.type !== spec.inverse.category)
|
|
48
57
|
continue;
|
|
@@ -56,13 +65,18 @@ export function generateInverses(entries, profile) {
|
|
|
56
65
|
idSet = new Set();
|
|
57
66
|
targetMap.set(spec.inverse.name, idSet);
|
|
58
67
|
}
|
|
59
|
-
const wasNew = !idSet.has(source.id);
|
|
60
68
|
idSet.add(source.id);
|
|
69
|
+
// One generated edge per (target, inverse, source, locator): two
|
|
70
|
+
// locators from one source keep two edges.
|
|
71
|
+
const edgeKey = `${targetId}\u0000${spec.inverse.name}\u0000${source.id}\u0000${locator === undefined ? "-" : `+${locator}`}`;
|
|
72
|
+
const wasNew = !edgeKeys.has(edgeKey);
|
|
73
|
+
edgeKeys.add(edgeKey);
|
|
61
74
|
if (wasNew) {
|
|
62
75
|
generatedEdges.push({
|
|
63
76
|
targetUlid: targetId,
|
|
64
77
|
sourceUlid: source.id,
|
|
65
78
|
attrName: spec.attrName,
|
|
79
|
+
...(locator !== undefined ? { locator } : {}),
|
|
66
80
|
});
|
|
67
81
|
}
|
|
68
82
|
}
|
|
@@ -115,7 +129,7 @@ export function generateInverses(entries, profile) {
|
|
|
115
129
|
}
|
|
116
130
|
// Resolve generated edges to displayId-based Link objects.
|
|
117
131
|
const links = [];
|
|
118
|
-
for (const { targetUlid, sourceUlid, attrName } of generatedEdges) {
|
|
132
|
+
for (const { targetUlid, sourceUlid, attrName, locator } of generatedEdges) {
|
|
119
133
|
const kind = ATTR_TO_LINK_KIND[attrName];
|
|
120
134
|
if (!kind)
|
|
121
135
|
continue;
|
|
@@ -129,6 +143,7 @@ export function generateInverses(entries, profile) {
|
|
|
129
143
|
kind,
|
|
130
144
|
location: source.location,
|
|
131
145
|
origin: "generated",
|
|
146
|
+
...(locator !== undefined ? { locator } : {}),
|
|
132
147
|
});
|
|
133
148
|
}
|
|
134
149
|
return { entries: result, links, diagnostics };
|
package/esm/compiler/mod.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Compiler pipeline. Takes file paths, parses all entries, validates them,
|
|
5
5
|
* builds a bidirectional traceability graph, and returns the compiled model.
|
|
6
6
|
*/
|
|
7
|
-
import type { Diagnostic, DisplayId, Document, EffectiveProfile, Entry, Link } from "../model/mod.js";
|
|
7
|
+
import type { CaptionConventions, Diagnostic, DisplayId, Document, EffectiveProfile, Entry, Link } from "../model/mod.js";
|
|
8
8
|
import { type TypeRegistry } from "../typl/mod.js";
|
|
9
9
|
/** Options for {@linkcode compile}. */
|
|
10
10
|
export interface CompileOptions {
|
|
@@ -50,6 +50,31 @@ export interface CompileOptions {
|
|
|
50
50
|
* deterministically. Optional — absent means no corpus.
|
|
51
51
|
*/
|
|
52
52
|
readonly corpusEntries?: readonly Entry[];
|
|
53
|
+
/**
|
|
54
|
+
* Caption-position conventions from `.markspec.yaml`
|
|
55
|
+
* (`ToolConfig.captionConventions`), passed to the validator pipeline
|
|
56
|
+
* for MSL-C072. Optional — absent means the rule is inactive.
|
|
57
|
+
*/
|
|
58
|
+
readonly captionConventions?: CaptionConventions;
|
|
59
|
+
/**
|
|
60
|
+
* Upstream ids declared in `project.yaml` `dependencies:` and
|
|
61
|
+
* `references:` (derived with `deriveUpstreamId`). Passed to the
|
|
62
|
+
* validator pipeline so a trace target that stays unresolved is
|
|
63
|
+
* reported as MSL-T014 instead of MSL-L006. Optional — absent means
|
|
64
|
+
* MSL-L006 is unchanged.
|
|
65
|
+
*/
|
|
66
|
+
readonly declaredUpstreamIds?: readonly string[];
|
|
67
|
+
/**
|
|
68
|
+
* Scope of the validator pipeline. Defaults to `true`: the compiled path
|
|
69
|
+
* set is the whole project, so MSL-L006 and MSL-T014 are reported. Pass
|
|
70
|
+
* `false` when the paths are one file or a subset (`insert <file>`,
|
|
71
|
+
* `doc build <file>`, `lint <file>`): a target in a file outside the set
|
|
72
|
+
* cannot be told from a typo, so the project-wide trace and DSL codes are
|
|
73
|
+
* suppressed, as in `check <file>` (ADR-027). `false` also suppresses the
|
|
74
|
+
* cross-entry DSL codes TYPL-009, TYPL-010, TYPL-011, UXIL-016, UXIL-017
|
|
75
|
+
* and UXIL-018 for the same reason.
|
|
76
|
+
*/
|
|
77
|
+
readonly projectWide?: boolean;
|
|
53
78
|
}
|
|
54
79
|
/** Compiled project output with resolved traceability graph. */
|
|
55
80
|
export interface CompileResult {
|
|
@@ -75,6 +100,14 @@ export interface CompileResult {
|
|
|
75
100
|
* Compile MarkSpec files from the given paths into a resolved
|
|
76
101
|
* traceability graph.
|
|
77
102
|
*
|
|
103
|
+
* The returned diagnostics combine parse diagnostics, the validator
|
|
104
|
+
* pipeline's diagnostics, inverse-generation diagnostics and MSL-T013. The
|
|
105
|
+
* pipeline call is the same `runPipeline` call that bare `markspec check`
|
|
106
|
+
* and the LSP make, with project-wide scope by default
|
|
107
|
+
* (`options.projectWide`), so MSL-L006 and the other traceability rules are
|
|
108
|
+
* included. The diagnostics do not include fmt drift, lockfile drift or prose
|
|
109
|
+
* lint.
|
|
110
|
+
*
|
|
78
111
|
* @param paths - File paths to compile
|
|
79
112
|
* @param options - Compile options
|
|
80
113
|
* @returns Compiled entries, links, and diagnostics
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/compiler/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,IAAI,EAEL,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/compiler/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,IAAI,EAEL,MAAM,iB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D,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAC1D,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAC1D,4GAA4G;IAC5G,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClD,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACrC;AA4BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAyMxB;AAmID,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC"}
|
package/esm/compiler/mod.js
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Compiler pipeline. Takes file paths, parses all entries, validates them,
|
|
5
5
|
* builds a bidirectional traceability graph, and returns the compiled model.
|
|
6
6
|
*/
|
|
7
|
-
import { makeDisplayId } from "../model/mod.js";
|
|
7
|
+
import { isUpstreamEntry, makeDisplayId, relationLocatorMode, } from "../model/mod.js";
|
|
8
|
+
import { buildCriteria, isCriteriaBearing } from "../criteria/scenarios.js";
|
|
9
|
+
import { parseTraceValue, splitTraceValues } from "../refs/split.js";
|
|
8
10
|
import { parseFile } from "../parser/mod.js";
|
|
9
|
-
import { applyCorpusPostPass, classifyEntriesStage,
|
|
10
|
-
import { validateUxilFamily } from "../validator/uxil_family.js";
|
|
11
|
+
import { applyCorpusPostPass, classifyEntriesStage, runPipeline, } from "../validator/mod.js";
|
|
11
12
|
import { buildTypeRegistry } from "../typl/mod.js";
|
|
12
13
|
import { buildEffectiveDisciplineRegistry } from "../profile/discipline_registry.js";
|
|
13
14
|
import { ATTR_TO_LINK_KIND } from "./constants.js";
|
|
@@ -41,7 +42,9 @@ function resolveGit(raw, withContributors) {
|
|
|
41
42
|
* Project `Entry.source` onto `EntryProperties.source`. Always returns a
|
|
42
43
|
* non-empty object — every entry has a known source category. Markdown
|
|
43
44
|
* entries get `{ type: "markdown" }`; doc-comment entries get the full
|
|
44
|
-
* code-source fan-out (adapter, language, function, rule)
|
|
45
|
+
* code-source fan-out (adapter, language, function, rule); `.feature`
|
|
46
|
+
* header entries get `{ type: "feature-file", adapter: "gherkin", rule }`
|
|
47
|
+
* where `rule` is the Gherkin node kind.
|
|
45
48
|
*/
|
|
46
49
|
function resolveSource(source) {
|
|
47
50
|
if (source.kind === "markdown") {
|
|
@@ -56,7 +59,11 @@ function resolveSource(source) {
|
|
|
56
59
|
rule: source.rule,
|
|
57
60
|
};
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
if (source.kind === "feature-file") {
|
|
63
|
+
// The Gherkin node the header stands above is the extractor rule.
|
|
64
|
+
return { type: "feature-file", adapter: "gherkin", rule: source.node };
|
|
65
|
+
}
|
|
66
|
+
// Exhaustiveness check — adding a fourth EntrySource variant becomes a
|
|
60
67
|
// compile-time error here, forcing a deliberate decision about its
|
|
61
68
|
// properties.source projection rather than silently inheriting the
|
|
62
69
|
// tree-sitter branch's defaults.
|
|
@@ -105,6 +112,14 @@ class Semaphore {
|
|
|
105
112
|
* Compile MarkSpec files from the given paths into a resolved
|
|
106
113
|
* traceability graph.
|
|
107
114
|
*
|
|
115
|
+
* The returned diagnostics combine parse diagnostics, the validator
|
|
116
|
+
* pipeline's diagnostics, inverse-generation diagnostics and MSL-T013. The
|
|
117
|
+
* pipeline call is the same `runPipeline` call that bare `markspec check`
|
|
118
|
+
* and the LSP make, with project-wide scope by default
|
|
119
|
+
* (`options.projectWide`), so MSL-L006 and the other traceability rules are
|
|
120
|
+
* included. The diagnostics do not include fmt drift, lockfile drift or prose
|
|
121
|
+
* lint.
|
|
122
|
+
*
|
|
108
123
|
* @param paths - File paths to compile
|
|
109
124
|
* @param options - Compile options
|
|
110
125
|
* @returns Compiled entries, links, and diagnostics
|
|
@@ -177,26 +192,26 @@ export async function compile(paths, options) {
|
|
|
177
192
|
if (res.document)
|
|
178
193
|
documents.set(res.filePath, res.document);
|
|
179
194
|
}
|
|
180
|
-
// Phase 2: Validate all entries
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
//
|
|
195
|
+
// Phase 2: Validate all entries with the same validator pipeline that
|
|
196
|
+
// bare `markspec check` and the LSP run (`runPipeline`): core hygiene,
|
|
197
|
+
// classification, typed attributes, traceability (MSL-L006, MSL-T014),
|
|
198
|
+
// Gherkin checks and the uxil family. By default the requested path set is
|
|
199
|
+
// the whole project, so project-wide scope applies (`options.projectWide`).
|
|
200
|
+
// Only the pipeline's diagnostics are used. The graph below is built from
|
|
201
|
+
// compile's own classification, so the compiled graph does not depend on
|
|
202
|
+
// the pipeline. CLI-only gates (fmt drift, lock drift, prose lint) are
|
|
203
|
+
// not part of compile.
|
|
204
|
+
const pipelineDiagnostics = runPipeline(allEntries, options.profile ?? null, options.captionConventions ?? {}, {
|
|
205
|
+
projectWide: options.projectWide ?? true,
|
|
206
|
+
declaredUpstreamIds: options.declaredUpstreamIds ?? [],
|
|
207
|
+
}).diagnostics;
|
|
208
|
+
// Phase 2.5: Classify entries when a profile is loaded. The
|
|
209
|
+
// classification diagnostics are already part of the pipeline result.
|
|
187
210
|
let classifiedEntries = allEntries;
|
|
188
211
|
if (options.profile) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
parseDiagnostics.push(...stage2.diagnostics);
|
|
212
|
+
classifiedEntries = classifyEntriesStage(allEntries, options.profile)
|
|
213
|
+
.entries;
|
|
192
214
|
}
|
|
193
|
-
// Phase 2.6: uxil diagnostics family (S9 #727) — profile-gated (inert
|
|
194
|
-
// without a `declares: ux-surface` designation), mirroring runPipeline's
|
|
195
|
-
// Stage 5 so compile-backed surfaces (CLI compile/export/show, the MCP
|
|
196
|
-
// server) agree with `check` and the LSP on designated corpora. No
|
|
197
|
-
// file-local filter here: the requested path set IS the corpus being
|
|
198
|
-
// compiled — the same full-set semantics MSL-L006 assumes in compile.
|
|
199
|
-
const uxilDiagnostics = validateUxilFamily(classifiedEntries, options.profile ?? null);
|
|
200
215
|
// Phase 3: Build traceability graph.
|
|
201
216
|
// Keep first occurrence of each display ID (validator catches duplicates).
|
|
202
217
|
const entries = new Map();
|
|
@@ -234,22 +249,25 @@ export async function compile(paths, options) {
|
|
|
234
249
|
entries.set(entry.displayId, entry);
|
|
235
250
|
}
|
|
236
251
|
}
|
|
252
|
+
// Phase 4.5: Attach criteria (scenario names of fenced feature blocks)
|
|
253
|
+
// to Requirement and Contract entries, then resolve link locators
|
|
254
|
+
// against them (epic #915).
|
|
255
|
+
attachCriteria(entries, options.profile);
|
|
237
256
|
const authoredLinks = extractLinks([...entries.values()]);
|
|
238
|
-
const links = [...authoredLinks, ...generatedLinks];
|
|
257
|
+
const links = resolveLocators([...authoredLinks, ...generatedLinks], entries, options.profile);
|
|
239
258
|
// MSL-T013: check link targets for draft/retired state.
|
|
240
259
|
const linkTargetDiags = checkLinkTargets(entries, links);
|
|
241
260
|
const forward = buildAdjacency(links, (l) => l.from);
|
|
242
261
|
const reverse = buildAdjacency(links, (l) => l.to);
|
|
243
|
-
// Build the corpus typl registry directly —
|
|
262
|
+
// Build the corpus typl registry directly — the pipeline (called above)
|
|
244
263
|
// already ran the full validateTypl pass (citation resolution, TYPL-009,
|
|
245
|
-
// etc.) for
|
|
246
|
-
//
|
|
247
|
-
//
|
|
264
|
+
// etc.) for its diagnostics; re-running it here just to get `.registry`
|
|
265
|
+
// would redo that work a second time per compile/show/context/report/
|
|
266
|
+
// export/MCP call.
|
|
248
267
|
const typeRegistry = buildTypeRegistry([...entries.values()]);
|
|
249
268
|
let diagnostics = [
|
|
250
269
|
...parseDiagnostics,
|
|
251
|
-
...
|
|
252
|
-
...uxilDiagnostics,
|
|
270
|
+
...pipelineDiagnostics,
|
|
253
271
|
...linkTargetDiags,
|
|
254
272
|
];
|
|
255
273
|
// Phase 5: Corpus-aware diagnostic post-pass (ADR-030). A project entry
|
|
@@ -285,35 +303,81 @@ function extractLinks(entries) {
|
|
|
285
303
|
}
|
|
286
304
|
/**
|
|
287
305
|
* Attributes whose value is `slug + optional free-text locator` per
|
|
288
|
-
* ADR-002 §2.6 (citation type + legacy Derived-from tolerance).
|
|
289
|
-
* target is the leading non-whitespace token
|
|
306
|
+
* ADR-002 §2.6 (citation type + legacy Derived-from tolerance). Without a
|
|
307
|
+
* bracket locator, the link target is the leading non-whitespace token.
|
|
290
308
|
*/
|
|
291
|
-
const
|
|
309
|
+
const LEADING_TOKEN_ATTRS = new Set([
|
|
292
310
|
"Derived-from",
|
|
293
311
|
"References",
|
|
294
312
|
]);
|
|
295
|
-
/**
|
|
313
|
+
/** The link target of one comma-separated part without a locator, as
|
|
314
|
+
* before scenario locators: the leading token for
|
|
315
|
+
* {@linkcode LEADING_TOKEN_ATTRS}, else the whole trimmed part. */
|
|
316
|
+
function plainTarget(key, part) {
|
|
317
|
+
const trimmed = part.trim();
|
|
318
|
+
return LEADING_TOKEN_ATTRS.has(key) ? trimmed.split(/\s/)[0] : trimmed;
|
|
319
|
+
}
|
|
320
|
+
/** Map an attribute key+value to zero or more links. The value is split
|
|
321
|
+
* with {@linkcode splitTraceValues}. A part with a bracket locator
|
|
322
|
+
* (`A [x]`) yields a link to `A` that keeps the normalized locator. Any
|
|
323
|
+
* other part is read as before scenario locators existed
|
|
324
|
+
* ({@linkcode plainTarget}). */
|
|
296
325
|
function extractLinksFromAttribute(from, key, value, location) {
|
|
297
326
|
const kind = ATTR_TO_LINK_KIND[key];
|
|
298
327
|
if (!kind)
|
|
299
328
|
return [];
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
329
|
+
return splitTraceValues(value).map((part) => {
|
|
330
|
+
const { target, locator } = parseTraceValue(part);
|
|
331
|
+
if (locator !== undefined) {
|
|
332
|
+
return { from, to: makeDisplayId(target), kind, location, locator };
|
|
333
|
+
}
|
|
334
|
+
return { from, to: makeDisplayId(plainTarget(key, part)), kind, location };
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
/** Attach `criteria` to every criteria-bearing, non-upstream entry that
|
|
338
|
+
* has at least one scenario. Entries without scenarios are left unchanged, so compiled
|
|
339
|
+
* output for projects without feature blocks does not change. */
|
|
340
|
+
function attachCriteria(entries, profile) {
|
|
341
|
+
for (const [id, entry] of entries) {
|
|
342
|
+
// Upstream (federated) entries are read-only references: no criteria.
|
|
343
|
+
if (isUpstreamEntry(entry))
|
|
344
|
+
continue;
|
|
345
|
+
if (!isCriteriaBearing(entry, profile))
|
|
346
|
+
continue;
|
|
347
|
+
const criteria = buildCriteria(entry);
|
|
348
|
+
if (criteria.length > 0)
|
|
349
|
+
entries.set(id, { ...entry, criteria });
|
|
309
350
|
}
|
|
310
|
-
// Comma-separated targets for id-list attributes.
|
|
311
|
-
return value
|
|
312
|
-
.split(",")
|
|
313
|
-
.map((s) => s.trim())
|
|
314
|
-
.filter((s) => s.length > 0)
|
|
315
|
-
.map((to) => ({ from, to: makeDisplayId(to), kind, location }));
|
|
316
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* Set `locatorResolved` on every link whose locator is on a `"criterion"`
|
|
354
|
+
* relation and whose target resolves to a criteria-bearing entry. For a
|
|
355
|
+
* generated inverse the target of the authored relation is `link.from`.
|
|
356
|
+
*/
|
|
357
|
+
function resolveLocators(links, entries, profile) {
|
|
358
|
+
// A target may be written as a display ID or as a ULID.
|
|
359
|
+
const byUlid = new Map();
|
|
360
|
+
for (const e of entries.values())
|
|
361
|
+
if (e.id)
|
|
362
|
+
byUlid.set(e.id, e);
|
|
363
|
+
return links.map((link) => {
|
|
364
|
+
if (link.locator === undefined)
|
|
365
|
+
return link;
|
|
366
|
+
if (relationLocatorMode(LINK_KIND_TO_ATTR[link.kind]) !== "criterion") {
|
|
367
|
+
return link;
|
|
368
|
+
}
|
|
369
|
+
const targetId = link.origin === "generated" ? link.from : link.to;
|
|
370
|
+
const target = entries.get(targetId) ?? byUlid.get(targetId);
|
|
371
|
+
if (!target || !isCriteriaBearing(target, profile))
|
|
372
|
+
return link;
|
|
373
|
+
const resolved = (target.criteria ?? []).some((c) => c.addressable && c.name === link.locator);
|
|
374
|
+
return { ...link, locatorResolved: resolved };
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
/** Reverse of {@linkcode ATTR_TO_LINK_KIND}: each link kind has one
|
|
378
|
+
* attribute. */
|
|
379
|
+
const LINK_KIND_TO_ATTR = Object
|
|
380
|
+
.fromEntries(Object.entries(ATTR_TO_LINK_KIND).map(([attr, kind]) => [kind, attr]));
|
|
317
381
|
/** Build an adjacency map from links using a key selector. */
|
|
318
382
|
function buildAdjacency(links, keyFn) {
|
|
319
383
|
const map = new Map();
|
package/esm/compiler/schema.d.ts
CHANGED
|
@@ -70,8 +70,9 @@ export declare function serializeCompileResult(result: CompileResult): Serialize
|
|
|
70
70
|
/**
|
|
71
71
|
* Convert an {@linkcode Entry} to a JSON-safe {@linkcode SerializedEntry} by
|
|
72
72
|
* replacing `typedAttributes` (a `ReadonlyMap`) with a plain
|
|
73
|
-
* `Record<string, readonly string[]>`,
|
|
74
|
-
* (privacy rule — never publish connector state)
|
|
73
|
+
* `Record<string, readonly string[]>`, stripping `properties.sync`
|
|
74
|
+
* (privacy rule — never publish connector state), and dropping
|
|
75
|
+
* `attributeLines` (a parser aid for diagnostic locations).
|
|
75
76
|
*/
|
|
76
77
|
export declare function serializeEntry(entry: Entry): SerializedEntry;
|
|
77
78
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compiler/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,EAAE,iBAAiB,CAAC,GAAG;IAC7D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;IAC9D,sCAAsC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,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,EAAE,SAAS,eAAe,EAAE,CAAC,CAAC;CAC/D;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAClD,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAClD,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;IAClD,+CAA+C;IAC/C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,sCAAsC;IACtC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;CAC/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,GACpB,uBAAuB,CAazB;AAgBD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CA8B5D"}
|
package/esm/compiler/schema.js
CHANGED
|
@@ -42,8 +42,9 @@ function serializeTypeRegistry(registry) {
|
|
|
42
42
|
/**
|
|
43
43
|
* Convert an {@linkcode Entry} to a JSON-safe {@linkcode SerializedEntry} by
|
|
44
44
|
* replacing `typedAttributes` (a `ReadonlyMap`) with a plain
|
|
45
|
-
* `Record<string, readonly string[]>`,
|
|
46
|
-
* (privacy rule — never publish connector state)
|
|
45
|
+
* `Record<string, readonly string[]>`, stripping `properties.sync`
|
|
46
|
+
* (privacy rule — never publish connector state), and dropping
|
|
47
|
+
* `attributeLines` (a parser aid for diagnostic locations).
|
|
47
48
|
*/
|
|
48
49
|
export function serializeEntry(entry) {
|
|
49
50
|
// Replace the ReadonlyMap with a plain Record when populated; omit when empty
|
|
@@ -62,7 +63,9 @@ export function serializeEntry(entry) {
|
|
|
62
63
|
// from a delivered corpus, matching the serialized-field-presence
|
|
63
64
|
// contract. Object rest destructuring drops the named key regardless
|
|
64
65
|
// of its value, unlike `...entry` alone.
|
|
65
|
-
|
|
66
|
+
// `attributeLines` is a parser aid for diagnostic locations, not part
|
|
67
|
+
// of the compiled schema.
|
|
68
|
+
const { origin, attributeLines: _attributeLines, ...rest } = entry;
|
|
66
69
|
return {
|
|
67
70
|
...rest,
|
|
68
71
|
typedAttributes,
|
package/esm/config/markspec.d.ts
CHANGED
|
@@ -50,12 +50,12 @@ export interface MarkspecYaml {
|
|
|
50
50
|
* Applied after built-in build-output skips and all `.gitignore` rules at
|
|
51
51
|
* every directory level by `core/discovery`. Negations can re-include
|
|
52
52
|
* non-hidden directories, provided their parents are not ignored. Hidden
|
|
53
|
-
* directories are always skipped. Defaults to `[]` when the key is absent.
|
|
53
|
+
* directories are always skipped. Defaults to `[]` when the key is absent or null.
|
|
54
54
|
*/
|
|
55
55
|
readonly exclude: readonly string[];
|
|
56
56
|
/**
|
|
57
57
|
* Per-keyword caption-position conventions (spec §4.7 MSL-C072).
|
|
58
|
-
* Defaults to `{}` when the key is absent.
|
|
58
|
+
* Defaults to `{}` when the key is absent or null.
|
|
59
59
|
*/
|
|
60
60
|
readonly captionConventions: CaptionConventions;
|
|
61
61
|
}
|
package/esm/config/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/config/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/config/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAIL,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,yFAAyF;AACzF,MAAM,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAMrE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU7B;AA8DD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,aAAa,CA4Hf;AAwID;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAiBxD;AAMD;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAUvC"}
|