The schema and a project's extension
sheriff validate validates each file with a JSON Schema validator against the base schema of the SpecSheriff guidelines, composed with the project's extension (§s-eferktypcj7njt5).
The extension is validated first, against the schema of an extension. That schema lets an extension add only kinds, fields of an existing kind, and properties of a file or of a link.
What the extension adds joins the base schema:
- its kinds join the kinds a node may have;
- its conditions join those every node is held to;
- its properties of a file and of a link join those a file and a link may hold.
sheriff binding validates each file against the same schema before it checks anything.
sheriff reindex validates each file once it has merged each key written twice and changed what an earlier release wrote, as §s-f5rz6b7dhxejjts says, and before it computes anything. It leaves out of that validation only what it writes itself:
- the links pointing at a node;
- outside the archive, a sid a node lacks, every location, a header's index of its sections and the values gathered beside a field.
Where the schema refuses a file, or the schema of an extension refuses the project's extension, each of the two commands names that file or the extension and every refusal in it. It then checks nothing more, and sheriff reindex writes no file.
Each command is written for the shape the schema gives a file. Only a validation against the schema names where a file departs from that shape and what is wrong there. sheriff reindex builds each file from all of them, so writing only some would leave the files disagreeing with one another. A key written twice is merged first, since a file read without the merge holds only its last value. What an earlier release wrote is changed first, since the schema refuses its old names. What sheriff reindex writes itself is left out, since a node written by hand lacks it until the command runs.
The links it makes
The links made to it
The tests bound to it
- skills/tools/test/e2e/commands.test.ts · s-xzcw3hv4hmxz7h7 sheriff reindex and sheriff binding refuse a file the schema refuses, naming it, rather than fail on it
- skills/tools/test/unit/binding.test.ts · s-xzcw3hv4hmxz7h7 sheriff binding refuses a file the schema refuses before it checks anything, naming the file and every refusal in it
- skills/tools/test/unit/binding.test.ts · s-xzcw3hv4hmxz7h7 sheriff binding refuses where the schema of an extension refuses the project's extension, naming it, and checks nothing more
- skills/tools/test/unit/reindex.test.ts · s-xzcw3hv4hmxz7h7 the reindex refuses a file the schema refuses, naming the file and every refusal in it, and then writes no file
- skills/tools/test/unit/reindex.test.ts · s-xzcw3hv4hmxz7h7 the reindex refuses a sid that is not one, since only a sid a node lacks is left out of the validation
- skills/tools/test/unit/reindex.test.ts · s-xzcw3hv4hmxz7h7 the reindex refuses where the schema of an extension refuses the project's extension, naming it, and then writes no file
- skills/tools/test/unit/reindex.test.ts · s-xzcw3hv4hmxz7h7 the reindex validates once it has changed what an earlier release wrote, and leaves out what it writes itself
- skills/tools/test/unit/schema.test.ts · s-xzcw3hv4hmxz7h7 composes a project's extension with the schema: its kinds, the fields it adds to a kind, the properties of a file and of a link
- skills/tools/test/unit/schema.test.ts · s-xzcw3hv4hmxz7h7 refuses an extension that does more than add, and then composes nothing
- skills/tools/test/unit/validate.test.ts · s-xzcw3hv4hmxz7h7 refuses an extension that is no JSON, or whose kind's schema is no JSON Schema, naming it rather than failing on it
- skills/tools/test/unit/validate.test.ts · s-xzcw3hv4hmxz7h7 refuses an extension the schema of an extension refuses, naming it, and takes a project's extension as no copy of the schema