1- # Recipe Integration Test Harness
1+ # Pattern Integration Test Harness
2+
3+ > ** Terminology update:** What we previously called “recipes” are now referred
4+ > to as “patterns.” The builder API still exports a ` recipe(...) ` helper, but
5+ > throughout this document we describe the authored artifacts as patterns.
26
37## Objectives
48
1014
1115## Test Artifact Structure
1216
13- Each recipe test case consists of:
17+ Each pattern test case consists of:
1418
15- - ** Recipe module** : A ` .tsx ` or ` .ts ` file exporting a recipe, lift, or handler.
16- - ** Fixture file** (proposed ` .recipe.test.json ` or ` .recipe.test.ts ` ):
17- - ` arguments ` : Optional initial argument payload (JSON) passed to the recipe.
19+ - ** Pattern module** : A ` .tsx ` or ` .ts ` file exporting a pattern, lift, or
20+ handler.
21+ - ** Fixture file** (proposed ` .pattern.test.json ` or ` .pattern.test.ts ` ):
22+ - ` arguments ` : Optional initial argument payload (JSON) passed to the pattern.
1823 - ` initialState ` : Optional set of documents/cells to seed before running.
1924 - ` assertions ` : Array of checkpoints. Each checkpoint contains:
2025 - ` expect ` : A list of ` { path: string, value: JSONValue } ` assertions on the
@@ -43,12 +48,12 @@ Example fixture snippet:
4348
4449## Harness Execution Flow
4550
46- 1 . Compile the recipe module (shared pipeline for V1 and V2).
47- 2 . Run the recipe twice per fixture:
51+ 1 . Compile the pattern module (shared pipeline for V1 and V2).
52+ 2 . Run the pattern twice per fixture:
4853 - ** V1 mode** : Use current ` recipe ` /` lift ` /` handler ` exports.
4954 - ** V2 mode** : Swap in ` recipeV2 ` /` liftV2 ` /` handlerV2 ` and new runtime paths.
50553 . For each mode:
51- - Instantiate the runtime, seed initial state, run the recipe , and evaluate
56+ - Instantiate the runtime, seed initial state, run the pattern , and evaluate
5257 assertions.
5358 - For checkpoints with events, emit them sequentially via handler streams and
5459 re-run assertions after the scheduler settles.
@@ -62,14 +67,14 @@ Example fixture snippet:
6267- Provide utilities for referencing cells/streams via friendly syntax (e.g.,
6368 resolve ` result.increment ` to the correct link automatically using the stored
6469 snapshot or capability wrappers).
65- - Allow fixtures to specify tolerance for unordered arrays or partial structures
66- when recipes return collections.
70+ - Allow fixtures to specify tolerance for unordered arrays or partial
71+ structures when patterns return collections.
6772
6873## Rollout
6974
70- - Add the harness and fixtures under ` packages/runner/integration/ ` so UI-facing
71- patterns remain focused on front-end rendering scenarios.
72- - Seed the suite with high-impact recipes (mirroring those in
75+ - Add the harness and fixtures under ` packages/runner/integration/ ` so
76+ UI-facing patterns remain focused on front-end rendering scenarios.
77+ - Seed the suite with high-impact patterns (mirroring those in
7378 ` packages/patterns/ ` ) to validate end-to-end behavior.
7479- Expand coverage to other workspaces once the harness stabilizes.
7580- Keep fixtures mode-agnostic so future migrations (beyond V2) can reuse the
0 commit comments