@agentshouse/mdmodel 0.1.0-alpha.1 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +220 -7
- package/dist/blocks.d.ts +11 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +63 -0
- package/dist/blocks.js.map +1 -0
- package/dist/definition.d.ts +8 -6
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +44 -38
- package/dist/definition.js.map +1 -1
- package/dist/divide.d.ts +3 -0
- package/dist/divide.d.ts.map +1 -0
- package/dist/divide.js +363 -0
- package/dist/divide.js.map +1 -0
- package/dist/document.d.ts +4 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +95 -4
- package/dist/document.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/links.d.ts +25 -1
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +289 -48
- package/dist/links.js.map +1 -1
- package/dist/paths.d.ts +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +5 -0
- package/dist/paths.js.map +1 -1
- package/dist/profile.js.map +1 -1
- package/dist/project.d.ts +21 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +158 -0
- package/dist/project.js.map +1 -0
- package/dist/refuse.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +16 -38
- package/dist/schema.js.map +1 -1
- package/dist/sections.d.ts.map +1 -1
- package/dist/sections.js +14 -47
- package/dist/sections.js.map +1 -1
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validate.d.ts +2 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +17 -8
- package/dist/validate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/yaml.d.ts +1 -0
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +6 -4
- package/dist/yaml.js.map +1 -1
- package/fixtures/README.md +87 -27
- package/fixtures/cases/any-without-type/context.json +1 -0
- package/fixtures/cases/binary-any-reference/context.json +5 -0
- package/fixtures/cases/binary-any-reference/expected.json +7 -0
- package/fixtures/cases/binary-any-reference/library/notes/draft.md +6 -0
- package/fixtures/cases/binary-any-reference/library/types/note.md +5 -0
- package/fixtures/cases/binary-document-collision/context.json +5 -0
- package/fixtures/cases/binary-document-collision/expected.json +6 -0
- package/fixtures/cases/binary-document-collision/library/notes/draft.md +3 -0
- package/fixtures/cases/binary-document-collision/library/types/note.md +3 -0
- package/fixtures/cases/binary-link-outside-collection/context.json +6 -0
- package/fixtures/cases/binary-link-outside-collection/expected.json +6 -0
- package/fixtures/cases/binary-link-outside-collection/library/notes/draft.md +5 -0
- package/fixtures/cases/binary-link-outside-collection/library/types/note.md +3 -0
- package/fixtures/cases/binary-prototype-reference/context.json +1 -0
- package/fixtures/cases/binary-prototype-reference/expected.json +7 -0
- package/fixtures/cases/binary-prototype-reference/library/notes/draft.md +6 -0
- package/fixtures/cases/binary-prototype-reference/library/types/note.md +5 -0
- package/fixtures/cases/binary-typed-reference/context.json +5 -0
- package/fixtures/cases/binary-typed-reference/expected.json +7 -0
- package/fixtures/cases/binary-typed-reference/library/notes/draft.md +6 -0
- package/fixtures/cases/binary-typed-reference/library/types/note.md +5 -0
- package/fixtures/cases/binary-typed-reference/library/types/person.md +3 -0
- package/fixtures/cases/bracketed-link-definition/context.json +1 -0
- package/fixtures/cases/bracketed-link-definition/expected.json +1 -0
- package/fixtures/cases/bracketed-link-definition/library/item.md +10 -0
- package/fixtures/cases/bracketed-link-definition/library/types/task.md +7 -0
- package/fixtures/cases/declared-binary-links/context.json +6 -0
- package/fixtures/cases/declared-binary-links/expected.json +1 -0
- package/fixtures/cases/declared-binary-links/library/notes/draft.md +7 -0
- package/fixtures/cases/declared-binary-links/library/types/note.md +3 -0
- package/fixtures/cases/duplicate-link-definition/context.json +1 -0
- package/fixtures/cases/duplicate-link-definition/expected.json +1 -0
- package/fixtures/cases/duplicate-link-definition/library/item.md +11 -0
- package/fixtures/cases/duplicate-link-definition/library/types/task.md +7 -0
- package/fixtures/cases/fenced-link-definition/context.json +1 -0
- package/fixtures/cases/fenced-link-definition/expected.json +1 -0
- package/fixtures/cases/fenced-link-definition/library/item.md +12 -0
- package/fixtures/cases/fenced-link-definition/library/types/task.md +7 -0
- package/fixtures/cases/field-enum/context.json +1 -0
- package/fixtures/cases/interrupted-link-definition/context.json +1 -0
- package/fixtures/cases/interrupted-link-definition/expected.json +1 -0
- package/fixtures/cases/interrupted-link-definition/library/notes/draft.md +8 -0
- package/fixtures/cases/interrupted-link-definition/library/types/note.md +3 -0
- package/fixtures/cases/long-fence-link-definition/context.json +1 -0
- package/fixtures/cases/long-fence-link-definition/expected.json +1 -0
- package/fixtures/cases/long-fence-link-definition/library/notes/draft.md +9 -0
- package/fixtures/cases/long-fence-link-definition/library/types/note.md +3 -0
- package/fixtures/cases/malformed-definition/context.json +1 -0
- package/fixtures/cases/missing-binary-image/context.json +6 -0
- package/fixtures/cases/missing-binary-image/expected.json +6 -0
- package/fixtures/cases/missing-binary-image/library/notes/draft.md +5 -0
- package/fixtures/cases/missing-binary-image/library/types/note.md +3 -0
- package/fixtures/cases/missing-binary-link/context.json +6 -0
- package/fixtures/cases/missing-binary-link/expected.json +6 -0
- package/fixtures/cases/missing-binary-link/library/notes/draft.md +5 -0
- package/fixtures/cases/missing-binary-link/library/types/note.md +3 -0
- package/fixtures/cases/missing-required-field/context.json +1 -0
- package/fixtures/cases/missing-section-item-kind/context.json +1 -0
- package/fixtures/cases/missing-section-item-kind/expected.json +7 -0
- package/fixtures/cases/missing-section-item-kind/library/types/task.md +7 -0
- package/fixtures/cases/paragraph-link-definition/context.json +5 -0
- package/fixtures/cases/paragraph-link-definition/expected.json +1 -0
- package/fixtures/cases/paragraph-link-definition/library/notes/draft.md +10 -0
- package/fixtures/cases/paragraph-link-definition/library/types/note.md +3 -0
- package/fixtures/cases/prd-definition/context.json +1 -0
- package/fixtures/cases/prd-definition/library/types/task.md +2 -1
- package/fixtures/cases/prototype-field/context.json +1 -0
- package/fixtures/cases/prototype-field/expected.json +7 -0
- package/fixtures/cases/prototype-field/library/item.md +9 -0
- package/fixtures/cases/prototype-field/library/types/task.md +7 -0
- package/fixtures/cases/quoted-link-definition/context.json +1 -0
- package/fixtures/cases/quoted-link-definition/expected.json +6 -0
- package/fixtures/cases/quoted-link-definition/library/notes/draft.md +7 -0
- package/fixtures/cases/quoted-link-definition/library/types/note.md +3 -0
- package/fixtures/cases/referenced-missing-file/context.json +1 -0
- package/fixtures/cases/structured-section/context.json +1 -0
- package/fixtures/cases/structured-section/library/types/task.md +1 -1
- package/fixtures/cases/truncated-link-definition/context.json +1 -0
- package/fixtures/cases/truncated-link-definition/expected.json +6 -0
- package/fixtures/cases/truncated-link-definition/library/notes/draft.md +7 -0
- package/fixtures/cases/truncated-link-definition/library/notes/other.md +5 -0
- package/fixtures/cases/truncated-link-definition/library/types/note.md +3 -0
- package/fixtures/cases/unclosed-frontmatter/context.json +1 -0
- package/fixtures/cases/undeclared-field/context.json +1 -0
- package/fixtures/cases/undeclared-field/expected.json +7 -0
- package/fixtures/cases/undeclared-field/library/item.md +9 -0
- package/fixtures/cases/undeclared-field/library/types/task.md +7 -0
- package/fixtures/cases/unresolved-link/context.json +1 -0
- package/fixtures/cases/valid-typed-document/context.json +1 -0
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +1 -0
- package/fixtures/cases/valid-typed-document/library/types/task.md +2 -1
- package/fixtures/cases/wide-item-fence-link/context.json +1 -0
- package/fixtures/cases/wide-item-fence-link/expected.json +1 -0
- package/fixtures/cases/wide-item-fence-link/library/notes/draft.md +7 -0
- package/fixtures/cases/wide-item-fence-link/library/types/note.md +3 -0
- package/fixtures/division.json +415 -0
- package/fixtures/preamble.json +107 -0
- package/fixtures/projection.json +186 -0
- package/package.json +4 -5
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
{
|
|
2
|
+
"definitions": {
|
|
3
|
+
"task": "---\ntype: definition\nfields:\n name: { kind: text }\n status: { kind: enum, values: [open, done], required: true }\nsections:\n Description: { kind: text, required: true }\n Acceptance: { kind: list, of: reference, to: person }\n---\n",
|
|
4
|
+
"unreadable-task": "---\ntype: definition\nsections:\n Description: { kind: prose }\n---\n"
|
|
5
|
+
},
|
|
6
|
+
"cases": [
|
|
7
|
+
{
|
|
8
|
+
"name": "a Document whose whole input fits the budget is one Span carrying its projection",
|
|
9
|
+
"file": "tasks/one.md",
|
|
10
|
+
"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",
|
|
11
|
+
"documentTargets": [],
|
|
12
|
+
"definition": "task",
|
|
13
|
+
"budget": 4096,
|
|
14
|
+
"expected": {
|
|
15
|
+
"ok": true,
|
|
16
|
+
"spans": [
|
|
17
|
+
{
|
|
18
|
+
"text": "Ship the release\n\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n",
|
|
19
|
+
"source": "Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n## Description\n\nBody of the description.\n\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "an input over the budget descends to whole heading nodes and packs adjacent siblings",
|
|
26
|
+
"file": "tasks/one.md",
|
|
27
|
+
"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",
|
|
28
|
+
"documentTargets": [],
|
|
29
|
+
"definition": "task",
|
|
30
|
+
"budget": 45,
|
|
31
|
+
"expected": {
|
|
32
|
+
"ok": true,
|
|
33
|
+
"spans": [
|
|
34
|
+
{
|
|
35
|
+
"text": "Ship the release\n\n\nPreamble prose.\n\n",
|
|
36
|
+
"source": "Ship the release\nstatus: open\n---\n\nPreamble prose.\n\n"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"text": "## Description\n\nBody of the description.\n\n",
|
|
40
|
+
"source": "## Description\n\nBody of the description.\n\n"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"text": "## Notes\n\nNotes prose.\n\n",
|
|
44
|
+
"source": "## Notes\n\nNotes prose.\n\n"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "a heading node over the budget divides into adjacent blocks carrying its own heading",
|
|
51
|
+
"file": "tasks/one.md",
|
|
52
|
+
"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",
|
|
53
|
+
"documentTargets": [],
|
|
54
|
+
"definition": "task",
|
|
55
|
+
"budget": 50,
|
|
56
|
+
"expected": {
|
|
57
|
+
"ok": true,
|
|
58
|
+
"spans": [
|
|
59
|
+
{
|
|
60
|
+
"text": "Task\n\n\n",
|
|
61
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"text": "## Overview\n\nFirst paragraph of the overview.\n\n",
|
|
65
|
+
"source": "## Overview\n\nFirst paragraph of the overview.\n\n"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"text": "## Overview\n\nSecond paragraph of the overview.\n\n",
|
|
69
|
+
"source": "Second paragraph of the overview.\n\n"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"text": "## Notes\n\nShort note.\n",
|
|
73
|
+
"source": "## Notes\n\nShort note.\n"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "a node continuation and the next whole sibling stay in their own Spans",
|
|
80
|
+
"file": "tasks/one.md",
|
|
81
|
+
"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",
|
|
82
|
+
"documentTargets": [],
|
|
83
|
+
"definition": "task",
|
|
84
|
+
"budget": 75,
|
|
85
|
+
"expected": {
|
|
86
|
+
"ok": true,
|
|
87
|
+
"spans": [
|
|
88
|
+
{
|
|
89
|
+
"text": "Task\n\n\n",
|
|
90
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"text": "## Overview\n\nFirst paragraph of the overview.\n\n",
|
|
94
|
+
"source": "## Overview\n\nFirst paragraph of the overview.\n\n"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"text": "## Overview\n\nSecond paragraph of the overview.\n\n",
|
|
98
|
+
"source": "Second paragraph of the overview.\n\n"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"text": "## Notes\n\nShort note.\n",
|
|
102
|
+
"source": "## Notes\n\nShort note.\n"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "a continuation Span carries its own node heading and never an ancestor heading",
|
|
109
|
+
"file": "tasks/one.md",
|
|
110
|
+
"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",
|
|
111
|
+
"documentTargets": [],
|
|
112
|
+
"definition": "task",
|
|
113
|
+
"budget": 40,
|
|
114
|
+
"expected": {
|
|
115
|
+
"ok": true,
|
|
116
|
+
"spans": [
|
|
117
|
+
{
|
|
118
|
+
"text": "Task\n\n\n",
|
|
119
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"text": "## Overview\n\nIntro line.\n\n",
|
|
123
|
+
"source": "## Overview\n\nIntro line.\n\n"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"text": "### Detail\n\nDetail paragraph one.\n\n",
|
|
127
|
+
"source": "### Detail\n\nDetail paragraph one.\n\n"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"text": "### Detail\n\nDetail paragraph two.\n",
|
|
131
|
+
"source": "Detail paragraph two.\n"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "a block over the budget divides into sentences that repeat their predecessor",
|
|
138
|
+
"file": "tasks/one.md",
|
|
139
|
+
"source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nOne. Two. Three. Four.\n",
|
|
140
|
+
"documentTargets": [],
|
|
141
|
+
"definition": "task",
|
|
142
|
+
"budget": 30,
|
|
143
|
+
"expected": {
|
|
144
|
+
"ok": true,
|
|
145
|
+
"spans": [
|
|
146
|
+
{
|
|
147
|
+
"text": "Task\n\n\n",
|
|
148
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"text": "## Overview\n\nOne. Two. Three. ",
|
|
152
|
+
"source": "## Overview\n\nOne. Two. Three. "
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"text": "## Overview\n\nThree. Four.\n",
|
|
156
|
+
"source": "Three. Four.\n"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "a single sentence over the budget divides at a bound cut inside it",
|
|
163
|
+
"file": "tasks/one.md",
|
|
164
|
+
"source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\naaaa bbbb cccc dddd eeee\n",
|
|
165
|
+
"documentTargets": [],
|
|
166
|
+
"definition": "task",
|
|
167
|
+
"budget": 20,
|
|
168
|
+
"expected": {
|
|
169
|
+
"ok": true,
|
|
170
|
+
"spans": [
|
|
171
|
+
{
|
|
172
|
+
"text": "Task\n\n\n",
|
|
173
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"text": "## Overview\n\naaaa",
|
|
177
|
+
"source": "## Overview\n\naaaa"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"text": "## Overview\n\n bbbb",
|
|
181
|
+
"source": " bbbb"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"text": "## Overview\n\n cccc",
|
|
185
|
+
"source": " cccc"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"text": "## Overview\n\n dddd",
|
|
189
|
+
"source": " dddd"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"text": "## Overview\n\n eeee\n",
|
|
193
|
+
"source": " eeee\n"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "an untyped input with no definition descends the same ladder",
|
|
200
|
+
"file": "notes/one.md",
|
|
201
|
+
"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",
|
|
202
|
+
"documentTargets": [],
|
|
203
|
+
"definition": null,
|
|
204
|
+
"budget": 60,
|
|
205
|
+
"expected": {
|
|
206
|
+
"ok": true,
|
|
207
|
+
"spans": [
|
|
208
|
+
{
|
|
209
|
+
"text": "# Title\n\nIntro paragraph about the whole thing.\n\n",
|
|
210
|
+
"source": "# Title\n\nIntro paragraph about the whole thing.\n\n"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"text": "## Alpha\n\nAlpha one. Alpha two.\n\n",
|
|
214
|
+
"source": "## Alpha\n\nAlpha one. Alpha two.\n\n"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"text": "### Deep\n\nDeep prose here.\n\n",
|
|
218
|
+
"source": "### Deep\n\nDeep prose here.\n\n"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"text": "## Beta\n\nBeta prose.\n",
|
|
222
|
+
"source": "## Beta\n\nBeta prose.\n"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "a Document that declares the built-in any type divides its body after the fence",
|
|
229
|
+
"file": "notes/two.md",
|
|
230
|
+
"source": "---\ntype: any\ntitle: Note\n---\n\n## Notes\n\nRead it.\n",
|
|
231
|
+
"documentTargets": [],
|
|
232
|
+
"definition": null,
|
|
233
|
+
"budget": 4096,
|
|
234
|
+
"expected": {
|
|
235
|
+
"ok": true,
|
|
236
|
+
"spans": [
|
|
237
|
+
{
|
|
238
|
+
"text": "\n## Notes\n\nRead it.\n",
|
|
239
|
+
"source": "\n## Notes\n\nRead it.\n"
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "an internal link embeds its label and addresses the destination the author wrote",
|
|
246
|
+
"file": "tasks/one.md",
|
|
247
|
+
"source": "---\ntype: task\nname: Task\nstatus: open\n---\n\n## Overview\n\nRead [the plan](../plans/q3.md) before starting.\n\n## Notes\n\nShort note.\n",
|
|
248
|
+
"documentTargets": [
|
|
249
|
+
"plans/q3.md"
|
|
250
|
+
],
|
|
251
|
+
"definition": "task",
|
|
252
|
+
"budget": 50,
|
|
253
|
+
"expected": {
|
|
254
|
+
"ok": true,
|
|
255
|
+
"spans": [
|
|
256
|
+
{
|
|
257
|
+
"text": "Task\n\n\n",
|
|
258
|
+
"source": "Task\nstatus: open\n---\n\n"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"text": "## Overview\n\nRead the plan before starting.\n\n",
|
|
262
|
+
"source": "## Overview\n\nRead [the plan](../plans/q3.md) before starting.\n\n"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"text": "## Notes\n\nShort note.\n",
|
|
266
|
+
"source": "## Notes\n\nShort note.\n"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "a declared structured section stays outside the text and inside the extent",
|
|
273
|
+
"file": "tasks/one.md",
|
|
274
|
+
"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",
|
|
275
|
+
"documentTargets": [],
|
|
276
|
+
"definition": "task",
|
|
277
|
+
"budget": 4096,
|
|
278
|
+
"expected": {
|
|
279
|
+
"ok": true,
|
|
280
|
+
"spans": [
|
|
281
|
+
{
|
|
282
|
+
"text": "Task\n\n\nPreamble prose.\n\n## Notes\n\nShort note.\n",
|
|
283
|
+
"source": "Task\nstatus: open\n---\n\nPreamble prose.\n\n## Acceptance\n\n- people/ana.md\n\n## Notes\n\nShort note.\n"
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "a Document that declares a type the caller supplies no definition for is refused",
|
|
290
|
+
"file": "tasks/one.md",
|
|
291
|
+
"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",
|
|
292
|
+
"documentTargets": [],
|
|
293
|
+
"definition": null,
|
|
294
|
+
"budget": 4096,
|
|
295
|
+
"expected": {
|
|
296
|
+
"ok": false,
|
|
297
|
+
"refusal": {
|
|
298
|
+
"file": "tasks/one.md",
|
|
299
|
+
"rule": "unknown-type",
|
|
300
|
+
"version": "<package-version>",
|
|
301
|
+
"location": "type"
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "a definition the model cannot read is refused at that definition",
|
|
307
|
+
"file": "tasks/one.md",
|
|
308
|
+
"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",
|
|
309
|
+
"documentTargets": [],
|
|
310
|
+
"definition": "unreadable-task",
|
|
311
|
+
"budget": 4096,
|
|
312
|
+
"expected": {
|
|
313
|
+
"ok": false,
|
|
314
|
+
"refusal": {
|
|
315
|
+
"file": "types/task.md",
|
|
316
|
+
"rule": "definition-section-kind",
|
|
317
|
+
"version": "<package-version>",
|
|
318
|
+
"location": "Description"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "a free-text value the author quoted embeds bare and addresses the quotes it was written with",
|
|
324
|
+
"file": "tasks/one.md",
|
|
325
|
+
"source": "---\ntype: task\nname: \"Ship: the release\"\nstatus: open\n---\n\nBody prose.\n",
|
|
326
|
+
"documentTargets": [],
|
|
327
|
+
"definition": "task",
|
|
328
|
+
"budget": 4096,
|
|
329
|
+
"expected": {
|
|
330
|
+
"ok": true,
|
|
331
|
+
"spans": [
|
|
332
|
+
{
|
|
333
|
+
"text": "Ship: the release\n\n\nBody prose.\n",
|
|
334
|
+
"source": "\"Ship: the release\"\nstatus: open\n---\n\nBody prose.\n"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "sentence division reads every terminator and closer and drops a carry the budget cannot hold",
|
|
341
|
+
"file": "notes/three.md",
|
|
342
|
+
"source": "## Ask\n\nReady? Go! He said \"no.\" Then (silence.) Done.\n",
|
|
343
|
+
"documentTargets": [],
|
|
344
|
+
"definition": null,
|
|
345
|
+
"budget": 30,
|
|
346
|
+
"expected": {
|
|
347
|
+
"ok": true,
|
|
348
|
+
"spans": [
|
|
349
|
+
{
|
|
350
|
+
"text": "## Ask\n\nReady? Go! ",
|
|
351
|
+
"source": "## Ask\n\nReady? Go! "
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"text": "## Ask\n\nGo! He said \"no.\" ",
|
|
355
|
+
"source": "Go! He said \"no.\" "
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"text": "## Ask\n\nThen (silence.) Done.\n",
|
|
359
|
+
"source": "Then (silence.) Done.\n"
|
|
360
|
+
}
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "a heading with no body of its own leads the first child node instead of standing alone",
|
|
366
|
+
"file": "notes/four.md",
|
|
367
|
+
"source": "## Part\n\n### Alpha\n\nAlpha prose that is long enough to matter.\n\n### Beta\n\nBeta prose.\n",
|
|
368
|
+
"documentTargets": [],
|
|
369
|
+
"definition": null,
|
|
370
|
+
"budget": 70,
|
|
371
|
+
"expected": {
|
|
372
|
+
"ok": true,
|
|
373
|
+
"spans": [
|
|
374
|
+
{
|
|
375
|
+
"text": "## Part\n\n### Alpha\n\nAlpha prose that is long enough to matter.\n\n",
|
|
376
|
+
"source": "## Part\n\n### Alpha\n\nAlpha prose that is long enough to matter.\n\n"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"text": "### Beta\n\nBeta prose.\n",
|
|
380
|
+
"source": "### Beta\n\nBeta prose.\n"
|
|
381
|
+
}
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "a heading the budget cannot hold beside any text is not repeated",
|
|
387
|
+
"file": "notes/five.md",
|
|
388
|
+
"source": "## An overview of the release\n\nFirst paragraph here.\n\nSecond paragraph here.\n",
|
|
389
|
+
"documentTargets": [],
|
|
390
|
+
"definition": null,
|
|
391
|
+
"budget": 25,
|
|
392
|
+
"expected": {
|
|
393
|
+
"ok": true,
|
|
394
|
+
"spans": [
|
|
395
|
+
{
|
|
396
|
+
"text": "## An overview of the",
|
|
397
|
+
"source": "## An overview of the"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"text": " release\n\nFirst paragraph",
|
|
401
|
+
"source": " release\n\nFirst paragraph"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"text": " here.\n\n",
|
|
405
|
+
"source": " here.\n\n"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"text": "Second paragraph here.\n",
|
|
409
|
+
"source": "Second paragraph here.\n"
|
|
410
|
+
}
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
]
|
|
415
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "CRLF frontmatter and H2 closing syntax",
|
|
4
|
+
"source": "---\r\ntype: note\r\ntitle: \"Kept\" # syntax\r\n---\r\n\r\n# Title\r\nIntro.\r\n\r\n## Body ###\r\nKept.\r\n",
|
|
5
|
+
"preamble": "\r\n# Title\r\nIntro.\r\n\r\n",
|
|
6
|
+
"value": "\r\nNew intro.\r\n\r\n",
|
|
7
|
+
"expected": "---\r\ntype: note\r\ntitle: \"Kept\" # syntax\r\n---\r\n\r\nNew intro.\r\n\r\n## Body ###\r\nKept.\r\n"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "untyped document without sections",
|
|
11
|
+
"source": "# Title\nAll body text.",
|
|
12
|
+
"preamble": "# Title\nAll body text.",
|
|
13
|
+
"value": "Replaced without final newline.",
|
|
14
|
+
"expected": "Replaced without final newline."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "typed document without sections",
|
|
18
|
+
"source": "---\ntype: note\n---\n# Title\nAll body text.",
|
|
19
|
+
"preamble": "# Title\nAll body text.",
|
|
20
|
+
"value": "New body.\n",
|
|
21
|
+
"expected": "---\ntype: note\n---\nNew body.\n"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "empty document",
|
|
25
|
+
"source": "",
|
|
26
|
+
"preamble": "",
|
|
27
|
+
"value": "First text.\n",
|
|
28
|
+
"expected": "First text.\n"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "frontmatter only",
|
|
32
|
+
"source": "---\ntype: note\n---\n",
|
|
33
|
+
"preamble": "",
|
|
34
|
+
"value": "First text.\n",
|
|
35
|
+
"expected": "---\ntype: note\n---\nFirst text.\n"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "frontmatter delimiter at EOF",
|
|
39
|
+
"source": "---\ntype: note\n---",
|
|
40
|
+
"preamble": "",
|
|
41
|
+
"value": "\nFirst text.",
|
|
42
|
+
"expected": "---\ntype: note\n---\nFirst text."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "section starts at offset zero",
|
|
46
|
+
"source": "## Body\nKept.\n",
|
|
47
|
+
"preamble": "",
|
|
48
|
+
"value": "Intro.\n\n",
|
|
49
|
+
"expected": "Intro.\n\n## Body\nKept.\n"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "section immediately after frontmatter",
|
|
53
|
+
"source": "---\ntype: note\n---\n## Body\nKept.\n",
|
|
54
|
+
"preamble": "",
|
|
55
|
+
"value": "Intro.\n",
|
|
56
|
+
"expected": "---\ntype: note\n---\nIntro.\n## Body\nKept.\n"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "backtick fence hides a heading",
|
|
60
|
+
"source": "```md\n## Example\n```\n\n## Body\nKept.\n",
|
|
61
|
+
"preamble": "```md\n## Example\n```\n\n",
|
|
62
|
+
"value": "Example removed.\n",
|
|
63
|
+
"expected": "Example removed.\n## Body\nKept.\n"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "tilde fence hides a heading",
|
|
67
|
+
"source": " ~~~md\n## Example\n ~~~\n\n## Body\nKept.",
|
|
68
|
+
"preamble": " ~~~md\n## Example\n ~~~\n\n",
|
|
69
|
+
"value": "Example removed.\n",
|
|
70
|
+
"expected": "Example removed.\n## Body\nKept."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "unclosed fence carries the entire body",
|
|
74
|
+
"source": "---\ntype: note\n---\n```\n## Example\n",
|
|
75
|
+
"preamble": "```\n## Example\n",
|
|
76
|
+
"value": "Plain replacement.\n",
|
|
77
|
+
"expected": "---\ntype: note\n---\nPlain replacement.\n"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "existing section parser ignores other heading forms",
|
|
81
|
+
"source": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n## Actual ##\nKept.\n",
|
|
82
|
+
"preamble": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n",
|
|
83
|
+
"value": "Intro.\n",
|
|
84
|
+
"expected": "Intro.\n## Actual ##\nKept.\n"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Unicode and mixed newlines",
|
|
88
|
+
"source": "---\r\ntype: note\r\n---\r\n🙂 Вступ\r\n\n## Body\nKept.\r\n",
|
|
89
|
+
"preamble": "🙂 Вступ\r\n\n",
|
|
90
|
+
"value": "Новий 🙂\n\n",
|
|
91
|
+
"expected": "---\r\ntype: note\r\n---\r\nНовий 🙂\n\n## Body\nKept.\r\n"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "heading at EOF and empty replacement",
|
|
95
|
+
"source": "Intro.\n\n## Body",
|
|
96
|
+
"preamble": "Intro.\n\n",
|
|
97
|
+
"value": "",
|
|
98
|
+
"expected": "## Body"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "Runtime moved export link",
|
|
102
|
+
"source": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../data/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n",
|
|
103
|
+
"preamble": "\nFiled beside [the export](../data/export.csv).\n\n",
|
|
104
|
+
"value": "\nFiled beside [the export](../files/export.csv).\n\n",
|
|
105
|
+
"expected": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../files/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n"
|
|
106
|
+
}
|
|
107
|
+
]
|