geospec 0.1.0-beta.2 → 0.1.0-beta.4

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 (46) hide show
  1. package/agent/doctrine.md +8 -0
  2. package/agent/geospec-authoring/SKILL.md +19 -20
  3. package/agent/geospec-authoring/api-constants.md +11 -1
  4. package/agent/geospec-authoring/api-functions.md +9 -1
  5. package/agent/geospec-authoring/api-index.md +22 -7
  6. package/agent/geospec-authoring/api-types.md +91 -3
  7. package/agent/geospec-authoring/public-api-constants.md +33 -1
  8. package/agent/geospec-authoring/public-api-functions.md +21 -2
  9. package/agent/geospec-authoring/public-api-index.md +57 -20
  10. package/agent/geospec-authoring/public-api-types-2.md +267 -220
  11. package/agent/geospec-authoring/public-api-types-3.md +217 -0
  12. package/agent/geospec-authoring/public-api-types.md +37 -137
  13. package/agent/resources.js +14 -13
  14. package/agent/skills.json +3 -2
  15. package/dist/assertion-client/client.d.mts +12 -2
  16. package/dist/assertion-client/client.mjs +2 -2
  17. package/dist/assertion-client/index.d.mts +2 -2
  18. package/dist/assertion-client/index.mjs +1 -1
  19. package/dist/config/tau-project-artifact.mjs +1 -1
  20. package/dist/create-geospec.d.mts +3 -2
  21. package/dist/create-geospec.mjs +1 -1
  22. package/dist/engine/client.d.mts +21 -1
  23. package/dist/engine/client.mjs +1 -1
  24. package/dist/index.d.mts +2 -2
  25. package/dist/model/export-intent.d.mts +17 -1
  26. package/dist/model/export-intent.mjs +1 -1
  27. package/dist/model/index.d.mts +4 -3
  28. package/dist/model/index.mjs +1 -1
  29. package/dist/model/native-model-loader.d.mts +30 -7
  30. package/dist/model/native-model-loader.mjs +1 -1
  31. package/dist/model/region-scope.d.mts +23 -0
  32. package/dist/model/region-scope.mjs +1 -0
  33. package/dist/model/subject-assertions.mjs +1 -1
  34. package/dist/model/types.d.mts +50 -3
  35. package/dist/runner/collector.d.mts +4 -2
  36. package/dist/runner/collector.mjs +2 -2
  37. package/dist/runner/index.d.mts +3 -2
  38. package/dist/runner/index.mjs +1 -1
  39. package/dist/runner/native/native-serial-runner.mjs +1 -1
  40. package/dist/runner/run-geospec-module.mjs +2 -2
  41. package/dist/runner/timeout-codes.d.mts +45 -0
  42. package/dist/runner/timeout-codes.mjs +1 -0
  43. package/dist/runner/types.d.mts +34 -1
  44. package/dist/runner/worker/runner-types.d.mts +24 -3
  45. package/dist/runner/worker/serial-runner.mjs +1 -1
  46. package/package.json +4 -4
package/agent/doctrine.md CHANGED
@@ -29,6 +29,14 @@ Every matcher takes one expectation object:
29
29
  - Wrong: `await expectGeo(model)…`. Correct: await `loadModel`, then assert synchronously.
30
30
  - Wrong: exact-feature matchers on a mesh kernel (Manifold, JSCAD, OpenSCAD, PicoGK, PicoVoxel). Correct: `toBeValidBrep`, `toHaveTopologyCounts`, the face, hole, pattern, chamfer, fillet and wall-thickness matchers, `toHaveStepUnits`, `toHaveProductStructure` and `toHaveVoidContinuity` need STEP BRep evidence and report unsupported on meshes; assert meshes with bounds, volume, surface area, connected components and `toBeWatertight`.
31
31
 
32
+ ## Loads and budgets
33
+
34
+ - GeoSpec has no `beforeAll`. Write each `loadModel` inside its own `it`: within one run, identical loads (same file or code, parameters, format, tolerances and region) share one export and one admission. Each load keeps its own `loadId` and records `reused: true`, and a file is reused only while its source closure is unchanged.
35
+ - `loadModel({ file, workUnitLimit })` sets the default claim budget for that subject, and `expectGeo(model, { workUnitLimit })` overrides it for one chain. The budget is a positive integer no greater than 512000000. A `MATCHER_TIMEOUT` refusal reports `details.limit` and, when measured, `details.used`; raise the budget within the bound or simplify the model, and never treat the refusal as a pass.
36
+ - `loadModel({ file, region: { min: [x, y, z], max: [x, y, z] } })` makes a separate claim about one millimetre box, never a stand-in for a whole-model claim. The kernel crops before export (PicoVoxel trims Voxels parts), and other kernels, STEP loads and unconfirmed crops refuse with a typed diagnostic. A cropped subject answers only bounding box, volume, surface area, mass and center of mass of its region, and its assertions record the region. Every other matcher on it refuses with `GEOSPEC_REGION_WHOLE_MODEL_CLAIM`. Name the region in the test, and keep whole-model claims on whole-model loads.
37
+ - A host or engine limit leaves a claim undecided, never false. Keep the model as designed: never coarsen, shrink or crop it to fit. Raise `workUnitLimit` or `testTimeout` within the host's maximum, which the host can raise, or report the claim as not decided at this capacity.
38
+ - `toHaveCenterOfMass({ point, tolerance })` takes an exact point. Per-axis ranges such as `{ y: { greaterThan: 1 } }` are refused.
39
+
32
40
  ## Coverage
