@metamesh/testkit 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/README.md +122 -88
  3. package/dist/assertions.d.ts +8 -15
  4. package/dist/assertions.d.ts.map +1 -1
  5. package/dist/assertions.js +24 -70
  6. package/dist/assertions.js.map +1 -1
  7. package/dist/content-assertions.d.ts +28 -0
  8. package/dist/content-assertions.d.ts.map +1 -0
  9. package/dist/content-assertions.js +75 -0
  10. package/dist/content-assertions.js.map +1 -0
  11. package/dist/content-matchers.d.ts +12 -0
  12. package/dist/content-matchers.d.ts.map +1 -0
  13. package/dist/content-matchers.js +22 -0
  14. package/dist/content-matchers.js.map +1 -0
  15. package/dist/docs/guides/package.md +122 -88
  16. package/dist/docs/manifest.json +175 -35
  17. package/dist/docs/reference/font-fixtures/LoadedFontFixtures.md +1 -1
  18. package/dist/docs/reference/font-fixtures/loadFontFixtureServices.md +1 -1
  19. package/dist/docs/reference/font-fixtures/loadFontFixtures.md +1 -1
  20. package/dist/docs/reference/fonts/FontTestFixture.md +1 -1
  21. package/dist/docs/reference/fonts/prepareFontTestServices.md +1 -1
  22. package/dist/docs/reference/index/BufferContent.md +13 -0
  23. package/dist/docs/reference/index/ContentMismatchError.md +12 -0
  24. package/dist/docs/reference/index/GeneratorModelTestInput.md +13 -0
  25. package/dist/docs/reference/index/GeneratorModelTestOptions.md +10 -0
  26. package/dist/docs/reference/index/GeneratorTestResult.md +18 -0
  27. package/dist/docs/reference/index/GeneratorTestRunner.md +9 -9
  28. package/dist/docs/reference/index/GeneratorTestRunnerOptions.md +2 -3
  29. package/dist/docs/reference/index/MeshContent.md +13 -0
  30. package/dist/docs/reference/index/MeshMeasurementExpectation.md +3 -3
  31. package/dist/docs/reference/index/MeshMeasurementTolerances.md +1 -1
  32. package/dist/docs/reference/index/RunModelOptions.md +13 -0
  33. package/dist/docs/reference/index/assertEqualBuffer.md +15 -0
  34. package/dist/docs/reference/index/assertEqualMesh.md +14 -0
  35. package/dist/docs/reference/index/{expectMeshMeasurements.md → assertMeshMeasurements.md} +3 -3
  36. package/dist/docs/reference/index/{expectValidDefaults.md → assertValidDefaults.md} +3 -3
  37. package/dist/docs/reference/index/assertValidDefinition.md +10 -0
  38. package/dist/docs/reference/index/assertValidParts.md +12 -0
  39. package/dist/docs/reference/index/{expectValidPresets.md → assertValidPresets.md} +3 -3
  40. package/dist/docs/reference/index/contentMatchers.md +12 -0
  41. package/dist/docs/reference/index/createGeneratorTestRunner.md +2 -4
  42. package/dist/docs/reference/index/getTestEngine.md +1 -1
  43. package/dist/docs/reference/index/runModel.md +13 -0
  44. package/dist/generator-execution.d.ts +6 -0
  45. package/dist/generator-execution.d.ts.map +1 -0
  46. package/dist/generator-execution.js +20 -0
  47. package/dist/generator-execution.js.map +1 -0
  48. package/dist/generator-test-runner.d.ts +32 -0
  49. package/dist/generator-test-runner.d.ts.map +1 -0
  50. package/dist/generator-test-runner.js +109 -0
  51. package/dist/generator-test-runner.js.map +1 -0
  52. package/dist/index.d.ts +10 -5
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +7 -4
  55. package/dist/index.js.map +1 -1
  56. package/dist/measurements.d.ts +4 -4
  57. package/dist/measurements.d.ts.map +1 -1
  58. package/dist/measurements.js +10 -9
  59. package/dist/measurements.js.map +1 -1
  60. package/dist/run-model.d.ts +21 -0
  61. package/dist/run-model.d.ts.map +1 -0
  62. package/dist/run-model.js +39 -0
  63. package/dist/run-model.js.map +1 -0
  64. package/dist/{engine.d.ts → test-engine.d.ts} +1 -1
  65. package/dist/test-engine.d.ts.map +1 -0
  66. package/dist/{engine.js → test-engine.js} +1 -1
  67. package/dist/test-engine.js.map +1 -0
  68. package/package.json +8 -5
  69. package/dist/docs/reference/index/GeneratorTestExecution.md +0 -19
  70. package/dist/docs/reference/index/expectSerializableDefinition.md +0 -10
  71. package/dist/docs/reference/index/expectValidParts.md +0 -19
  72. package/dist/engine.d.ts.map +0 -1
  73. package/dist/engine.js.map +0 -1
  74. package/dist/runner.d.ts +0 -36
  75. package/dist/runner.d.ts.map +0 -1
  76. package/dist/runner.js +0 -121
  77. package/dist/runner.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "formatVersion": 1,
