@timiagama/ecr 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +16 -0
  3. package/README.md +411 -7
  4. package/dist/bin.d.ts +20 -0
  5. package/dist/bin.d.ts.map +1 -0
  6. package/dist/bin.js +26 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/cli/corpus-loader.d.ts +198 -0
  9. package/dist/cli/corpus-loader.d.ts.map +1 -0
  10. package/dist/cli/corpus-loader.js +351 -0
  11. package/dist/cli/corpus-loader.js.map +1 -0
  12. package/dist/cli/corpus-statistics.d.ts +113 -0
  13. package/dist/cli/corpus-statistics.d.ts.map +1 -0
  14. package/dist/cli/corpus-statistics.js +119 -0
  15. package/dist/cli/corpus-statistics.js.map +1 -0
  16. package/dist/cli/diagnostic-reporter.d.ts +103 -0
  17. package/dist/cli/diagnostic-reporter.d.ts.map +1 -0
  18. package/dist/cli/diagnostic-reporter.js +254 -0
  19. package/dist/cli/diagnostic-reporter.js.map +1 -0
  20. package/dist/cli/project-ignore.d.ts +113 -0
  21. package/dist/cli/project-ignore.d.ts.map +1 -0
  22. package/dist/cli/project-ignore.js +199 -0
  23. package/dist/cli/project-ignore.js.map +1 -0
  24. package/dist/cli/safe-text.d.ts +25 -0
  25. package/dist/cli/safe-text.d.ts.map +1 -0
  26. package/dist/cli/safe-text.js +34 -0
  27. package/dist/cli/safe-text.js.map +1 -0
  28. package/dist/cli/supervisor.d.ts +108 -0
  29. package/dist/cli/supervisor.d.ts.map +1 -0
  30. package/dist/cli/supervisor.js +139 -0
  31. package/dist/cli/supervisor.js.map +1 -0
  32. package/dist/cli.d.ts +247 -0
  33. package/dist/cli.d.ts.map +1 -0
  34. package/dist/cli.js +591 -0
  35. package/dist/cli.js.map +1 -0
  36. package/dist/corpus-validator.d.ts +183 -0
  37. package/dist/corpus-validator.d.ts.map +1 -0
  38. package/dist/corpus-validator.js +479 -0
  39. package/dist/corpus-validator.js.map +1 -0
  40. package/dist/document-identity-rule.d.ts +198 -0
  41. package/dist/document-identity-rule.d.ts.map +1 -0
  42. package/dist/document-identity-rule.js +244 -0
  43. package/dist/document-identity-rule.js.map +1 -0
  44. package/dist/ecr.d.ts +103 -0
  45. package/dist/ecr.d.ts.map +1 -0
  46. package/dist/ecr.js +216 -0
  47. package/dist/ecr.js.map +1 -0
  48. package/dist/glob-pattern.d.ts +94 -0
  49. package/dist/glob-pattern.d.ts.map +1 -0
  50. package/dist/glob-pattern.js +188 -0
  51. package/dist/glob-pattern.js.map +1 -0
  52. package/dist/heading-source-form.d.ts +77 -0
  53. package/dist/heading-source-form.d.ts.map +1 -0
  54. package/dist/heading-source-form.js +129 -0
  55. package/dist/heading-source-form.js.map +1 -0
  56. package/dist/identifier-grammar.d.ts +212 -0
  57. package/dist/identifier-grammar.d.ts.map +1 -0
  58. package/dist/identifier-grammar.js +273 -0
  59. package/dist/identifier-grammar.js.map +1 -0
  60. package/dist/index.d.ts +19 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +11 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/inline-reference-rule.d.ts +557 -0
  65. package/dist/inline-reference-rule.d.ts.map +1 -0
  66. package/dist/inline-reference-rule.js +802 -0
  67. package/dist/inline-reference-rule.js.map +1 -0
  68. package/dist/meta-documents.d.ts +91 -0
  69. package/dist/meta-documents.d.ts.map +1 -0
  70. package/dist/meta-documents.js +133 -0
  71. package/dist/meta-documents.js.map +1 -0
  72. package/dist/per-document-visitor.d.ts +510 -0
  73. package/dist/per-document-visitor.d.ts.map +1 -0
  74. package/dist/per-document-visitor.js +1032 -0
  75. package/dist/per-document-visitor.js.map +1 -0
  76. package/dist/references-section-rule.d.ts +482 -0
  77. package/dist/references-section-rule.d.ts.map +1 -0
  78. package/dist/references-section-rule.js +777 -0
  79. package/dist/references-section-rule.js.map +1 -0
  80. package/dist/section-hierarchy-rule.d.ts +299 -0
  81. package/dist/section-hierarchy-rule.d.ts.map +1 -0
  82. package/dist/section-hierarchy-rule.js +482 -0
  83. package/dist/section-hierarchy-rule.js.map +1 -0
  84. package/dist/source-alignment.d.ts +41 -0
  85. package/dist/source-alignment.d.ts.map +1 -0
  86. package/dist/source-alignment.js +166 -0
  87. package/dist/source-alignment.js.map +1 -0
  88. package/dist/source-lines.d.ts +69 -0
  89. package/dist/source-lines.d.ts.map +1 -0
  90. package/dist/source-lines.js +104 -0
  91. package/dist/source-lines.js.map +1 -0
  92. package/dist/spec-version.d.ts +19 -0
  93. package/dist/spec-version.d.ts.map +1 -0
  94. package/dist/spec-version.js +19 -0
  95. package/dist/spec-version.js.map +1 -0
  96. package/dist/types.d.ts +219 -0
  97. package/dist/types.d.ts.map +1 -0
  98. package/dist/types.js +11 -0
  99. package/dist/types.js.map +1 -0
  100. package/examples/docs/0. Orientation/0.0 - System Overview.md +34 -0
  101. package/examples/docs/0. Orientation/0.0.1 - Glossary.md +21 -0
  102. package/examples/docs/0. Orientation/0.0.2 - Quality Gates.md +22 -0
  103. package/examples/docs/3. Ingestion/3.1 - Ingestion - Validation Rules.md +33 -0
  104. package/examples/docs/4. Payments/4.10 - Settlement.md +22 -0
  105. package/examples/docs/4. Payments/4.2 - Payment Processing Contract.md +33 -0
  106. package/examples/docs/8. Orchestration/8.1 - Workflow Orchestration Contract.md +38 -0
  107. package/examples/docs/8. Orchestration/8.1.3 - Retry Policy.md +17 -0
  108. package/examples/docs/8. Orchestration/8.10 - Dead Letter Queue.md +20 -0
  109. package/examples/docs/README.md +7 -0
  110. package/package.json +65 -7
  111. package/protocol/navigation-protocol.md +223 -0
  112. package/spec/v2/1 - ECR - Structural Specification.md +1467 -0
  113. package/spec/v2/2 - ECR - User Guide.md +845 -0
  114. package/spec/v2/3 - Design Rationale - The Section Separator.md +243 -0
  115. package/src/bin.ts +30 -0
  116. package/src/cli/corpus-loader.ts +482 -0
  117. package/src/cli/corpus-statistics.ts +196 -0
  118. package/src/cli/diagnostic-reporter.ts +344 -0
  119. package/src/cli/project-ignore.ts +238 -0
  120. package/src/cli/safe-text.ts +39 -0
  121. package/src/cli/supervisor.ts +204 -0
  122. package/src/cli.ts +836 -0
  123. package/src/corpus-validator.ts +642 -0
  124. package/src/document-identity-rule.ts +422 -0
  125. package/src/ecr.ts +298 -0
  126. package/src/glob-pattern.ts +242 -0
  127. package/src/heading-source-form.ts +173 -0
  128. package/src/identifier-grammar.ts +380 -0
  129. package/src/index.ts +78 -0
  130. package/src/inline-reference-rule.ts +1235 -0
  131. package/src/meta-documents.ts +159 -0
  132. package/src/per-document-visitor.ts +1528 -0
  133. package/src/references-section-rule.ts +1182 -0
  134. package/src/section-hierarchy-rule.ts +705 -0
  135. package/src/source-alignment.ts +209 -0
  136. package/src/source-lines.ts +123 -0
  137. package/src/spec-version.ts +19 -0
  138. package/src/types.ts +267 -0
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Source Alignment
3
+ *
4
+ * Maps a parsed text node back to the raw Markdown it came from, character by
5
+ * character. The source-form checks of the navigation guarantee (1#9.11) need
6
+ * to know where a parsed character sits in the source, because a search reads
7
+ * the source: an identifier that parses correctly may be escaped, encoded or
8
+ * split across a line there, and no recipe would find it.
9
+ *
10
+ * Used by ECR104 for citations and by ECR103 for the relationship label of a
11
+ * References entry. Moved here unchanged from ECR104, where it was developed.
12
+ */
13
+ import { decodeNamedCharacterReference } from 'decode-named-character-reference';
14
+ import { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';
15
+ /** A line ending as Markdown recognises it. */
16
+ const LINE_ENDING = /^(?:\r\n|\n|\r)/;
17
+ /**
18
+ * The prefix a container repeats on its continuation lines.
19
+ *
20
+ * A paragraph inside a blockquote or a list item carries `> ` or indentation
21
+ * on every line after the first. The parser strips it; the source keeps it.
22
+ */
23
+ const CONTINUATION_PREFIX = /^[ \t>]*/;
24
+ /**
25
+ * Whitespace the parser drops from the end of a line.
26
+ *
27
+ * Markdown discards spaces and tabs before a soft line break, so the source
28
+ * carries them and the parsed text does not.
29
+ */
30
+ const TRAILING_WHITESPACE = /^[ \t]*/;
31
+ /** A named character reference, such as `&` or `fj`. */
32
+ const NAMED_REFERENCE = /^&[a-zA-Z][a-zA-Z0-9]{1,31};/;
33
+ /** A numeric character reference, decimal or hexadecimal. */
34
+ const NUMERIC_REFERENCE = /^&#(?:([0-9]{1,7})|[xX]([0-9a-fA-F]{1,6}));/;
35
+ /**
36
+ * Maps each offset of a node's parsed text to its offset in the source.
37
+ *
38
+ * A text node's source differs from its parsed value in several ways, and
39
+ * the ones undone here are: backslash escapes, character references, the
40
+ * whitespace Markdown drops before a soft line break, and the continuation
41
+ * prefix a blockquote or list item repeats on every line after the first.
42
+ * Line endings are carried through unchanged by the parser, so both sides
43
+ * consume their own.
44
+ *
45
+ * This list is not claimed to be exhaustive. Each construct that was missed
46
+ * rejected some piece of ordinary prose, so the cases covered here are the
47
+ * ones with fixtures, and a failure to align is reported rather than
48
+ * guessed at.
49
+ *
50
+ * Character references are decoded with the same packages the Markdown
51
+ * parser itself uses, rather than guessed at. Earlier versions inferred an
52
+ * expansion's length from surrounding text and were wrong in every direction:
53
+ * `fj` produces two characters, an unknown name produces none, and
54
+ * `
` produces a line ending. Guessing is what made each round of this
55
+ * work reject a different piece of ordinary prose.
56
+ *
57
+ * @param source - The node's raw source
58
+ * @param parsed - The node's parsed text
59
+ * @returns Source offset for each parsed offset, or `undefined` if the two
60
+ * could not be aligned
61
+ */
62
+ export function alignParsedToSource(source, parsed) {
63
+ const map = [];
64
+ let sourceIndex = 0;
65
+ let parsedIndex = 0;
66
+ while (parsedIndex < parsed.length) {
67
+ if (sourceIndex >= source.length) {
68
+ return undefined;
69
+ }
70
+ const remaining = source.slice(sourceIndex);
71
+ const parsedCharacter = parsed.charAt(parsedIndex);
72
+ // A character reference, decoded exactly. Tested first because `&` also
73
+ // begins its own expansion (`&amp;` parses to `&`), and because a
74
+ // reference can produce a line ending: `&#10;` decodes to a line feed
75
+ // while the source holds no line break at all.
76
+ const expansion = readCharacterReference(remaining);
77
+ if (expansion !== undefined) {
78
+ if (!parsed.startsWith(expansion.text, parsedIndex)) {
79
+ return undefined;
80
+ }
81
+ for (let unit = 0; unit < expansion.text.length; unit += 1) {
82
+ map[parsedIndex + unit] = sourceIndex;
83
+ }
84
+ sourceIndex += expansion.length;
85
+ parsedIndex += expansion.text.length;
86
+ continue;
87
+ }
88
+ // A soft line break, and any container prefix on the line that follows.
89
+ //
90
+ // The parser does not normalise line endings: a CRLF document yields a
91
+ // text node whose value still contains CRLF. The source ending therefore
92
+ // decides how much is consumed, on both sides. Taking the parsed text's
93
+ // own ending instead was wrong twice over -- consuming one character for
94
+ // a two-character ending desynchronised every multi-line paragraph in a
95
+ // CRLF checkout, and consuming two for a one-character ending swallowed
96
+ // the line feed that a following `&#10;` had produced.
97
+ const parsedEnding = LINE_ENDING.exec(parsed.slice(parsedIndex))?.[0];
98
+ if (parsedEnding !== undefined) {
99
+ // Spaces and tabs before the break exist only in the source.
100
+ const dropped = TRAILING_WHITESPACE.exec(remaining)?.[0] ?? '';
101
+ const sourceEnding = LINE_ENDING.exec(remaining.slice(dropped.length))?.[0];
102
+ if (sourceEnding === undefined) {
103
+ return undefined;
104
+ }
105
+ // Consume exactly what the source spent, not what the parsed text
106
+ // could match. The two differ when a literal CR is followed by an
107
+ // encoded line feed: the parsed value then holds `CR LF`, of which
108
+ // only the CR came from this line ending. Taking both would swallow
109
+ // the entity's own character and strand the reference that produced it.
110
+ if (!parsed.startsWith(sourceEnding, parsedIndex)) {
111
+ return undefined;
112
+ }
113
+ for (let unit = 0; unit < sourceEnding.length; unit += 1) {
114
+ map[parsedIndex + unit] = sourceIndex;
115
+ }
116
+ sourceIndex += dropped.length + sourceEnding.length;
117
+ sourceIndex +=
118
+ CONTINUATION_PREFIX.exec(source.slice(sourceIndex))?.[0].length ?? 0;
119
+ parsedIndex += sourceEnding.length;
120
+ continue;
121
+ }
122
+ // A backslash escape: two source characters produce one.
123
+ if (remaining.startsWith(`\\${parsedCharacter}`)) {
124
+ map[parsedIndex] = sourceIndex;
125
+ sourceIndex += 2;
126
+ parsedIndex += 1;
127
+ continue;
128
+ }
129
+ if (remaining.startsWith(parsedCharacter)) {
130
+ map[parsedIndex] = sourceIndex;
131
+ sourceIndex += 1;
132
+ parsedIndex += 1;
133
+ continue;
134
+ }
135
+ return undefined;
136
+ }
137
+ return map;
138
+ }
139
+ /**
140
+ * Decodes a character reference at the start of `remaining`, if there is one.
141
+ *
142
+ * An unrecognised name is not a reference at all -- `&NotAnEntity;` stays
143
+ * literal -- and is reported as such by returning `undefined`, so the
144
+ * ordinary literal comparison handles it.
145
+ *
146
+ * @param remaining - Source text beginning at the candidate reference
147
+ * @returns The decoded text and the reference's source length, or `undefined`
148
+ */
149
+ function readCharacterReference(remaining) {
150
+ const numeric = NUMERIC_REFERENCE.exec(remaining);
151
+ if (numeric !== null) {
152
+ const decimal = numeric[1];
153
+ const value = decimal ?? numeric[2] ?? '';
154
+ return {
155
+ text: decodeNumericCharacterReference(value, decimal === undefined ? 16 : 10),
156
+ length: numeric[0].length,
157
+ };
158
+ }
159
+ const named = NAMED_REFERENCE.exec(remaining);
160
+ if (named === null) {
161
+ return undefined;
162
+ }
163
+ const decoded = decodeNamedCharacterReference(named[0].slice(1, -1));
164
+ return decoded === false ? undefined : { text: decoded, length: named[0].length };
165
+ }
166
+ //# sourceMappingURL=source-alignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-alignment.js","sourceRoot":"","sources":["../src/source-alignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,mDAAmD,CAAC;AAUpG,+CAA+C;AAC/C,MAAM,WAAW,GAAW,iBAAiB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,mBAAmB,GAAW,UAAU,CAAC;AAE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AAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAErF,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACpF,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Source Lines
3
+ *
4
+ * Reads a document's raw Markdown by line, for the source-form checks of the
5
+ * navigation guarantee (1#9.11). The published recipes search raw text line
6
+ * by line, so the rules that promise a recipe will find something have to
7
+ * look at the same lines the recipe does.
8
+ */
9
+ import type { Position, PositionRange } from './types.js';
10
+ /**
11
+ * Records where each line of a source begins.
12
+ *
13
+ * Markdown treats LF, CRLF and a lone CR as line endings. Indexing only LF
14
+ * left a CR-only document with a single line start, so every offset beyond
15
+ * the first line failed to resolve and source validation was silently
16
+ * skipped -- exactly the documents that most need it.
17
+ *
18
+ * @param sourceText - The document's raw Markdown
19
+ * @returns Absolute offset of the first character of each line
20
+ */
21
+ export declare function indexLineStarts(sourceText: string): readonly number[];
22
+ /**
23
+ * A document's raw source, addressable by line.
24
+ */
25
+ export declare class SourceLines {
26
+ /** The document's raw Markdown. */
27
+ private readonly sourceText;
28
+ /** Absolute offset at which each line begins. */
29
+ private readonly lineStarts;
30
+ /**
31
+ * Indexes a source for line access.
32
+ *
33
+ * @param sourceText - The document's raw Markdown
34
+ */
35
+ constructor(sourceText: string);
36
+ /**
37
+ * Returns one line of the source, without its line ending.
38
+ *
39
+ * @param line - Zero-based line number
40
+ * @returns The line's text, or `undefined` when the line does not exist
41
+ */
42
+ readLine(line: number): string | undefined;
43
+ /**
44
+ * Reports whether a Markdown line also begins a line for a search engine.
45
+ *
46
+ * Markdown ends a line at LF, CRLF or a lone CR; ripgrep and grep end one
47
+ * only at LF. So a line that follows a lone CR is, to a search, the middle
48
+ * of the line before it, and no recipe anchored with `^` can match it.
49
+ *
50
+ * @param line - Zero-based Markdown line number
51
+ * @returns `true` when the line starts the file or follows an LF
52
+ */
53
+ tellStartsSearchLine(line: number): boolean;
54
+ /**
55
+ * Returns the source a range covers.
56
+ *
57
+ * @param range - A range within the document
58
+ * @returns Its raw source, or `undefined` when it lies outside the document
59
+ */
60
+ slice(range: PositionRange): string | undefined;
61
+ /**
62
+ * Converts a line/character position into an absolute source offset.
63
+ *
64
+ * @param position - A position within the document
65
+ * @returns The offset, or `undefined` when the line is out of range
66
+ */
67
+ offsetOf(position: Position): number | undefined;
68
+ }
69
+ //# sourceMappingURL=source-lines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-lines.d.ts","sourceRoot":"","sources":["../src/source-lines.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAoBrE;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,mCAAmC;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IAEpC,iDAAiD;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAE/C;;;;OAIG;gBACgB,UAAU,EAAE,MAAM;IAKrC;;;;;OAKG;IACI,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAYjD;;;;;;;;;OASG;IACI,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAMlD;;;;;OAKG;IACI,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS;IAOtD;;;;;OAKG;IACI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS;CAKxD"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Source Lines
3
+ *
4
+ * Reads a document's raw Markdown by line, for the source-form checks of the
5
+ * navigation guarantee (1#9.11). The published recipes search raw text line
6
+ * by line, so the rules that promise a recipe will find something have to
7
+ * look at the same lines the recipe does.
8
+ */
9
+ /**
10
+ * Records where each line of a source begins.
11
+ *
12
+ * Markdown treats LF, CRLF and a lone CR as line endings. Indexing only LF
13
+ * left a CR-only document with a single line start, so every offset beyond
14
+ * the first line failed to resolve and source validation was silently
15
+ * skipped -- exactly the documents that most need it.
16
+ *
17
+ * @param sourceText - The document's raw Markdown
18
+ * @returns Absolute offset of the first character of each line
19
+ */
20
+ export function indexLineStarts(sourceText) {
21
+ const starts = [0];
22
+ for (let index = 0; index < sourceText.length; index += 1) {
23
+ const character = sourceText.charAt(index);
24
+ if (character === '\r') {
25
+ const isCarriageReturnLineFeed = sourceText.charAt(index + 1) === '\n';
26
+ starts.push(index + (isCarriageReturnLineFeed ? 2 : 1));
27
+ if (isCarriageReturnLineFeed) {
28
+ index += 1;
29
+ }
30
+ }
31
+ else if (character === '\n') {
32
+ starts.push(index + 1);
33
+ }
34
+ }
35
+ return starts;
36
+ }
37
+ /**
38
+ * A document's raw source, addressable by line.
39
+ */
40
+ export class SourceLines {
41
+ /** The document's raw Markdown. */
42
+ sourceText;
43
+ /** Absolute offset at which each line begins. */
44
+ lineStarts;
45
+ /**
46
+ * Indexes a source for line access.
47
+ *
48
+ * @param sourceText - The document's raw Markdown
49
+ */
50
+ constructor(sourceText) {
51
+ this.sourceText = sourceText;
52
+ this.lineStarts = indexLineStarts(sourceText);
53
+ }
54
+ /**
55
+ * Returns one line of the source, without its line ending.
56
+ *
57
+ * @param line - Zero-based line number
58
+ * @returns The line's text, or `undefined` when the line does not exist
59
+ */
60
+ readLine(line) {
61
+ const start = this.lineStarts[line];
62
+ if (start === undefined) {
63
+ return undefined;
64
+ }
65
+ const next = this.lineStarts[line + 1] ?? this.sourceText.length;
66
+ return this.sourceText.slice(start, next).replace(/(?:\r\n|\n|\r)$/, '');
67
+ }
68
+ /**
69
+ * Reports whether a Markdown line also begins a line for a search engine.
70
+ *
71
+ * Markdown ends a line at LF, CRLF or a lone CR; ripgrep and grep end one
72
+ * only at LF. So a line that follows a lone CR is, to a search, the middle
73
+ * of the line before it, and no recipe anchored with `^` can match it.
74
+ *
75
+ * @param line - Zero-based Markdown line number
76
+ * @returns `true` when the line starts the file or follows an LF
77
+ */
78
+ tellStartsSearchLine(line) {
79
+ const start = this.lineStarts[line];
80
+ return start === 0 || (start !== undefined && this.sourceText.charAt(start - 1) === '\n');
81
+ }
82
+ /**
83
+ * Returns the source a range covers.
84
+ *
85
+ * @param range - A range within the document
86
+ * @returns Its raw source, or `undefined` when it lies outside the document
87
+ */
88
+ slice(range) {
89
+ const start = this.offsetOf(range.start);
90
+ const end = this.offsetOf(range.end);
91
+ return start === undefined || end === undefined ? undefined : this.sourceText.slice(start, end);
92
+ }
93
+ /**
94
+ * Converts a line/character position into an absolute source offset.
95
+ *
96
+ * @param position - A position within the document
97
+ * @returns The offset, or `undefined` when the line is out of range
98
+ */
99
+ offsetOf(position) {
100
+ const lineStart = this.lineStarts[position.line];
101
+ return lineStart === undefined ? undefined : lineStart + position.character;
102
+ }
103
+ }
104
+ //# sourceMappingURL=source-lines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-lines.js","sourceRoot":"","sources":["../src/source-lines.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,MAAM,GAAa,CAAC,CAAC,CAAC,CAAC;IAE7B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAW,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEnD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,MAAM,wBAAwB,GAAY,UAAU,CAAC,MAAM,C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,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,KAAoB;QAC/B,MAAM,KAAK,GAAuB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7D,MAAM,GAAG,GAAuB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEzD,OAAO,KAAK,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClG,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,QAAkB;QAChC,MAAM,SAAS,GAAuB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAErE,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;IAC9E,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Specification Version
3
+ *
4
+ * The version of the ECR specification this package implements.
5
+ *
6
+ * The specification and the package are versioned independently: a linter bug
7
+ * fix is a package release that leaves the grammar untouched, and a
8
+ * specification clarification may need no package release at all. Tying the
9
+ * two numbers together would force one to move whenever the other did.
10
+ *
11
+ * This constant is the single source of truth for the implemented version. A
12
+ * test asserts that the specification document and the README state the same
13
+ * number, so the three cannot drift apart.
14
+ */
15
+ /**
16
+ * The ECR specification version implemented by this package.
17
+ */
18
+ export declare const ECR_SPEC_VERSION: string;
19
+ //# sourceMappingURL=spec-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-version.d.ts","sourceRoot":"","sources":["../src/spec-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAgB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Specification Version
3
+ *
4
+ * The version of the ECR specification this package implements.
5
+ *
6
+ * The specification and the package are versioned independently: a linter bug
7
+ * fix is a package release that leaves the grammar untouched, and a
8
+ * specification clarification may need no package release at all. Tying the
9
+ * two numbers together would force one to move whenever the other did.
10
+ *
11
+ * This constant is the single source of truth for the implemented version. A
12
+ * test asserts that the specification document and the README state the same
13
+ * number, so the three cannot drift apart.
14
+ */
15
+ /**
16
+ * The ECR specification version implemented by this package.
17
+ */
18
+ export const ECR_SPEC_VERSION = '2.0.0';
19
+ //# sourceMappingURL=spec-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-version.js","sourceRoot":"","sources":["../src/spec-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,OAAO,CAAC"}
@@ -0,0 +1,219 @@
1
+ /**
2
+ * ECR Output Schema Types
3
+ *
4
+ * Derived from section 1#10 of the ECR Structural Specification (doc 1).
5
+ *
6
+ * These types define the normative output schema produced by the ECR linter.
7
+ * The schema is host-agnostic and designed for consumption by graph engines,
8
+ * Language Servers, Obsidian plugins, and other host environments.
9
+ */
10
+ /**
11
+ * Stable document identity.
12
+ *
13
+ * Grammar: `Digit+ ("." Digit+)*`
14
+ *
15
+ * @example "3.1"
16
+ */
17
+ export type DocID = string;
18
+ /**
19
+ * Stable section identity.
20
+ *
21
+ * Grammar: `DocID "#" SectionPath`, where `SectionPath ::= Digit+ ("." Digit+)*`
22
+ *
23
+ * The text before the `#` is the owning document's DocID.
24
+ *
25
+ * @example "3.1#2"
26
+ */
27
+ export type SectionID = string;
28
+ /**
29
+ * Severity level for a diagnostic emitted by the ECR linter.
30
+ */
31
+ export type DiagnosticSeverity = "error" | "warning" | "info";
32
+ /**
33
+ * A zero-based line/character position within a document.
34
+ */
35
+ export interface Position {
36
+ /** Zero-based line number. */
37
+ readonly line: number;
38
+ /** Zero-based character offset within the line. */
39
+ readonly character: number;
40
+ }
41
+ /**
42
+ * A contiguous range within a document defined by a start and end position.
43
+ */
44
+ export interface PositionRange {
45
+ /** Inclusive start of the range. */
46
+ readonly start: Position;
47
+ /** Exclusive end of the range. */
48
+ readonly end: Position;
49
+ }
50
+ /**
51
+ * A host-agnostic diagnostic produced by the ECR linter.
52
+ *
53
+ * Diagnostics can be mapped into LSP diagnostics or rendered in other UIs.
54
+ */
55
+ export interface Diagnostic {
56
+ /** Severity of this diagnostic. */
57
+ readonly severity: DiagnosticSeverity;
58
+ /** Identifier of the validation rule that produced this diagnostic. */
59
+ readonly ruleId: string;
60
+ /** Human-readable description of the issue. */
61
+ readonly message: string;
62
+ /** Opaque, host-provided URI of the source document. */
63
+ readonly uri: string;
64
+ /**
65
+ * Positional range within the source document.
66
+ * Optional; depends on whether the Markdown parser provides positional metadata.
67
+ */
68
+ readonly range?: PositionRange;
69
+ /** DocID of the document, when determinable. */
70
+ readonly docId?: DocID;
71
+ /** SectionID providing structural context, when determinable. */
72
+ readonly sectionId?: SectionID;
73
+ /** Arbitrary structured data associated with this diagnostic. */
74
+ readonly data?: Readonly<Record<string, unknown>>;
75
+ }
76
+ /**
77
+ * Semantic direction label for a document-level reference edge.
78
+ *
79
+ * Direction describes the relationship meaning; it does not alter edge orientation.
80
+ */
81
+ export type ReferenceDirection = "authority" | "dependency" | "constraint" | "contract";
82
+ /**
83
+ * The keyword form of an inline reference.
84
+ */
85
+ export type InlineReferenceKind = "see" | "per";
86
+ /**
87
+ * A single section extracted from a validated ECR document.
88
+ *
89
+ * The H1 heading is represented as the root section node. All numbered
90
+ * headings of depth \>= 2 are child section nodes.
91
+ */
92
+ export interface SectionNode {
93
+ /** DocID (for the root H1 node) or SectionID (for sub-headings). */
94
+ readonly id: DocID | SectionID;
95
+ /**
96
+ * Human-readable heading text.
97
+ * Extracted for display and diagnostics only; not part of ECR structural identity.
98
+ */
99
+ readonly title: string;
100
+ /** Markdown heading depth (1 for H1, 2 for H2, etc.). */
101
+ readonly headingDepth: number;
102
+ /**
103
+ * Identifier of the nearest preceding heading whose depth is exactly
104
+ * `headingDepth - 1`. Absent for the root H1 node.
105
+ */
106
+ readonly parentId?: DocID | SectionID;
107
+ }
108
+ /**
109
+ * A document-level typed edge extracted from a `## References` list item.
110
+ *
111
+ * Edges are directed from the current document to the referenced document.
112
+ */
113
+ export interface ReferenceEdge {
114
+ /** DocID of the document containing the reference. */
115
+ readonly fromDocId: DocID;
116
+ /** Target DocID declared in the References entry. */
117
+ readonly toDocId: DocID;
118
+ /** Semantic direction label for this edge. */
119
+ readonly direction: ReferenceDirection;
120
+ /** Non-empty explanation text extracted from the References entry. */
121
+ readonly explanation: string;
122
+ /**
123
+ * Non-empty title text extracted from the References entry.
124
+ * For display and diagnostics only; not part of ECR structural identity.
125
+ */
126
+ readonly title: string;
127
+ }
128
+ /**
129
+ * A section-attributed edge extracted from an inline `see` or `per` reference.
130
+ */
131
+ export interface InlineReferenceEdge {
132
+ /** Identifier of the section context where the inline reference occurs. */
133
+ readonly fromId: DocID | SectionID;
134
+ /** Target identifier referenced by the inline form. */
135
+ readonly toId: DocID | SectionID;
136
+ /** The keyword form (`see` or `per`) that produced this edge. */
137
+ readonly kind: InlineReferenceKind;
138
+ }
139
+ /**
140
+ * Canonical structural representation of a single validated ECR document.
141
+ */
142
+ export interface ExtractedDocument {
143
+ /** DocID extracted from the H1 heading. */
144
+ readonly docId: DocID;
145
+ /**
146
+ * Document title extracted from the H1 heading.
147
+ * For display and diagnostics only; not part of ECR structural identity.
148
+ */
149
+ readonly title: string;
150
+ /** All section nodes extracted from numbered headings, including the root H1. */
151
+ readonly sections: readonly SectionNode[];
152
+ /** Document-level reference edges extracted from the `## References` section. */
153
+ readonly references: readonly ReferenceEdge[];
154
+ /** Section-level inline reference edges extracted from valid `see`/`per` forms. */
155
+ readonly inlineReferences: readonly InlineReferenceEdge[];
156
+ }
157
+ /**
158
+ * Input descriptor for a single-document lint operation.
159
+ */
160
+ export interface LintInput {
161
+ /** Opaque, host-provided URI identifying the document instance. */
162
+ readonly uri: string;
163
+ /** Optional version tag for the document instance. */
164
+ readonly version?: number;
165
+ }
166
+ /**
167
+ * Result of a lint operation over a single Markdown document.
168
+ */
169
+ export interface LintResult {
170
+ /** Input descriptor identifying the document that was validated. */
171
+ readonly input: LintInput;
172
+ /** Whether the document satisfies per-document ECR structural invariants. */
173
+ readonly ok: boolean;
174
+ /** Diagnostics produced during validation. */
175
+ readonly diagnostics: readonly Diagnostic[];
176
+ /**
177
+ * Extracted structural artefacts from the document.
178
+ * Present when a valid DocID is recovered and structural extraction succeeds.
179
+ */
180
+ readonly extracted?: ExtractedDocument;
181
+ }
182
+ /**
183
+ * A single document entry within a corpus validation result.
184
+ */
185
+ export interface CorpusDocumentEntry {
186
+ /** Opaque, host-provided URI identifying the document instance. */
187
+ readonly uri: string;
188
+ /** Per-document lint result. */
189
+ readonly result: LintResult;
190
+ }
191
+ /**
192
+ * Global identifier index built from a validated corpus.
193
+ *
194
+ * Maps each unique identifier to the URI of the document that defines it.
195
+ */
196
+ export interface CorpusIndex {
197
+ /** Mapping from each DocID to the URI of its defining document. */
198
+ readonly docIds: Readonly<Record<DocID, string>>;
199
+ /** Mapping from each SectionID to the URI of its defining document. */
200
+ readonly sectionIds: Readonly<Record<SectionID, string>>;
201
+ }
202
+ /**
203
+ * Result of validating a corpus of ECR documents.
204
+ *
205
+ * Includes per-document results, corpus-wide diagnostics, and an optional
206
+ * global identifier index suitable for graph construction.
207
+ */
208
+ export interface CorpusResult {
209
+ /** Per-document lint results for every document in the corpus. */
210
+ readonly documents: readonly CorpusDocumentEntry[];
211
+ /**
212
+ * Global identifier index.
213
+ * Present when corpus-wide indexing succeeds.
214
+ */
215
+ readonly index?: CorpusIndex;
216
+ /** Corpus-wide diagnostics (e.g. duplicate DocIDs, unresolved references). */
217
+ readonly diagnostics: readonly Diagnostic[];
218
+ }
219
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;GAMG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAM/B;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,kCAAkC;IAClC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,iEAAiE;IACjE,QAAQ,CAAC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ClE,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C"}
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ECR Output Schema Types
3
+ *
4
+ * Derived from section 1#10 of the ECR Structural Specification (doc 1).
5
+ *
6
+ * These types define the normative output schema produced by the ECR linter.
7
+ * The schema is host-agnostic and designed for consumption by graph engines,
8
+ * Language Servers, Obsidian plugins, and other host environments.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}