The decoder MUST read, in the table, the optional family (two name templates, dialect and plugin, each with {host} once and {name} once, and optionally contract, an export subpath), instances (each a name, the instanceOf unit it is an instance of and a placement of folder or package), plugins (each a noun and optional dependsOn nouns of other plugins) and extends (the host package of a package that is a dialect or a plugin), into a Table that always has instances and plugins; it MUST refuse, with one sentence, instances or plugins with no family, a template without its two holes or with the same text for dialect and plugin, an instance of no layered unit, a folder instance of a unit that has no instances, a name or noun that is declared twice or is not a name, a plugin noun that would read as a dialect, a dependency on itself, on no plugin or in a loop, a contract that is not an export subpath, and a table that both extends a host and declares members.
Enforced (check): .github: cd commons/kanon && bun run verify — extensions.test.ts: the family, instances, plugins and extends are decoded, each malformed form is refused with a sentence, and any JSON value is a table or a sentence
Proved by: kanon/suite/extensions.test.ts
Written in: kanon/src/family.ts, kanon/src/table.ts
Tests: passed: suite/extensions.test.ts decoding any value gives a table or a sentence and never throws; passed: suite/extensions.test.ts a host's table declares its family, instances and plugins, and the package of each comes f; passed: suite/extensions.test.ts a malformed instance, plugin or family is refused with a sentence
Cited by: Kanon content checks