Appendix F — Conformance corpus
Appendix F. Conformance corpus (informative)
Informative. This appendix is a placeholder for the embedded conformance corpus. The current corpus lives on disk under
standard/conformance/positive/andstandard/conformance/negative/. A future Cook Standard cut will inline the corpus into this appendix so the Standard renders as a self-contained reference.
F.1. Status
The corpus is consumed by cook-lang’s test suite (cargo test -p cook-lang --test conformance) and is referenced by the conformance criteria in § 1.1. Implementations seeking conformance should clone the repository and run the harness against their parser; this appendix will be expanded to a rendered enumeration in a future cut.
F.2. Syntax-only consumers
A second harness, tree-sitter-cook/scripts/conformance.mjs, runs the same corpus against the tree-sitter grammar. A syntax-only implementation cannot honour every negative fixture: many rejections are register-phase or codegen-phase rules (region ordering, placeholder admission, probe declaredness) over Cookfiles that are syntactically well-formed. Such a consumer maintains an explicit skip list pairing each skipped negative fixture with the normative rule that rejects it and the phase that enforces it; a skipped fixture MUST parse cleanly (the skip asserts “accepted by syntax, rejected later”, not “ignored”). As of v0.18 the tree-sitter harness skips the two CS-0224 gather/command agreement codegen rejections, the CS-0022/CS-0024 codegen rejections, the CS-0026 import-path rules, the CS-0095 gather <probe> register-phase rejections (undeclared key, non-array value, artifact dep), the CS-0143 cook.recipe origin field type check (a non-string origin — register-phase), the CS-0144 cook.require_recipe outside-a-recipe-body rejection (a register-block call — register-phase), the CS-0149 cook.on_register_complete minting-ban rejection (a queued callback calling cook.recipe — register-phase), the CS-0153 cook.add_unit step_kind value check (step_kind = "test" — a test work unit is registrable only through cook.add_test; register-phase), the CS-0155 probe-driven literal-first-step rejection (a literal-output cook_step with no preceding step in a gather <probe> recipe has nothing to gather — register-phase), the § 7.1.1 chore-parameter rules whose enforcement is parse-time semantic rather than grammatical (ordering, duplicate names, at-most-one variadic, variadic-tail — the dot-ban and the no-default-on-variadic rule remain grammatical), and the whole config-block family, whose body is opaque LUA_SOURCE to a grammar: the CS-0163 sandbox rejections (os / io unreachable), the CS-0164 env.NAME output sink (now var.NAME), and the CS-0172 declared-namespace rejections (a $<NAME> absent from the frozen keyset, a table-valued declaration, a var write outside a config_body) — all register-phase. It honours every positive fixture, including the CS-0144 register-phase cook.require_recipe body line, the CS-0089 cook (LUA_EXPR) output form, the $<NAME[in]> member accessor (CS-0098, respelled by CS-0137), and the CS-0148 files glob-list producer — whose three syntactic rejections (empty list, unquoted entry, >{ … } body) are honoured as negatives, not skipped.
F.3. Language v2 expansion cases
The numbered positive corpus includes the Language v2 expansion cases:
065-gather-excludes066-gather-fan-out067-gather-many-to-one068-gather-named-files069-gather-probe-source070-seal-inline-files