@driftsys/markspec 0.11.0 → 0.12.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 (142) hide show
  1. package/README.md +9 -0
  2. package/esm/ast/normalize.d.ts +4 -5
  3. package/esm/ast/normalize.d.ts.map +1 -1
  4. package/esm/ast/normalize.js +6 -37
  5. package/esm/collect/mod.d.ts +29 -9
  6. package/esm/collect/mod.d.ts.map +1 -1
  7. package/esm/collect/mod.js +36 -10
  8. package/esm/compiler/mod.d.ts.map +1 -1
  9. package/esm/compiler/mod.js +2 -6
  10. package/esm/config/markspec.d.ts +4 -2
  11. package/esm/config/markspec.d.ts.map +1 -1
  12. package/esm/discovery/mod.d.ts +24 -8
  13. package/esm/discovery/mod.d.ts.map +1 -1
  14. package/esm/discovery/mod.js +57 -21
  15. package/esm/discovery/projects.d.ts +109 -0
  16. package/esm/discovery/projects.d.ts.map +1 -0
  17. package/esm/discovery/projects.js +232 -0
  18. package/esm/formatter/entry_body.d.ts +86 -0
  19. package/esm/formatter/entry_body.d.ts.map +1 -0
  20. package/esm/formatter/entry_body.js +287 -0
  21. package/esm/formatter/mod.d.ts +13 -9
  22. package/esm/formatter/mod.d.ts.map +1 -1
  23. package/esm/formatter/mod.js +126 -50
  24. package/esm/gates/mod.d.ts.map +1 -1
  25. package/esm/gates/mod.js +5 -4
  26. package/esm/lint/runner.d.ts.map +1 -1
  27. package/esm/lint/runner.js +4 -4
  28. package/esm/lock/check.d.ts.map +1 -1
  29. package/esm/lock/check.js +2 -1
  30. package/esm/lock/edge_drift.d.ts +2 -0
  31. package/esm/lock/edge_drift.d.ts.map +1 -1
  32. package/esm/lock/edge_drift.js +4 -0
  33. package/esm/lock/mod.d.ts +1 -1
  34. package/esm/lock/mod.d.ts.map +1 -1
  35. package/esm/lock/mod.js +1 -1
  36. package/esm/mod.d.ts +10 -6
  37. package/esm/mod.d.ts.map +1 -1
  38. package/esm/mod.js +8 -6
  39. package/esm/model/mod.d.ts +21 -0
  40. package/esm/model/mod.d.ts.map +1 -1
  41. package/esm/model/mod.js +10 -0
  42. package/esm/parser/code_regions.d.ts +29 -0
  43. package/esm/parser/code_regions.d.ts.map +1 -0
  44. package/esm/parser/code_regions.js +38 -0
  45. package/esm/parser/markdown.d.ts.map +1 -1
  46. package/esm/parser/markdown.js +103 -40
  47. package/esm/parser/mod.d.ts.map +1 -1
  48. package/esm/parser/mod.js +7 -1
  49. package/esm/parser/translate.d.ts.map +1 -1
  50. package/esm/parser/translate.js +5 -0
  51. package/esm/refs/mod.d.ts.map +1 -1
  52. package/esm/refs/mod.js +8 -19
  53. package/esm/reporter/mod.d.ts.map +1 -1
  54. package/esm/reporter/mod.js +2 -2
  55. package/esm/util/fence.d.ts +20 -29
  56. package/esm/util/fence.d.ts.map +1 -1
  57. package/esm/util/fence.js +42 -50
  58. package/esm/util/modals.d.ts +6 -0
  59. package/esm/util/modals.d.ts.map +1 -1
  60. package/esm/util/modals.js +37 -0
  61. package/esm/validator/body_blocks.d.ts +2 -1
  62. package/esm/validator/body_blocks.d.ts.map +1 -1
  63. package/esm/validator/body_blocks.js +80 -2
  64. package/esm/validator/corpus.d.ts +6 -0
  65. package/esm/validator/corpus.d.ts.map +1 -1
  66. package/esm/validator/corpus.js +16 -4
  67. package/esm/validator/mod.d.ts +1 -1
  68. package/esm/validator/mod.d.ts.map +1 -1
  69. package/esm/validator/mod.js +1 -1
  70. package/esm/validator/pipeline.d.ts.map +1 -1
  71. package/esm/validator/pipeline.js +11 -8
  72. package/package.json +1 -1
  73. package/script/ast/normalize.d.ts +4 -5
  74. package/script/ast/normalize.d.ts.map +1 -1
  75. package/script/ast/normalize.js +5 -36
  76. package/script/collect/mod.d.ts +29 -9
  77. package/script/collect/mod.d.ts.map +1 -1
  78. package/script/collect/mod.js +38 -10
  79. package/script/compiler/mod.d.ts.map +1 -1
  80. package/script/compiler/mod.js +1 -5
  81. package/script/config/markspec.d.ts +4 -2
  82. package/script/config/markspec.d.ts.map +1 -1
  83. package/script/discovery/mod.d.ts +24 -8
  84. package/script/discovery/mod.d.ts.map +1 -1
  85. package/script/discovery/mod.js +56 -20
  86. package/script/discovery/projects.d.ts +109 -0
  87. package/script/discovery/projects.d.ts.map +1 -0
  88. package/script/discovery/projects.js +240 -0
  89. package/script/formatter/entry_body.d.ts +86 -0
  90. package/script/formatter/entry_body.d.ts.map +1 -0
  91. package/script/formatter/entry_body.js +292 -0
  92. package/script/formatter/mod.d.ts +13 -9
  93. package/script/formatter/mod.d.ts.map +1 -1
  94. package/script/formatter/mod.js +124 -48
  95. package/script/gates/mod.d.ts.map +1 -1
  96. package/script/gates/mod.js +15 -14
  97. package/script/lint/runner.d.ts.map +1 -1
  98. package/script/lint/runner.js +3 -3
  99. package/script/lock/check.d.ts.map +1 -1
  100. package/script/lock/check.js +2 -1
  101. package/script/lock/edge_drift.d.ts +2 -0
  102. package/script/lock/edge_drift.d.ts.map +1 -1
  103. package/script/lock/edge_drift.js +5 -0
  104. package/script/lock/mod.d.ts +1 -1
  105. package/script/lock/mod.d.ts.map +1 -1
  106. package/script/lock/mod.js +2 -1
  107. package/script/mod.d.ts +10 -6
  108. package/script/mod.d.ts.map +1 -1
  109. package/script/mod.js +20 -5
  110. package/script/model/mod.d.ts +21 -0
  111. package/script/model/mod.d.ts.map +1 -1
  112. package/script/model/mod.js +11 -0
  113. package/script/parser/code_regions.d.ts +29 -0
  114. package/script/parser/code_regions.d.ts.map +1 -0
  115. package/script/parser/code_regions.js +41 -0
  116. package/script/parser/markdown.d.ts.map +1 -1
  117. package/script/parser/markdown.js +102 -39
  118. package/script/parser/mod.d.ts.map +1 -1
  119. package/script/parser/mod.js +7 -1
  120. package/script/parser/translate.d.ts.map +1 -1
  121. package/script/parser/translate.js +5 -0
  122. package/script/refs/mod.d.ts.map +1 -1
  123. package/script/refs/mod.js +7 -18
  124. package/script/reporter/mod.d.ts.map +1 -1
  125. package/script/reporter/mod.js +1 -1
  126. package/script/util/fence.d.ts +20 -29
  127. package/script/util/fence.d.ts.map +1 -1
  128. package/script/util/fence.js +47 -54
  129. package/script/util/modals.d.ts +6 -0
  130. package/script/util/modals.d.ts.map +1 -1
  131. package/script/util/modals.js +38 -0
  132. package/script/validator/body_blocks.d.ts +2 -1
  133. package/script/validator/body_blocks.d.ts.map +1 -1
  134. package/script/validator/body_blocks.js +80 -2
  135. package/script/validator/corpus.d.ts +6 -0
  136. package/script/validator/corpus.d.ts.map +1 -1
  137. package/script/validator/corpus.js +16 -3
  138. package/script/validator/mod.d.ts +1 -1
  139. package/script/validator/mod.d.ts.map +1 -1
  140. package/script/validator/mod.js +2 -1
  141. package/script/validator/pipeline.d.ts.map +1 -1
  142. package/script/validator/pipeline.js +11 -8
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/formatter/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAGX,MAAM,iBAAiB,CAAC;AA2BzB,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAc/D;AAmSD,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,cAAc,CAAC;CAC/C;AAED,o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;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,EAAE,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAKR;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,SAAI,GACf,MAAM,CAkBR;AAyED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,SAAI,GACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA2B5C"}
@@ -33,6 +33,7 @@ const render_js_1 = require("../ast/render.js");
33
33
  const normalize_js_1 = require("../ast/normalize.js");