33
41
 
34
42
  Bounds and physical properties are insufficient. Cover major components, named features, variants, dimensions/positions, disjoint counts, closure, interference and supported exact features. Explicitly report unsupported requirements; proxies cannot fulfill them.
@@ -36,6 +36,14 @@ Every matcher takes one expectation object:
36
36
  - Wrong: `await expectGeo(model)…`. Correct: await `loadModel`, then assert synchronously.
37
37
  - Wrong: exact-feature matchers on a mesh kernel (Manifold, JSCAD, OpenSCAD, PicoGK, PicoVoxel). Correct: `toBeValidBrep`, `toHaveTopologyCounts`, the face, hole, pattern, chamfer, fillet and wall-thickness matchers, `toHaveStepUnits`, `toHaveProductStructure` and `toHaveVoidContinuity` need STEP BRep evidence and report unsupported on meshes; assert meshes with bounds, volume, surface area, connected components and `toBeWatertight`.
38
38
 
39
+ ## Loads and budgets
40
+
41
+ - GeoSpec has no `beforeAll`. Write each `loadModel` inside its own `it`: within one run, identical loads (same file or code, parameters, format, tolerances and region) share one export and one admission. Each load keeps its own `loadId` and records `reused: true`, and a file is reused only while its source closure is unchanged.
42
+ - `loadModel({ file, workUnitLimit })` sets the default claim budget for that subject, and `expectGeo(model, { workUnitLimit })` overrides it for one chain. The budget is a positive integer no greater than 512000000. A `MATCHER_TIMEOUT` refusal reports `details.limit` and, when measured, `details.used`; raise the budget within the bound or simplify the model, and never treat the refusal as a pass.
43
+ - `loadModel({ file, region: { min: [x, y, z], max: [x, y, z] } })` makes a separate claim about one millimetre box, never a stand-in for a whole-model claim. The kernel crops before export (PicoVoxel trims Voxels parts), and other kernels, STEP loads and unconfirmed crops refuse with a typed diagnostic. A cropped subject answers only bounding box, volume, surface area, mass and center of mass of its region, and its assertions record the region. Every other matcher on it refuses with `GEOSPEC_REGION_WHOLE_MODEL_CLAIM`. Name the region in the test, and keep whole-model claims on whole-model loads.
44
+ - A host or engine limit leaves a claim undecided, never false. Keep the model as designed: never coarsen, shrink or crop it to fit. Raise `workUnitLimit` or `testTimeout` within the host's maximum, which the host can raise, or report the claim as not decided at this capacity.
45
+ - `toHaveCenterOfMass({ point, tolerance })` takes an exact point. Per-axis ranges such as `{ y: { greaterThan: 1 } }` are refused.
46
+
39
47
  ## Coverage
40
48
 
41
49
  Bounds and physical properties are insufficient. Cover major components, named features, variants, dimensions/positions, disjoint counts, closure, interference and supported exact features. Explicitly report unsupported requirements; proxies cannot fulfill them.
@@ -61,13 +69,19 @@ The symbols real Tau models use most, as verbatim declarations. Anything not sho
61
69
 
