@driftsys/markspec 0.11.0 → 0.12.1
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/README.md +9 -0
- package/esm/ast/normalize.d.ts +4 -5
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +6 -37
- package/esm/collect/mod.d.ts +29 -9
- package/esm/collect/mod.d.ts.map +1 -1
- package/esm/collect/mod.js +36 -10
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +2 -6
- package/esm/config/markspec.d.ts +5 -3
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +47 -5
- package/esm/discovery/mod.d.ts +24 -8
- package/esm/discovery/mod.d.ts.map +1 -1
- package/esm/discovery/mod.js +57 -21
- package/esm/discovery/projects.d.ts +111 -0
- package/esm/discovery/projects.d.ts.map +1 -0
- package/esm/discovery/projects.js +242 -0
- package/esm/formatter/entry_body.d.ts +84 -0
- package/esm/formatter/entry_body.d.ts.map +1 -0
- package/esm/formatter/entry_body.js +291 -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 +16 -9
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +327 -53
- 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.map +1 -1
- package/esm/gates/mod.js +6 -5
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +4 -4
- package/esm/lock/check.d.ts.map +1 -1
- package/esm/lock/check.js +2 -1
- package/esm/lock/edge_drift.d.ts +2 -0
- package/esm/lock/edge_drift.d.ts.map +1 -1
- package/esm/lock/edge_drift.js +4 -0
- package/esm/lock/mod.d.ts +1 -1
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +1 -1
- package/esm/lock/upstream_deps.js +1 -1
- package/esm/mod.d.ts +11 -6
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +9 -6
- package/esm/model/mod.d.ts +22 -1
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +10 -0
- package/esm/parser/code_regions.d.ts +29 -0
- package/esm/parser/code_regions.d.ts.map +1 -0
- package/esm/parser/code_regions.js +38 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +103 -40
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +7 -1
- package/esm/parser/translate.d.ts.map +1 -1
- package/esm/parser/translate.js +5 -0
- package/esm/refs/mod.d.ts +6 -2
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +15 -21
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +2 -2
- 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/util/fence.d.ts +20 -29
- package/esm/util/fence.d.ts.map +1 -1
- package/esm/util/fence.js +42 -50
- package/esm/util/modals.d.ts +6 -0
- package/esm/util/modals.d.ts.map +1 -1
- package/esm/util/modals.js +37 -0
- package/esm/validator/body_blocks.d.ts +2 -1
- package/esm/validator/body_blocks.d.ts.map +1 -1
- package/esm/validator/body_blocks.js +80 -2
- package/esm/validator/corpus.d.ts +6 -0
- package/esm/validator/corpus.d.ts.map +1 -1
- package/esm/validator/corpus.js +16 -4
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +1 -1
- package/esm/validator/pipeline.d.ts +6 -4
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +24 -19
- package/package.json +1 -1
- package/script/ast/normalize.d.ts +4 -5
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +5 -36
- package/script/collect/mod.d.ts +29 -9
- package/script/collect/mod.d.ts.map +1 -1
- package/script/collect/mod.js +38 -10
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +1 -5
- package/script/config/markspec.d.ts +5 -3
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +47 -5
- package/script/discovery/mod.d.ts +24 -8
- package/script/discovery/mod.d.ts.map +1 -1
- package/script/discovery/mod.js +56 -20
- package/script/discovery/projects.d.ts +111 -0
- package/script/discovery/projects.d.ts.map +1 -0
- package/script/discovery/projects.js +250 -0
- package/script/formatter/entry_body.d.ts +84 -0
- package/script/formatter/entry_body.d.ts.map +1 -0
- package/script/formatter/entry_body.js +296 -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 +16 -9
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +324 -50
- 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.map +1 -1
- package/script/gates/mod.js +15 -14
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +3 -3
- package/script/lock/check.d.ts.map +1 -1
- package/script/lock/check.js +2 -1
- package/script/lock/edge_drift.d.ts +2 -0
- package/script/lock/edge_drift.d.ts.map +1 -1
- package/script/lock/edge_drift.js +5 -0
- package/script/lock/mod.d.ts +1 -1
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +2 -1
- package/script/lock/upstream_deps.js +1 -1
- package/script/mod.d.ts +11 -6
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +23 -5
- package/script/model/mod.d.ts +22 -1
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +11 -0
- package/script/parser/code_regions.d.ts +29 -0
- package/script/parser/code_regions.d.ts.map +1 -0
- package/script/parser/code_regions.js +41 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +102 -39
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +7 -1
- package/script/parser/translate.d.ts.map +1 -1
- package/script/parser/translate.js +5 -0
- package/script/refs/mod.d.ts +6 -2
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +14 -20
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +1 -1
- 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/util/fence.d.ts +20 -29
- package/script/util/fence.d.ts.map +1 -1
- package/script/util/fence.js +47 -54
- package/script/util/modals.d.ts +6 -0
- package/script/util/modals.d.ts.map +1 -1
- package/script/util/modals.js +38 -0
- package/script/validator/body_blocks.d.ts +2 -1
- package/script/validator/body_blocks.d.ts.map +1 -1
- package/script/validator/body_blocks.js +80 -2
- package/script/validator/corpus.d.ts +6 -0
- package/script/validator/corpus.d.ts.map +1 -1
- package/script/validator/corpus.js +16 -3
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +2 -1
- package/script/validator/pipeline.d.ts +6 -4
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +24 -19
package/script/validator/mod.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* a profile-aware validator layer (not in the core).
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.detectCorpusCollisions = exports.attributeCorpusDiagnostics = exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.validateListingDocuments = exports.suppressDeclaredAttrR010 = exports.runPipeline = void 0;
|
|
18
|
+
exports.detectCorpusCollisions = exports.attributeCorpusDiagnostics = exports.applyCorpusPostPass = exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.validateListingDocuments = exports.suppressDeclaredAttrR010 = exports.runPipeline = void 0;
|
|
19
19
|
exports.validate = validate;
|
|
20
20
|
exports.indexByDisplayId = indexByDisplayId;
|
|
21
21
|
exports.findAttr = findAttr;
|
|
@@ -507,5 +507,6 @@ Object.defineProperty(exports, "effectiveTraceRules", { enumerable: true, get: f
|
|
|
507
507
|
Object.defineProperty(exports, "matchesAnyTarget", { enumerable: true, get: function () { return traceability_js_1.matchesAnyTarget; } });
|
|
508
508
|
Object.defineProperty(exports, "validateTraceabilityForEntry", { enumerable: true, get: function () { return traceability_js_1.validateTraceabilityForEntry; } });
|
|
509
509
|
var corpus_js_1 = require("./corpus.js");
|
|
510
|
+
Object.defineProperty(exports, "applyCorpusPostPass", { enumerable: true, get: function () { return corpus_js_1.applyCorpusPostPass; } });
|
|
510
511
|
Object.defineProperty(exports, "attributeCorpusDiagnostics", { enumerable: true, get: function () { return corpus_js_1.attributeCorpusDiagnostics; } });
|
|
511
512
|
Object.defineProperty(exports, "detectCorpusCollisions", { enumerable: true, get: function () { return corpus_js_1.detectCorpusCollisions; } });
|
|
@@ -19,12 +19,14 @@ export interface PipelineResult {
|
|
|
19
19
|
/** Options for {@linkcode runPipeline}. */
|
|
20
20
|
export interface PipelineOptions {
|
|
21
21
|
/**
|
|
22
|
-
* When `false`, suppress
|
|
23
|
-
*
|
|
22
|
+
* When `false`, suppress cross-entry TYPL-009/010/011 from Stage 1,
|
|
23
|
+
* UXIL-016/017/018 from Stage 5, and MSL-L006 ("link target does not
|
|
24
|
+
* resolve") from Stage 4.
|
|
25
|
+
* Use this when the validator is running against a subset
|
|
24
26
|
* of the project's files (e.g. `markspec check <file>`): file-local scope
|
|
25
27
|
* cannot distinguish a typo from a valid cross-file target. MSL-L006 is
|
|
26
28
|
* only meaningful when the full entry set is available (LSP, `compile`).
|
|
27
|
-
* Defaults to `true` (full-project scope — emit
|
|
29
|
+
* Defaults to `true` (full-project scope — emit these codes normally).
|
|
28
30
|
*/
|
|
29
31
|
readonly projectWide?: boolean;
|
|
30
32
|
/**
|
|
@@ -53,7 +55,7 @@ export interface PipelineOptions {
|
|
|
53
55
|
* and non-empty, MSL-C072 is checked for each entry. Defaults to no
|
|
54
56
|
* conventions (rule inactive).
|
|
55
57
|
* @param opts - Pipeline options. Pass `{ projectWide: false }` when
|
|
56
|
-
* validating a file-local subset
|
|
58
|
+
* validating a file-local subset to suppress cross-entry diagnostics.
|
|
57
59
|
*/
|
|
58
60
|
export declare function runPipeline(entries: readonly Entry[], profile: EffectiveProfile | null, captionConventions?: CaptionConventions, opts?: PipelineOptions): PipelineResult;
|
|
59
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/validator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/validator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,KAAK,EACN,MAAM,iBAAiB,CAAC;AAyCzB,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IAC5C,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;OAOG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAChC,kBAAkB,GAAE,kBAAuB,EAC3C,IAAI,GAAE,eAAoB,GACzB,cAAc,CA0JhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CASvB"}
|
|
@@ -27,11 +27,15 @@ const caption_convention_js_1 = require("./caption_convention.js");
|
|
|
27
27
|
const discipline_js_1 = require("./discipline.js");
|
|
28
28
|
const discipline_registry_js_1 = require("../profile/discipline_registry.js");
|
|
29
29
|
const uxil_family_js_1 = require("./uxil_family.js");
|
|
30
|
-
/** Cross-entry
|
|
30
|
+
/** Cross-entry DSL codes suppressed under file-local scope: a
|
|
31
31
|
* subset registry cannot distinguish a dangling reference from an
|
|
32
32
|
* unchecked file — the same false-positive class the MSL-L006 filter
|
|
33
|
-
* guards.
|
|
34
|
-
|
|
33
|
+
* guards. Suppress these even when the cause is inside the subset,
|
|
34
|
+
* matching uxil's scope policy. Parser diagnostics are unaffected. */
|
|
35
|
+
const FILE_LOCAL_SUPPRESSED_DSL = new Set([
|
|
36
|
+
"TYPL-009",
|
|
37
|
+
"TYPL-010",
|
|
38
|
+
"TYPL-011",
|
|
35
39
|
"UXIL-016",
|
|
36
40
|
"UXIL-017",
|
|
37
41
|
"UXIL-018",
|
|
@@ -52,7 +56,7 @@ const FILE_LOCAL_SUPPRESSED_UXIL = new Set([
|
|
|
52
56
|
* and non-empty, MSL-C072 is checked for each entry. Defaults to no
|
|
53
57
|
* conventions (rule inactive).
|
|
54
58
|
* @param opts - Pipeline options. Pass `{ projectWide: false }` when
|
|
55
|
-
* validating a file-local subset
|
|
59
|
+
* validating a file-local subset to suppress cross-entry diagnostics.
|
|
56
60
|
*/
|
|
57
61
|
function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
|
|
58
62
|
const diagnostics = [];
|
|
@@ -80,7 +84,6 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
|
|
|
80
84
|
diagnostics.push(...(0, caption_convention_js_1.validateCaptionConvention)(entry, captionConventions));
|
|
81
85
|
diagnostics.push(...(0, body_blocks_js_1.validateBodyBlocks)(entry));
|
|
82
86
|
diagnostics.push(...(0, feature_ac_js_1.validateFeatureAc)(entry));
|
|
83
|
-
diagnostics.push(...(0, per_type_attrs_js_1.validatePerTypeAttributes)(entry, profile ?? undefined));
|
|
84
87
|
diagnostics.push(...(0, modal_keywords_js_1.validateModalKeywords)(entry));
|
|
85
88
|
}
|
|
86
89
|
// Stage 1.6 — cross-file trace target-type compatibility (MSL-R083).
|
|
@@ -106,15 +109,19 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
|
|
|
106
109
|
finalEntries = stage2.entries;
|
|
107
110
|
diagnostics.push(...stage2.diagnostics);
|
|
108
111
|
}
|
|
109
|
-
// Stage 2.4 — late-stage inference warnings (MSL-T021 for steps 5/6)
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
112
|
+
// Stage 2.4 — late-stage inference warnings (MSL-T021 for steps 5/6)
|
|
113
|
+
// and per-type attribute compatibility (MSL-T022 / MSL-T024). Both run
|
|
114
|
+
// after Stage 2 so that a profile-classified `entry.type` (display-ID
|
|
115
|
+
// pattern match, no explicit `Type:`) resolves to its `extends:` core
|
|
116
|
+
// type — run before classification, MSL-T024 fired on every
|
|
117
|
+
// pattern-classified entry carrying `Satisfies:`/`Derived-from:`. In
|
|
118
|
+
// core-only mode `finalEntries === entries` and `entry.type` is always
|
|
119
|
+
// undefined, so this stage produces the same diagnostics regardless of
|
|
120
|
+
// mode. Partitions inline: `finalEmittable` below is derived from the
|
|
121
|
+
// post-normalization generation, which does not exist yet at this point.
|
|
116
122
|
for (const entry of (0, mod_js_1.emittableEntries)(finalEntries)) {
|
|
117
123
|
diagnostics.push(...(0, types_js_1.inferTypeFromLateStageChain)(entry));
|
|
124
|
+
diagnostics.push(...(0, per_type_attrs_js_1.validatePerTypeAttributes)(entry, profile ?? undefined));
|
|
118
125
|
}
|
|
119
126
|
// Stage 2.5 — normalize profile-declared list-value attributes. Splits
|
|
120
127
|
// comma-separated values for `id-list`/`tag-list` attributes the core parser
|
|
@@ -170,14 +177,12 @@ function runPipeline(entries, profile, captionConventions = {}, opts = {}) {
|
|
|
170
177
|
// FULL classified list on purpose: the family derives its own #771
|
|
171
178
|
// partition and its own declaring/citing split — registry scope is the
|
|
172
179
|
// module's contract, not this orchestrator's (mirrors validateTypl).
|
|
173
|
-
// File-local scope (projectWide: false) suppresses the cross-entry codes
|
|
174
|
-
// (UXIL-016/017/018) — a subset registry cannot distinguish a dangling
|
|
175
|
-
// reference from an unchecked file, the same false-positive class the
|
|
176
|
-
// MSL-L006 suppression guards (#727 review).
|
|
177
180
|
const uxilDiagnostics = (0, uxil_family_js_1.validateUxilFamily)(finalEntries, profile);
|
|
178
|
-
diagnostics.push(...
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
diagnostics.push(...uxilDiagnostics);
|
|
182
|
+
// Apply the same scope policy to Stage 1's typl and Stage 5's uxil.
|
|
183
|
+
const scopedDiagnostics = projectWide ? diagnostics : diagnostics.filter((d) => !FILE_LOCAL_SUPPRESSED_DSL.has(d.code));
|
|
184
|
+
const valid = !scopedDiagnostics.some((d) => d.severity === "error");
|
|
185
|
+
return { entries: finalEntries, diagnostics: scopedDiagnostics, valid };
|
|
181
186
|
}
|
|
182
187
|
/**
|
|
183
188
|
* Drop core Stage 1 `MSL-R010` ("unknown attribute") warnings for attributes
|