34
34
  const equivalence_js_1 = require("../ast/equivalence.js");
35
35
  const prose_js_1 = require("./prose.js");
36
+ const entry_body_js_1 = require("./entry_body.js");
36
37
  const dprint_js_1 = require("./dprint.js");
37
38
  const md_equiv_js_1 = require("./md_equiv.js");
38
39
  /**
@@ -54,7 +55,7 @@ function isSentenceInitial(line, offset) {
54
55
  *
55
56
  * The pass skips:
56
57
  *
57
- * - Fenced code blocks (between paired ``` or ~~~ markers) — code is
58
+ * - CommonMark fenced code blocks and inline-code spans — code is
58
59
  * verbatim per round-trip invariants (spec §5.1).
59
60
  * - Lines indented by four or more spaces (or a tab) — conservatively
60
61
  * captures indented code blocks and attribute trailers, both of which
@@ -63,21 +64,12 @@ function isSentenceInitial(line, offset) {
63
64
  * @remarks Not called by `format()` as of SP3 Task 5 — body modal
64
65
  * normalization moved to `normalizeBodyAst` in the AST pass (spec-correct
65
66
  * verbatim-boundary handling). Retained as an exported symbol because
66
- * `mod_test.ts` tests it directly and `core/ast/normalize.ts` documents
67
- * the intentional duplication until a follow-up collapses the two. Do NOT
67
+ * `mod_test.ts` tests it directly. Both entry points delegate to the same
68
+ * AST-backed prose normalizer. Do NOT
68
69
  * delete — external callers may depend on this export.
69
70
  */
70
71
  function normalizeModalKeywords(markdown) {
71
- const lines = markdown.split("\n");
72
- (0, fence_js_1.walkProseLines)(markdown, (line, i) => {
73
- // Indented-code / attribute-trailer lines aren't prose either.
74
- if (/^( {4}|\t)/.test(line))
75
- return;
76
- let normalized = line.replace(modals_js_1.RFC2119_MODAL_RE, (m) => m.toLowerCase());
77
- normalized = normalized.replace(modals_js_1.EARS_KEYWORD_RE, (m, _g1, offset) => isSentenceInitial(normalized, offset) ? m : m.toLowerCase());
78
- lines[i] = normalized;
79
- });
80
- return lines.join("\n");
72
+ return (0, modals_js_1.normalizeProseModals)(markdown);
81
73
  }
