@agentshouse/mdmodel 0.1.0-alpha.8 → 0.1.0-c68e2039f1ca8
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/API.md +300 -0
- package/README.md +34 -175
- package/dist/blocks.d.ts +11 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +62 -0
- package/dist/condition.d.ts +137 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/condition.js +394 -0
- package/dist/definition.d.ts +42 -25
- package/dist/definition.d.ts.map +1 -1
- package/dist/definition.js +473 -146
- package/dist/divide.d.ts +3 -0
- package/dist/divide.d.ts.map +1 -0
- package/dist/divide.js +310 -0
- package/dist/document.d.ts +2 -0
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +89 -120
- package/dist/fields.d.ts +4 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +3 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/links.d.ts +1 -0
- package/dist/links.d.ts.map +1 -1
- package/dist/links.js +618 -224
- package/dist/paths.d.ts +2 -3
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +27 -37
- package/dist/profile.js +1 -3
- package/dist/project.d.ts +19 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +82 -73
- package/dist/refuse.d.ts.map +1 -1
- package/dist/refuse.js +2 -10
- package/dist/schema.d.ts +7 -5
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +156 -41
- package/dist/sections.d.ts +2 -1
- package/dist/sections.d.ts.map +1 -1
- package/dist/sections.js +45 -67
- package/dist/types.d.ts +30 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/validate.d.ts +3 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +138 -136
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -3
- package/dist/yaml.d.ts +2 -0
- package/dist/yaml.d.ts.map +1 -1
- package/dist/yaml.js +255 -191
- package/fixtures/README.md +85 -55
- package/fixtures/cases/absent-optional-field/library/companies/acme.md +4 -0
- package/fixtures/cases/absent-optional-field/library/deals/lead.md +6 -0
- package/fixtures/cases/absent-optional-field/schema.yaml +56 -0
- package/fixtures/cases/binary-any-reference/expected.json +1 -2
- package/fixtures/cases/binary-any-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-document-collision/expected.json +1 -2
- package/fixtures/cases/binary-document-collision/schema.yaml +1 -0
- package/fixtures/cases/binary-link-outside-collection/expected.json +1 -2
- package/fixtures/cases/binary-link-outside-collection/schema.yaml +1 -0
- package/fixtures/cases/binary-prototype-reference/expected.json +1 -2
- package/fixtures/cases/binary-prototype-reference/schema.yaml +4 -0
- package/fixtures/cases/binary-typed-reference/expected.json +1 -2
- package/fixtures/cases/binary-typed-reference/schema.yaml +5 -0
- package/fixtures/cases/boolean-field/context.json +1 -0
- package/fixtures/cases/boolean-field/expected.json +6 -0
- package/fixtures/cases/boolean-field/library/companies/acme.md +4 -0
- package/fixtures/cases/boolean-field/library/deals/renewal.md +31 -0
- package/fixtures/cases/boolean-field/schema.yaml +56 -0
- package/fixtures/cases/bracketed-link-definition/schema.yaml +6 -0
- package/fixtures/cases/closed-nested-object/context.json +1 -0
- package/fixtures/cases/closed-nested-object/expected.json +6 -0
- package/fixtures/cases/closed-nested-object/library/companies/acme.md +4 -0
- package/fixtures/cases/closed-nested-object/library/deals/renewal.md +32 -0
- package/fixtures/cases/closed-nested-object/schema.yaml +56 -0
- package/fixtures/cases/composed-root-reference/context.json +1 -0
- package/fixtures/cases/composed-root-reference/expected.json +6 -0
- package/fixtures/cases/composed-root-reference/library/a.md +5 -0
- package/fixtures/cases/composed-root-reference/schema.yaml +13 -0
- package/fixtures/cases/date-time-format/context.json +1 -0
- package/fixtures/cases/date-time-format/expected.json +6 -0
- package/fixtures/cases/date-time-format/library/companies/acme.md +4 -0
- package/fixtures/cases/date-time-format/library/deals/renewal.md +31 -0
- package/fixtures/cases/date-time-format/schema.yaml +56 -0
- package/fixtures/cases/declared-binary-links/schema.yaml +1 -0
- package/fixtures/cases/default-unfilled/context.json +1 -0
- package/fixtures/cases/default-unfilled/expected.json +6 -0
- package/fixtures/cases/default-unfilled/library/companies/acme.md +4 -0
- package/fixtures/cases/default-unfilled/library/deals/renewal.md +29 -0
- package/fixtures/cases/default-unfilled/schema.yaml +56 -0
- package/fixtures/cases/defs-pattern/context.json +1 -0
- package/fixtures/cases/defs-pattern/expected.json +6 -0
- package/fixtures/cases/defs-pattern/library/companies/acme.md +4 -0
- package/fixtures/cases/defs-pattern/library/deals/renewal.md +31 -0
- package/fixtures/cases/defs-pattern/schema.yaml +56 -0
- package/fixtures/cases/dependent-rule/context.json +1 -0
- package/fixtures/cases/dependent-rule/expected.json +6 -0
- package/fixtures/cases/dependent-rule/library/companies/acme.md +4 -0
- package/fixtures/cases/dependent-rule/library/deals/renewal.md +30 -0
- package/fixtures/cases/dependent-rule/schema.yaml +56 -0
- package/fixtures/cases/duplicate-link-definition/schema.yaml +6 -0
- package/fixtures/cases/email-format/context.json +1 -0
- package/fixtures/cases/email-format/expected.json +6 -0
- package/fixtures/cases/email-format/library/companies/acme.md +4 -0
- package/fixtures/cases/email-format/library/deals/renewal.md +31 -0
- package/fixtures/cases/email-format/schema.yaml +56 -0
- package/fixtures/cases/fenced-link-definition/schema.yaml +6 -0
- package/fixtures/cases/field-enum/expected.json +2 -3
- package/fixtures/cases/field-enum/schema.yaml +7 -0
- package/fixtures/cases/frontmatter-schema/context.json +1 -0
- package/fixtures/cases/frontmatter-schema/expected.json +5 -0
- package/fixtures/cases/frontmatter-schema/schema.yaml +5 -0
- package/fixtures/cases/integer-field/context.json +1 -0
- package/fixtures/cases/integer-field/expected.json +6 -0
- package/fixtures/cases/integer-field/library/companies/acme.md +4 -0
- package/fixtures/cases/integer-field/library/deals/renewal.md +31 -0
- package/fixtures/cases/integer-field/schema.yaml +56 -0
- package/fixtures/cases/interrupted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/json-schema-constructs/context.json +1 -0
- package/fixtures/cases/json-schema-constructs/expected.json +1 -0
- package/fixtures/cases/json-schema-constructs/library/companies/acme.md +4 -0
- package/fixtures/cases/json-schema-constructs/library/deals/renewal.md +31 -0
- package/fixtures/cases/json-schema-constructs/schema.yaml +56 -0
- package/fixtures/cases/list-of-objects-closed/context.json +1 -0
- package/fixtures/cases/list-of-objects-closed/expected.json +6 -0
- package/fixtures/cases/list-of-objects-closed/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-closed/library/deals/renewal.md +32 -0
- package/fixtures/cases/list-of-objects-closed/schema.yaml +56 -0
- package/fixtures/cases/list-of-objects-item/context.json +1 -0
- package/fixtures/cases/list-of-objects-item/expected.json +6 -0
- package/fixtures/cases/list-of-objects-item/library/companies/acme.md +4 -0
- package/fixtures/cases/list-of-objects-item/library/deals/renewal.md +31 -0
- package/fixtures/cases/list-of-objects-item/schema.yaml +56 -0
- package/fixtures/cases/list-size/context.json +1 -0
- package/fixtures/cases/list-size/expected.json +6 -0
- package/fixtures/cases/list-size/library/companies/acme.md +4 -0
- package/fixtures/cases/list-size/library/deals/renewal.md +31 -0
- package/fixtures/cases/list-size/schema.yaml +56 -0
- package/fixtures/cases/long-fence-link-definition/schema.yaml +1 -0
- package/fixtures/cases/malformed-definition/expected.json +2 -4
- package/fixtures/cases/malformed-definition/schema.yaml +3 -0
- package/fixtures/cases/member-document/context.json +1 -0
- package/fixtures/cases/member-document/expected.json +1 -0
- package/fixtures/cases/member-document/library/people/ana.md +5 -0
- package/fixtures/cases/member-document/schema.yaml +5 -0
- package/fixtures/cases/missing-binary-image/expected.json +1 -2
- package/fixtures/cases/missing-binary-image/schema.yaml +1 -0
- package/fixtures/cases/missing-binary-link/expected.json +1 -2
- package/fixtures/cases/missing-binary-link/schema.yaml +1 -0
- package/fixtures/cases/missing-required-field/expected.json +2 -3
- package/fixtures/cases/missing-required-field/schema.yaml +7 -0
- package/fixtures/cases/missing-section-item-kind/context.json +1 -0
- package/fixtures/cases/missing-section-item-kind/expected.json +5 -0
- package/fixtures/cases/missing-section-item-kind/schema.yaml +6 -0
- package/fixtures/cases/misspelled-key/context.json +1 -0
- package/fixtures/cases/misspelled-key/expected.json +6 -0
- package/fixtures/cases/misspelled-key/library/companies/acme.md +4 -0
- package/fixtures/cases/misspelled-key/library/deals/renewal.md +32 -0
- package/fixtures/cases/misspelled-key/schema.yaml +56 -0
- package/fixtures/cases/nested-defs/context.json +1 -0
- package/fixtures/cases/nested-defs/expected.json +6 -0
- package/fixtures/cases/nested-defs/library/deal.md +6 -0
- package/fixtures/cases/nested-defs/schema.yaml +11 -0
- package/fixtures/cases/nested-required-field/context.json +1 -0
- package/fixtures/cases/nested-required-field/expected.json +6 -0
- package/fixtures/cases/nested-required-field/library/companies/acme.md +4 -0
- package/fixtures/cases/nested-required-field/library/deals/renewal.md +30 -0
- package/fixtures/cases/nested-required-field/schema.yaml +56 -0
- package/fixtures/cases/null-refused/context.json +1 -0
- package/fixtures/cases/null-refused/expected.json +6 -0
- package/fixtures/cases/null-refused/library/companies/acme.md +4 -0
- package/fixtures/cases/null-refused/library/deals/renewal.md +31 -0
- package/fixtures/cases/null-refused/schema.yaml +56 -0
- package/fixtures/cases/numeric-range/context.json +1 -0
- package/fixtures/cases/numeric-range/expected.json +6 -0
- package/fixtures/cases/numeric-range/library/companies/acme.md +4 -0
- package/fixtures/cases/numeric-range/library/deals/renewal.md +31 -0
- package/fixtures/cases/numeric-range/schema.yaml +56 -0
- package/fixtures/cases/one-of-variant/context.json +1 -0
- package/fixtures/cases/one-of-variant/expected.json +6 -0
- package/fixtures/cases/one-of-variant/library/companies/acme.md +4 -0
- package/fixtures/cases/one-of-variant/library/deals/renewal.md +31 -0
- package/fixtures/cases/one-of-variant/schema.yaml +56 -0
- package/fixtures/cases/open-map-value/context.json +1 -0
- package/fixtures/cases/open-map-value/expected.json +6 -0
- package/fixtures/cases/open-map-value/library/companies/acme.md +4 -0
- package/fixtures/cases/open-map-value/library/deals/renewal.md +31 -0
- package/fixtures/cases/open-map-value/schema.yaml +56 -0
- package/fixtures/cases/paragraph-link-definition/schema.yaml +1 -0
- package/fixtures/cases/prototype-field/context.json +1 -0
- package/fixtures/cases/prototype-field/expected.json +6 -0
- package/fixtures/cases/prototype-field/library/item.md +9 -0
- package/fixtures/cases/prototype-field/schema.yaml +6 -0
- package/fixtures/cases/quoted-link-definition/expected.json +1 -2
- package/fixtures/cases/quoted-link-definition/schema.yaml +1 -0
- package/fixtures/cases/referenced-missing-file/expected.json +0 -1
- package/fixtures/cases/referenced-missing-file/schema.yaml +11 -0
- package/fixtures/cases/remote-ref/context.json +1 -0
- package/fixtures/cases/remote-ref/expected.json +5 -0
- package/fixtures/cases/remote-ref/schema.yaml +3 -0
- package/fixtures/cases/second-member-document/context.json +1 -0
- package/fixtures/cases/second-member-document/expected.json +5 -0
- package/fixtures/cases/second-member-document/schema.yaml +4 -0
- package/fixtures/cases/section-item-enum/context.json +1 -0
- package/fixtures/cases/section-item-enum/expected.json +6 -0
- package/fixtures/cases/section-item-enum/library/task.md +8 -0
- package/fixtures/cases/section-item-enum/schema.yaml +3 -0
- package/fixtures/cases/section-item-kind/context.json +1 -0
- package/fixtures/cases/section-item-kind/expected.json +6 -0
- package/fixtures/cases/section-item-kind/library/task.md +8 -0
- package/fixtures/cases/section-item-kind/schema.yaml +3 -0
- package/fixtures/cases/section-items/context.json +1 -0
- package/fixtures/cases/section-items/expected.json +1 -0
- package/fixtures/cases/section-items/library/other.md +3 -0
- package/fixtures/cases/section-items/library/page.md +42 -0
- package/fixtures/cases/section-items/schema.yaml +10 -0
- package/fixtures/cases/section-reference-path/context.json +1 -0
- package/fixtures/cases/section-reference-path/expected.json +6 -0
- package/fixtures/cases/section-reference-path/library/other.md +3 -0
- package/fixtures/cases/section-reference-path/library/page.md +7 -0
- package/fixtures/cases/section-reference-path/schema.yaml +3 -0
- package/fixtures/cases/section-reference-type/context.json +1 -0
- package/fixtures/cases/section-reference-type/expected.json +6 -0
- package/fixtures/cases/section-reference-type/library/note.md +1 -0
- package/fixtures/cases/section-reference-type/library/page.md +7 -0
- package/fixtures/cases/section-reference-type/schema.yaml +3 -0
- package/fixtures/cases/shortcut-reference-link/context.json +1 -0
- package/fixtures/cases/shortcut-reference-link/expected.json +5 -0
- package/fixtures/cases/shortcut-reference-link/library/item.md +10 -0
- package/fixtures/cases/shortcut-reference-link/schema.yaml +6 -0
- package/fixtures/cases/string-length/context.json +1 -0
- package/fixtures/cases/string-length/expected.json +6 -0
- package/fixtures/cases/string-length/library/companies/acme.md +4 -0
- package/fixtures/cases/string-length/library/deals/renewal.md +31 -0
- package/fixtures/cases/string-length/schema.yaml +56 -0
- package/fixtures/cases/structured-section/expected.json +1 -2
- package/fixtures/cases/structured-section/schema.yaml +7 -0
- package/fixtures/cases/submission-keys/context.json +1 -0
- package/fixtures/cases/submission-keys/expected.json +1 -0
- package/fixtures/cases/submission-keys/library/notes/visitor.md +8 -0
- package/fixtures/cases/submission-keys/schema.yaml +4 -0
- package/fixtures/cases/text-field-kind/context.json +1 -0
- package/fixtures/cases/text-field-kind/expected.json +6 -0
- package/fixtures/cases/text-field-kind/library/page.md +4 -0
- package/fixtures/cases/text-field-kind/schema.yaml +4 -0
- package/fixtures/cases/truncated-link-definition/expected.json +1 -2
- package/fixtures/cases/truncated-link-definition/schema.yaml +1 -0
- package/fixtures/cases/types-folder-content/context.json +1 -0
- package/fixtures/cases/types-folder-content/expected.json +1 -0
- package/fixtures/cases/types-folder-content/library/types/task.md +4 -0
- package/fixtures/cases/types-folder-content/schema.yaml +4 -0
- package/fixtures/cases/unclosed-frontmatter/expected.json +1 -2
- package/fixtures/cases/undeclared-field/context.json +1 -0
- package/fixtures/cases/undeclared-field/expected.json +6 -0
- package/fixtures/cases/undeclared-field/library/item.md +9 -0
- package/fixtures/cases/undeclared-field/schema.yaml +6 -0
- package/fixtures/cases/unevaluated-items-closed/context.json +1 -0
- package/fixtures/cases/unevaluated-items-closed/expected.json +6 -0
- package/fixtures/cases/unevaluated-items-closed/library/trip.md +6 -0
- package/fixtures/cases/unevaluated-items-closed/schema.yaml +10 -0
- package/fixtures/cases/unknown-type/context.json +1 -0
- package/fixtures/cases/unknown-type/expected.json +6 -0
- package/fixtures/cases/unknown-type/library/item.md +3 -0
- package/fixtures/cases/unknown-type/schema.yaml +3 -0
- package/fixtures/cases/unlisted-reference-type/context.json +1 -0
- package/fixtures/cases/unlisted-reference-type/expected.json +5 -0
- package/fixtures/cases/unlisted-reference-type/schema.yaml +3 -0
- package/fixtures/cases/unresolved-link/expected.json +1 -2
- package/fixtures/cases/unresolved-link/schema.yaml +6 -0
- package/fixtures/cases/valid-typed-document/library/tasks/one.md +1 -0
- package/fixtures/cases/valid-typed-document/schema.yaml +16 -0
- package/fixtures/cases/wide-item-fence-link/schema.yaml +1 -0
- package/fixtures/division.json +409 -0
- package/fixtures/projection.json +109 -28
- package/package.json +3 -12
- package/dist/definition.js.map +0 -1
- package/dist/document.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/links.js.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/profile.js.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/refuse.js.map +0 -1
- package/dist/schema.js.map +0 -1
- package/dist/sections.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.js.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/yaml.js.map +0 -1
- package/fixtures/cases/binary-any-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-document-collision/library/types/note.md +0 -3
- package/fixtures/cases/binary-link-outside-collection/library/types/note.md +0 -3
- package/fixtures/cases/binary-prototype-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/note.md +0 -5
- package/fixtures/cases/binary-typed-reference/library/types/person.md +0 -3
- package/fixtures/cases/bracketed-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/declared-binary-links/library/types/note.md +0 -3
- package/fixtures/cases/duplicate-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/fenced-link-definition/library/types/task.md +0 -7
- package/fixtures/cases/field-enum/library/types/task.md +0 -8
- package/fixtures/cases/interrupted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/long-fence-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/malformed-definition/library/types/task.md +0 -5
- package/fixtures/cases/missing-binary-image/library/types/note.md +0 -3
- package/fixtures/cases/missing-binary-link/library/types/note.md +0 -3
- package/fixtures/cases/missing-required-field/library/types/task.md +0 -8
- package/fixtures/cases/paragraph-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/prd-definition/library/types/task.md +0 -15
- package/fixtures/cases/quoted-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/referenced-missing-file/library/types/person.md +0 -5
- package/fixtures/cases/referenced-missing-file/library/types/task.md +0 -8
- package/fixtures/cases/structured-section/library/types/task.md +0 -8
- package/fixtures/cases/truncated-link-definition/library/types/note.md +0 -3
- package/fixtures/cases/unresolved-link/library/types/task.md +0 -7
- package/fixtures/cases/valid-typed-document/library/types/person.md +0 -5
- package/fixtures/cases/valid-typed-document/library/types/task.md +0 -12
- package/fixtures/cases/wide-item-fence-link/library/types/note.md +0 -3
- package/markdown-syntax-profile.md +0 -9
- /package/fixtures/cases/{prd-definition → absent-optional-field}/context.json +0 -0
- /package/fixtures/cases/{prd-definition → absent-optional-field}/expected.json +0 -0
package/fixtures/README.md
CHANGED
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Each directory under `cases/` is one text Library, one validation context,
|
|
4
4
|
and one expected verdict. Consumers load the files under `library/` as
|
|
5
|
-
path-to-content,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
path-to-content, an absent `library/` being the empty Library, and the
|
|
6
|
+
required `context.json` as `ValidationContext`. Cases with a `schema.yaml` call
|
|
7
|
+
`verify` with its text, then compare its refusal or
|
|
8
|
+
`validate(library, context, verified.model)` against `expected.json`. Other
|
|
9
|
+
cases compare `validate(library, context)` directly. Text-only cases carry
|
|
10
|
+
`{ "binaryTargets": [] }`. Binary targets are membership declarations; the
|
|
11
|
+
corpus supplies no binary bytes or placeholder Documents.
|
|
9
12
|
|
|
10
13
|
## Preamble operations
|
|
11
14
|
|
|
@@ -15,29 +18,52 @@ the validation Libraries. Each row carries `name`, exact `source`, expected
|
|
|
15
18
|
the source, compare `Document.preamble`, apply
|
|
16
19
|
`{ kind: 'preamble', prior: preamble, value }`, and compare the serialized result.
|
|
17
20
|
These cases cover empty and heading-free Documents, frontmatter boundaries,
|
|
18
|
-
fenced headings, newline/source preservation, and
|
|
19
|
-
example from its [approved candidate](https://github.com/agentshouse/mdruntime/blob/ed0a6f0b95317d9ade846ec1f2871a3997519bc4/test/rooms.ts).
|
|
20
|
-
The package check runs every row in ESM, CommonJS, and the browser-target VM
|
|
21
|
-
bundle, also checking stale priors, immutable Documents, and conversion of the
|
|
22
|
-
Runtime link rewrite into a preamble operation through public APIs.
|
|
21
|
+
fenced headings, newline/source preservation, and a moved-export link rewrite.
|
|
23
22
|
|
|
24
23
|
## Projection
|
|
25
24
|
|
|
26
25
|
`projection.json` exercises the public `project` seam separately from the
|
|
27
|
-
validation Libraries. It carries `
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
validation Libraries. It carries `schema`, one schema text, and `cases`. Each
|
|
27
|
+
case carries `name`, the `file` the Document sits at, exact `source`, the
|
|
28
|
+
`documentTargets` the collection holds as Markdown documents, the `definition`
|
|
29
|
+
type name or `null`, an optional `move`, an optional `links` inventory, an
|
|
30
|
+
optional `relabel`, an optional `filtered`, and `expected`.
|
|
31
31
|
A case carrying a `move` lists both the Path its target sits at and the Path the
|
|
32
32
|
move takes it to, because the collection holds that target either way.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
`
|
|
36
|
-
|
|
34
|
+
Verify the schema, parse the source, call `project(document, file, context)`
|
|
35
|
+
with `documentTargets` and the verified type `definition` names, and compare against `expected`. Where
|
|
36
|
+
`links` is present, compare `links(document, file)` against it. Then check
|
|
37
37
|
that the source is unchanged. Where `move` is present, apply
|
|
38
38
|
`{ kind: 'link', href, to }`, confirm the serialized Document changed, and
|
|
39
39
|
confirm the projection of the moved Document is still exactly `expected`: a
|
|
40
|
-
moved Path rewrites destinations and leaves the projection alone.
|
|
40
|
+
moved Path rewrites destinations and leaves the projection alone. Where
|
|
41
|
+
`relabel` is present, split the source at its `from`, which the source carries
|
|
42
|
+
exactly once, join the pieces with its `to`, parse the result, and confirm its
|
|
43
|
+
projection is exactly the relabel's own `expected` and differs from the case's:
|
|
44
|
+
a changed visible label changes the projection. Where `filtered` is present,
|
|
45
|
+
apply `{ kind: 'field', name: field, value, prior }` with its `field` and
|
|
46
|
+
`value` and the Document's current value as `prior`, confirm the serialized
|
|
47
|
+
Document changed, and confirm its projection is still exactly `expected`: a
|
|
48
|
+
change to a value that is not prose leaves the projection alone.
|
|
49
|
+
|
|
50
|
+
## Division
|
|
51
|
+
|
|
52
|
+
`division.json` exercises the public `divide` seam separately from the
|
|
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 }`,
|
|
56
|
+
and compare against `expected`: either `{ "ok": true, "spans": [...] }`, where
|
|
57
|
+
each span carries the exact `text` to embed and the exact `source` the returned
|
|
58
|
+
`start` and `end` address in that case's source, or `{ "ok": false, "refusal": ... }`. Then
|
|
59
|
+
check that the source is unchanged. A span's `text` and `source` differ where
|
|
60
|
+
the embedded text repeats a continuation's own heading, carries an internal
|
|
61
|
+
link's visible label, or carries a frontmatter value without the quotes the
|
|
62
|
+
author wrote, and where the addressed extent encloses a declared structured
|
|
63
|
+
section between two pieces one span packs together or the whole of a free-text
|
|
64
|
+
value one span carries part of. `start` and `end` are UTF-8 byte offsets into the case's
|
|
65
|
+
source; every source in this corpus is ASCII, so a consumer compares the
|
|
66
|
+
addressed `source` with an ordinary string slice.
|
|
41
67
|
|
|
42
68
|
## Verdict format
|
|
43
69
|
|
|
@@ -53,53 +79,57 @@ Refusal:
|
|
|
53
79
|
{
|
|
54
80
|
"verdict": "refuse",
|
|
55
81
|
"file": "<library path>",
|
|
56
|
-
"location": "<
|
|
82
|
+
"location": "<JSON Pointer or section name>",
|
|
57
83
|
"rule": "<rule id>",
|
|
58
|
-
"version": "<package version>",
|
|
59
84
|
"referrers": ["<library path>"]
|
|
60
85
|
}
|
|
61
86
|
```
|
|
62
87
|
|
|
63
|
-
`location` is
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
88
|
+
`location` is the JSON Pointer of the frontmatter value a rule concerns, such
|
|
89
|
+
as `/shipping/city`, or the name of the section it concerns, and is omitted when
|
|
90
|
+
the rule concerns neither. `referrers` is present only for
|
|
91
|
+
`referenced-missing-file`. A schema refusal carries no `file`; its `location`
|
|
92
|
+
is the JSON Pointer of the schema part it concerns, such as
|
|
93
|
+
`/task/properties/title/type`, or `line <n>` for `schema-yaml`.
|
|
67
94
|
|
|
68
95
|
## Rule ids
|
|
69
96
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
|
|
97
|
-
`unwritable-link`
|
|
98
|
-
`
|
|
97
|
+
A frontmatter value that fails a JSON Schema keyword is refused under that
|
|
98
|
+
keyword's name, such as `required`, `type`, `enum`, `format`, `pattern`,
|
|
99
|
+
`minimum`, `maxLength`, `maxItems` or `oneOf`, at the value's JSON Pointer; a
|
|
100
|
+
missing required key is named by the Pointer it would sit at. A malformed
|
|
101
|
+
schema keyword is refused under that keyword's name at its Pointer in the
|
|
102
|
+
schema text. The model's own rules:
|
|
103
|
+
|
|
104
|
+
| Rule | When |
|
|
105
|
+
| ------------------------- | --------------------------------------------------------------------------------- |
|
|
106
|
+
| `binary-target-document` | A path is declared as both a text Document and a binary target |
|
|
107
|
+
| `frontmatter-fence` | A present frontmatter fence does not parse as the accepted YAML subset |
|
|
108
|
+
| `schema-yaml` | A schema text is not a mapping in the accepted YAML subset |
|
|
109
|
+
| `schema-type-name` | A type name is empty, starts with `$`, or is `any` or `attachment` |
|
|
110
|
+
| `schema` | A type or subschema is neither a mapping nor a boolean |
|
|
111
|
+
| `schema-keyword` | A schema carries a key that is no JSON Schema 2020-12 keyword the model admits |
|
|
112
|
+
| `$defs` | `$defs` is not a mapping |
|
|
113
|
+
| `$ref` | A `$ref` reaches no subschema under `#/$defs/` of the same file |
|
|
114
|
+
| `reference` | `reference` is not on a string or names something but a type, `any`, `attachment` |
|
|
115
|
+
| `sections` | A section is not `{ kind: text }` or `{ kind: list, items }` over one scalar |
|
|
116
|
+
| `member_document` | The mark is not a boolean, or a second type carries it |
|
|
117
|
+
| `unknown-type` | A file declares a type absent from the governing schema |
|
|
118
|
+
| `undeclared-field` | A closed object carries a key it does not declare |
|
|
119
|
+
| `required-section` | A required section heading is missing |
|
|
120
|
+
| `unresolved-reference` | A reference field, list item or section item reaches no file of a type it names |
|
|
121
|
+
| `unresolved-link` | A relative body link does not resolve to a current path |
|
|
122
|
+
| `structured-section` | A declared list section is not a list of values of its item schema |
|
|
123
|
+
| `referenced-missing-file` | Remaining files still reference an absent path |
|
|
124
|
+
| `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
|
+
|
|
127
|
+
`unwritable-link` is refused by `apply` and `division-budget` by `divide`, not
|
|
128
|
+
by `validate`, so no case under `cases/` carries either.
|
|
99
129
|
|
|
100
130
|
## YAML subset
|
|
101
131
|
|
|
102
|
-
Frontmatter
|
|
103
|
-
block and flow sequences, plain and quoted scalars, `true`, `false`, `null`,
|
|
132
|
+
Frontmatter and a schema text are each a mapping in a closed YAML subset: block and flow mappings,
|
|
133
|
+
block and flow sequences, a block sequence item that opens a mapping, plain and quoted scalars, `true`, `false`, `null`,
|
|
104
134
|
and decimal numbers. It does not take YAML 1.1 boolean or timestamp aliases,
|
|
105
|
-
octal numbers, anchors, tags, or block scalars.
|
|
135
|
+
octal numbers, anchors, tags, or block scalars. A mapping carries each key once.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$defs:
|
|
2
|
+
address:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
city: { type: string }
|
|
6
|
+
country: { type: string, pattern: '^[A-Z]{2}$' }
|
|
7
|
+
required: [city]
|
|
8
|
+
company:
|
|
9
|
+
properties:
|
|
10
|
+
name: { type: string }
|
|
11
|
+
deal:
|
|
12
|
+
type: object
|
|
13
|
+
properties:
|
|
14
|
+
title: { type: string, minLength: 1, maxLength: 40 }
|
|
15
|
+
company: { type: string, reference: company }
|
|
16
|
+
stage: { enum: [lead, proposal, won, lost], default: lead }
|
|
17
|
+
amount: { type: integer, minimum: 0 }
|
|
18
|
+
probability: { type: number, minimum: 0, maximum: 1 }
|
|
19
|
+
open: { type: boolean }
|
|
20
|
+
closes_at: { type: string, format: date-time }
|
|
21
|
+
contact_email: { type: string, format: email }
|
|
22
|
+
note: { type: [string, 'null'] }
|
|
23
|
+
shipping: { $ref: '#/$defs/address' }
|
|
24
|
+
tags: { type: array, items: { type: string }, maxItems: 3 }
|
|
25
|
+
lines:
|
|
26
|
+
type: array
|
|
27
|
+
items:
|
|
28
|
+
type: object
|
|
29
|
+
properties:
|
|
30
|
+
product: { type: string }
|
|
31
|
+
quantity: { type: integer, minimum: 1 }
|
|
32
|
+
required: [product, quantity]
|
|
33
|
+
blocks:
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
oneOf:
|
|
37
|
+
- properties:
|
|
38
|
+
kind: { const: paragraph }
|
|
39
|
+
text: { type: string }
|
|
40
|
+
required: [kind, text]
|
|
41
|
+
- properties:
|
|
42
|
+
kind: { const: quiz }
|
|
43
|
+
question: { type: string }
|
|
44
|
+
required: [kind, question]
|
|
45
|
+
attributes:
|
|
46
|
+
type: object
|
|
47
|
+
additionalProperties: { type: string }
|
|
48
|
+
required: [title, company, stage]
|
|
49
|
+
if:
|
|
50
|
+
properties:
|
|
51
|
+
stage: { const: won }
|
|
52
|
+
required: [stage]
|
|
53
|
+
then:
|
|
54
|
+
required: [amount]
|
|
55
|
+
sections:
|
|
56
|
+
Description: { kind: text }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
note: {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
note: {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: deal
|
|
3
|
+
title: Renewal
|
|
4
|
+
company: ../companies/acme.md
|
|
5
|
+
stage: won
|
|
6
|
+
amount: 1200
|
|
7
|
+
probability: 0.5
|
|
8
|
+
open: "no"
|
|
9
|
+
closes_at: 2026-10-10T09:30:00Z
|
|
10
|
+
contact_email: ana@example.com
|
|
11
|
+
note: null
|
|
12
|
+
shipping:
|
|
13
|
+
city: Paris
|
|
14
|
+
country: FR
|
|
15
|
+
tags: [renewal, priority]
|
|
16
|
+
lines:
|
|
17
|
+
- product: seats
|
|
18
|
+
quantity: 10
|
|
19
|
+
- product: support
|
|
20
|
+
quantity: 1
|
|
21
|
+
blocks:
|
|
22
|
+
- kind: paragraph
|
|
23
|
+
text: Signed.
|
|
24
|
+
- { kind: quiz, question: Renew next year? }
|
|
25
|
+
attributes:
|
|
26
|
+
region: emea
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Description
|
|
30
|
+
|
|
31
|
+
The yearly renewal.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$defs:
|
|
2
|
+
address:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
city: { type: string }
|
|
6
|
+
country: { type: string, pattern: '^[A-Z]{2}$' }
|
|
7
|
+
required: [city]
|
|
8
|
+
company:
|
|
9
|
+
properties:
|
|
10
|
+
name: { type: string }
|
|
11
|
+
deal:
|
|
12
|
+
type: object
|
|
13
|
+
properties:
|
|
14
|
+
title: { type: string, minLength: 1, maxLength: 40 }
|
|
15
|
+
company: { type: string, reference: company }
|
|
16
|
+
stage: { enum: [lead, proposal, won, lost], default: lead }
|
|
17
|
+
amount: { type: integer, minimum: 0 }
|
|
18
|
+
probability: { type: number, minimum: 0, maximum: 1 }
|
|
19
|
+
open: { type: boolean }
|
|
20
|
+
closes_at: { type: string, format: date-time }
|
|
21
|
+
contact_email: { type: string, format: email }
|
|
22
|
+
note: { type: [string, 'null'] }
|
|
23
|
+
shipping: { $ref: '#/$defs/address' }
|
|
24
|
+
tags: { type: array, items: { type: string }, maxItems: 3 }
|
|
25
|
+
lines:
|
|
26
|
+
type: array
|
|
27
|
+
items:
|
|
28
|
+
type: object
|
|
29
|
+
properties:
|
|
30
|
+
product: { type: string }
|
|
31
|
+
quantity: { type: integer, minimum: 1 }
|
|
32
|
+
required: [product, quantity]
|
|
33
|
+
blocks:
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
oneOf:
|
|
37
|
+
- properties:
|
|
38
|
+
kind: { const: paragraph }
|
|
39
|
+
text: { type: string }
|
|
40
|
+
required: [kind, text]
|
|
41
|
+
- properties:
|
|
42
|
+
kind: { const: quiz }
|
|
43
|
+
question: { type: string }
|
|
44
|
+
required: [kind, question]
|
|
45
|
+
attributes:
|
|
46
|
+
type: object
|
|
47
|
+
additionalProperties: { type: string }
|
|
48
|
+
required: [title, company, stage]
|
|
49
|
+
if:
|
|
50
|
+
properties:
|
|
51
|
+
stage: { const: won }
|
|
52
|
+
required: [stage]
|
|
53
|
+
then:
|
|
54
|
+
required: [amount]
|
|
55
|
+
sections:
|
|
56
|
+
Description: { kind: text }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: deal
|
|
3
|
+
title: Renewal
|
|
4
|
+
company: ../companies/acme.md
|
|
5
|
+
stage: won
|
|
6
|
+
amount: 1200
|
|
7
|
+
probability: 0.5
|
|
8
|
+
open: false
|
|
9
|
+
closes_at: 2026-10-10T09:30:00Z
|
|
10
|
+
contact_email: ana@example.com
|
|
11
|
+
note: null
|
|
12
|
+
shipping:
|
|
13
|
+
city: Paris
|
|
14
|
+
country: FR
|
|
15
|
+
cty: Lyon
|
|
16
|
+
tags: [renewal, priority]
|
|
17
|
+
lines:
|
|
18
|
+
- product: seats
|
|
19
|
+
quantity: 10
|
|
20
|
+
- product: support
|
|
21
|
+
quantity: 1
|
|
22
|
+
blocks:
|
|
23
|
+
- kind: paragraph
|
|
24
|
+
text: Signed.
|
|
25
|
+
- { kind: quiz, question: Renew next year? }
|
|
26
|
+
attributes:
|
|
27
|
+
region: emea
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Description
|
|
31
|
+
|
|
32
|
+
The yearly renewal.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
$defs:
|
|
2
|
+
address:
|
|
3
|
+
type: object
|
|
4
|
+
properties:
|
|
5
|
+
city: { type: string }
|
|
6
|
+
country: { type: string, pattern: '^[A-Z]{2}$' }
|
|
7
|
+
required: [city]
|
|
8
|
+
company:
|
|
9
|
+
properties:
|
|
10
|
+
name: { type: string }
|
|
11
|
+
deal:
|
|
12
|
+
type: object
|
|
13
|
+
properties:
|
|
14
|
+
title: { type: string, minLength: 1, maxLength: 40 }
|
|
15
|
+
company: { type: string, reference: company }
|
|
16
|
+
stage: { enum: [lead, proposal, won, lost], default: lead }
|
|
17
|
+
amount: { type: integer, minimum: 0 }
|
|
18
|
+
probability: { type: number, minimum: 0, maximum: 1 }
|
|
19
|
+
open: { type: boolean }
|
|
20
|
+
closes_at: { type: string, format: date-time }
|
|
21
|
+
contact_email: { type: string, format: email }
|
|
22
|
+
note: { type: [string, 'null'] }
|
|
23
|
+
shipping: { $ref: '#/$defs/address' }
|
|
24
|
+
tags: { type: array, items: { type: string }, maxItems: 3 }
|
|
25
|
+
lines:
|
|
26
|
+
type: array
|
|
27
|
+
items:
|
|
28
|
+
type: object
|
|
29
|
+
properties:
|
|
30
|
+
product: { type: string }
|
|
31
|
+
quantity: { type: integer, minimum: 1 }
|
|
32
|
+
required: [product, quantity]
|
|
33
|
+
blocks:
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
oneOf:
|
|
37
|
+
- properties:
|
|
38
|
+
kind: { const: paragraph }
|
|
39
|
+
text: { type: string }
|
|
40
|
+
required: [kind, text]
|
|
41
|
+
- properties:
|
|
42
|
+
kind: { const: quiz }
|
|
43
|
+
question: { type: string }
|
|
44
|
+
required: [kind, question]
|
|
45
|
+
attributes:
|
|
46
|
+
type: object
|
|
47
|
+
additionalProperties: { type: string }
|
|
48
|
+
required: [title, company, stage]
|
|
49
|
+
if:
|
|
50
|
+
properties:
|
|
51
|
+
stage: { const: won }
|
|
52
|
+
required: [stage]
|
|
53
|
+
then:
|
|
54
|
+
required: [amount]
|
|
55
|
+
sections:
|
|
56
|
+
Description: { kind: text }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "binaryTargets": [] }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: deal
|
|
3
|
+
title: Renewal
|
|
4
|
+
company: ../companies/acme.md
|
|
5
|
+
stage: won
|
|
6
|
+
amount: 1200
|
|
7
|
+
probability: 0.5
|
|
8
|
+
open: false
|
|
9
|
+
closes_at: 2026-10-10
|
|
10
|
+
contact_email: ana@example.com
|
|
11
|
+
note: null
|
|
12
|
+
shipping:
|
|
13
|
+
city: Paris
|
|
14
|
+
country: FR
|
|
15
|
+
tags: [renewal, priority]
|
|
16
|
+
lines:
|
|
17
|
+
- product: seats
|
|
18
|
+
quantity: 10
|
|
19
|
+
- product: support
|
|
20
|
+
quantity: 1
|
|
21
|
+
blocks:
|
|
22
|
+
- kind: paragraph
|
|
23
|
+
text: Signed.
|
|
24
|
+
- { kind: quiz, question: Renew next year? }
|
|
25
|
+
attributes:
|
|
26
|
+
region: emea
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Description
|
|
30
|
+
|
|
31
|
+
The yearly renewal.
|