geospec 0.0.0 → 0.1.0-beta.2

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 (95) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +244 -0
  3. package/agent/doctrine.md +47 -0
  4. package/agent/geospec-authoring/SKILL.md +496 -0
  5. package/agent/geospec-authoring/api-classes.md +13 -0
  6. package/agent/geospec-authoring/api-constants.md +6 -0
  7. package/agent/geospec-authoring/api-functions.md +49 -0
  8. package/agent/geospec-authoring/api-index.md +362 -0
  9. package/agent/geospec-authoring/api-types.md +1700 -0
  10. package/agent/geospec-authoring/public-api-classes.md +22 -0
  11. package/agent/geospec-authoring/public-api-constants.md +19 -0
  12. package/agent/geospec-authoring/public-api-functions.md +196 -0
  13. package/agent/geospec-authoring/public-api-index.md +856 -0
  14. package/agent/geospec-authoring/public-api-types-2.md +1513 -0
  15. package/agent/geospec-authoring/public-api-types.md +2048 -0
  16. package/agent/resources.d.ts +19 -0
  17. package/agent/resources.js +26 -0
  18. package/agent/skills.d.cts +13 -0
  19. package/agent/skills.json +27 -0
  20. package/dist/assertion-client/client.d.mts +124 -0
  21. package/dist/assertion-client/client.mjs +2 -0
  22. package/dist/assertion-client/index.d.mts +5 -0
  23. package/dist/assertion-client/index.mjs +1 -0
  24. package/dist/config/index.d.mts +3 -0
  25. package/dist/config/index.mjs +1 -0
  26. package/dist/config/node/index.d.mts +3 -0
  27. package/dist/config/node/index.mjs +1 -0
  28. package/dist/config/node/load.d.mts +19 -0
  29. package/dist/config/node/load.mjs +1 -0
  30. package/dist/config/tau-project-artifact.d.mts +54 -0
  31. package/dist/config/tau-project-artifact.mjs +3 -0
  32. package/dist/config/types.d.mts +57 -0
  33. package/dist/config/validate.mjs +1 -0
  34. package/dist/create-geospec.d.mts +49 -0
  35. package/dist/create-geospec.mjs +1 -0
  36. package/dist/engine/client.d.mts +93 -0
  37. package/dist/engine/client.mjs +1 -0
  38. package/dist/engine/index.d.mts +3 -0
  39. package/dist/engine/index.mjs +1 -0
  40. package/dist/engine/matchers.d.mts +70 -0
  41. package/dist/engine/matchers.mjs +1 -0
  42. package/dist/engine/pmi.types.d.mts +78 -0
  43. package/dist/engine/protocol.d.mts +20 -0
  44. package/dist/engine/protocol.mjs +1 -0
  45. package/dist/geometry-unit.d.mts +12 -0
  46. package/dist/index.d.mts +6 -0
  47. package/dist/index.mjs +1 -0
  48. package/dist/mesh/index.d.mts +4 -0
  49. package/dist/mesh/index.mjs +1 -0
  50. package/dist/mesh/types.d.mts +575 -0
  51. package/dist/model/errors.d.mts +20 -0
  52. package/dist/model/errors.mjs +2 -0
  53. package/dist/model/export-intent.d.mts +63 -0
  54. package/dist/model/export-intent.mjs +1 -0
  55. package/dist/model/index.d.mts +6 -0
  56. package/dist/model/index.mjs +1 -0
  57. package/dist/model/load-model.d.mts +25 -0
  58. package/dist/model/load-model.mjs +1 -0
  59. package/dist/model/native-model-loader.d.mts +119 -0
  60. package/dist/model/native-model-loader.mjs +1 -0
  61. package/dist/model/subject-assertions.mjs +1 -0
  62. package/dist/model/subject.d.mts +11 -0
  63. package/dist/model/subject.mjs +1 -0
  64. package/dist/model/types.d.mts +207 -0
  65. package/dist/runner/collector.d.mts +62 -0
  66. package/dist/runner/collector.mjs +2 -0
  67. package/dist/runner/discovery.d.mts +93 -0
  68. package/dist/runner/discovery.mjs +1 -0
  69. package/dist/runner/filter.d.mts +50 -0
  70. package/dist/runner/filter.mjs +1 -0
  71. package/dist/runner/index.d.mts +6 -0
  72. package/dist/runner/index.mjs +1 -0
  73. package/dist/runner/native/index.d.mts +4 -0
  74. package/dist/runner/native/index.mjs +1 -0
  75. package/dist/runner/native/native-pool-grants.d.mts +21 -0
  76. package/dist/runner/native/native-pool-grants.mjs +1 -0
  77. package/dist/runner/native/native-serial-runner.d.mts +29 -0
  78. package/dist/runner/native/native-serial-runner.mjs +1 -0
  79. package/dist/runner/pool/pool-messages.d.mts +94 -0
  80. package/dist/runner/run-geospec-module.d.mts +13 -0
  81. package/dist/runner/run-geospec-module.mjs +47 -0
  82. package/dist/runner/types.d.mts +743 -0
  83. package/dist/runner/worker/index.d.mts +4 -0
  84. package/dist/runner/worker/index.mjs +1 -0
  85. package/dist/runner/worker/no-matching-tests-issue.d.mts +12 -0
  86. package/dist/runner/worker/no-matching-tests-issue.mjs +1 -0
  87. package/dist/runner/worker/runner-types.d.mts +146 -0
  88. package/dist/runner/worker/serial-runner.mjs +1 -0
  89. package/dist/selector/types.d.mts +271 -0
  90. package/dist/step/types.d.mts +134 -0
  91. package/dist/vitest/adapter.d.mts +56 -0
  92. package/dist/vitest/adapter.mjs +3 -0
  93. package/dist/vitest/index.d.mts +4 -0
  94. package/dist/vitest/index.mjs +1 -0
  95. package/package.json +114 -5
