test(cli): compile every example of the import prompt #276

Merged
abiwab merged 1 commit from test/ai-spec-examples into dev/1.6 2026-11-26 16:21:14 +01:00
Owner

PR 3 of the DX & authoring-aids plan (AI specs hygiene). Extends packages/cli/tests/ai-spec-examples.test.ts (from #274) to every example of gram import's prompt (gram-spec.ts), in three kinds (the ❌ being the marker):

  • Full recipe (frontmatter block, and SECTION 8's reference recipe, which sits in no fence): compiles with no kitchen code of severity warning or above; frontmatter read key for key, no # in a value, no deprecated key (deprecatedFrontmatterKeysIn).
  • Snippet (no frontmatter, no ❌): the same, with UNDEFINED_REFERENCE alone tolerated.
  • Counter-example (holds a ❌): only its ✅ lines are checked, as snippets.

Fences are found at any indentation (closing on the same one), so the indented block under the ->&name rule is covered while the ```gram written after a ❌ opens nothing. Minimum counts per kind guard against a silently empty extraction. A last test requires every deprecated key of FRONTMATTER_KEYS to be named in the prompt: it failed on yield / yields, now named as deprecated in the prose next to servings.

The test no longer mentions the local, git-ignored gram-authoring skill: that check moved to a local script.

No changeset (internal tooling; the deprecation itself is announced by PR 2a).

Checks: red before the prose fix, green after; one deliberate mutation per kind fails the test; typecheck, biome, full bun test (4112 pass, 0 fail); audit unchanged (127 flags).

PR 3 of the DX & authoring-aids plan (AI specs hygiene). Extends `packages/cli/tests/ai-spec-examples.test.ts` (from #274) to every example of `gram import`'s prompt (`gram-spec.ts`), in three kinds (the ❌ being the marker): - **Full recipe** (frontmatter block, and SECTION 8's reference recipe, which sits in no fence): compiles with no kitchen code of severity `warning` or above; frontmatter read key for key, no `#` in a value, no deprecated key (`deprecatedFrontmatterKeysIn`). - **Snippet** (no frontmatter, no ❌): the same, with `UNDEFINED_REFERENCE` alone tolerated. - **Counter-example** (holds a ❌): only its ✅ lines are checked, as snippets. Fences are found at any indentation (closing on the same one), so the indented block under the `->&name` rule is covered while the ```gram written after a ❌ opens nothing. Minimum counts per kind guard against a silently empty extraction. A last test requires every deprecated key of `FRONTMATTER_KEYS` to be named in the prompt: it failed on `yield` / `yields`, now named as deprecated in the prose next to `servings`. The test no longer mentions the local, git-ignored gram-authoring skill: that check moved to a local script. No changeset (internal tooling; the deprecation itself is announced by PR 2a). Checks: red before the prose fix, green after; one deliberate mutation per kind fails the test; typecheck, biome, full `bun test` (4112 pass, 0 fail); audit unchanged (127 flags).
test(cli): compile every example of the import prompt
All checks were successful
CI / Build & Test (pull_request) Successful in 5m30s
027130a6e2
abiwab merged commit c02f9387c6 into dev/1.6 2026-11-26 16:21:14 +01:00
abiwab deleted branch test/ai-spec-examples 2026-11-26 16:21:14 +01:00
Sign in to join this conversation.
No description provided.