3
3
  "packageName": "@metamesh/testkit",
4
- "packageVersion": "0.16.0",
4
+ "packageVersion": "0.18.0",
5
5
  "documents": [
6
6
  {
7
7
  "id": "testkit/guide/testing",
@@ -88,107 +88,205 @@
88
88
  ]
89
89
  },
90
90
  {
91
- "id": "testkit/reference/index/createGeneratorTestRunner",
92
- "title": "createGeneratorTestRunner",
93
- "summary": "Creates a lazy runner for one generation program without loading assets or an engine.",
94
- "path": "reference/index/createGeneratorTestRunner.md",
91
+ "id": "testkit/reference/index/assertEqualBuffer",
92
+ "title": "assertEqualBuffer",
93
+ "summary": "Asserts exact ordered numeric contents through length and at(index), without copying storage. Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs. Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and preserves reader failures. This assertion does not establish valid manufacturing geometry.",
94
+ "path": "reference/index/assertEqualBuffer.md",
95
95
  "importPath": "@metamesh/testkit",
96
96
  "availability": "Local Node testing",
97
97
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
98
98
  "keywords": [
99
99
  "reference",
100
100
  "index",
101
- "createGeneratorTestRunner"
101
+ "assertEqualBuffer"
102
102
  ]
103
103
  },
104
104
  {
105
- "id": "testkit/reference/index/expectMeshMeasurements",
106
- "title": "expectMeshMeasurements",
107
- "summary": "Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.",
108
- "path": "reference/index/expectMeshMeasurements.md",
105
+ "id": "testkit/reference/index/assertEqualMesh",
106
+ "title": "assertEqualMesh",
107
+ "summary": "Asserts identical positions and indices with buffer-specific mismatch diagnostics. Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail. Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.",
108
+ "path": "reference/index/assertEqualMesh.md",
109
109
  "importPath": "@metamesh/testkit",
110
110
  "availability": "Local Node testing",
111
111
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
112
112
  "keywords": [
113
113
  "reference",
114
114
  "index",
115
- "expectMeshMeasurements"
115
+ "assertEqualMesh"
116
116
  ]
117
117
  },
118
118
  {
119
- "id": "testkit/reference/index/expectSerializableDefinition",
120
- "title": "expectSerializableDefinition",
121
- "summary": "Throws unless a definition already has the canonical package-serializable representation.",
122
- "path": "reference/index/expectSerializableDefinition.md",
119
+ "id": "testkit/reference/index/assertMeshMeasurements",
120
+ "title": "assertMeshMeasurements",
121
+ "summary": "Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.",
122
+ "path": "reference/index/assertMeshMeasurements.md",
123
123
  "importPath": "@metamesh/testkit",
124
124
  "availability": "Local Node testing",
125
125
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
126
126
  "keywords": [
127
127
  "reference",
128
128
  "index",
129
- "expectSerializableDefinition"
129
+ "assertMeshMeasurements"
130
130
  ]
131
131
  },