82
74
  /**
83
75
  * Canonical front-matter key order per ADR-007. Core keys first, then
@@ -230,16 +222,19 @@ function emitBodyViaAst(lines, file, diagnostics, cachedEntries, proseFormat) {
230
222
  for (const entry of sorted) {
231
223
  if (!entry.body.trim())
232
224
  continue; // empty or whitespace-only body
233
- const indent = (entry.location.column - 1) + 2; // marker column (0-based) + 2 spaces = list-item continuation indent
225
+ // List-item continuation indent: the item's content column, which
226
+ // follows every space after the marker (#865).
227
+ const indent = (0, entry_body_js_1.contentColumn)(lines[entry.location.line - 1] ?? "", entry.location.column - 1);
234
228
  const indentStr = " ".repeat(indent);
235
229
  const titleLineIdx = entry.location.line - 1; // 0-based
236
230
  // Locate the body segment in `lines` — between the title line and
237
231
  // the attr block start (or item end when there is no attr block).
238
- const range = findAttributeBlockRange(lines, entry.location.line, indent);
232
+ const itemEndFloor = entry.endLine ?? 0;
233
+ const range = findAttributeBlockRange(lines, entry.location.line, indent, itemEndFloor);
239
234
  const bodyStart = titleLineIdx + 1;
240
235
  const bodyEnd = range
241
236
  ? range.start
242
- : findItemEnd(lines, titleLineIdx, indent);
237
+ : findItemEnd(lines, titleLineIdx, indent, itemEndFloor);
243
238
  if (bodyEnd <= bodyStart)
244
239
  continue; // no body lines to replace
245
240
  // Route the body through the canonical AST: build → normalize
@@ -397,13 +392,16 @@ function format(markdown, options) {
397
392
  // `normalizeBodyAst` (more spec-correct: respects §2.5 verbatim
398
393
  // boundaries and per-node sentence-initial context). `normalizeModalKeywords`
399
394
  // stays exported/defined for other callers/tests but is not invoked here.
400
- const body = rawBody;
401
- const { entries } = (0, markdown_js_1.parseMarkdown)(body, { file });
402
395
  const diagnostics = [...fm.diagnostics];
396
+ // Drop empty-valued trailer lines (`Id:`, `Satisfies:`) before the main
397
+ // pass; left in place they demote the whole trailer block to body code.
398
+ const repaired = removeEmptyTrailerLines(rawBody, (0, markdown_js_1.parseMarkdown)(rawBody, { file }).entries, diagnostics);
399
+ const body = repaired ?? rawBody;
400
+ const { entries } = (0, markdown_js_1.parseMarkdown)(body, { file });
403
401
  // ADR-029: the whole-document Markdown pass is Markdown-only. Gate on the
404
402
  // file extension HERE so the invariant has one home — a caller that wires
405
- // formatMarkdownProse without its own guard (e.g. a future write tool, or
406
- // formatSource forwarding options with a source-file label) cannot silently
403
+ // formatMarkdownProse without its own guard (e.g. a future write tool
404
+ // forwarding options with a source-file label) cannot silently
407
405
  // reflow a source file's doc comment as Markdown. The CommonMark-semantic
408
406
  // gate cannot catch that class, so it must be prevented, not detected. The
409
407
  // CLI/LSP call-site guards remain as defense-in-depth.
@@ -416,12 +414,19 @@ function format(markdown, options) {
416
414
  return { output: markdown, diagnostics, changed: false };
417
415
  }
418
416
  const lines = body.split("\n");
419
- let changed = false;
417
+ let changed = repaired !== undefined;
420
418
  // Process bottom-to-top so line splicing doesn't shift earlier entries.
421
419
  const sorted = [...entries].sort((a, b) => b.location.line - a.location.line);
422
420
  const genUlid = options?.generateUlid ?? ulid_1.ulid;
423
421
  for (const entry of sorted) {
424
- const indent = (entry.location.column - 1) + 2;
422
+ const indent = (0, entry_body_js_1.contentColumn)(lines[entry.location.line - 1] ?? "", entry.location.column - 1);
423
+ // `entry.endLine` comes from the parse of the unedited buffer. Entries
424
+ // are processed bottom to top, so only this entry's own edits move its
425
+ // end; the change in line count since here measures them.
426
+ const lengthAtStart = lines.length;
427
+ const itemEndFloor = () => entry.endLine === undefined
428
+ ? 0
429
+ : entry.endLine + (lines.length - lengthAtStart);
425
430
  let attrs = [...entry.rawAttributes];
426
431
  const titleLineIdx = entry.location.line - 1;
427
432
  // #686: a title that soft-wraps onto extra physical lines is a single
@@ -436,7 +441,7 @@ function format(markdown, options) {
436
441
  // attribute block so a malformed entry with no blank line before its
437
442
  // trailer cannot swallow it.
438
443
  if (titleLineIdx >= 0 && titleLineIdx < lines.length) {
439
- const attrRange = findAttributeBlockRange(lines, entry.location.line, indent);
444
+ const attrRange = findAttributeBlockRange(lines, entry.location.line, indent, itemEndFloor());
440
445
  const limit = attrRange ? attrRange.start : lines.length;
441
446
  let titleEnd = titleLineIdx;
442
447
  while (titleEnd + 1 < limit && lines[titleEnd + 1].trim() !== "") {
@@ -518,7 +523,7 @@ function format(markdown, options) {
518
523
  if (attrs.length === 0)
519
524
  continue;
520
525
  const normalized = sortAttributes(expandCsvValues(attrs));
521
- const range = findAttributeBlockRange(lines, entry.location.line, indent);
526
+ const range = findAttributeBlockRange(lines, entry.location.line, indent, itemEndFloor());
522
527
  if (range) {
523
528
  // Replace existing attribute block.
524
529
  const newBlock = renderAttributeBlock(normalized, indent);
@@ -530,7 +535,7 @@ function format(markdown, options) {
530
535
  }
531
536
  else {
532
537
  // No attribute block — insert one after the entry body.
533
- const insertLine = findEntryBodyEnd(lines, entry, indent);
538
+ const insertLine = findEntryBodyEnd(lines, entry, indent, itemEndFloor());
534
539
  const newBlock = renderAttributeBlock(normalized, indent);
535
540
  lines.splice(insertLine, 0, "", ...newBlock.split("\n"));
536
541
  changed = true;
@@ -571,8 +576,11 @@ function format(markdown, options) {
571
576
  : entries;
572
577
  const extents = proseEntries.map((e) => {
573
578
  const start = e.location.line - 1;
574
- const entryIndent = (e.location.column - 1) + 2;
575
- return { start, end: findItemEnd(collapsedLines, start, entryIndent) };
579
+ const entryIndent = (0, entry_body_js_1.contentColumn)(collapsedLines[start] ?? "", e.location.column - 1);
580
+ return {
581
+ start,
582
+ end: findItemEnd(collapsedLines, start, entryIndent, e.endLine ?? 0),
583
+ };
576
584
  });
577
585
  const prose = (0, prose_js_1.formatProseSegments)(collapsedLines, extents, proseFormat);
578
586
  if (prose.changed)
@@ -637,16 +645,10 @@ function renderFrontMatter(attrs) {
637
645
  */
