@agentshouse/mdmodel 0.1.0-c64dbada0730d → 0.1.0-c679f403bf3fb

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 (53) hide show
  1. package/API.md +230 -216
  2. package/README.md +15 -18
  3. package/dist/blocks.d.ts.map +1 -1
  4. package/dist/blocks.js +7 -14
  5. package/dist/condition.d.ts +21 -8
  6. package/dist/condition.d.ts.map +1 -1
  7. package/dist/condition.js +208 -89
  8. package/dist/definition.d.ts +16 -1
  9. package/dist/definition.d.ts.map +1 -1
  10. package/dist/definition.js +255 -29
  11. package/dist/divide.d.ts.map +1 -1
  12. package/dist/divide.js +27 -17
  13. package/dist/document.d.ts +6 -3
  14. package/dist/document.d.ts.map +1 -1
  15. package/dist/document.js +315 -167
  16. package/dist/fields.d.ts +2 -0
  17. package/dist/fields.d.ts.map +1 -1
  18. package/dist/fields.js +7 -0
  19. package/dist/index.d.ts +14 -8
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +7 -5
  22. package/dist/links.d.ts +3 -0
  23. package/dist/links.d.ts.map +1 -1
  24. package/dist/links.js +66 -40
  25. package/dist/paths.d.ts +10 -1
  26. package/dist/paths.d.ts.map +1 -1
  27. package/dist/paths.js +115 -12
  28. package/dist/project.d.ts +1 -0
  29. package/dist/project.d.ts.map +1 -1
  30. package/dist/project.js +38 -15
  31. package/dist/references.d.ts +2 -2
  32. package/dist/references.d.ts.map +1 -1
  33. package/dist/references.js +6 -1
  34. package/dist/schema.js +2 -2
  35. package/dist/types.d.ts +49 -2
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/validate.d.ts +30 -2
  38. package/dist/validate.d.ts.map +1 -1
  39. package/dist/validate.js +290 -115
  40. package/dist/yaml.d.ts +7 -3
  41. package/dist/yaml.d.ts.map +1 -1
  42. package/dist/yaml.js +72 -43
  43. package/fixtures/README.md +6 -5
  44. package/fixtures/cases/cross-room-link/context.json +1 -0
  45. package/fixtures/cases/cross-room-link/expected.json +1 -0
  46. package/fixtures/cases/cross-room-link/library/clients/acme.md +6 -0
  47. package/fixtures/cases/cross-room-link/schema.yaml +3 -0
  48. package/fixtures/cases/cross-room-reference/context.json +1 -0
  49. package/fixtures/cases/cross-room-reference/expected.json +1 -0
  50. package/fixtures/cases/cross-room-reference/library/clients/acme.md +9 -0
  51. package/fixtures/cases/cross-room-reference/schema.yaml +9 -0
  52. package/fixtures/division.json +26 -26
  53. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,KAAK;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAnC,YAAqB,MAAM,EAAE,MAAM,EAGlC;CACF;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IAC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E,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG3E;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAqB9F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAgBjE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAEzD"}
package/dist/yaml.js CHANGED
@@ -84,6 +84,30 @@ export function interpretPlain(text) {
84
84
  return Number(text);
85
85
  return text;
86
86
  }