132
132
  {
133
- "id": "testkit/reference/index/expectValidDefaults",
134
- "title": "expectValidDefaults",
133
+ "id": "testkit/reference/index/assertValidDefaults",
134
+ "title": "assertValidDefaults",
135
135
  "summary": "Throws unless defaults strictly decode and equal the defaults derived from the definition.",
136
- "path": "reference/index/expectValidDefaults.md",
136
+ "path": "reference/index/assertValidDefaults.md",
137
+ "importPath": "@metamesh/testkit",
138
+ "availability": "Local Node testing",
139
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
140
+ "keywords": [
141
+ "reference",
142
+ "index",
143
+ "assertValidDefaults"
144
+ ]
145
+ },
146
+ {
147
+ "id": "testkit/reference/index/assertValidDefinition",
148
+ "title": "assertValidDefinition",
149
+ "summary": "Strictly parses a definition and requires its JSON round trip to retain the canonical package representation.",
150
+ "path": "reference/index/assertValidDefinition.md",
137
151
  "importPath": "@metamesh/testkit",
138
152
  "availability": "Local Node testing",
139
153
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
140
154
  "keywords": [
141
155
  "reference",
142
156
  "index",
143
- "expectValidDefaults"
157
+ "assertValidDefinition"
144
158
  ]
145
159
  },
146
160
  {
147
- "id": "testkit/reference/index/expectValidParts",
148
- "title": "expectValidParts",
149
- "summary": "Checks finalized parts without measurement facts, retaining shared snapshot resources and placement. Runs mesh reconstruction/finalization synchronously using the supplied engine. Strictly checks unknown wire data and reconstructs its meshes using the supplied engine. Initializes the shared test engine lazily, then applies the same wire and mesh checks.",
150
- "path": "reference/index/expectValidParts.md",
161
+ "id": "testkit/reference/index/assertValidParts",
162
+ "title": "assertValidParts",
163
+ "summary": "Validates supplied world meshes and their exact agreement with reconstructed local geometry and placement. Resolves to the same parts or rejects on failure. A supplied engine is reused; otherwise the shared engine initializes lazily.",
164
+ "path": "reference/index/assertValidParts.md",
151
165
  "importPath": "@metamesh/testkit",
152
166
  "availability": "Local Node testing",
153
167
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
154
168
  "keywords": [
155
169
  "reference",
156
170
  "index",
157
- "expectValidParts"
171
+ "assertValidParts"
158
172
  ]
159
173
  },
160
174
  {
161
- "id": "testkit/reference/index/expectValidPresets",
162
- "title": "expectValidPresets",
175
+ "id": "testkit/reference/index/assertValidPresets",
176
+ "title": "assertValidPresets",
163
177
  "summary": "Checks preset metadata. Validate domain assertions through the generation test runner.",
164
- "path": "reference/index/expectValidPresets.md",
178
+ "path": "reference/index/assertValidPresets.md",
179
+ "importPath": "@metamesh/testkit",
180
+ "availability": "Local Node testing",
181
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
182
+ "keywords": [
183
+ "reference",
184
+ "index",
185
+ "assertValidPresets"
186
+ ]
187
+ },
188
+ {
189
+ "id": "testkit/reference/index/BufferContent",
190
+ "title": "BufferContent",
191
+ "summary": "Numeric contents readable without copying their storage, including immutable model buffers.",
192
+ "path": "reference/index/BufferContent.md",
193
+ "importPath": "@metamesh/testkit",
194
+ "availability": "Local Node testing",
195
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
196
+ "keywords": [
197
+ "reference",
198
+ "index",
199
+ "BufferContent"
200
+ ]
201
+ },
202
+ {
203
+ "id": "testkit/reference/index/contentMatchers",
204
+ "title": "contentMatchers",
205
+ "summary": "Optional expect.extend adapters; only content mismatches become failed matcher results.",
206
+ "path": "reference/index/contentMatchers.md",
207
+ "importPath": "@metamesh/testkit",
208
+ "availability": "Local Node testing",
209
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
210
+ "keywords": [
211
+ "reference",
212
+ "index",
213
+ "contentMatchers"
214
+ ]
215
+ },
216
+ {
217
+ "id": "testkit/reference/index/ContentMismatchError",
218
+ "title": "ContentMismatchError",
219
+ "summary": "A difference in valid buffer contents, distinct from malformed inputs or reader failures.",
220
+ "path": "reference/index/ContentMismatchError.md",
221
+ "importPath": "@metamesh/testkit",
222
+ "availability": "Local Node testing",
223
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
224
+ "keywords": [
225
+ "reference",
226
+ "index",
227
+ "ContentMismatchError"
228
+ ]
229
+ },
230
+ {
231
+ "id": "testkit/reference/index/createGeneratorTestRunner",
232
+ "title": "createGeneratorTestRunner",
233
+ "summary": "Creates a lazy runner for one generation program without loading assets or an engine.",
234
+ "path": "reference/index/createGeneratorTestRunner.md",
235
+ "importPath": "@metamesh/testkit",
236
+ "availability": "Local Node testing",
237
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
238
+ "keywords": [
239
+ "reference",
240
+ "index",
241
+ "createGeneratorTestRunner"
242
+ ]
243
+ },
244
+ {
245
+ "id": "testkit/reference/index/GeneratorModelTestInput",
246
+ "title": "GeneratorModelTestInput",
247
+ "summary": "Definition and executable runtime needed to validate and prepare a Generator.",
248
+ "path": "reference/index/GeneratorModelTestInput.md",
165
249
  "importPath": "@metamesh/testkit",
166
250
  "availability": "Local Node testing",
167
251
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
168
252
  "keywords": [
169
253
  "reference",
170
254
  "index",
171
- "expectValidPresets"
255
+ "GeneratorModelTestInput"
172
256
  ]
173
257
  },