638
646
  function collapseBlankLines(lines) {
639
647
  const out = [];
640
- let inFence = false;
648
+ const fencedLines = (0, fence_js_1.fencedCodeLines)(lines.join("\n"));
641
649
  let prevBlank = false;
642
- for (const line of lines) {
643
- if (fence_js_1.FENCE_RE.test(line)) {
644
- out.push(line);
645
- inFence = !inFence;
646
- prevBlank = false;
647
- continue;
648
- }
649
- if (inFence) {
650
+ for (const [i, line] of lines.entries()) {
651
+ if (fencedLines.has(i)) {
650
652
  out.push(line);
651
653
  prevBlank = false;
652
654
  continue;
@@ -743,8 +745,8 @@ function sortAttributes(attributes) {
743
745
  * no trailing line-continuation characters.
744
746
  *
745
747
  * @param attributes - The attributes to render, in canonical order.
746
- * @param indent - Body indent for the entry (2 for list-wrapped entries,
747
- * 0 for entries inside source-file doc comments).
748
+ * @param indent - The 0-based list item content column, or 0 inside
749
+ * source-file doc comments.
748
750
  */
749
751
  function renderAttributeBlock(attributes, indent) {
750
752
  const prefix = " ".repeat(indent + 4);
@@ -755,18 +757,26 @@ function renderAttributeBlock(attributes, indent) {
755
757
  /**
756
758
  * Find the 0-based line index where a list item's content ends.
757
759
  * Exported for the ADR-029 prose pass (entry-extent computation).
758
- * Scans forward from the entry start, stopping at: a sibling list item
759
- * (`- ` at the entry's marker column), a line with less indent, or EOF.
760
+ * Scans forward from the later of the line after the entry start and
761
+ * `itemEndFloor` until a line has less indent than the content column, a
762
+ * conventional sibling marker is found, or EOF. Pass the parser's
763
+ * `Entry.endLine` as `itemEndFloor` so that a lazy continuation line
764
+ * inside the item does not end the scan early; the default `0` keeps
765
+ * the indentation-only scan.
760
766
  */
761
- function findItemEnd(lines, startIdx, indent) {
767
+ function findItemEnd(lines, startIdx, indent, itemEndFloor = 0) {
762
768
  const indentStr = " ".repeat(indent);
763
- // The marker column is indent - 2 (e.g., indent 2 → marker at column 0).
769
+ // Recognize sibling bullets with one space after the marker.
764
770
  const markerPrefix = " ".repeat(Math.max(0, indent - 2)) + "- ";
765
- for (let i = startIdx + 1; i < lines.length; i++) {
771
+ // `itemEndFloor` is the 0-based index just after the item's last content
772
+ // line, from the parser's `Entry.endLine`. The scan starts there, because
773
+ // an indentation scan ends the item early at a lazy continuation line
774
+ // (a paragraph line indented less than the item content).
775
+ for (let i = Math.max(startIdx + 1, itemEndFloor); i < lines.length; i++) {
766
776
  const line = lines[i];
767
777
  if (line.trim() === "")
768
778
  continue;
769
- // Sibling list item at same level
779
+ // Sibling with a one-space marker; wider markers use the indent check.
770
780
  if (line.startsWith(markerPrefix))
771
781
  return i;
772
782
  // Line with less indent than continuation
@@ -775,6 +785,72 @@ function findItemEnd(lines, startIdx, indent) {
775
785
  }
776
786
  return lines.length;
777
787
  }
788
+ /** A trailer-shaped line whose value may be empty: `Key:` or `Key: value`. */
789
+ const TRAILER_SHAPED_RE = /^[A-Z][A-Za-z-]*:(?:\s.*)?$/;
790
+ /** A trailer-shaped line with no value: `Key:` (spec §2 makes it MSL-P021). */
791
+ const EMPTY_TRAILER_RE = /^([A-Z][A-Za-z-]*):\s*$/;
792
+ /**
793
+ * Remove empty-valued `Key:` lines from each entry's trailing trailer block.
794
+ *
795
+ * An empty-valued line is not a valid trailer (spec §2, MSL-P021), so the
796
+ * parser treats the whole trailing block as body code. Left alone, the
797
+ * main pass would fence that block and append a fresh `Id:`, silently
798
+ * turning real trace links into inert body text. An empty value carries no
799
+ * information, so dropping the line is lossless: an `Id:` placeholder then
800
+ * gets stamped in place and the remaining trailers stay trailers.
801
+ *
802
+ * Only touches a block of contiguous lines at the very end of an entry,
803
+ * indented at least four columns past the entry body, in which every line
804
+ * is trailer-shaped. Emits one MSL-F001 info diagnostic per removed line.
805
+ *
806
+ * @returns The repaired text, or `undefined` when nothing was removed.
807
+ */
808
+ function removeEmptyTrailerLines(body, entries, diagnostics) {
809
+ const lines = body.split("\n");
810
+ let removedAny = false;
811
+ const sorted = [...entries].sort((a, b) => b.location.line - a.location.line);
812
+ for (const entry of sorted) {
813
+ const indent = (0, entry_body_js_1.contentColumn)(lines[entry.location.line - 1] ?? "", entry.location.column - 1);
814
+ const startIdx = entry.location.line - 1;
815
+ let end = findItemEnd(lines, startIdx, indent, entry.endLine ?? 0);
816
+ while (end > startIdx && lines[end - 1].trim() === "")
817
+ end--;
818
+ let start = end;
819
+ while (start - 1 > startIdx && lines[start - 1].trim() !== "")
820
+ start--;
821
+ if (start >= end || start - 1 <= startIdx)
822
+ continue;
823
+ const trailerIndent = " ".repeat(indent + 4);
824
+ const block = lines.slice(start, end);
825
+ const isTrailerBlock = block.every((l) => l.startsWith(trailerIndent) && TRAILER_SHAPED_RE.test(l.trim()));
826
+ if (!isTrailerBlock)
827
+ continue;
828
+ const kept = block.filter((l) => !EMPTY_TRAILER_RE.test(l.trim()));
829
+ if (kept.length === block.length)
830
+ continue;
831
+ for (const l of block) {
832
+ const key = EMPTY_TRAILER_RE.exec(l.trim())?.[1];
833
+ if (key === undefined)
834
+ continue;
835
+ diagnostics.push({
836
+ code: "MSL-F001",
837
+ severity: "info",
838
+ message: `removed empty '${key}:' trailer line from ${entry.displayId}`,
839
+ location: entry.location,
840
+ });
841
+ }
842
+ if (kept.length > 0) {
843
+ lines.splice(start, end - start, ...kept);
844
+ }
845
+ else {
846
+ // Whole block was placeholders: drop it and its leading blank line.
847
+ const from = lines[start - 1].trim() === "" ? start - 1 : start;
848
+ lines.splice(from, end - from);
849
+ }
850
+ removedAny = true;
851
+ }
852
+ return removedAny ? lines.join("\n") : undefined;
853
+ }
778
854
  /**
779
855
  * Find the 0-based line range [start, end) of the attribute block
780
856
  * for an entry starting at the given line.
@@ -782,9 +858,9 @@ function findItemEnd(lines, startIdx, indent) {
782
858
  * Scans forward from the entry start to find the list item boundary,
783
859
  * then walks backwards to find the contiguous trailing attribute block.
784
860
  */
785
- function findAttributeBlockRange(lines, entryStartLine, indent) {
861
+ function findAttributeBlockRange(lines, entryStartLine, indent, itemEndFloor = 0) {
786
862
  const startIdx = entryStartLine - 1;
787
- const itemEnd = findItemEnd(lines, startIdx, indent);
863
+ const itemEnd = findItemEnd(lines, startIdx, indent, itemEndFloor);
788
864
  // Walk backwards from itemEnd, skip trailing blank lines.
789
865
  let scanEnd = itemEnd;
790
866
  while (scanEnd > startIdx && lines[scanEnd - 1].trim() === "") {
@@ -813,9 +889,9 @@ function findAttributeBlockRange(lines, entryStartLine, indent) {
813
889
  * Find the 0-based line index where a new attribute block should be inserted
814
890
  * (after the last non-blank body line of the entry).
815
891
  */
816
- function findEntryBodyEnd(lines, entry, indent) {
892
+ function findEntryBodyEnd(lines, entry, indent, itemEndFloor = 0) {
817
893
  const startIdx = entry.location.line - 1;
818
- const itemEnd = findItemEnd(lines, startIdx, indent);
894
+ const itemEnd = findItemEnd(lines, startIdx, indent, itemEndFloor);
819
895
  let insertAt = itemEnd;
820
896
  while (insertAt > startIdx && lines[insertAt - 1].trim() === "") {
821
897
  insertAt--;
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/gates/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,QAAQ,IAAI,YAAY,EAE9B,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,YAAY,CAChC,UAA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B,mBAAmB,EAAE,cAAc,GAAG,SAAS,GAC9C,OAAO,CAAC,UAAU,EAAE,CAAC,CAwCvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,KAAK,CAAC,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACtE,OAAO,CAAC,UAAU,EAAE,CAAC,CAuCvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,SAAS,GACpC,OAAO,CAAC,UAAU,EAAE,CAAC,CAQvB"}
@@ -22,11 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.fmtDriftGate = fmtDriftGate;
23
23
  exports.lockfileDriftGate = lockfileDriftGate;
24
24
  exports.proseLintGate = proseLintGate;
25
- const mod_js_1 = require("../formatter/mod.js");
26
- const mod_js_2 = require("../parser/mod.js");
27
- const mod_js_3 = require("../refs/mod.js");
28
- const mod_js_4 = require("../lock/mod.js");
29
- const mod_js_5 = require("../lint/mod.js");
25
+ const mod_js_1 = require("../model/mod.js");
26
+ const mod_js_2 = require("../formatter/mod.js");
27
+ const mod_js_3 = require("../parser/mod.js");
28
+ const mod_js_4 = require("../refs/mod.js");
29
+ const mod_js_5 = require("../lock/mod.js");
30
+ const mod_js_6 = require("../lint/mod.js");
30
31
  /**
31
32
  * Format-drift gate — the `MSL-F010` (formatter drift) and `MSL-F011`
32
33
  * (reference-canonicalization drift) findings.
@@ -57,9 +58,9 @@ async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
57
58
  // consumer using a delivered corpus. Filter to `!e.origin`, mirroring
58
59
  // lockfileDriftGate — deliberately BROADER than the validators'
59
60
  // `emittableEntries` (upstream-only, #771); do not "unify" it.
60
- const refIndex = (0, mod_js_3.buildRefIndex)(entries.filter((e) => !e.origin));
61
+ const refIndex = (0, mod_js_4.buildRefIndex)(entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e)));
61
62
  for (const [filePath, content] of mdContents) {
62
- const formatted = (0, mod_js_1.format)(content, {
63
+ const formatted = (0, mod_js_2.format)(content, {
63
64
  file: filePath,
64
65
  formatMarkdownProse,
65
66
  });
@@ -71,8 +72,8 @@ async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
71
72
  location: { file: filePath, line: 1, column: 1 },
72
73
  });
73
74
  }
74
- const parsed = await (0, mod_js_2.parseFile)(formatted.output, { file: filePath });
75
- const refResult = (0, mod_js_3.canonicalizeRefs)(formatted.output, parsed.entries, refIndex, ledger);
75
+ const parsed = await (0, mod_js_3.parseFile)(formatted.output, { file: filePath });
76
+ const refResult = (0, mod_js_4.canonicalizeRefs)(formatted.output, parsed.entries, refIndex, ledger);
76
77
  if (refResult.changed) {
77
78
  diagnostics.push({
78
79
  code: "MSL-F011",
@@ -119,18 +120,18 @@ async function lockfileDriftGate(lockParse, lockPath, entries, cache) {
119
120
  // `!e.origin` (project-owned only) — deliberately BROADER than the
120
121
  // validators' `emittableEntries` partition (upstream-only, #771): the
121
122
  // edge ledger records only edges the project authors.
122
- const projectEntries = entries.filter((e) => !e.origin);
123
- const drift = await (0, mod_js_4.detectOfflineEdgeDrift)(projectEntries, lockParse.lockfile.generatedCache);
123
+ const projectEntries = entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e));
124
+ const drift = await (0, mod_js_5.detectOfflineEdgeDrift)(projectEntries, lockParse.lockfile.generatedCache);
124
125
  const diagnostics = drift.drifted
125
126
  ? [{
126
127
  code: "MSL-L212",
127
128
  severity: "error",
128
- message: `traceability edges drifted from markspec.lock: locked ${drift.lockedCount} edge(s), current ${drift.currentCount} — run \`markspec lock\` to refresh. (After upgrading MarkSpec this can also fire once because traceability inputs now include source-file doc comments; re-running \`markspec lock\` clears it.)`,
129
+ message: (0, mod_js_5.formatEdgeDriftMessage)(drift.lockedCount, drift.currentCount),
129
130
  location: { file: lockPath, line: 1, column: 1 },
130
131
  }]
131
132
  : [];
132
133
  if (cache !== undefined) {
133
- const cacheDiags = await (0, mod_js_4.verifyUpstreamCache)(lockParse.lockfile.upstreams, cache.cacheRoot, cache.readFile);
134
+ const cacheDiags = await (0, mod_js_5.verifyUpstreamCache)(lockParse.lockfile.upstreams, cache.cacheRoot, cache.readFile);
134
135
  // verifyUpstreamCache is a reusable, lockfile-path-agnostic probe and
135
136
  // emits `location: undefined` (see cache_check.ts). Stamp the same
136
137
  // lockfile location the sibling edge-drift MSL-L212 above uses, so both
@@ -161,7 +162,7 @@ async function lockfileDriftGate(lockParse, lockPath, entries, cache) {
161
162
  * file indexing) is not needed here: `check` passes no `glossaryFilePaths`.
162
163
  */
163
164
  async function proseLintGate(entries, profile) {
164
- const lintResult = await (0, mod_js_5.runLint)({ entries, profile });
165
+ const lintResult = await (0, mod_js_6.runLint)({ entries, profile });
165
166
  return lintResult.diagnostics.map((d) => ({
166
167
  code: d.code,
167
168
  severity: d.severity,
@@ -1 +1 @@
1
- {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAKT;AAM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gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA+FvE"}
@@ -125,7 +125,7 @@ async function runLint(options) {
125
125
  // validated but is never prose-linted — do not "unify" this filter.
126
126
  const inScopeDiags = new Map();
127
127
  for (const entry of entries) {
128
- if (entry.origin)
128
+ if ((0, mod_js_1.isCorpusEntry)(entry))
129
129
  continue;
130
130
  if (!isProseScope(entry, profile))
131
131
  continue;
@@ -153,7 +153,7 @@ async function runLint(options) {
153
153
  for (const entry of entries) {
154
154
  if (entry.shape !== "Authored")
155
155
  continue;
156
- if (entry.origin)
156
+ if ((0, mod_js_1.isCorpusEntry)(entry))
157
157
  continue;
158
158
  hygieneDiags.push(...(0, suppression_js_1.runSuppressionRules)(entry));
159
159
  }
@@ -188,6 +188,6 @@ async function runLint(options) {
188
188
  // ones). Corpus entries are excluded — counting them would skew band-counts
189
189
  // and the mean on prose a consumer cannot act on (ADR-030 §D4). A no-op when
190
190
  // no corpus is present.
191
- const score = (0, score_js_1.computeScoreRollup)(out, entries.filter((e) => !e.origin));
191
+ const score = (0, score_js_1.computeScoreRollup)(out, entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e)));
192
192
  return { diagnostics: out, score };
193
193
  }
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/lock/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACtC,UAAU,EAAE,CA0Jd"}
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/lock/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACtC,UAAU,EAAE,CA4Jd"}
@@ -22,6 +22,7 @@
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.checkDrift = checkDrift;
25
+ const edge_drift_js_1 = require("./edge_drift.js");
25
26
  /**
26
27
  * Compare locked vs resolved upstreams; return one diagnostic per drift
27
28
  * case. An empty result means the lockfile is in sync with the current
@@ -160,7 +161,7 @@ function checkDrift(locked, resolved, declaredReferenceIds) {
160
161
  diags.push({
161
162
  code: "MSL-L212",
162
163
  severity: "error",
163
- message: `Canonical edge hash drifted: locked ${locked.generatedCache.edgesHash} (${locked.generatedCache.edgesCount} edges) vs current ${resolved.canonicalEdgeHash} (${resolved.canonicalEdgeCount} edges).`,
164
+ message: (0, edge_drift_js_1.formatEdgeDriftMessage)(locked.generatedCache.edgesCount, resolved.canonicalEdgeCount),
164
165
  location: undefined,
165
166
  });
166
167
  }
@@ -18,6 +18,8 @@ export interface OfflineEdgeDrift {
18
18
  /** Edge count in the current project graph. */
19
19
  readonly currentCount: number;
20
20
  }
21
+ /** Build the actionable edge-drift message shared by CLI and core checks. */
22
+ export declare function formatEdgeDriftMessage(lockedCount: number, currentCount: number): string;
21
23
  /**
22
24
  * Compare the current project graph's canonical edge hash against a
23
25
  * lockfile's generated-cache. Offline by design — no upstream resolution.
@@ -1 +1 @@
1
- {"version":3,"file":"edge_drift.d.ts","sourceRoot":"","sources":["../../src/lock/edge_drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,SAAS,KAAK,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
1
+ {"version":3,"file":"edge_drift.d.ts","sourceRoot":"","sources":["../../src/lock/edge_drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,SAAS,KAAK,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
@@ -9,9 +9,14 @@
9
9
  * can never disagree on what "drift" means.
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.formatEdgeDriftMessage = formatEdgeDriftMessage;
12
13
  exports.detectOfflineEdgeDrift = detectOfflineEdgeDrift;
13
14
  const resolve_js_1 = require("./resolve.js");
14
15
  const canonical_edges_js_1 = require("./canonical_edges.js");
16
+ /** Build the actionable edge-drift message shared by CLI and core checks. */
17
+ function formatEdgeDriftMessage(lockedCount, currentCount) {
18
+ return `traceability edges drifted from markspec.lock: locked ${lockedCount} edge(s), current ${currentCount} — run \`markspec lock\` to refresh. (After upgrading MarkSpec this can also fire once because traceability inputs now include source-file doc comments; re-running \`markspec lock\` clears it.)`;
19
+ }
15
20
  /**
16
21
  * Compare the current project graph's canonical edge hash against a
17
22
  * lockfile's generated-cache. Offline by design — no upstream resolution.
@@ -16,7 +16,7 @@ export { checkDrift } from "./check.js";
16
16
  export { sha256Bytes, sha256String } from "./hash.js";
17
17
  export { canonicalEdgeJson, hashCanonicalEdges } from "./canonical_edges.js";
18
18
  export type { EdgeQuad } from "./canonical_edges.js";
19
- export { detectOfflineEdgeDrift } from "./edge_drift.js";
19
+ export { detectOfflineEdgeDrift, formatEdgeDriftMessage, } from "./edge_drift.js";
20
20
  export type { OfflineEdgeDrift } from "./edge_drift.js";
21
21
  export { verifyUpstreamCache } from "./cache_check.js";
22
22
  export { extractEdgeLedger, extractEdgeQuads, resolveBoundEntries, resolveProfileChain, resolveReferences, resolveUpstreams, } from "./resolve.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/lock/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,iBAAiB,EACjB,gBAAg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"}
@@ -7,7 +7,7 @@
7
7
  * for both `markspec lock` and `markspec compile --frozen`.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.resolveIntent = exports.parseLsRemote = exports.compileAcquiredTree = exports.resolveProjectDependencies = exports.upstreamCacheRoot = exports.resolveProjectReferences = exports.deriveUpstreamId = exports.resolveUpstreams = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.extractEdgeQuads = exports.extractEdgeLedger = exports.verifyUpstreamCache = exports.detectOfflineEdgeDrift = exports.hashCanonicalEdges = exports.canonicalEdgeJson = exports.sha256String = exports.sha256Bytes = exports.checkDrift = exports.isBelowFloor = exports.dependencyPinAssurance = exports.parseLockfile = exports.serializeLockfile = exports.LOCKFILE_SCHEMA_VERSION = void 0;
10
+ exports.resolveIntent = exports.parseLsRemote = exports.compileAcquiredTree = exports.resolveProjectDependencies = exports.upstreamCacheRoot = exports.resolveProjectReferences = exports.deriveUpstreamId = exports.resolveUpstreams = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.extractEdgeQuads = exports.extractEdgeLedger = exports.verifyUpstreamCache = exports.formatEdgeDriftMessage = exports.detectOfflineEdgeDrift = exports.hashCanonicalEdges = exports.canonicalEdgeJson = exports.sha256String = exports.sha256Bytes = exports.checkDrift = exports.isBelowFloor = exports.dependencyPinAssurance = exports.parseLockfile = exports.serializeLockfile = exports.LOCKFILE_SCHEMA_VERSION = void 0;
11
11
  var model_js_1 = require("./model.js");
12
12
  Object.defineProperty(exports, "LOCKFILE_SCHEMA_VERSION", { enumerable: true, get: function () { return model_js_1.LOCKFILE_SCHEMA_VERSION; } });
13
13
  var serializer_js_1 = require("./serializer.js");
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "canonicalEdgeJson", { enumerable: true, get: fun
28
28
  Object.defineProperty(exports, "hashCanonicalEdges", { enumerable: true, get: function () { return canonical_edges_js_1.hashCanonicalEdges; } });
29
29
  var edge_drift_js_1 = require("./edge_drift.js");
30
30
  Object.defineProperty(exports, "detectOfflineEdgeDrift", { enumerable: true, get: function () { return edge_drift_js_1.detectOfflineEdgeDrift; } });
31
+ Object.defineProperty(exports, "formatEdgeDriftMessage", { enumerable: true, get: function () { return edge_drift_js_1.formatEdgeDriftMessage; } });
31
32
  var cache_check_js_1 = require("./cache_check.js");
32
33
  Object.defineProperty(exports, "verifyUpstreamCache", { enumerable: true, get: function () { return cache_check_js_1.verifyUpstreamCache; } });
33
34
  var resolve_js_1 = require("./resolve.js");
package/script/mod.d.ts CHANGED
@@ -8,8 +8,8 @@
8
8
  * from core/mod.ts, never from internal paths.
9
9
  */
10
10
  import "./_dnt.polyfills.js";
11
- export declare const VERSION = "0.11.0";
12
- export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, CORE_SCHEMA_VERSION, DEFAULT_PROJECT_CONFIG, descendantsOf, emittableEntries, formatEntryOrigin, isUpstreamEntry, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, sameOriginSource, } from "./model/mod.js";
11
+ export declare const VERSION = "0.12.0";
12
+ export { ConfigError, CORE_DISCIPLINE_REGISTRY, CORE_KINDS, CORE_RELATIONS, CORE_SCHEMA_VERSION, DEFAULT_PROJECT_CONFIG, descendantsOf, emittableEntries, formatEntryOrigin, isCorpusEntry, isUpstreamEntry, KNOWN_LINK_KINDS, LOCK_EXTRA_INVERSE_KEYS, makeDisplayId, makeUlid, MIXED_DISCIPLINE, PALETTE_HUES, sameOriginSource, } from "./model/mod.js";
13
13
  export type { Attribute, BodyToken, BodyTokenKind, Caption, CaptionConventions, CaptionPosition, ConfigFieldError, DeliveredDocument, Diagnostic, Directive, Discipline, DisciplineRegistry, DisplayId, EarsTrigger, EffectiveProfile, EffectiveTypeDef, EntityRefConvention, Entry, EntryOrigin, EntryShape, EntrySource, ExtractorRule, InlineRef, KindDecl, LabelConcern, LabelConcernKind, LabelValue, Link, LinkKind, LoadedProfile, ModalCase, PaletteHue, ProfileChain, ProfileConvention, ProjectConfig, ProjectRef, ProvenancedMap, ProvenancedMapEntry, ProvenancedValue, RelationDef, Severity, SourceLocation, Ulid, } from "./model/mod.js";
14
14
  export { astEquivalent } from "./ast/equivalence.js";
15
15
  export { normalizeBodyAst } from "./ast/normalize.js";
@@ -34,9 +34,11 @@ export { detectCaptions, detectDirectives, detectInlineRefs, isSupportedExtensio
34
34
  export type { DetectCaptionsOptions, DetectDirectivesOptions, DetectInlineRefsOptions, DocCommentBlockMeta, LanguageDocCommentSpec, LineMap, ParseFileResult, ParseOptions, ParseSourceOptions, ParseSourceResult, SupportedLanguage, } from "./parser/mod.js";
35
35
  export { format } from "./formatter/mod.js";
36
36
  export type { FormatOptions, FormatResult } from "./formatter/mod.js";
37
+ export { readEntryBody, replaceEntryBody } from "./formatter/entry_body.js";
38
+ export type { EntryBodyEdit, EntryBodyRefusal, } from "./formatter/entry_body.js";
37
39
  export { loadMarkdownFormatter, MARKSPEC_MARKDOWN_GLOBAL_CONFIG, MARKSPEC_MARKDOWN_PLUGIN_CONFIG, } from "./formatter/dprint.js";
38
40
  export type { ProseFormatOptions, ProseFormatter } from "./formatter/dprint.js";
39
- export { attributeCorpusDiagnostics, classifyEntriesStage, classifyEntry, compileDisplayIdPattern, detectCorpusCollisions, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, suppressDeclaredAttrR010, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
41
+ export { applyCorpusPostPass, attributeCorpusDiagnostics, classifyEntriesStage, classifyEntry, compileDisplayIdPattern, detectCorpusCollisions, effectiveScope, effectiveTraceRules, matchesAnyTarget, normalizeListValues, runPipeline, suppressDeclaredAttrR010, validate, validateAttributesForEntry, validateListingDocuments, validateTraceabilityForEntry, validateValue, } from "./validator/mod.js";
40
42
  export type { ClassifyResult, ClassifyStageResult, CorpusCollisionResult, EffectiveAttrScope, ListingFileContext, ListingKind, PipelineOptions, PipelineResult, ValidateResult, ValueValidator, } from "./validator/mod.js";
41
43
  export { compile, generateInverses, serializeCompileResult, } from "./compiler/mod.js";
42
44
  export type { CompileOptions, CompileResult, GenerateInversesResult, SerializedCompileResult, SerializedEntry, SerializedTypeRegistry, } from "./compiler/mod.js";
@@ -51,12 +53,12 @@ export type { EntryScore, LintDiagnostic, LintOptions, LintResult, RuleContribut
51
53
  export * as typl from "./typl/mod.js";
52
54
  export { uxilDeclaringTypes, validateUxilFamily, } from "./validator/uxil_family.js";
53
55
  export * as uxil from "./uxil/mod.js";
54
- export { canonicalEdgeJson, checkDrift, compileAcquiredTree, dependencyPinAssurance, deriveUpstreamId, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, parseLsRemote, resolveBoundEntries, resolveIntent, resolveProfileChain, resolveProjectDependencies, resolveProjectReferences, resolveReferences, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, upstreamCacheRoot, verifyUpstreamCache, } from "./lock/mod.js";
56
+ export { canonicalEdgeJson, checkDrift, compileAcquiredTree, dependencyPinAssurance, deriveUpstreamId, detectOfflineEdgeDrift, extractEdgeLedger, extractEdgeQuads, formatEdgeDriftMessage, hashCanonicalEdges, isBelowFloor, LOCKFILE_SCHEMA_VERSION, parseLockfile, parseLsRemote, resolveBoundEntries, resolveIntent, resolveProfileChain, resolveProjectDependencies, resolveProjectReferences, resolveReferences, resolveUpstreams, serializeLockfile, sha256Bytes, sha256String, upstreamCacheRoot, verifyUpstreamCache, } from "./lock/mod.js";
55
57
  export type { AcquireCompileIO, BoundEntry as LockBoundEntry, BoundEntryBinding as LockBinding, CompiledSnapshot, EdgeQuad, FetchUrl, GeneratedCache, GitIO, GitRef, LockedAttributes, LockEdge, Lockfile, LockfileMeta, LockfileToolchain, OfflineEdgeDrift, ParseLockfileResult, ReadFile as LockReadFile, RefList, ResolvedBoundEntry, ResolvedIntent, ResolvedProfile, ResolvedReference, ResolvedUpstreams, ResolveProjectDependenciesOptions, ResolveProjectDependenciesResult, ResolveProjectReferencesOptions, ResolveProjectReferencesResult, ResolveUpstreamsOptions, Upstream, UpstreamDependency, UpstreamDepsIO, UpstreamProfile, UpstreamReference, UpstreamRefsIO, UpstreamRegistry, } from "./lock/mod.js";
56
58
  export { buildRefIndex, canonicalizeRefs, TRACE_ATTRIBUTE_KEYS, } from "./refs/mod.js";
57
59
  export type { RefIndex } from "./refs/mod.js";
58
60
  export { fmtDriftGate, lockfileDriftGate, proseLintGate } from "./gates/mod.js";
59
- export { FENCE_RE, isLineFenced, walkProseLines } from "./util/fence.js";
61
+ export { FENCE_RE, fencedCodeLines, isLineFenced, walkProseLines, } from "./util/fence.js";
60
62
  export type { ProseLineCallback } from "./util/fence.js";
61
63
  export { isUnsafeRelPath } from "./util/paths.js";
62
64
  export { aggregateStatusByState, encodeLogLine, inferLockedAttributes, parseLogLine, parseMapping, validateMappings, } from "./sync/mod.js";
@@ -64,7 +66,9 @@ export type { AttributeMapping, BoundEntryStatus, ConflictPolicy, Direction as S
64
66
  export { type Arch as SelfUpgradeArch, assertTrustedReleaseUrl, classifyInstallPath, type ClassifyResult as SelfUpgradeClassifyResult, compareVersions, type Comparison, DEFAULT_RELEASES_API, DEFAULT_RELEASES_DOWNLOAD_BASE, detectTarget, type InstallSource, type Os as SelfUpgradeOs, parseSha256Line, type Platform as SelfUpgradePlatform, platformFromBuild, type ReleaseAssets, releaseAssets, type ReleaseEndpoints, type ResolveEndpointsInput, resolveReleaseEndpoints, type Target as SelfUpgradeTarget, } from "./self_upgrade/mod.js";
65
67
  export { discoverFiles, isIgnored, MARKDOWN_EXTENSIONS, parseGitignore, RELEVANT_EXTENSIONS, SOURCE_EXTENSIONS, } from "./discovery/mod.js";
66
68
  export type { DiscoverOptions, DiscoveryDirEntry, DiscoveryIO, GitignoreRule, } from "./discovery/mod.js";
67
- export { collectProjectEntries } from "./collect/mod.js";
69
+ export { createProjectRootResolver, discoverProjectRoots, findNestedProjectRoots, isWithin, nearestRoot, resolveConfigRoot, } from "./discovery/projects.js";
70
+ export type { ProjectDiscoveryOptions, ProjectRootResolver, } from "./discovery/projects.js";
71
+ export { collectProjectEntries, UnreadableProjectFileError, } from "./collect/mod.js";
68
72
  export type { CollectOptions } from "./collect/mod.js";
69
73
  export { checkSnapshotSchema, deserializeEntry, extractSerializedEntries, } from "./compiler/deserialize.js";
70
74
  export type { ExtractedEntries } from "./compiler/deserialize.js";