@@ -0,0 +1,743 @@
1
+ import { GeometryDiagnostic, Vec3 } from "../mesh/types.mjs";
2
+ import { GeometrySelector } from "../selector/types.mjs";
3
+ import { GeoSpecModelLoadEvidence, GeoSpecNativeModelLoader } from "../model/native-model-loader.mjs";
4
+ import { GeoSpecCanonicalClaimReport, GeoSpecNativeSubject } from "../engine/client.mjs";
5
+ import { GeoSpecAssertionClientOptions } from "../assertion-client/client.mjs";
6
+ import "../assertion-client/index.mjs";
7
+ import { BuiltinModule, BundleResult, VmFileSystem, VmIssue } from "@taucad/esbuild/vm";
8
+ //#region src/runner/types.d.ts
9
+ /**
10
+ * Axis-keyed numeric expectation used by high-level geometry matchers.
11
+ *
12
+ * @public
13
+ */
14
+ type GeoSpecAxisExpectation = {
15
+ x?: number;
16
+ y?: number;
17
+ z?: number;
18
+ };
19
+ /**
20
+ * Bounding-box expectation accepted by `expectGeo(...).toHaveBoundingBox(...)`.
21
+ *
22
+ * @public
23
+ */
24
+ type GeoSpecBoundingBoxExpectation = {
25
+ min?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>;
26
+ max?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>;
27
+ size?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>;
28
+ center?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>;
29
+ tolerance?: number;
30
+ };
31
+ /**
32
+ * Connected-components expectation accepted by
33
+ * `expectGeo(...).toHaveConnectedComponents(...)`.
34
+ *
35
+ * @public
36
+ */
37
+ type GeoSpecConnectedComponentsExpectation = {
38
+ count: number;
39
+ tolerance?: number;
40
+ toleranceMm?: number;
41
+ };
42
+ /**
43
+ * Component selector used by pair-filtered component-interference checks.
44
+ *
45
+ * @public
46
+ */
47
+ type GeoSpecComponentSelector = string | RegExp;
48
+ /**
49
+ * A pair-specific component-interference check accepted by
50
+ * `expectGeo(...).toHaveNoComponentInterference(...)`.
51
+ *
52
+ * @public
53
+ */
54
+ type GeoSpecComponentInterferencePairExpectation = {
55
+ left: GeoSpecComponentSelector;
56
+ right: GeoSpecComponentSelector;
57
+ };
58
+ /**
59
+ * Intentional component interference allowance accepted by
60
+ * `expectGeo(...).toHaveNoComponentInterference(...)`.
61
+ *
62
+ * @public
63
+ */
64
+ type GeoSpecComponentInterferenceAllowance = {
65
+ kind?: 'intentionalInterference';
66
+ left: GeoSpecComponentSelector;
67
+ right: GeoSpecComponentSelector;
68
+ maxVolume?: number;
69
+ reason: string;
70
+ };
71
+ /**
72
+ * Component-interference expectation accepted by
73
+ * `expectGeo(...).toHaveNoComponentInterference(...)`.
74
+ *
75
+ * GeoSpec checks for positive solid intersection volume between assembly
76
+ * components. Tangent contact and correctly meshed gears are allowed.
77
+ * `pairs` narrows the check to specific component-label pairs while preserving
78
+ * exact positive-volume evidence for every selected pair. `allowances`
79
+ * documents explicitly intentional positive-volume interference such as gasket
80
+ * compression, press fits, or simplified thread engagement.
81
+ *
82
+ * @public
83
+ */
84
+ type GeoSpecComponentInterferenceExpectation = {
85
+ tolerance?: number;
86
+ pairs?: GeoSpecComponentInterferencePairExpectation[];
87
+ allowances?: GeoSpecComponentInterferenceAllowance[];
88
+ };
89
+ /**
90
+ * Shared scalar expectation used by geometry measurements.
91
+ *
92
+ * @public
93
+ */
94
+ type GeoSpecNumericExpectation = number | {
95
+ value?: number;
96
+ greaterThan?: number;
97
+ greaterThanOrEqual?: number;
98
+ lessThan?: number;
99
+ lessThanOrEqual?: number;
100
+ };
101
+ /**
102
+ * Point expectation accepted by center and feature matchers.
103
+ *
104
+ * @public
105
+ */
106
+ type GeoSpecPointExpectation = Vec3 | GeoSpecAxisExpectation;
107
+ /**
108
+ * Surface-area expectation accepted by `expectGeo(...).toHaveSurfaceArea(...)`.
109
+ *
110
+ * @public
111
+ */
112
+ type GeoSpecSurfaceAreaExpectation = {
113
+ value: number | GeoSpecNumericExpectation;
114
+ tolerance?: number;
115
+ };
116
+ /**
117
+ * Volume expectation accepted by `expectGeo(...).toHaveVolume(...)`.
118
+ *
119
+ * @public
120
+ */
121
+ type GeoSpecVolumeExpectation = {
122
+ value: number | GeoSpecNumericExpectation;
123
+ tolerance?: number;
124
+ };
125
+ /**
126
+ * Mass expectation accepted by `expectGeo(...).toHaveMass(...)`.
127
+ *
128
+ * @public
129
+ */
130
+ type GeoSpecMassExpectation = {
131
+ value: number | GeoSpecNumericExpectation;
132
+ density?: number;
133
+ tolerance?: number;
134
+ };
135
+ /**
136
+ * Center-of-mass expectation accepted by
137
+ * `expectGeo(...).toHaveCenterOfMass(...)`.
138
+ *
139
+ * @public
140
+ */
141
+ type GeoSpecCenterOfMassExpectation = {
142
+ point: GeoSpecPointExpectation;
143
+ tolerance?: number;
144
+ };
145
+ /**
146
+ * Planar-face expectation accepted by `expectGeo(...).toHavePlanarFace(...)`.
147
+ *
148
+ * @public
149
+ */
150
+ type GeoSpecPlanarFaceExpectation = {
151
+ normal: GeoSpecPointExpectation;
152
+ offset: number;
153
+ area?: GeoSpecNumericExpectation;
154
+ tolerance?: number;
155
+ };
156
+ /**
157
+ * Cylindrical-face expectation accepted by
158
+ * `expectGeo(...).toHaveCylindricalFace(...)`.
159
+ *
160
+ * @public
161
+ */
162
+ type GeoSpecCylindricalFaceExpectation = {
163
+ radius: number;
164
+ axis: 'x' | 'y' | 'z';
165
+ tolerance?: number;
166
+ };
167
+ /**
168
+ * Circular-hole expectation accepted by `expectGeo(...).toHaveCircularHole(...)`.
169
+ *
170
+ * @public
171
+ */
172
+ type GeoSpecCircularHoleExpectation = {
173
+ diameter: number;
174
+ through?: boolean;
175
+ axis?: 'x' | 'y' | 'z';
176
+ center?: GeoSpecPointExpectation;
177
+ tolerance?: number;
178
+ };
179
+ /**
180
+ * Chamfer-feature expectation accepted by
181
+ * `expectGeo(...).toHaveChamferFeature(...)`.
182
+ *
183
+ * @public
184
+ */
185
+ type GeoSpecChamferFeatureExpectation = {
186
+ distance: number;
187
+ selection?: string;
188
+ tolerance?: number;
189
+ };
190
+ /**
191
+ * Minimum-wall-thickness expectation accepted by
192
+ * `expectGeo(...).toHaveMinimumWallThickness(...)`.
193
+ *
194
+ * @public
195
+ */
196
+ type GeoSpecMinimumWallThicknessExpectation = {
197
+ value: GeoSpecNumericExpectation;
198
+ tolerance?: number;
199
+ };
200
+ /**
201
+ * One void-continuity waypoint: an explicit subject-frame point known to lie
202
+ * in the void, or an occurrence whose bounds centre is taken as the waypoint
203
+ * (convenient for "this bore/cavity connects to that one" claims).
204
+ *
205
+ * @public
206
+ */
207
+ type GeoSpecVoidWaypoint = Vec3 | {
208
+ occurrence: string;
209
+ };
210
+ /**
211
+ * Void-continuity expectation accepted by
212
+ * `expectGeo(...).toHaveVoidContinuity(...)`.
213
+ *
214
+ * A whole-assembly negative-space claim: the ordered `path` waypoints must all
215
+ * lie in ONE connected open-void component (void = outside every `material`
216
+ * solid), that component must not reach any `isolatedFrom` point, and its
217
+ * tightest sampled cross-section must meet `minCrossSection`. Connectivity and
218
+ * isolation are proven from Boolean shell topology, generalized winding-number
219
+ * body identity, and deterministic cross-sections.
220
+ *
221
+ * @public
222
+ */
223
+ type GeoSpecVoidContinuityExpectation = {
224
+ /** Ordered waypoints (>= 1) known to lie in the void being proven. */
225
+ path: GeoSpecVoidWaypoint[];
226
+ /**
227
+ * Occurrence names whose solids bound the void. Defaults to every occurrence
228
+ * in the subject (the whole-assembly negative space).
229
+ */
230
+ material?: string[];
231
+ /** Minimum required bottleneck cross-section (mm²), sampled. */
232
+ minCrossSection?: number;
233
+ /** Points that must NOT be reachable from the path void (isolation claim). */
234
+ isolatedFrom?: Vec3[];
235
+ /**
236
+ * Region bounded for the proof (subject frame). Defaults to the union
237
+ * of the `material` occurrence bounds, which encloses every interior void.
238
+ */
239
+ bounds?: {
240
+ min: Vec3;
241
+ max: Vec3;
242
+ };
243
+ };
244
+ /**
245
+ * Topology-count expectation accepted by `expectGeo(...).toHaveTopologyCounts(...)`.
246
+ *
247
+ * @public
248
+ */
249
+ type GeoSpecTopologyCountsExpectation = {
250
+ vertices?: GeoSpecNumericExpectation;
251
+ edges?: GeoSpecNumericExpectation;
252
+ wires?: GeoSpecNumericExpectation;
253
+ faces?: GeoSpecNumericExpectation;
254
+ shells?: GeoSpecNumericExpectation;
255
+ solids?: GeoSpecNumericExpectation;
256
+ compounds?: GeoSpecNumericExpectation;
257
+ tolerance?: number;
258
+ };
259
+ /**
260
+ * STEP unit expectation accepted by `expectGeo(...).toHaveStepUnits(...)`.
261
+ *
262
+ * @public
263
+ */
264
+ type GeoSpecStepUnitsExpectation = {
265
+ unit: string;
266
+ };
267
+ /**
268
+ * Product-structure expectation accepted by `expectGeo(...).toHaveProductStructure(...)`.
269
+ *
270
+ * @public
271
+ */
272
+ type GeoSpecProductStructureExpectation = {
273
+ names?: string[];
274
+ count?: GeoSpecNumericExpectation;
275
+ };
276
+ /**
277
+ * Circular-hole-pattern expectation accepted by
278
+ * `expectGeo(...).toHaveCircularHolePattern(...)`.
279
+ *
280
+ * @public
281
+ */
282
+ type GeoSpecCircularHolePatternExpectation = {
283
+ count: number;
284
+ holeDiameter: number;
285
+ boltCircleDiameter?: number;
286
+ axis?: 'x' | 'y' | 'z';
287
+ center?: GeoSpecPointExpectation;
288
+ tolerance?: number;
289
+ };
290
+ /**
291
+ * Fillet-feature expectation accepted by `expectGeo(...).toHaveFilletFeature(...)`.
292
+ *
293
+ * @public
294
+ */
295
+ type GeoSpecFilletFeatureExpectation = {
296
+ radius: number;
297
+ selection?: string;
298
+ tolerance?: number;
299
+ };
300
+ /**
301
+ * Geometry selector used by inspection and spatial relationship matchers.
302
+ *
303
+ * @public
304
+ */
305
+ type GeoSpecGeometrySelector = GeoSpecComponentSelector | {
306
+ kind: 'occurrence';
307
+ /** Product or instance name to match (also matches the PRODUCT name shared by instanced parts). */
308
+ name?: GeoSpecComponentSelector;
309
+ /** Exact occurrence path — the per-instance identity when instances share one product. */
310
+ path?: GeoSpecComponentSelector;
311
+ } | {
312
+ kind: 'axis';
313
+ name?: GeoSpecComponentSelector;
314
+ axis?: 'x' | 'y' | 'z';
315
+ center?: Vec3;
316
+ direction?: Vec3;
317
+ radius?: number;
318
+ tolerance?: number;
319
+ } | {
320
+ kind: 'plane';
321
+ name?: GeoSpecComponentSelector;
322
+ normal?: Vec3;
323
+ offset?: number;
324
+ tolerance?: number;
325
+ } |
326
+ /**
327
+ * SB3 V1 selector catalog kinds (body/face/datum/interface/group plus the
328
+ * string shorthand), resolved by the native engine. SB4 routes
329
+ * relationship endpoints through that engine: the legacy explicit
330
+ * axis/plane members above resolve as `stability: 'explicit'` fixtures
331
+ * (rejected by the production evidence policy), while named legacy forms
332
+ * become engine queries. The catalog's occurrence/axis/plane query forms
333
+ * stay out of this union because their `kind` discriminants collide with
334
+ * the legacy explicit members.
335
+ */
336
+ Exclude<GeometrySelector, string | {
337
+ kind: 'occurrence' | 'axis' | 'plane';
338
+ }>;
339
+ /**
340
+ * Assembly occurrence rule accepted by
341
+ * `expectGeo(...).toHaveAssemblyOccurrences(...)`.
342
+ *
343
+ * @public
344
+ */
345
+ type GeoSpecAssemblyOccurrenceExpectation = {
346
+ name: GeoSpecComponentSelector;
347
+ count?: GeoSpecNumericExpectation;
348
+ bounds?: {
349
+ within?: GeoSpecComponentSelector;
350
+ min?: Vec3 | GeoSpecAxisExpectation;
351
+ max?: Vec3 | GeoSpecAxisExpectation;
352
+ center?: GeoSpecPointExpectation;
353
+ tolerance?: number;
354
+ };
355
+ };
356
+ /**
357
+ * Assembly occurrence expectation accepted by
358
+ * `expectGeo(...).toHaveAssemblyOccurrences(...)`.
359
+ *
360
+ * @public
361
+ */
362
+ type GeoSpecAssemblyOccurrencesExpectation = {
363
+ occurrences: GeoSpecAssemblyOccurrenceExpectation[];
364
+ uniqueNames?: boolean;
365
+ };
366
+ /**
367
+ * One spatial relationship accepted by
368
+ * `expectGeo(...).toHaveSpatialRelationships(...)`.
369
+ *
370
+ * Verdicts are decided by exact BRep evidence only (D3): extrema for
371
+ * `contact`/`clearance`, analytic fact comparison for
372
+ * `coaxial`/`concentric`/`coplanar`/`parallel`/`perpendicular`/`angle`,
373
+ * exact solid classification for `containment`/`insertion`, and exact
374
+ * boolean common volume for `interference` (positive volume outside the
375
+ * `minVolume`/`maxVolume` allowance band fails).
376
+ *
377
+ * @public
378
+ */
379
+ type GeoSpecSpatialRelationshipExpectation = {
380
+ id?: string;
381
+ kind: 'contact' | 'clearance' | 'coaxial' | 'concentric' | 'coplanar' | 'parallel' | 'perpendicular' | 'angle' | 'containment' | 'insertion' | 'interference';
382
+ subject: GeoSpecGeometrySelector;
383
+ target: GeoSpecGeometrySelector;
384
+ tolerance?: number;
385
+ angularToleranceDegrees?: number;
386
+ /** Expected angle in degrees for `kind: 'angle'` (orientation-insensitive). */
387
+ angleDegrees?: number;
388
+ /** Declared insertion axis (subject-frame direction) for `kind: 'insertion'`. */
389
+ axis?: Vec3;
390
+ min?: number;
391
+ max?: number;
392
+ minVolume?: number;
393
+ maxVolume?: number;
394
+ reason?: string;
395
+ };
396
+ /**
397
+ * Spatial relationship expectation accepted by
398
+ * `expectGeo(...).toHaveSpatialRelationships(...)`.
399
+ *
400
+ * @public
401
+ */
402
+ type GeoSpecSpatialRelationshipsExpectation = {
403
+ relationships: GeoSpecSpatialRelationshipExpectation[];
404
+ };
405
+ /**
406
+ * Mesh integrity expectation accepted by
407
+ * `expectGeo(...).toHaveMeshIntegrity(...)`.
408
+ *
409
+ * @public
410
+ */
411
+ type GeoSpecMeshIntegrityExpectation = {
412
+ finitePositions?: boolean;
413
+ degenerateTriangles?: {
414
+ count?: number;
415
+ maxCount?: number;
416
+ areaTolerance?: number;
417
+ };
418
+ duplicateFaces?: {
419
+ count?: number;
420
+ maxCount?: number;
421
+ };
422
+ watertight?: boolean;
423
+ triangleCount?: GeoSpecNumericExpectation;
424
+ };
425
+ /**
426
+ * Diagnostic severities rejected by
427
+ * `expectGeo(...).toHaveNoDiagnostics(...)`.
428
+ *
429
+ * Defaults to `error` and `warning` when omitted.
430
+ *
431
+ * @public
432
+ */
433
+ type GeoSpecNoDiagnosticsExpectation = {
434
+ severities?: Array<GeometryDiagnostic['severity']>;
435
+ };
436
+ /**
437
+ * Exact BRep validity expectation accepted by `expectGeo(...).toBeValidBrep(...)`.
438
+ *
439
+ * @public
440
+ */
441
+ type GeoSpecValidBrepExpectation = {
442
+ maxTolerance?: number;
443
+ freeBounds?: {
444
+ count?: GeoSpecNumericExpectation;
445
+ };
446
+ minEdgeLength?: number;
447
+ sameParameter?: boolean;
448
+ closedShells?: boolean;
449
+ closedWires?: boolean;
450
+ };
451
+ /**
452
+ * Assertion chain returned by `expectGeo(subject)`.
453
+ *
454
+ * @public
455
+ */
456
+ type GeoSpecMatcher = {
457
+ /** Core-owned negation; missing or refused evidence still fails. */
458
+ readonly not: Omit<GeoSpecMatcher, 'not'>;
459
+ /** Assert the fixed rational plate contract. */
460
+ toSatisfyRationalPlate(): GeoSpecAssertion;
461
+ /** Assert the fixed parallel-plane distance contract. */
462
+ toSatisfyParallelPlaneDistance(): GeoSpecAssertion;
463
+ /**
464
+ * Assert axis-aligned bounds, size, or center for a loaded geometry subject.
465
+ */
466
+ toHaveBoundingBox(first: Vec3 | GeoSpecBoundingBoxExpectation, second?: Vec3): GeoSpecAssertion;
467
+ /**
468
+ * Assert how many spatially disjoint chunks the mesh contains.
469
+ */
470
+ toHaveConnectedComponents(expected: GeoSpecConnectedComponentsExpectation): GeoSpecAssertion;
471
+ /**
472
+ * Assert closed mesh edge incidence; this does not prove vertex-manifold
473
+ * validity, embeddedness, a Boolean fuse, or material connectivity.
474
+ */
475
+ toBeWatertight(): GeoSpecAssertion;
476
+ /**
477
+ * Assert that separate assembly components do not occupy the same solid volume.
478
+ */
479
+ toHaveNoComponentInterference(expected?: GeoSpecComponentInterferenceExpectation): GeoSpecAssertion;
480
+ /**
481
+ * Assert that named assembly occurrences exist with expected counts and bounds.
482
+ */
483
+ toHaveAssemblyOccurrences(expected: GeoSpecAssemblyOccurrencesExpectation): GeoSpecAssertion;
484
+ /**
485
+ * Assert that selected entities satisfy declared spatial relationships.
486
+ */
487
+ toHaveSpatialRelationships(expected: GeoSpecSpatialRelationshipsExpectation): GeoSpecAssertion;
488
+ /**
489
+ * Assert rendered mesh evidence is internally trustworthy for downstream checks.
490
+ */
491
+ toHaveMeshIntegrity(expected: GeoSpecMeshIntegrityExpectation): GeoSpecAssertion;
492
+ /**
493
+ * Assert that the subject carries no diagnostics at the rejected severities.
494
+ */
495
+ toHaveNoDiagnostics(expected?: GeoSpecNoDiagnosticsExpectation): GeoSpecAssertion;
496
+ /**
497
+ * Assert total surface area, preferring exact BRep mass properties when available.
498
+ */
499
+ toHaveSurfaceArea(expected: GeoSpecSurfaceAreaExpectation): GeoSpecAssertion;
500
+ /**
501
+ * Assert enclosed volume, preferring exact BRep mass properties when available.
502
+ */
503
+ toHaveVolume(expected: GeoSpecVolumeExpectation): GeoSpecAssertion;
504
+ /**
505
+ * Assert mass derived from exact mass properties or volume times density.
506
+ */
507
+ toHaveMass(expected: GeoSpecMassExpectation): GeoSpecAssertion;
508
+ /**
509
+ * Assert the center of mass or mesh-derived centroid for a closed subject.
510
+ */
511
+ toHaveCenterOfMass(expected: GeoSpecCenterOfMassExpectation): GeoSpecAssertion;
512
+ /**
513
+ * Assert that exact BRep evidence reports a valid shape.
514
+ */
515
+ toBeValidBrep(expected?: GeoSpecValidBrepExpectation): GeoSpecAssertion;
516
+ /**
517
+ * Assert exact BRep topology counts.
518
+ */
519
+ toHaveTopologyCounts(expected: GeoSpecTopologyCountsExpectation): GeoSpecAssertion;
520
+ /**
521
+ * Assert the STEP unit evidence.
522
+ */
523
+ toHaveStepUnits(expected: GeoSpecStepUnitsExpectation): GeoSpecAssertion;
524
+ /**
525
+ * Assert STEP product-structure evidence.
526
+ */
527
+ toHaveProductStructure(expected: GeoSpecProductStructureExpectation): GeoSpecAssertion;
528
+ /**
529
+ * Assert that BRep evidence contains a planar face matching the requested constraints.
530
+ */
531
+ toHavePlanarFace(expected: GeoSpecPlanarFaceExpectation): GeoSpecAssertion;
532
+ /**
533
+ * Assert that BRep evidence contains a cylindrical face with the requested radius and axis.
534
+ */
535
+ toHaveCylindricalFace(expected: GeoSpecCylindricalFaceExpectation): GeoSpecAssertion;
536
+ /**
537
+ * Assert that BRep evidence contains a circular hole matching diameter, center, and axis.
538
+ */
539
+ toHaveCircularHole(expected: GeoSpecCircularHoleExpectation): GeoSpecAssertion;
540
+ /**
541
+ * Assert that BRep evidence contains a repeated circular-hole pattern.
542
+ */
543
+ toHaveCircularHolePattern(expected: GeoSpecCircularHolePatternExpectation): GeoSpecAssertion;
544
+ /**
545
+ * Assert that BRep evidence contains a chamfer feature with the requested distance.
546
+ */
547
+ toHaveChamferFeature(expected: GeoSpecChamferFeatureExpectation): GeoSpecAssertion;
548
+ /**
549
+ * Assert that BRep evidence contains a fillet feature with the requested radius.
550
+ */
551
+ toHaveFilletFeature(expected: GeoSpecFilletFeatureExpectation): GeoSpecAssertion;
552
+ /**
553
+ * Assert that BRep evidence reports a minimum wall thickness satisfying the expectation.
554
+ */
555
+ toHaveMinimumWallThickness(expected: GeoSpecMinimumWallThicknessExpectation): GeoSpecAssertion;
556
+ /**
557
+ * Assert that the declared waypoints share one connected void, stay isolated
558
+ * from the declared spaces, and hold the minimum cross-section.
559
+ */
560
+ toHaveVoidContinuity(expected: GeoSpecVoidContinuityExpectation): GeoSpecAssertion;
561
+ };
562
+ /**
563
+ * Geometry assertion collected from a GeoSpec test module.
564
+ *
565
+ * @public
566
+ */
567
+ type GeoSpecAssertion = {
568
+ /** Assertion kind. */
569
+ kind: 'boundingBox' | 'connectedComponents' | 'watertight' | 'componentInterference' | 'assemblyOccurrences' | 'spatialRelationships' | 'meshIntegrity' | 'noDiagnostics' | 'surfaceArea' | 'volume' | 'mass' | 'centerOfMass' | 'validBrep' | 'topologyCounts' | 'stepUnits' | 'productStructure' | 'planarFace' | 'cylindricalFace' | 'circularHole' | 'circularHolePattern' | 'chamferFeature' | 'filletFeature' | 'minimumWallThickness' | 'voidContinuity' | 'toSatisfyRationalPlate' | 'toSatisfyParallelPlaneDistance';
570
+ /** User-authored value passed to expectGeo(). */
571
+ subject: unknown;
572
+ /** Expected geometry condition. */
573
+ expected: unknown;
574
+ /** True when the assertion evaluated successfully. */
575
+ passed?: boolean;
576
+ /** Structured diagnostics from matcher evaluation. */
577
+ diagnostics?: GeometryDiagnostic[];
578
+ /** Exact compiled assertion report, including core-owned bytes and polarity. */
579
+ report?: GeoSpecCanonicalClaimReport;
580
+ /** The host load which admitted this assertion's subject; independent of equal geometry hashes. */
581
+ loadId?: string;
582
+ /** Wall-clock cost of matcher evaluation in milliseconds (R1: budgeted matchers only). */
583
+ durationMs?: number;
584
+ };
585
+ /**
586
+ * Test case status after runner collection.
587
+ *
588
+ * @public
589
+ */
590
+ type GeoSpecTestStatus = 'passed' | 'failed' | 'unsupported' | 'inconclusive' | 'not-run' | 'skipped';
591
+ /** Test accounting for the actual module collection and execution. @public */
592
+ type GeoSpecTestAccounting = {
593
+ discovered: number;
594
+ selected: number;
595
+ completed: number;
596
+ passed: number;
597
+ failed: number;
598
+ unsupported: number;
599
+ inconclusive: number;
600
+ skipped: number;
601
+ notRun: number;
602
+ };
603
+ /** Consumed source and artifact identities retained without replacing earlier loads. @public */
604
+ type GeoSpecRunLineage = {
605
+ status: 'complete' | 'unavailable' | 'mixed';
606
+ modules: ReadonlyArray<{
607
+ entryPath: string;
608
+ bundleSha256: string;
609
+ files: Readonly<Record<string, string>>;
610
+ consistent: boolean;
611
+ }>;
612
+ loads: ReadonlyArray<{
613
+ loadId: string;
614
+ status: 'complete' | 'unavailable' | 'failed';
615
+ subject?: GeoSpecNativeSubject;
616
+ evidence?: GeoSpecModelLoadEvidence;
617
+ error?: string;
618
+ diagnostics?: readonly GeometryDiagnostic[];
619
+ }>;
620
+ };
621
+ /**
622
+ * Worker-local cache for successful GeoSpec bundles.
623
+ *
624
+ * The cache is internal runner infrastructure. Each invocation still creates a
625
+ * fresh collector, run token and host binding, so runs that reuse one entry
626
+ * stay isolated. An entry is reused only while every read its bundle was built
627
+ * from still returns the answer the bundler got.
628
+ *
629
+ * @public
630
+ */
631
+ type GeoSpecModuleBundleCache = Map<string, {
632
+ builtinIdentity: string;
633
+ /** The run token embedded in `bundle.code`; a reuse executes a copy under its own run's token. */
634
+ runToken: string;
635
+ bundle: BundleResult;
636
+ /**
637
+ * Each filesystem read the bundler made while building `bundle`, with the
638
+ * answer it got. Existence probes are reads too: they decide which file an
639
+ * import resolves to.
640
+ */
641
+ bundlerReads: ReadonlyArray<{
642
+ question: 'exists' | 'utf8' | 'bytes';
643
+ path: string;
644
+ answer: boolean | string | Uint8Array<ArrayBuffer>;
645
+ }>;
646
+ }>;
647
+ /**
648
+ * A collected GeoSpec test case.
649
+ *
650
+ * @public
651
+ */
652
+ type GeoSpecTestCase = {
653
+ /** Registration ordinal before filtering, scoped to the source module's collection. */
654
+ ordinal?: number;
655
+ /** Hierarchical suite path. */
656
+ suite: string[];
657
+ /** Test case name. */
658
+ name: string;
659
+ /** Assertions produced by the test callback. */
660
+ assertions: GeoSpecAssertion[];
661
+ /** Final test status. */
662
+ status: GeoSpecTestStatus;
663
+ /** Structured diagnostics emitted by test execution. */
664
+ diagnostics: GeometryDiagnostic[];
665
+ /** Wall-clock cost of the test body plus its pending assertions, in milliseconds (R1). */
666
+ durationMs?: number;
667
+ };
668
+ /**
669
+ * Options for executing a GeoSpec ESM test module.
670
+ *
671
+ * @public
672
+ */
673
+ type RunGeoSpecModuleOptions = {
674
+ /** Filesystem containing the test module and its project imports. */
675
+ filesystem: VmFileSystem;
676
+ /** Filesystem-root-relative ESM test entry path. */
677
+ entryPath: string;
678
+ /** JavaScript regular expression matched against full `suite > test` names. */
679
+ testNamePattern?: string | RegExp;
680
+ /** Timeout for async test callbacks, in milliseconds. */
681
+ testTimeout?: number;
682
+ /** Milliseconds. Non-verdict matcher infrastructure backstop. */
683
+ matcherWallBackstop?: number;
684
+ /** Emit structured forensic events for this run. */
685
+ forensic?: boolean;
686
+ /**
687
+ * Host-provided protocol-3 compiled assertion client. The host owns engine and
688
+ * admitted subject lifetimes and supplies bindings through builtinModules;
689
+ * authored tests use the canonical GeoSpec API, not a separate native dialect.
690
+ */
691
+ nativeAssertions: GeoSpecAssertionClientOptions;
692
+ /** Host-composed identity loader; authored tests use the canonical `geospec/model` API. */
693
+ nativeModelLoader?: (options: Parameters<GeoSpecNativeModelLoader>[0]) => Promise<GeoSpecNativeSubject & {
694
+ readonly load?: GeoSpecModelLoadEvidence;
695
+ }>;
696
+ /** Additional in-memory modules made available to the VM. */
697
+ builtinModules?: Record<string, BuiltinModule>;
698
+ /** Successful bundle cache owned by a serial runner worker. @internal */
699
+ bundleCache?: GeoSpecModuleBundleCache;
700
+ /**
701
+ * List-only collection pass (R3 shard splitting): execute the module to
702
+ * REGISTER tests, skip every body, and return all registered tests as
703
+ * `skipped` in registration order. Used by the pool to split heavy files
704
+ * into per-test shards.
705
+ */
706
+ collectOnly?: boolean;
707
+ };
708
+ /**
709
+ * Successful GeoSpec run result.
710
+ *
711
+ * @public
712
+ */
713
+ type GeoSpecRunSuccess = {
714
+ success: true;
715
+ /** True only when selected tests completed successfully with coherent available lineage. */
716
+ passed: boolean;
717
+ tests: GeoSpecTestCase[];
718
+ bundle: BundleResult;
719
+ accounting?: GeoSpecTestAccounting;
720
+ lineage?: GeoSpecRunLineage;
721
+ };
722
+ /**
723
+ * Failed GeoSpec run result.
724
+ *
725
+ * @public
726
+ */
727
+ type GeoSpecRunFailure = {
728
+ success: false;
729
+ issues: VmIssue[];
730
+ bundle?: BundleResult;
731
+ accounting?: GeoSpecTestAccounting;
732
+ lineage?: GeoSpecRunLineage;
733
+ /** Tests registered before a module execution failure, including their retained assertions. */
734
+ tests?: GeoSpecTestCase[];
735
+ };
736
+ /**
737
+ * Result returned by {@link import('./run-geospec-module.js').runGeoSpecModule}.
738
+ *
739
+ * @public
740
+ */
741
+ type GeoSpecRunResult = GeoSpecRunSuccess | GeoSpecRunFailure;
742
+ //#endregion
743
+ export { GeoSpecAssemblyOccurrenceExpectation, GeoSpecAssemblyOccurrencesExpectation, GeoSpecAssertion, GeoSpecAxisExpectation, GeoSpecBoundingBoxExpectation, GeoSpecCenterOfMassExpectation, GeoSpecChamferFeatureExpectation, GeoSpecCircularHoleExpectation, GeoSpecCircularHolePatternExpectation, GeoSpecComponentInterferenceAllowance, GeoSpecComponentInterferenceExpectation, GeoSpecComponentInterferencePairExpectation, GeoSpecComponentSelector, GeoSpecConnectedComponentsExpectation, GeoSpecCylindricalFaceExpectation, GeoSpecFilletFeatureExpectation, GeoSpecGeometrySelector, GeoSpecMassExpectation, GeoSpecMatcher, GeoSpecMeshIntegrityExpectation, GeoSpecMinimumWallThicknessExpectation, GeoSpecModuleBundleCache, GeoSpecNoDiagnosticsExpectation, GeoSpecNumericExpectation, GeoSpecPlanarFaceExpectation, GeoSpecPointExpectation, GeoSpecProductStructureExpectation, GeoSpecRunFailure, GeoSpecRunLineage, GeoSpecRunResult, GeoSpecRunSuccess, GeoSpecSpatialRelationshipExpectation, GeoSpecSpatialRelationshipsExpectation, GeoSpecStepUnitsExpectation, GeoSpecSurfaceAreaExpectation, GeoSpecTestAccounting, GeoSpecTestCase, GeoSpecTestStatus, GeoSpecTopologyCountsExpectation, GeoSpecValidBrepExpectation, GeoSpecVoidContinuityExpectation, GeoSpecVoidWaypoint, GeoSpecVolumeExpectation, RunGeoSpecModuleOptions };