174
258
  {
175
- "id": "testkit/reference/index/GeneratorTestExecution",
176
- "title": "GeneratorTestExecution",
177
- "summary": "Parameter or assertion failure, or a generated snapshot owned separately from its runner.",
178
- "path": "reference/index/GeneratorTestExecution.md",
259
+ "id": "testkit/reference/index/GeneratorModelTestOptions",
260
+ "title": "GeneratorModelTestOptions",
261
+ "summary": "Generation policy, optional test-owned engine, and asynchronous Generator asset preparation.",
262
+ "path": "reference/index/GeneratorModelTestOptions.md",
179
263
  "importPath": "@metamesh/testkit",
180
264
  "availability": "Local Node testing",
181
265
  "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
182
266
  "keywords": [
183
267
  "reference",
184
268
  "index",
185
- "GeneratorTestExecution"
269
+ "GeneratorModelTestOptions"
270
+ ]
271
+ },
272
+ {
273
+ "id": "testkit/reference/index/GeneratorTestResult",
274
+ "title": "GeneratorTestResult",
275
+ "summary": "Parameter or assertion failure, or a durable immutable model result.",
276
+ "path": "reference/index/GeneratorTestResult.md",
277
+ "importPath": "@metamesh/testkit",
278
+ "availability": "Local Node testing",
279
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
280
+ "keywords": [
281
+ "reference",
282
+ "index",
283
+ "GeneratorTestResult"
186
284
  ]
187
285
  },
188
286
  {
189
287
  "id": "testkit/reference/index/GeneratorTestRunner",
190
288
  "title": "GeneratorTestRunner",
191
- "summary": "A lazy reusable Generator test session; dispose the runner and every returned snapshot separately.",
289
+ "summary": "A lazy reusable Generator test session; dispose only the runner's caches.",
192
290
  "path": "reference/index/GeneratorTestRunner.md",
193
291
  "importPath": "@metamesh/testkit",
194
292
  "availability": "Local Node testing",
@@ -227,6 +325,20 @@
227
325
  "getTestEngine"
228
326
  ]
229
327
  },
328
+ {
329
+ "id": "testkit/reference/index/MeshContent",
330
+ "title": "MeshContent",
331
+ "summary": "Ordered manufacturing geometry; placement, appearance and resource identities are separate.",
332
+ "path": "reference/index/MeshContent.md",
333
+ "importPath": "@metamesh/testkit",
334
+ "availability": "Local Node testing",
335
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
336
+ "keywords": [
337
+ "reference",
338
+ "index",
339
+ "MeshContent"
340
+ ]
341
+ },
230
342
  {
231
343
  "id": "testkit/reference/index/MeshMeasurementExpectation",
232
344
  "title": "MeshMeasurementExpectation",
@@ -254,6 +366,34 @@
254
366
  "index",
255
367
  "MeshMeasurementTolerances"
256
368
  ]