87
+ const ESCAPES = {
88
+ b: '\b',
89
+ f: '\f',
90
+ n: '\n',
91
+ r: '\r',
92
+ t: '\t',
93
+ '"': '"',
94
+ '/': '/',
95
+ '\\': '\\',
96
+ };
97
+ function parseEscape(c) {
98
+ c.i += 1;
99
+ const escaped = peek(c);
100
+ const held = ESCAPES[escaped];
101
+ if (held !== undefined) {
102
+ c.i += 1;
103
+ return held;
104
+ }
105
+ const hex = c.text.slice(c.i + 1, c.i + 5);
106
+ if (escaped !== 'u' || c.i + 5 > c.end || !/^[0-9A-Fa-f]{4}$/.test(hex))
107
+ throw new YamlError(c.i);
108
+ c.i += 5;
109
+ return String.fromCharCode(Number.parseInt(hex, 16));
110
+ }
87
111
  function parseQuoted(c) {
88
112
  const quote = peek(c);
89
113
  const start = c.i;
@@ -91,31 +115,19 @@ function parseQuoted(c) {
91
115
  let out = '';
92
116
  while (c.i < c.end) {
93
117
  const ch = peek(c);
118
+ if (quote === "'" && ch === "'" && c.i + 1 < c.end && c.text[c.i + 1] === "'") {
119
+ out += "'";
120
+ c.i += 2;
121
+ continue;
122
+ }
94
123
  if (ch === quote) {
95
124
  c.i += 1;
96
125
  return scalar(out, start, c.i);
97
126
  }
98
127
  if (ch === '\n' || ch === '\r')
99
128
  throw new YamlError(c.i);
100
- if (quote === "'" && ch === "'" && c.text[c.i + 1] === "'") {
101
- out += "'";
102
- c.i += 2;
103
- continue;
104
- }
105
129
  if (quote === '"' && ch === '\\') {
106
- c.i += 1;
107
- const escaped = peek(c);
108
- if (escaped === 'n')
109
- out += '\n';
110
- else if (escaped === 't')
111
- out += '\t';
112
- else if (escaped === '"')
113
- out += '"';
114
- else if (escaped === '\\')
115
- out += '\\';
116
- else
117
- throw new YamlError(c.i);
118
- c.i += 1;
130
+ out += parseEscape(c);
119
131
  continue;
120
132
  }
121
133
  out += ch;
@@ -208,11 +220,12 @@ function parseFlowMap(c) {
208
220
  if (peek(c) !== ':')
209
221
  throw new YamlError(c.i);
210
222
  c.i += 1;
223
+ const after = c.i;
211
224
  const value = parseFlowValue(c);
212
225
  if (seen.has(key.name))
213
226
  throw new YamlError(key.start);
214
227
  seen.add(key.name);
215
- entries.push({ key: key.name, keyStart: key.start, keyEnd: key.end, value });
228
+ entries.push({ key: key.name, after, value });
216
229
  skipFlowSpace(c);
217
230
  if (peek(c) === ',') {
218
231
  c.i += 1;
@@ -254,6 +267,7 @@ function parseFlowSeq(c) {
254
267
  throw new YamlError(c.i);
255
268
  }
256
269
  function parseValue(c, parentKeyIndent) {
270
+ const at = c.i;
257
271
  skipSpaces(c);
258
272
  if (peek(c) === '#')
259
273
  skipToEol(c);
@@ -262,12 +276,12 @@ function parseValue(c, parentKeyIndent) {
262
276
  skipEol(c);
263
277
  skipBlankAndComments(c);
264
278
  if (c.i >= c.end)
265
- return scalar(null, c.i, c.i);
279
+ return scalar(null, at, at);
266
280
  const nextIndent = indentAt(c);
267
281
  if (nextIndent === parentKeyIndent && seqAhead(c))
268
282
  return parseBlockSeq(c, nextIndent);
269
283
  if (nextIndent <= parentKeyIndent)
270
- return scalar(null, c.i, c.i);
284
+ return scalar(null, at, at);
271
285
  if (peek(c) === '-')
272
286
  return parseBlockSeq(c, nextIndent);
273
287
  if (peek(c) === '[')
@@ -315,9 +329,6 @@ function lineStartOf(c) {
315
329
  j -= 1;
316
330
  return j;
317
331
  }
318
- function valueEnd(value, marked) {
319
- return value.kind === 'scalar' && value.start === value.end ? marked : value.end;
320
- }
321
332
  function parseSeqItem(c, indent) {
322
333
  skipSpaces(c);
323
334
  if (peek(c) !== '#' && peek(c) !== '\n' && peek(c) !== '\r' && c.i < c.end && mappingAhead(c))
@@ -337,10 +348,9 @@ function parseBlockSeq(c, indent) {
337
348
  if (peek(c) !== '-')
338
349
  break;
339
350
  c.i += 1;
340
- const marked = c.i;
341
351
  const item = parseSeqItem(c, indent);
342
352
  items.push(item);
343
- end = valueEnd(item, marked);
353
+ end = item.end;
344
354
  }
345
355
  return { kind: 'seq', items, start, end };
346
356
  }
@@ -366,13 +376,13 @@ function parseBlockMap(c, indent, inline = false) {
366
376
  if (peek(c) !== ':')
367
377
  throw new YamlError(c.i);
368
378
  c.i += 1;
369
- const marked = c.i;
379
+ const after = c.i;
370
380
  const value = parseValue(c, indent);
371
381
  if (seen.has(key.name))
372
382
  throw new YamlError(key.start);
373
383
  seen.add(key.name);
374
- entries.push({ key: key.name, keyStart: key.start, keyEnd: key.end, value });
375
- end = valueEnd(value, marked);
384
+ entries.push({ key: key.name, after, value });
385
+ end = value.end;
376
386
  }
377
387
  return { kind: 'map', entries, start, end };
378
388
  }
@@ -418,24 +428,42 @@ export function isPlainSafe(text) {
418
428
  return false;
419
429
  return true;
420
430
  }
431
+ export function plain(value) {
432
+ if (!isRecord(value))
433
+ return false;
434
+ const prototype = Object.getPrototypeOf(value);
435
+ return prototype === Object.prototype || prototype === null;
436
+ }
437
+ function listed(value) {
438
+ const keys = Object.keys(value);
439
+ return keys.length === value.length && keys.every((key, index) => key === String(index));
440
+ }
441
+ function heldWithin(value, within) {
442
+ if (value === null || typeof value === 'string' || typeof value === 'boolean')
443
+ return true;
444
+ if (typeof value === 'number')
445
+ return Number.isFinite(value);
446
+ if (typeof value !== 'object' || within.includes(value))
447
+ return false;
448
+ const path = [...within, value];
449
+ const held = (item) => heldWithin(item, path);
450
+ if (Array.isArray(value))
451
+ return listed(value) && value.every(held);
452
+ return plain(value) && Object.values(value).every(held);
453
+ }
454
+ export function frontmatterValue(value) {
455
+ return heldWithin(value, []);
456
+ }
421
457
  export function serializeJs(value) {
422
- if (value === null)
423
- return 'null';
424
- if (value === true)
425
- return 'true';
426
- if (value === false)
427
- return 'false';
428
- if (typeof value === 'number' && Number.isFinite(value))
429
- return JSON.stringify(value);
430
458
  if (typeof value === 'string')
431
459
  return isPlainSafe(value) ? value : JSON.stringify(value);
460
+ if (value === null || typeof value !== 'object')
461
+ return JSON.stringify(value);
432
462
  if (Array.isArray(value))
433
463
  return `[${value.map(serializeJs).join(', ')}]`;
434
- if (isRecord(value))
435
- return `{${Object.entries(value)
436
- .map(([key, held]) => `${serializeKey(key)}: ${serializeJs(held)}`)
437
- .join(', ')}}`;
438
- throw new YamlError(0);
464
+ return `{${Object.entries(value)
465
+ .map(([key, held]) => `${serializeKey(key)}: ${serializeJs(held)}`)
466
+ .join(', ')}}`;
439
467
  }
440
468
  export function isRecord(value) {
441
469
  return value !== null && typeof value === 'object' && !Array.isArray(value);
@@ -485,7 +513,8 @@ export function equalValue(left, right) {
485
513
  if (left === right)
486
514
  return true;
487
515
  if (Array.isArray(left) && Array.isArray(right)) {
488
- return (left.length === right.length && left.every((item, index) => equalValue(item, right[index])));
516
+ return (left.length === right.length &&
517
+ Array.from(left).every((item, index) => equalValue(item, right[index])));
489
518
  }
490
519
  if (isRecord(left) && isRecord(right)) {
491
520
  const keys = Object.keys(left);
@@ -51,8 +51,8 @@ change to a value that is not prose leaves the projection alone.
51
51
 
52
52
  `division.json` exercises the public `divide` seam separately from the
53
53
  validation Libraries. It carries `schema` and `cases` like `projection.json`,
54
- and each case adds the `budget` the division runs under. Parse the source, call
55
- `divide(document, file, context)` with `{ documentTargets, definition, budget }`,
54
+ and each case adds the `bound` the division runs under. Parse the source, call
55
+ `divide(document, file, context)` with `{ documentTargets, definition, bound }`,
56
56
  and compare against `expected`: either `{ "ok": true, "spans": [...] }`, where
57
57
  each span carries the exact `text` to embed and the exact `source` the returned
58
58
  `start` and `end` address in that case's source, or `{ "ok": false, "refusal": ... }`. Then
@@ -107,6 +107,7 @@ schema text. The model's own rules:
107
107
  | `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
108
108
  | `schema-yaml` | A schema text is not a mapping in the accepted YAML subset |
109
109
  | `schema-type-name` | A type name is empty, starts with `$`, or is `any` or `attachment` |
110
+ | `provided-type` | A schema names a type its caller provides with a key but its two role keywords |
110
111
  | `schema` | A type or subschema is neither a mapping nor a boolean |
111
112
  | `schema-keyword` | A schema carries a key that is no JSON Schema 2020-12 keyword the model admits |
112
113
  | `$defs` | `$defs` is not a mapping |
@@ -122,9 +123,9 @@ schema text. The model's own rules:
122
123
  | `structured-section` | A declared list section is not a list of values of its item schema |
123
124
  | `referenced-missing-file` | Remaining files still reference an absent path |
124
125
  | `unwritable-link` | No Markdown destination form can carry a new link destination |
125
- | `division-budget` | A division budget is not a whole number of at least 2 |
126
+ | `division-bound` | A division bound is not a whole number of at least 2 |
126
127
 
127
- `unwritable-link` is refused by `apply` and `division-budget` by `divide`, not
128
+ `unwritable-link` is refused by `apply` and `division-bound` by `divide`, not
128
129
  by `validate`, so no case under `cases/` carries either.
129
130
 
130
131
  A reference that admits `attachment` reaches any path in the same Library, so
@@ -136,6 +137,6 @@ Library is accepted too, so `unresolved-link` never names it and
136
137
  ## YAML subset
137
138
 
138
139
  Frontmatter and a schema text are each a mapping in a closed YAML subset: block and flow mappings,
139
- block and flow sequences, a block sequence item that opens a mapping, plain and quoted scalars, `true`, `false`, `null`,
140
+ block and flow sequences, a block sequence item that opens a mapping, plain and quoted scalars (a single-quoted scalar doubles its apostrophe, a double-quoted one takes JSON's escapes), `true`, `false`, `null`,
140
141
  and decimal numbers. It does not take YAML 1.1 boolean or timestamp aliases,
141
142
  octal numbers, anchors, tags, or block scalars. A mapping carries each key once.
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: client
3
+ name: Acme
4
+ ---
5
+
6
+ Paid by [the March invoice](/rooms/finance/invoices/march.md#total).
@@ -0,0 +1,3 @@
1
+ client:
2
+ properties:
3
+ name: { type: string }
@@ -0,0 +1 @@
1
+ { "binaryTargets": [] }
@@ -0,0 +1 @@
1
+ { "verdict": "accept" }
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: client
3
+ name: Acme
4
+ finance: /rooms/finance/invoices/acme.md
5
+ ---
6
+
7
+ ## Invoices
8
+
9
+ - [March](/rooms/finance/invoices/march.md)
@@ -0,0 +1,9 @@
1
+ client:
2
+ properties:
3
+ name: { type: string }
4
+ finance: { type: string, reference: invoice, cross_room: true }
5
+ sections:
6
+ Invoices: { kind: list, items: { type: string, reference: invoice, cross_room: true } }
7
+ invoice:
8
+ properties:
9
+ name: { type: string }
@@ -2,12 +2,12 @@
2
2
  "schema": "task:\n type: object\n properties:\n name: { type: string }\n status: { enum: [open, done] }\n required: [status]\n sections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, items: { type: string, reference: person } }\nperson: {}\n",
3
3
  "cases": [
4
4
  {
5
- "name": "a Document whose whole input fits the budget is one Span carrying its projection",
5
+ "name": "a Document whose whole input fits the bound is one Span carrying its projection",
6
6
  "file": "tasks/one.md",
7
7
  "source": "---\ntype: task\nname: Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n## Acceptance\n\n- people/ana.md\n",
8
8
  "documentTargets": [],
9
9
  "definition": "task",
10
- "budget": 4096,
10
+ "bound": 4096,
11
11
  "expected": {
12
12
  "ok": true,
13
13
  "spans": [
@@ -19,12 +19,12 @@
19
19
  }
20
20
  },
21
21
  {
22
- "name": "an input over the budget descends to whole heading nodes and packs adjacent siblings",
22
+ "name": "an input over the bound descends to whole heading nodes and packs adjacent siblings",
23
23
  "file": "tasks/one.md",
24
24
  "source": "---\ntype: task\nname: Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n## Notes\n\nNotes prose.\n\n## Acceptance\n\n- people/ana.md\n",
25
25
  "documentTargets": [],
26
26
  "definition": "task",
27
- "budget": 45,
27
+ "bound": 45,
28
28
  "expected": {
29
29
  "ok": true,
30
30
  "spans": [
@@ -44,12 +44,12 @@
44
44
  }
45
45
  },
46
46
  {
47
- "name": "a heading node over the budget divides into adjacent blocks carrying its own heading",
47
+ "name": "a heading node over the bound divides into adjacent blocks carrying its own heading",
48
48
  "file": "tasks/one.md",
49
49
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nFirst paragraph of the overview.\n\nSecond paragraph of the overview.\n\n## Notes\n\nShort note.\n",
50
50
  "documentTargets": [],
51
51
  "definition": "task",
52
- "budget": 50,
52
+ "bound": 50,
53
53
  "expected": {
54
54
  "ok": true,
55
55
  "spans": [
@@ -78,7 +78,7 @@
78
78
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nFirst paragraph of the overview.\n\nSecond paragraph of the overview.\n\n## Notes\n\nShort note.\n",
79
79
  "documentTargets": [],
80
80
  "definition": "task",
81
- "budget": 75,
81
+ "bound": 75,
82
82
  "expected": {
83
83
  "ok": true,
84
84
  "spans": [
@@ -107,7 +107,7 @@
107
107
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nIntro line.\n\n### Detail\n\nDetail paragraph one.\n\nDetail paragraph two.\n",
108
108
  "documentTargets": [],
109
109
  "definition": "task",
110
- "budget": 40,
110
+ "bound": 40,
111
111
  "expected": {
112
112
  "ok": true,
113
113
  "spans": [
@@ -131,12 +131,12 @@
131
131
  }
132
132
  },
133
133
  {
134
- "name": "a block over the budget divides into sentences that repeat their predecessor",
134
+ "name": "a block over the bound divides into sentences that repeat their predecessor",
135
135
  "file": "tasks/one.md",
136
136
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nOne. Two. Three. Four.\n",
137
137
  "documentTargets": [],
138
138
  "definition": "task",
139
- "budget": 30,
139
+ "bound": 30,
140
140
  "expected": {
141
141
  "ok": true,
142
142
  "spans": [
@@ -156,12 +156,12 @@
156
156
  }
157
157
  },
158
158
  {
159
- "name": "a single sentence over the budget divides at a bound cut inside it",
159
+ "name": "a single sentence over the bound divides at a bound cut inside it",
160
160
  "file": "tasks/one.md",
161
161
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\naaaa bbbb cccc dddd eeee\n",
162
162
  "documentTargets": [],
163
163
  "definition": "task",
164
- "budget": 20,
164
+ "bound": 20,
165
165
  "expected": {
166
166
  "ok": true,
167
167
  "spans": [
@@ -198,7 +198,7 @@
198
198
  "source": "# Title\n\nIntro paragraph about the whole thing.\n\n## Alpha\n\nAlpha one. Alpha two.\n\n### Deep\n\nDeep prose here.\n\n## Beta\n\nBeta prose.\n",
199
199
  "documentTargets": [],
200
200
  "definition": null,
201
- "budget": 60,
201
+ "bound": 60,
202
202
  "expected": {
203
203
  "ok": true,
204
204
  "spans": [
@@ -227,7 +227,7 @@
227
227
  "source": "---\ntype: any\ntitle: Note\n---\n\n## Notes\n\nRead it.\n",
228
228
  "documentTargets": [],
229
229
  "definition": null,
230
- "budget": 4096,
230
+ "bound": 4096,
231
231
  "expected": {
232
232
  "ok": true,
233
233
  "spans": [
@@ -246,7 +246,7 @@
246
246
  "plans/q3.md"
247
247
  ],
248
248
  "definition": "task",
249
- "budget": 50,
249
+ "bound": 50,
250
250
  "expected": {
251
251
  "ok": true,
252
252
  "spans": [
@@ -271,7 +271,7 @@
271
271
  "source": "---\ntype: task\nname: Task\nstatus: open\n---\n\nPreamble prose.\n\n## Acceptance\n\n- people/ana.md\n\n## Notes\n\nShort note.\n",
272
272
  "documentTargets": [],
273
273
  "definition": "task",
274
- "budget": 4096,
274
+ "bound": 4096,
275
275
  "expected": {
276
276
  "ok": true,
277
277
  "spans": [
@@ -288,7 +288,7 @@
288
288
  "source": "---\ntype: task\nname: Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n## Acceptance\n\n- people/ana.md\n",
289
289
  "documentTargets": [],
290
290
  "definition": null,
291
- "budget": 4096,
291
+ "bound": 4096,
292
292
  "expected": {
293
293
  "ok": false,
294
294
  "refusal": {
@@ -299,17 +299,17 @@
299
299
  }
300
300
  },
301
301
  {
302
- "name": "a budget that cannot hold one whole character is refused before any division",
302
+ "name": "a bound that cannot hold one whole character is refused before any division",
303
303
  "file": "notes/one.md",
304
304
  "source": "## Notes\n\nShort note.\n",
305
305
  "documentTargets": [],
306
306
  "definition": null,
307
- "budget": 1,
307
+ "bound": 1,
308
308
  "expected": {
309
309
  "ok": false,
310
310
  "refusal": {
311
311
  "file": "notes/one.md",
312
- "rule": "division-budget"
312
+ "rule": "division-bound"
313
313
  }
314
314
  }
315
315
  },
@@ -319,7 +319,7 @@
319
319
  "source": "---\ntype: task\nname: \"Ship: the release\"\nstatus: open\n---\n\nBody prose.\n",
320
320
  "documentTargets": [],
321
321
  "definition": "task",
322
- "budget": 4096,
322
+ "bound": 4096,
323
323
  "expected": {
324
324
  "ok": true,
325
325
  "spans": [
@@ -331,12 +331,12 @@
331
331
  }
332
332
  },
333
333
  {
334
- "name": "sentence division reads every terminator and closer and drops a carry the budget cannot hold",
334
+ "name": "sentence division reads every terminator and closer and drops a carry the bound cannot hold",
335
335
  "file": "notes/three.md",
336
336
  "source": "## Ask\n\nReady? Go! He said \"no.\" Then (silence.) Done.\n",
337
337
  "documentTargets": [],
338
338
  "definition": null,
339
- "budget": 30,
339
+ "bound": 30,
340
340
  "expected": {
341
341
  "ok": true,
342
342
  "spans": [
@@ -361,7 +361,7 @@
361
361
  "source": "## Part\n\n### Alpha\n\nAlpha prose that is long enough to matter.\n\n### Beta\n\nBeta prose.\n",
362
362
  "documentTargets": [],
363
363
  "definition": null,
364
- "budget": 70,
364
+ "bound": 70,
365
365
  "expected": {
366
366
  "ok": true,
367
367
  "spans": [
@@ -377,12 +377,12 @@
377
377
  }
378
378
  },
379
379
  {
380
- "name": "a heading the budget cannot hold beside any text is not repeated",
380
+ "name": "a heading the bound cannot hold beside any text is not repeated",
381
381
  "file": "notes/five.md",
382
382
  "source": "## An overview of the release\n\nFirst paragraph here.\n\nSecond paragraph here.\n",
383
383
  "documentTargets": [],
384
384
  "definition": null,
385
- "budget": 25,
385
+ "bound": 25,
386
386
  "expected": {
387
387
  "ok": true,
388
388
  "spans": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdmodel",
3
- "version": "0.1.0-c64dbada0730d",
3
+ "version": "0.1.0-c679f403bf3fb",
4
4
  "description": "MD Type language, parser, validator, structured change application, Markdown syntax profile, and conformance fixtures",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,6 +26,8 @@
26
26
  "README.md"
27
27
  ],
28
28
  "dependencies": {
29
- "@cfworker/json-schema": "4.1.1"
29
+ "@cfworker/json-schema": "4.1.1",
30
+ "decode-named-character-reference": "1.3.0",
31
+ "micromark-util-decode-numeric-character-reference": "2.0.2"
30
32
  }
31
33
  }