62
70
  ```ts
63
71
  // Start a geometry assertion chain
64
- export declare function expectGeo(subject: GeoSpecSubject): GeoSpecMatcher;
72
+ export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
65
73
 
66
74
  // A model admitted by one live GeoSpec host scope
67
75
  GeoSpecSubject: {
68
76
  readonly [subjectBrand]: true
69
77
  }
70
78
 
79
+ // Per-chain options accepted by `expectGeo(subject, options)`
80
+ GeoSpecExpectOptions: {
81
+ // Deterministic work-unit budget for every claim in this chain
82
+ readonly workUnitLimit?: number
83
+ }
84
+
71
85
  // Load a CAD model into GeoSpec evidence
72
86
  export declare function loadModel<Code extends Record<string, string> = Record<string, string>>(_options: LoadModelOptions<Code>): Promise<GeoSpecSubject>;
73
87
 
@@ -85,6 +99,8 @@ LoadModelOptions: LoadModelSourceOptions | LoadModelCodeOptions<Code> | LoadMode
85
99
  meshLinearTolerance?: number
86
100
  // Angular tolerance in degrees used while meshing exact BRep evidence
87
101
  meshAngularToleranceDegrees?: number
102
+ // Default work-unit budget for every claim on this subject
103
+ workUnitLimit?: number
88
104
 
89
105
  // Geometry formats accepted by {@link import ('./load-model.js').loadModel}
90
106
  GeoSpecModelFormat: MeshFileFormat | 'step' | 'stp'
@@ -230,6 +246,7 @@ GeoSpecMassExpectation: {
230
246
 
231
247
  // Center-of-mass expectation accepted by `expectGeo(...).toHaveCenterOfMass(...)`
232
248
  GeoSpecCenterOfMassExpectation: {
249
+ // Exact expected point in millimetres
233
250
  point: GeoSpecPointExpectation
234
251
  tolerance?: number
235
252
  }
@@ -456,24 +473,6 @@ GeoSpecNumericExpectation: number | {
456
473
  // Point expectation accepted by center and feature matchers
457
474
  GeoSpecPointExpectation: Vec3 | GeoSpecAxisExpectation
458
475
 
459
- // Shared scalar expectation used by geometry measurements
460
- GeoSpecNumericExpectation: number | {
461
- value?: number;
462
- greaterThan?: number;
463
- greaterThanOrEqual?: number;
464
- lessThan?: number;
465
- lessThanOrEqual?: number;
466
- }
467
-
468
- // Shared scalar expectation used by geometry measurements
469
- GeoSpecNumericExpectation: number | {
470
- value?: number;
471
- greaterThan?: number;
472
- greaterThanOrEqual?: number;
473
- lessThan?: number;
474
- lessThanOrEqual?: number;
475
- }
476
-
477
476
  // Shared scalar expectation used by geometry measurements
478
477
  GeoSpecNumericExpectation: number | {
479
478
  value?: number;
@@ -486,7 +485,7 @@ GeoSpecNumericExpectation: number | {
486
485
 
487
486
  ## API reference
488
487
 
489
- To read any other signature, grep the skill directory for the name followed by `(` (or the bare type name): each hit is the declaration line and names its file; read a few lines around it for overloads and parameter notes. `api-index.md` lists all 345 symbols by file.
488
+ To read any other signature, grep the skill directory for the name followed by `(` (or the bare type name): each hit is the declaration line and names its file; read a few lines around it for overloads and parameter notes. `api-index.md` lists all 360 symbols by file.
490
489
 
491
490
  - `api-functions.md` — Functions
492
491
  - `api-constants.md` — Constants
@@ -1,6 +1,16 @@
1
1
  # geospec — Constants
2
2
 
3
- 1 top-level symbols. Signatures are verbatim typescript.
3
+ 4 top-level symbols. Signatures are verbatim typescript.
4
4
 
5
5
  // Every matcher name exposed by {@link expectGeo}, derived from the live matcher surface so it can never drift from the real implementation
6
6
  geoSpecMatcherNames: readonly string[]
7
+
8
+ // The matchers mesh evidence answers, as the GeoSpec authoring skill lists them (`packages/geospec/agent/geospec-authoring/SKILL.md`)
9
+ geoSpecMeshEvidenceMatchers: readonly ["toHaveBoundingBox", "toHaveVolume", "toHaveSurfaceArea", "toHaveConnectedComponents", "toBeWatertight"]
10
+
11
+ // The claims a region-cropped subject answers
12
+ // Remarks: Every other kind quantifies over the whole model (component counts, all-components interference, occurrences, watertightness, integrity, topology, diagnostics) or relates parts the crop may have cut, so a crop can neither prove nor disprove it.
13
+ geoSpecRegionScopedKinds: ReadonlySet<GeoSpecAssertion['kind']>
14
+
15
+ // Diagnostic code of a whole-model claim made on a region-cropped subject
16
+ geoSpecRegionWholeModelClaimCode: "GEOSPEC_REGION_WHOLE_MODEL_CLAIM"
@@ -11,8 +11,9 @@ export declare function describe(name: string, function_: GeoSpecTestCallback):
11
11
 
12
12
  // Start a geometry assertion chain
13
13
  // expectGeo (function)
14
- export declare function expectGeo(subject: GeoSpecSubject): GeoSpecMatcher;
14
+ export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
15
15
  // subject: geometry subject under test
16
+ // options: Optional chain options, such as a larger `workUnitLimit` for a claim that refused with `MATCHER_TIMEOUT`
16
17
 
17
18
  // GeoSpec test helper used inside VM-executed test modules
18
19
  // it (function)
@@ -46,4 +47,11 @@ export declare function resolveRuntimeExportIntent(options: {
46
47
  format: RuntimeBackedModelFormat;
47
48
  meshLinearTolerance?: number;
48
49
  meshAngularToleranceDegrees?: number;
50
+ /**
51
+ * The kernel that evaluates this source, when the host knows it. Routes are
52
+ * then chosen among that kernel's own, so a mesh-only kernel is told its
53
+ * BRep matchers are unsupported instead of being sent to another kernel's
54
+ * STEP route.
55
+ */
56
+ kernelId?: string;
49
57
  }): RuntimeExportIntent | RuntimeExportIntentFailure;
@@ -1,6 +1,6 @@
1
1
  # geospec API index
2
2
 
3
- geospec 0.1.0-beta.2 · 345 symbols · extracted by TypeScript 5.9.3.
3
+ geospec 0.1.0-beta.4 · 360 symbols · extracted by TypeScript 5.9.3.
4
4
 
5
5
  Every symbol appears here exactly once. The heading above each block names the file with its signature; grep the skill directory for `name(` to land on the declaration directly.
6
6
 
@@ -20,13 +20,16 @@ resolveRuntimeExportIntent (function)
20
20
  ## Constants — `api-constants.md`
21
21
 
22
22
  geoSpecMatcherNames (constant) — Every matcher name exposed by {@link expectGeo}, derived from the…
23
+ geoSpecMeshEvidenceMatchers (constant) — The matchers mesh evidence answers, as the GeoSpec authoring skill…
24
+ geoSpecRegionScopedKinds (constant) — The claims a region-cropped subject answers
25
+ geoSpecRegionWholeModelClaimCode (constant) — Diagnostic code of a whole-model claim made on a region-cropped…
23
26
 
24
27
  ## Types — `api-types.md`
25
28
 
26
29
  GeoSpecSubject (type) [1 members] — A model admitted by one live GeoSpec host scope
27
30
  GeoSpecSubject.[subjectBrand] (property)
28
31
  GeoSpecUnit (type) — Geometry units accepted at GeoSpec evidence-loading boundaries
29
- GeoSpecAssertion (type) [8 members] — Geometry assertion collected from a GeoSpec test module
32
+ GeoSpecAssertion (type) [9 members] — Geometry assertion collected from a GeoSpec test module
30
33
  GeoSpecAssertion.kind (property) — Assertion kind
31
34
  GeoSpecAssertion.subject (property) — User-authored value passed to expectGeo()
32
35
  GeoSpecAssertion.expected (property) — Expected geometry condition
@@ -34,6 +37,7 @@ GeoSpecAssertion (type) [8 members] — Geometry assertion collected from a GeoS
34
37
  GeoSpecAssertion.diagnostics (property) — Structured diagnostics from matcher evaluation
35
38
  GeoSpecAssertion.report (property) — Exact compiled assertion report, including core-owned bytes and polarity
36
39
  GeoSpecAssertion.loadId (property) — The host load which admitted this assertion's subject
40
+ GeoSpecAssertion.region (property) — The crop this assertion's subject was loaded with
37
41
  GeoSpecAssertion.durationMs (property) — Wall-clock cost of matcher evaluation in milliseconds (R1
38
42
  GeoSpecAssemblyOccurrenceExpectation (type) [3 members] — Assembly occurrence rule accepted by `expectGeo(...).toHaveAssemblyOccurrences(...)`
39
43
  GeoSpecAssemblyOccurrenceExpectation.name (property)
@@ -53,7 +57,7 @@ GeoSpecBoundingBoxExpectation (type) [5 members] — Bounding-box expectation ac
53
57
  GeoSpecBoundingBoxExpectation.center (property)
54
58
  GeoSpecBoundingBoxExpectation.tolerance (property)
55
59
  GeoSpecCenterOfMassExpectation (type) [2 members] — Center-of-mass expectation accepted by `expectGeo(...).toHaveCenterOfMass(...)`
56
- GeoSpecCenterOfMassExpectation.point (property)
60
+ GeoSpecCenterOfMassExpectation.point (property) — Exact expected point in millimetres
57
61
  GeoSpecCenterOfMassExpectation.tolerance (property)
58
62
  GeoSpecChamferFeatureExpectation (type) [3 members] — Chamfer-feature expectation accepted by `expectGeo(...).toHaveChamferFeature(...)`
59
63
  GeoSpecChamferFeatureExpectation.distance (property)
@@ -69,6 +73,8 @@ GeoSpecCylindricalFaceExpectation (type) [3 members] — Cylindrical-face expect
69
73
  GeoSpecCylindricalFaceExpectation.radius (property)
70
74
  GeoSpecCylindricalFaceExpectation.axis (property)
71
75
  GeoSpecCylindricalFaceExpectation.tolerance (property)
76
+ GeoSpecExpectOptions (type) [1 members] — Per-chain options accepted by `expectGeo(subject, options)`
77
+ GeoSpecExpectOptions.workUnitLimit (property) — Deterministic work-unit budget for every claim in this chain
72
78
  GeoSpecComponentInterferenceAllowance (type) [5 members] — Intentional component interference allowance accepted by `expectGeo(...).toHaveNoComponentInterference(...)`
73
79
  GeoSpecComponentInterferenceAllowance.kind (property)
74
80
  GeoSpecComponentInterferenceAllowance.left (property)
@@ -300,6 +306,9 @@ CreateModelLoaderOptions (type) [10 members] — Defaults accepted by {@link imp
300
306
  CreateModelLoaderOptions.mesh (property) — Whether STEP loading should also produce mesh evidence
301
307
  CreateModelLoaderOptions.meshLinearTolerance (property) — Linear tolerance used while meshing exact BRep evidence
302
308
  CreateModelLoaderOptions.meshAngularToleranceDegrees (property) — Angular tolerance in degrees used while meshing exact BRep evidence
309
+ GeoSpecLoadRegion (type) [2 members] — Axis-aligned crop box in canonical Z-up millimetres
310
+ GeoSpecLoadRegion.min (property)
311
+ GeoSpecLoadRegion.max (property)
303
312
  GeoSpecModelFormat (type) — Geometry formats accepted by {@link import ('./load-model.js').loadModel}
304
313
  GeoSpecModelLoader (type) — Function shape used by GeoSpec runners to provide model loading…
305
314
  ManagedGeoSpecModelLoader (type) [1 members] — A configured loader whose shared runtime can be released with…
@@ -312,7 +321,7 @@ GeoSpecRuntimeSourceAdapter (type) [3 members] — Explicit source adapter for f
312
321
  GeoSpecRuntimeSourceAdapter.id (property)
313
322
  GeoSpecRuntimeSourceAdapter.extensions (property)
314
323
  GeoSpecRuntimeSourceAdapter.createRuntime (method)
315
- LoadModelCodeOptions (type) [11 members] — Inline code-CAD model load options
324
+ LoadModelCodeOptions (type) [13 members] — Inline code-CAD model load options
316
325
  LoadModelCodeOptions.code (property) — Source files keyed by project-relative path
317
326
  LoadModelCodeOptions.file (property) — Entry path to render from {@link code }
318
327
  LoadModelCodeOptions.format (property) — Geometry format to export
@@ -324,7 +333,9 @@ LoadModelCodeOptions (type) [11 members] — Inline code-CAD model load options
324
333
  LoadModelCodeOptions.mesh (property) — Whether STEP loading should also produce mesh evidence
325
334
  LoadModelCodeOptions.meshLinearTolerance (property) — Linear tolerance used while meshing exact BRep evidence
326
335
  LoadModelCodeOptions.meshAngularToleranceDegrees (property) — Angular tolerance in degrees used while meshing exact BRep evidence
327
- LoadModelFileOptions (type) [10 members] — Filesystem-backed model load options
336
+ LoadModelCodeOptions.workUnitLimit (property) — Default work-unit budget for every claim on this subject
337
+ LoadModelCodeOptions.region (property) — Axis-aligned millimetre box the kernel crops the model to before…
338
+ LoadModelFileOptions (type) [12 members] — Filesystem-backed model load options
328
339
  LoadModelFileOptions.file (property) — Project-relative model file to render
329
340
  LoadModelFileOptions.projectPath (property) — Project root used by runtime integrations
330
341
  LoadModelFileOptions.format (property) — Geometry format to export
@@ -335,14 +346,17 @@ LoadModelFileOptions (type) [10 members] — Filesystem-backed model load option
335
346
  LoadModelFileOptions.mesh (property) — Whether STEP loading should also produce mesh evidence
336
347
  LoadModelFileOptions.meshLinearTolerance (property) — Linear tolerance used while meshing exact BRep evidence
337
348
  LoadModelFileOptions.meshAngularToleranceDegrees (property) — Angular tolerance in degrees used while meshing exact BRep evidence
338
- LoadModelOptions (type) [6 members] — Options accepted by {@link import ('./load-model.js').loadModel}
349
+ LoadModelFileOptions.workUnitLimit (property) — Default work-unit budget for every claim on this subject
350
+ LoadModelFileOptions.region (property) — Axis-aligned millimetre box the kernel crops the model to before…
351
+ LoadModelOptions (type) [7 members] — Options accepted by {@link import ('./load-model.js').loadModel}
339
352
  LoadModelOptions.format (property) — Geometry format to export
340
353
  LoadModelOptions.parameters (property) — Explicit parameters passed to the runtime
341
354
  LoadModelOptions.stepStreaming (property) — STEP reader strategy used for STEP exports
342
355
  LoadModelOptions.mesh (property) — Whether STEP loading should also produce mesh evidence
343
356
  LoadModelOptions.meshLinearTolerance (property) — Linear tolerance used while meshing exact BRep evidence
344
357
  LoadModelOptions.meshAngularToleranceDegrees (property) — Angular tolerance in degrees used while meshing exact BRep evidence
345
- LoadModelSourceOptions (type) [11 members] — Direct geometry-source model load options
358
+ LoadModelOptions.workUnitLimit (property) — Default work-unit budget for every claim on this subject
359
+ LoadModelSourceOptions (type) [12 members] — Direct geometry-source model load options
346
360
  LoadModelSourceOptions.source (property) — Geometry bytes, path, browser file/blob, or in-memory mesh buffer
347
361
  LoadModelSourceOptions.resources (property) — Named external resources consumed alongside the direct geometry bytes
348
362
  LoadModelSourceOptions.format (property) — Source geometry format
@@ -354,6 +368,7 @@ LoadModelSourceOptions (type) [11 members] — Direct geometry-source model load
354
368
  LoadModelSourceOptions.mesh (property) — Whether STEP loading should also produce mesh evidence
355
369
  LoadModelSourceOptions.meshLinearTolerance (property) — Linear tolerance used while meshing exact BRep evidence
356
370
  LoadModelSourceOptions.meshAngularToleranceDegrees (property) — Angular tolerance in degrees used while meshing exact BRep evidence
371
+ LoadModelSourceOptions.workUnitLimit (property) — Default work-unit budget for every claim on this subject
357
372
 
358
373
  ## Classes — `api-classes.md`
359
374
 
@@ -1,6 +1,6 @@
1
1
  # geospec — Types
2
2
 
3
- 67 top-level symbols. Signatures are verbatim typescript.
3
+ 69 top-level symbols. Signatures are verbatim typescript.
4
4
 
5
5
  // A model admitted by one live GeoSpec host scope
6
6
  GeoSpecSubject: {
@@ -29,6 +29,11 @@ GeoSpecAssertion: {
29
29
  report?: GeoSpecCanonicalClaimReport;
30
30
  /** The host load which admitted this assertion's subject; independent of equal geometry hashes. */
31
31
  loadId?: string;
32
+ /**
33
+ * The crop this assertion's subject was loaded with. Present only for a region load: the verdict
34
+ * holds for this millimetre box, never for the whole model.
35
+ */
36
+ region?: GeoSpecLoadRegion;
32
37
  /** Wall-clock cost of matcher evaluation in milliseconds (R1: budgeted matchers only). */
33
38
  durationMs?: number;
34
39
  }
@@ -54,6 +59,9 @@ GeoSpecAssertion: {
54
59
  // The host load which admitted this assertion's subject
55
60
  loadId?: string
56
61
 
62
+ // The crop this assertion's subject was loaded with
63
+ region?: GeoSpecLoadRegion
64
+
57
65
  // Wall-clock cost of matcher evaluation in milliseconds (R1
58
66
  durationMs?: number
59
67
 
@@ -126,10 +134,12 @@ GeoSpecBoundingBoxExpectation: {
126
134
 
127
135
  // Center-of-mass expectation accepted by `expectGeo(...).toHaveCenterOfMass(...)`
128
136
  GeoSpecCenterOfMassExpectation: {
137
+ /** Exact expected point in millimetres; per-axis ranges such as `{ greaterThan }` are not supported. */
129
138
  point: GeoSpecPointExpectation;
130
139
  tolerance?: number;
131
140
  }
132
141
 
142
+ // Exact expected point in millimetres
133
143
  point: GeoSpecPointExpectation
134
144
 
135
145
  tolerance?: number
@@ -179,6 +189,20 @@ GeoSpecCylindricalFaceExpectation: {
179
189
 
180
190
  tolerance?: number
181
191
 
192
+ // Per-chain options accepted by `expectGeo(subject, options)`
193
+ GeoSpecExpectOptions: {
194
+ /**
195
+ * Deterministic work-unit budget for every claim in this chain: a positive integer no
196
+ * greater than the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). Omitted uses the subject's
197
+ * `loadModel` budget, then the host's, then the engine default. Raise it to retry a
198
+ * `MATCHER_TIMEOUT` refusal whose `details.used` exceeded `details.limit`.
199
+ */
200
+ readonly workUnitLimit?: number;
201
+ }
202
+
203
+ // Deterministic work-unit budget for every claim in this chain
204
+ readonly workUnitLimit?: number
205
+
182
206
  // Intentional component interference allowance accepted by `expectGeo(...).toHaveNoComponentInterference(...)`
183
207
  GeoSpecComponentInterferenceAllowance: {
184
208
  kind?: 'intentionalInterference';
@@ -1437,6 +1461,16 @@ CreateModelLoaderOptions: {
1437
1461
  // Angular tolerance in degrees used while meshing exact BRep evidence
1438
1462
  meshAngularToleranceDegrees?: number
1439
1463
 
1464
+ // Axis-aligned crop box in canonical Z-up millimetres
1465
+ GeoSpecLoadRegion: {
1466
+ readonly min: readonly [number, number, number];
1467
+ readonly max: readonly [number, number, number];
1468
+ }
1469
+
1470
+ readonly min: readonly [number, number, number]
1471
+
1472
+ readonly max: readonly [number, number, number]
1473
+
1440
1474
  // Geometry formats accepted by {@link import ('./load-model.js').loadModel}
1441
1475
  GeoSpecModelFormat: MeshFileFormat | 'step' | 'stp'
1442
1476
 
@@ -1452,8 +1486,8 @@ ManagedGeoSpecModelLoader: GeoSpecModelLoader & {
1452
1486
  dispose(): Promise<void>;
1453
1487
 
1454
1488
  // Runtime client surface consumed by `geospec/model`
1455
- // Remarks: GeoSpec accepts concrete Tau runtime clients from multiple call sites but only needs connection lifecycle and request-scoped documents. Keep this shape small so typed runtime clients do not have to widen their full generic method surface to GeoSpec's testing DSL. A client with `shutdown` is awaited through it when GeoSpec releases an owned runtime, so its host resources are closed before the caller (for example a worker thread) exits.
1456
- GeoSpecRuntimeClient: Pick<RuntimeClient, 'connect' | 'terminate'> & Partial<Pick<RuntimeClient, 'shutdown'>> & {
1489
+ // Remarks: GeoSpec accepts concrete Tau runtime clients from multiple call sites but only needs connection lifecycle and request-scoped documents. Keep this shape small so typed runtime clients do not have to widen their full generic method surface to GeoSpec's testing DSL. A client with `shutdown` is awaited through it when GeoSpec releases an owned runtime, so its host resources are closed before the caller (for example a worker thread) exits. A client with `snapshotSource` lets one run reuse an identical file load after confirming that the source closure it exported is unchanged.
1490
+ GeoSpecRuntimeClient: Pick<RuntimeClient, 'connect' | 'terminate'> & Partial<Pick<RuntimeClient, 'shutdown' | 'snapshotSource' | 'describe'>> & {
1457
1491
  open: (input: Pick<Parameters<RuntimeClient['open']>[0], 'source' | 'parameters' | 'stage' | 'watch' | 'signal'>) => Pick<ReturnType<RuntimeClient['open']>, 'export' | 'close'>;
1458
1492
  on?(event: 'telemetry', handler: (batch: {
1459
1493
  readonly entries: ReadonlyArray<{
@@ -1524,6 +1558,21 @@ LoadModelCodeOptions: {
1524
1558
  meshLinearTolerance?: number;
1525
1559
  /** Angular tolerance in degrees used while meshing exact BRep evidence. */
1526
1560
  meshAngularToleranceDegrees?: number;
1561
+ /**
1562
+ * Default work-unit budget for every claim on this subject: a positive integer no greater than
1563
+ * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
1564
+ * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
1565
+ */
1566
+ workUnitLimit?: number;
1567
+ /**
1568
+ * Axis-aligned millimetre box the kernel crops the model to before export, so a large mesh model
1569
+ * can be checked region by region. Only kernels whose direct GLB export declares a `region` option
1570
+ * honor it; any other kernel, a STEP load or a crop the kernel does not confirm refuses with a typed
1571
+ * diagnostic instead of loading the whole model. The cropped subject is a different subject: its
1572
+ * admission carries the kernel's crop notice and its load evidence records `region`, so a claim on
1573
+ * it never stands for the whole model.
1574
+ */
1575
+ region?: GeoSpecLoadRegion;
1527
1576
  }
1528
1577
 
1529
1578
  // Source files keyed by project-relative path
@@ -1559,6 +1608,12 @@ LoadModelCodeOptions: {
1559
1608
  // Angular tolerance in degrees used while meshing exact BRep evidence
1560
1609
  meshAngularToleranceDegrees?: number
1561
1610
 
1611
+ // Default work-unit budget for every claim on this subject
1612
+ workUnitLimit?: number
1613
+
1614
+ // Axis-aligned millimetre box the kernel crops the model to before export, so a large mesh model can be checked region by region
1615
+ region?: GeoSpecLoadRegion
1616
+
1562
1617
  // Filesystem-backed model load options
1563
1618
  LoadModelFileOptions: {
1564
1619
  /** Project-relative model file to render. */
@@ -1581,6 +1636,21 @@ LoadModelFileOptions: {
1581
1636
  meshLinearTolerance?: number;
1582
1637
  /** Angular tolerance in degrees used while meshing exact BRep evidence. */
1583
1638
  meshAngularToleranceDegrees?: number;
1639
+ /**
1640
+ * Default work-unit budget for every claim on this subject: a positive integer no greater than
1641
+ * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
1642
+ * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
1643
+ */
1644
+ workUnitLimit?: number;
1645
+ /**
1646
+ * Axis-aligned millimetre box the kernel crops the model to before export, so a large mesh model
1647
+ * can be checked region by region. Only kernels whose direct GLB export declares a `region` option
1648
+ * honor it; any other kernel, a STEP load or a crop the kernel does not confirm refuses with a typed
1649
+ * diagnostic instead of loading the whole model. The cropped subject is a different subject: its
1650
+ * admission carries the kernel's crop notice and its load evidence records `region`, so a claim on
1651
+ * it never stands for the whole model.
1652
+ */
1653
+ region?: GeoSpecLoadRegion;
1584
1654
  }
1585
1655
 
1586
1656
  // Project-relative model file to render
@@ -1613,6 +1683,12 @@ LoadModelFileOptions: {
1613
1683
  // Angular tolerance in degrees used while meshing exact BRep evidence
1614
1684
  meshAngularToleranceDegrees?: number
1615
1685
 
1686
+ // Default work-unit budget for every claim on this subject
1687
+ workUnitLimit?: number
1688
+
1689
+ // Axis-aligned millimetre box the kernel crops the model to before export, so a large mesh model can be checked region by region
1690
+ region?: GeoSpecLoadRegion
1691
+
1616
1692
  // Options accepted by {@link import ('./load-model.js').loadModel}
1617
1693
  LoadModelOptions: LoadModelSourceOptions | LoadModelCodeOptions<Code> | LoadModelFileOptions
1618
1694
 
@@ -1634,6 +1710,9 @@ LoadModelOptions: LoadModelSourceOptions | LoadModelCodeOptions<Code> | LoadMode
1634
1710
  // Angular tolerance in degrees used while meshing exact BRep evidence
1635
1711
  meshAngularToleranceDegrees?: number
1636
1712
 
1713
+ // Default work-unit budget for every claim on this subject
1714
+ workUnitLimit?: number
1715
+
1637
1716
  // Direct geometry-source model load options
1638
1717
  LoadModelSourceOptions: {
1639
1718
  /** Geometry bytes, path, browser file/blob, or in-memory mesh buffer. */
@@ -1661,6 +1740,12 @@ LoadModelSourceOptions: {
1661
1740
  meshLinearTolerance?: number;
1662
1741
  /** Angular tolerance in degrees used while meshing exact BRep evidence. */
1663
1742
  meshAngularToleranceDegrees?: number;
1743
+ /**
1744
+ * Default work-unit budget for every claim on this subject: a positive integer no greater than
1745
+ * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
1746
+ * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
1747
+ */
1748
+ workUnitLimit?: number;
1664
1749
  }
1665
1750
 
1666
1751
  // Geometry bytes, path, browser file/blob, or in-memory mesh buffer
@@ -1698,3 +1783,6 @@ LoadModelSourceOptions: {
1698
1783
 
1699
1784
  // Angular tolerance in degrees used while meshing exact BRep evidence
1700
1785
  meshAngularToleranceDegrees?: number
1786
+
1787
+ // Default work-unit budget for every claim on this subject
1788
+ workUnitLimit?: number
@@ -1,6 +1,6 @@
1
1
  # geospec — Constants
2
2
 
3
- 4 top-level symbols. Signatures are verbatim typescript.
3
+ 9 top-level symbols. Signatures are verbatim typescript.
4
4
 
5
5
  // Every matcher name exposed by {@link expectGeo}, derived from the live matcher surface so it can never drift from the real implementation
6
6
  geoSpecMatcherNames: readonly string[]
@@ -12,8 +12,40 @@ geoSpecMatcherDescriptors: Readonly<{
12
12
  } : GeoSpecMatcherDescriptor;
13
13
  }>
14
14
 
15
+ // The matchers mesh evidence answers, as the GeoSpec authoring skill lists them (`packages/geospec/agent/geospec-authoring/SKILL.md`)
16
+ geoSpecMeshEvidenceMatchers: readonly ["toHaveBoundingBox", "toHaveVolume", "toHaveSurfaceArea", "toHaveConnectedComponents", "toBeWatertight"]
17
+
18
+ // The claims a region-cropped subject answers
19
+ // Remarks: Every other kind quantifies over the whole model (component counts, all-components interference, occurrences, watertightness, integrity, topology, diagnostics) or relates parts the crop may have cut, so a crop can neither prove nor disprove it.
20
+ geoSpecRegionScopedKinds: ReadonlySet<GeoSpecAssertion['kind']>
21
+
22
+ // Diagnostic code of a whole-model claim made on a region-cropped subject
23
+ geoSpecRegionWholeModelClaimCode: "GEOSPEC_REGION_WHOLE_MODEL_CLAIM"
24
+
15
25
  // Directories skipped by recursive GeoSpec discovery unless callers provide their own ignored-directory list
16
26
  defaultGeoSpecIgnoredDirectories: readonly [".git", "node_modules", "dist", "coverage", ".tau/cache", ".tau/artifacts", ".tau/transcripts"]
17
27
 
18
28
  // Default file globs used by GeoSpec test discovery
19
29
  defaultGeoSpecInclude: readonly ["**/*.geospec.{ts,js}"]
30
+
31
+ // Codes for GeoSpec wall-clock timeouts, one per bound
32
+ geoSpecTimeoutCode: {
33
+ /** A test's async body outlived `testTimeout` / `--test-timeout`. */
34
+ readonly test: "GEOSPEC_TEST_TIMEOUT";
35
+ /** A pool shard outlived the non-verdict `--shard-timeout` watchdog. */
36
+ readonly shard: "GEOSPEC_SHARD_TIMEOUT";
37
+ /** A whole run outlived its host run budget. */
38
+ readonly run: "GEOSPEC_RUN_TIMEOUT";
39
+ }
40
+
41
+ // A test's async body outlived `testTimeout` / `--test-timeout`
42
+ readonly test: "GEOSPEC_TEST_TIMEOUT"
43
+
44
+ // A pool shard outlived the non-verdict `--shard-timeout` watchdog
45
+ readonly shard: "GEOSPEC_SHARD_TIMEOUT"
46
+
47
+ // A whole run outlived its host run budget
48
+ readonly run: "GEOSPEC_RUN_TIMEOUT"
49
+
50
+ // Default largest work-unit budget a spec may author through `loadModel` or `expectGeo` options
51
+ geoSpecMaximumWorkUnitLimit: 512000000
@@ -1,6 +1,6 @@
1
1
  # geospec — Functions
2
2
 
3
- 34 top-level symbols. Signatures are verbatim typescript.
3
+ 36 top-level symbols. Signatures are verbatim typescript.
4
4
 
5
5
  // GeoSpec suite helper used inside VM-executed test modules
6
6
  // describe (function)
@@ -11,8 +11,9 @@ export declare function describe(name: string, function_: GeoSpecTestCallback):
11
11
 
12
12
  // Start a geometry assertion chain
13
13
  // expectGeo (function)
14
- export declare function expectGeo(subject: GeoSpecSubject): GeoSpecMatcher;
14
+ export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
15
15
  // subject: geometry subject under test
16
+ // options: Optional chain options, such as a larger `workUnitLimit` for a claim that refused with `MATCHER_TIMEOUT`
16
17
 
17
18
  // GeoSpec test helper used inside VM-executed test modules
18
19
  // it (function)
@@ -72,6 +73,13 @@ export declare function resolveRuntimeExportIntent(options: {
72
73
  format: RuntimeBackedModelFormat;
73
74
  meshLinearTolerance?: number;
74
75
  meshAngularToleranceDegrees?: number;
76
+ /**
77
+ * The kernel that evaluates this source, when the host knows it. Routes are
78
+ * then chosen among that kernel's own, so a mesh-only kernel is told its
79
+ * BRep matchers are unsupported instead of being sent to another kernel's
80
+ * STEP route.
81
+ */
82
+ kernelId?: string;
75
83
  }): RuntimeExportIntent | RuntimeExportIntentFailure;
76
84
 
77
85
  // clearCollectorGlobals (function)
@@ -125,6 +133,11 @@ export declare function isGeoSpecTestFile(path: string): boolean;
125
133
  export declare function runGeoSpecModule(options: RunGeoSpecModuleOptions): Promise<GeoSpecRunResult>;
126
134
  // options: filesystem and test entry path
127
135
 
136
+ // Whether a diagnostic or issue code belongs to the GeoSpec timeout family
137
+ // isGeoSpecTimeoutCode (function)
138
+ export declare function isGeoSpecTimeoutCode(code: string): code is GeoSpecTimeoutCode;
139
+ // code: Any diagnostic or issue code
140
+
128
141
  // Compose compiled assertion and model bindings with the SDK's serial lifecycle
129
142
  // createNativeGeoSpecRunner (function)
130
143
  export declare function createNativeGeoSpecRunner(options: GeoSpecNativeRunnerOptions): GeoSpecRunner;
@@ -168,6 +181,12 @@ export declare function createGeoSpecMatcherMethods<Result>(options: {
168
181
  export declare function evaluateGeoSpecNativeQuery(options: GeoSpecNativeQueryOptions): GeoSpecCanonicalClaimReport;
169
182
  // options: Query identity, subject and authored payload
170
183
 
184
+ // Resolve a host's largest authored work-unit budget
185
+ // Throws: TypeError when the configured maximum is not a positive safe integer.
186
+ // resolveGeoSpecMaximumWorkUnitLimit (function)
187
+ export declare function resolveGeoSpecMaximumWorkUnitLimit(maximum?: number): number;
188
+ // maximum: The host's configured maximum, when it sets one
189
+
171
190
  // Create Vitest matchers over an existing runner-independent client
172
191
  // createGeoSpecVitestAdapter (function)
173
192
  export declare function createGeoSpecVitestAdapter(client: GeoSpecAssertionClient): GeoSpecVitestAdapter;