369
+ },
370
+ {
371
+ "id": "testkit/reference/index/runModel",
372
+ "title": "runModel",
373
+ "summary": "Runs a model program or synchronous callback once and returns durable immutable data. Strictly validates Generator inputs (defaults when omitted), prepares services, and returns durable data.",
374
+ "path": "reference/index/runModel.md",
375
+ "importPath": "@metamesh/testkit",
376
+ "availability": "Local Node testing",
377
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
378
+ "keywords": [
379
+ "reference",
380
+ "index",
381
+ "runModel"
382
+ ]
383
+ },
384
+ {
385
+ "id": "testkit/reference/index/RunModelOptions",
386
+ "title": "RunModelOptions",
387
+ "summary": "Host policy and prepared services for an isolated model run; the engine remains host-owned.",
388
+ "path": "reference/index/RunModelOptions.md",
389
+ "importPath": "@metamesh/testkit",
390
+ "availability": "Local Node testing",
391
+ "canonical": "https://metamesh.studio/docs/develop/agent-authoring#test-models",
392
+ "keywords": [
393
+ "reference",
394
+ "index",
395
+ "RunModelOptions"
396
+ ]
257
397
  }
258
398
  ]
259
399
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Byte-verified local font selections and a reusable Generator service-preparation adapter.
4
4
 
5
- Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Byte-verified local font selections and a reusable Generator service-preparation adapter. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Fixture provider matching createGeneratorTestRunner's asynchronous service boundary.
4
4
 
5
- Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Fixture provider matching createGeneratorTestRunner's asynchronous service boundary. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog.
4
4
 
5
- Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit/font-fixtures` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Node-only local descriptor loader. Paths resolve beside the descriptor; bytes never come from a catalog. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  A checked-in immutable font fixture; no catalog or network is used by the test harness.
4
4
 
5
- Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** A checked-in immutable font fixture; no catalog or network is used by the test harness. */
@@ -2,7 +2,7 @@
2
2
 
3
3
  Prepares the same synchronous text service used by Studio, from reproducible fixture bytes.
4
4
 
5
- Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit/fonts` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Prepares the same synchronous text service used by Studio, from reproducible fixture bytes. */
@@ -0,0 +1,13 @@
1
+ # BufferContent
2
+
3
+ Numeric contents readable without copying their storage, including immutable model buffers.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Numeric contents readable without copying their storage, including immutable model buffers. */
9
+ export interface BufferContent {
10
+ readonly length: number;
11
+ at(index: number): number | undefined;
12
+ }
13
+ ```
@@ -0,0 +1,12 @@
1
+ # ContentMismatchError
2
+
3
+ A difference in valid buffer contents, distinct from malformed inputs or reader failures.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** A difference in valid buffer contents, distinct from malformed inputs or reader failures. */
9
+ export declare class ContentMismatchError extends Error {
10
+ constructor(message: string);
11
+ }
12
+ ```
@@ -0,0 +1,13 @@
1
+ # GeneratorModelTestInput
2
+
3
+ Definition and executable runtime needed to validate and prepare a Generator.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Definition and executable runtime needed to validate and prepare a Generator. */
9
+ export interface GeneratorModelTestInput<D extends GeneratorDefinition> {
10
+ readonly definition: D;
11
+ readonly runtime: ModelProgram<GeneratorParams<D>, GeneratorServices>;
12
+ }
13
+ ```
@@ -0,0 +1,10 @@
1
+ # GeneratorModelTestOptions
2
+
3
+ Generation policy, optional test-owned engine, and asynchronous Generator asset preparation.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Generation policy, optional test-owned engine, and asynchronous Generator asset preparation. */
9
+ export type GeneratorModelTestOptions<D extends GeneratorDefinition> = Omit<GeneratorTestRunnerOptions<D>, "cache" | "verifyCache">;
10
+ ```
@@ -0,0 +1,18 @@
1
+ # GeneratorTestResult
2
+
3
+ Parameter or assertion failure, or a durable immutable model result.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Parameter or assertion failure, or a durable immutable model result. */
9
+ export type GeneratorTestResult<D extends GeneratorDefinition> = {
10
+ readonly type: "invalid";
11
+ readonly validation: ParameterValidationResult;
12
+ } | {
13
+ readonly type: "generated";
14
+ readonly parameters: GeneratorParams<D>;
15
+ readonly validation: ParameterValidationResult;
16
+ readonly model: ModelResult;
17
+ };
18
+ ```
@@ -1,19 +1,19 @@
1
1
  # GeneratorTestRunner
2
2
 
3
- A lazy reusable Generator test session; dispose the runner and every returned snapshot separately.
3
+ A lazy reusable Generator test session; dispose only the runner's caches.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
- /** A lazy reusable Generator test session; dispose the runner and every returned snapshot separately. */
8
+ /** A lazy reusable Generator test session; dispose only the runner's caches. */
9
9
  export interface GeneratorTestRunner<D extends GeneratorDefinition> {
10
- /** Checks declarations and assertions only. Set `normalize: false` to probe deliberately invalid typed values. */
11
- readonly validate: (parameters: GeneratorParams<D>, options?: {
12
- readonly normalize?: boolean;
10
+ /** Checks declarations and assertions only. Set `validateInput: false` to probe deliberately invalid typed values. */
11
+ readonly check: (parameters: GeneratorParams<D>, options?: {
12
+ readonly validateInput?: boolean;
13
13
  }) => Promise<ParameterValidationResult>;
14
- /** Normalizes once, prepares assets, and executes the same persistent session used by production hosts. */
15
- readonly execute: (parameters: Readonly<Record<string, unknown>>) => Promise<GeneratorTestExecution<D>>;
16
- /** Releases runner caches; separately owned snapshots remain valid. */
14
+ /** Strictly validates inputs, prepares assets, and executes a persistent session. */
15
+ readonly run: (parameters: Readonly<Record<string, unknown>>) => Promise<GeneratorTestResult<D>>;
16
+ /** Releases runner caches; previously returned results remain valid. */
17
17
  readonly dispose: () => void;
18
18
  }
19
19
  ```
@@ -2,13 +2,12 @@
2
2
 
3
3
  Fixed host resources and optional asynchronous asset preparation.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Fixed host resources and optional asynchronous asset preparation. */
9
- export interface GeneratorTestRunnerOptions<D extends GeneratorDefinition> {
9
+ export interface GeneratorTestRunnerOptions<D extends GeneratorDefinition> extends Omit<SessionOptions<GeneratorServices>, "services"> {
10
10
  readonly prepareServices?: (definition: D, parameters: GeneratorParams<D>) => GeneratorServices | Promise<GeneratorServices>;
11
11
  readonly engine?: ModelEngine;
12
- readonly limits?: Partial<ModelingLimits>;
13
12
  }
14
13
  ```
@@ -0,0 +1,13 @@
1
+ # MeshContent
2
+
3
+ Ordered manufacturing geometry; placement, appearance and resource identities are separate.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Ordered manufacturing geometry; placement, appearance and resource identities are separate. */
9
+ export interface MeshContent {
10
+ readonly positions: BufferContent;
11
+ readonly indices: BufferContent;
12
+ }
13
+ ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  Physical expectations for a closed mesh; omitted facts are not asserted.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Physical expectations for a closed mesh; omitted facts are not asserted. */
@@ -13,7 +13,7 @@ export interface MeshMeasurementExpectation {
13
13
  readonly signedVolume?: number;
14
14
  /** Sum of triangle areas in square millimetres. */
15
15
  readonly surfaceArea?: number;
16
- /** Exact number of components connected by indexed mesh edges. */
17
- readonly connectedComponentCount?: number;
16
+ /** Exact number of surface shells connected by shared indexed edges. */
17
+ readonly shellCount?: number;
18
18
  }
19
19
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Absolute nonnegative comparison allowances; each omitted tolerance defaults to zero. */
@@ -0,0 +1,13 @@
1
+ # RunModelOptions
2
+
3
+ Host policy and prepared services for an isolated model run; the engine remains host-owned.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Host policy and prepared services for an isolated model run; the engine remains host-owned. */
9
+ export interface RunModelOptions<S = Record<never, never>> extends ModelRunOptions<S> {
10
+ /** Reuse a test-owned engine; omitted uses the lazy shared test engine. */
11
+ readonly engine?: ModelEngine;
12
+ }
13
+ ```
@@ -0,0 +1,15 @@
1
+ # assertEqualBuffer
2
+
3
+ Asserts exact ordered numeric contents through length and at(index), without copying storage. Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs. Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and preserves reader failures. This assertion does not establish valid manufacturing geometry.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /**
9
+ * Asserts exact ordered numeric contents through length and at(index), without copying storage.
10
+ * Uses Object.is regardless of storage type: NaN equals NaN; signed zero differs.
11
+ * Throws ContentMismatchError for the first difference, TypeError for malformed inputs, and
12
+ * preserves reader failures. This assertion does not establish valid manufacturing geometry.
13
+ */
14
+ export declare function assertEqualBuffer(actual: BufferContent, expected: BufferContent): void;
15
+ ```
@@ -0,0 +1,14 @@
1
+ # assertEqualMesh
2
+
3
+ Asserts identical positions and indices with buffer-specific mismatch diagnostics. Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail. Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /**
9
+ * Asserts identical positions and indices with buffer-specific mismatch diagnostics.
10
+ * Ignores metadata. Geometrically equivalent meshes with different triangulation or ordering can fail.
11
+ * Shares assertEqualBuffer's numeric equality, validation and error behavior without copying storage.
12
+ */
13
+ export declare function assertEqualMesh(actual: MeshContent, expected: MeshContent): void;
14
+ ```
@@ -1,8 +1,8 @@
1
- # expectMeshMeasurements
1
+ # assertMeshMeasurements
2
2
 
3
3
  Analyzes current buffers, requires closed oriented edge topology, and checks selected physical facts with explicit absolute tolerances. Returns fresh measurements without initializing an engine. These facts do not prove geometric equivalence or absence of self-intersections.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /**
@@ -10,5 +10,5 @@ Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
10
10
  * facts with explicit absolute tolerances. Returns fresh measurements without initializing an
11
11
  * engine. These facts do not prove geometric equivalence or absence of self-intersections.
12
12
  */
13
- export declare function expectMeshMeasurements(mesh: TriangleMesh, expected: MeshMeasurementExpectation, tolerances?: MeshMeasurementTolerances): TriangleMeshAnalysis;
13
+ export declare function assertMeshMeasurements(triangleMesh: TriangleMeshInput, expected: MeshMeasurementExpectation, tolerances?: MeshMeasurementTolerances): TriangleMeshAnalysis;
14
14
  ```
@@ -1,10 +1,10 @@
1
- # expectValidDefaults
1
+ # assertValidDefaults
2
2
 
3
3
  Throws unless defaults strictly decode and equal the defaults derived from the definition.
4
4
 
5
- Import from `@metamesh/testkit` (@metamesh/testkit@0.16.0).
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
6
 
7
7
  ```ts
8
8
  /** Throws unless defaults strictly decode and equal the defaults derived from the definition. */
9
- export declare function expectValidDefaults<const D extends GeneratorDefinition>(definition: D, defaults: GeneratorParams<D>): void;
9
+ export declare function assertValidDefaults<const D extends GeneratorDefinition>(definition: D, defaults: GeneratorParams<D>): void;
10
10
  ```
@@ -0,0 +1,10 @@
1
+ # assertValidDefinition
2
+
3
+ Strictly parses a definition and requires its JSON round trip to retain the canonical package representation.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Strictly parses a definition and requires its JSON round trip to retain the canonical package representation. */
9
+ export declare function assertValidDefinition(definition: GeneratorDefinition): void;
10
+ ```
@@ -0,0 +1,12 @@
1
+ # assertValidParts
2
+
3
+ Validates supplied world meshes and their exact agreement with reconstructed local geometry and placement. Resolves to the same parts or rejects on failure. A supplied engine is reused; otherwise the shared engine initializes lazily.
4
+
5
+ Import from `@metamesh/testkit` (@metamesh/testkit@0.18.0).
6
+
7
+ ```ts
8
+ /** Validates supplied world meshes and their exact agreement with reconstructed local geometry and placement.
9
+ * Resolves to the same parts or rejects on failure. A supplied engine is reused; otherwise the shared engine initializes lazily.
10
+ */
11
+ export declare function assertValidParts(parts: readonly ModelPart[], engine?: ModelEngine): Promise<readonly ModelPart[]>;
12
+ ```