geospec 0.0.0 → 0.1.0-beta.3
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.
- package/LICENSE +201 -0
- package/README.md +244 -0
- package/agent/doctrine.md +55 -0
- package/agent/geospec-authoring/SKILL.md +495 -0
- package/agent/geospec-authoring/api-classes.md +13 -0
- package/agent/geospec-authoring/api-constants.md +16 -0
- package/agent/geospec-authoring/api-functions.md +57 -0
- package/agent/geospec-authoring/api-index.md +377 -0
- package/agent/geospec-authoring/api-types.md +1788 -0
- package/agent/geospec-authoring/public-api-classes.md +22 -0
- package/agent/geospec-authoring/public-api-constants.md +51 -0
- package/agent/geospec-authoring/public-api-functions.md +215 -0
- package/agent/geospec-authoring/public-api-index.md +893 -0
- package/agent/geospec-authoring/public-api-types-2.md +1560 -0
- package/agent/geospec-authoring/public-api-types-3.md +217 -0
- package/agent/geospec-authoring/public-api-types.md +1948 -0
- package/agent/resources.d.ts +19 -0
- package/agent/resources.js +27 -0
- package/agent/skills.d.cts +13 -0
- package/agent/skills.json +28 -0
- package/dist/assertion-client/client.d.mts +134 -0
- package/dist/assertion-client/client.mjs +2 -0
- package/dist/assertion-client/index.d.mts +5 -0
- package/dist/assertion-client/index.mjs +1 -0
- package/dist/config/index.d.mts +3 -0
- package/dist/config/index.mjs +1 -0
- package/dist/config/node/index.d.mts +3 -0
- package/dist/config/node/index.mjs +1 -0
- package/dist/config/node/load.d.mts +19 -0
- package/dist/config/node/load.mjs +1 -0
- package/dist/config/tau-project-artifact.d.mts +54 -0
- package/dist/config/tau-project-artifact.mjs +3 -0
- package/dist/config/types.d.mts +57 -0
- package/dist/config/validate.mjs +1 -0
- package/dist/create-geospec.d.mts +50 -0
- package/dist/create-geospec.mjs +1 -0
- package/dist/engine/client.d.mts +113 -0
- package/dist/engine/client.mjs +1 -0
- package/dist/engine/index.d.mts +3 -0
- package/dist/engine/index.mjs +1 -0
- package/dist/engine/matchers.d.mts +70 -0
- package/dist/engine/matchers.mjs +1 -0
- package/dist/engine/pmi.types.d.mts +78 -0
- package/dist/engine/protocol.d.mts +20 -0
- package/dist/engine/protocol.mjs +1 -0
- package/dist/geometry-unit.d.mts +12 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +1 -0
- package/dist/mesh/index.d.mts +4 -0
- package/dist/mesh/index.mjs +1 -0
- package/dist/mesh/types.d.mts +575 -0
- package/dist/model/errors.d.mts +20 -0
- package/dist/model/errors.mjs +2 -0
- package/dist/model/export-intent.d.mts +79 -0
- package/dist/model/export-intent.mjs +1 -0
- package/dist/model/index.d.mts +7 -0
- package/dist/model/index.mjs +1 -0
- package/dist/model/load-model.d.mts +25 -0
- package/dist/model/load-model.mjs +1 -0
- package/dist/model/native-model-loader.d.mts +142 -0
- package/dist/model/native-model-loader.mjs +1 -0
- package/dist/model/region-scope.d.mts +23 -0
- package/dist/model/region-scope.mjs +1 -0
- package/dist/model/subject-assertions.mjs +1 -0
- package/dist/model/subject.d.mts +11 -0
- package/dist/model/subject.mjs +1 -0
- package/dist/model/types.d.mts +254 -0
- package/dist/runner/collector.d.mts +64 -0
- package/dist/runner/collector.mjs +2 -0
- package/dist/runner/discovery.d.mts +93 -0
- package/dist/runner/discovery.mjs +1 -0
- package/dist/runner/filter.d.mts +50 -0
- package/dist/runner/filter.mjs +1 -0
- package/dist/runner/index.d.mts +7 -0
- package/dist/runner/index.mjs +1 -0
- package/dist/runner/native/index.d.mts +4 -0
- package/dist/runner/native/index.mjs +1 -0
- package/dist/runner/native/native-pool-grants.d.mts +21 -0
- package/dist/runner/native/native-pool-grants.mjs +1 -0
- package/dist/runner/native/native-serial-runner.d.mts +29 -0
- package/dist/runner/native/native-serial-runner.mjs +1 -0
- package/dist/runner/pool/pool-messages.d.mts +94 -0
- package/dist/runner/run-geospec-module.d.mts +13 -0
- package/dist/runner/run-geospec-module.mjs +47 -0
- package/dist/runner/timeout-codes.d.mts +45 -0
- package/dist/runner/timeout-codes.mjs +1 -0
- package/dist/runner/types.d.mts +776 -0
- package/dist/runner/worker/index.d.mts +4 -0
- package/dist/runner/worker/index.mjs +1 -0
- package/dist/runner/worker/no-matching-tests-issue.d.mts +12 -0
- package/dist/runner/worker/no-matching-tests-issue.mjs +1 -0
- package/dist/runner/worker/runner-types.d.mts +167 -0
- package/dist/runner/worker/serial-runner.mjs +1 -0
- package/dist/selector/types.d.mts +271 -0
- package/dist/step/types.d.mts +134 -0
- package/dist/vitest/adapter.d.mts +56 -0
- package/dist/vitest/adapter.mjs +3 -0
- package/dist/vitest/index.d.mts +4 -0
- package/dist/vitest/index.mjs +1 -0
- package/package.json +114 -5
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: geospec-authoring
|
|
3
|
+
description: Guides canonical GeoSpec geometry tests in TypeScript or JavaScript for every Tau kernel. Use for *.geospec.ts and *.geospec.js tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GeoSpec authoring
|
|
7
|
+
|
|
8
|
+
Write tests before implementation; assert deterministic, measurable properties.
|
|
9
|
+
|
|
10
|
+
## Test shape
|
|
11
|
+
|
|
12
|
+
- Use `*.geospec.ts` or `*.geospec.js`. Import `describe`, `it` and `expectGeo` from `geospec`, and `loadModel` from `geospec/model`.
|
|
13
|
+
- Await `loadModel`, then assert synchronously with `expectGeo(model)`. The host supplies the compiled binding; authoring does not select an engine.
|
|
14
|
+
- Await or return the complete model-load chain from the test callback; detached future loads are not part of a completed test.
|
|
15
|
+
- Omit `parameters` for model-code defaults; use `{ file, parameters }` for variants. Loaded subjects are opaque.
|
|
16
|
+
|
|
17
|
+
Canonical TypeScript authoring:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { describe, expectGeo, it } from 'geospec';
|
|
21
|
+
import { loadModel } from 'geospec/model';
|
|
22
|
+
|
|
23
|
+
describe('main geometry', () => {
|
|
24
|
+
it('has the intended envelope', async () => {
|
|
25
|
+
const model = await loadModel({ file: 'main.ts', parameters: { width: 120 } });
|
|
26
|
+
expectGeo(model).toHaveBoundingBox({ size: { x: 120 }, tolerance: 1 });
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Specs are always TypeScript or JavaScript, whatever the model's kernel: `loadModel({ file })` evaluates `main.ts`, `main.tsx`, `main.py`, `main.scad`, `main.kcl` or `main.cs` through Tau's runtime. `test_model` discovers `*.geospec.ts` and `*.geospec.js` only.
|
|
32
|
+
|
|
33
|
+
Every matcher takes one expectation object:
|
|
34
|
+
|
|
35
|
+
- Wrong: `expectGeo(model).toHaveVolume(5000, { tolerance: 5 })`. Correct: `expectGeo(model).toHaveVolume({ value: 5000, tolerance: 5 })`.
|
|
36
|
+
- Wrong: `await expectGeo(model)…`. Correct: await `loadModel`, then assert synchronously.
|
|
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
|
+
|
|
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
|
+
|
|
47
|
+
## Coverage
|
|
48
|
+
|
|
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.
|
|
50
|
+
|
|
51
|
+
- `toHaveBoundingBox`: size/position.
|
|
52
|
+
- `toHaveConnectedComponents`: qualified material connectivity; visual touching cannot justify tolerance changes.
|
|
53
|
+
- `toBeWatertight`: closed edge incidence, not manifold validity, fusion or material connectivity. Bounds prove none of these. Missing evidence is unsupported.
|
|
54
|
+
- `toHaveSurfaceArea`, `toHaveVolume`, `toHaveCenterOfMass`, `toHaveMass`: physical measurements.
|
|
55
|
+
- `toHaveNoComponentInterference`: overlap; allow deliberate press fits.
|
|
56
|
+
- `loadModel({ file, format: 'step' })`: use BRep evidence for supported topology and feature assertions. Missing occurrence, interference, clearance, containment, lumen, wall, section or motion evidence is unsupported, not a pass or an envelope substitute.
|
|
57
|
+
|
|
58
|
+
Test assemblies and independent units; preserve sibling coverage when adding files. Non-top-level geometry needs kernel export/invocation, not test removal.
|
|
59
|
+
|
|
60
|
+
Fix geometry at its root; never weaken tolerances, delete assertions, or reduce detail to pass.
|
|
61
|
+
|
|
62
|
+
`public-api-index.md` covers the host and framework API; authoring needs only the Core API below and `api-*` files.
|
|
63
|
+
|
|
64
|
+
## Core API
|
|
65
|
+
|
|
66
|
+
The symbols real Tau models use most, as verbatim declarations. Anything not shown is in the API reference below.
|
|
67
|
+
|
|
68
|
+
### Functions
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// Start a geometry assertion chain
|
|
72
|
+
export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
|
|
73
|
+
|
|
74
|
+
// A model admitted by one live GeoSpec host scope
|
|
75
|
+
GeoSpecSubject: {
|
|
76
|
+
readonly [subjectBrand]: true
|
|
77
|
+
}
|
|
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
|
+
|
|
85
|
+
// Load a CAD model into GeoSpec evidence
|
|
86
|
+
export declare function loadModel<Code extends Record<string, string> = Record<string, string>>(_options: LoadModelOptions<Code>): Promise<GeoSpecSubject>;
|
|
87
|
+
|
|
88
|
+
// Options accepted by {@link import ('./load-model.js').loadModel}
|
|
89
|
+
LoadModelOptions: LoadModelSourceOptions | LoadModelCodeOptions<Code> | LoadModelFileOptions
|
|
90
|
+
// Geometry format to export
|
|
91
|
+
format?: GeoSpecModelFormat
|
|
92
|
+
// Explicit parameters passed to the runtime
|
|
93
|
+
parameters?: Record<string, unknown>
|
|
94
|
+
// STEP reader strategy used for STEP exports
|
|
95
|
+
stepStreaming?: StepStreamingMode
|
|
96
|
+
// Whether STEP loading should also produce mesh evidence
|
|
97
|
+
mesh?: boolean
|
|
98
|
+
// Linear tolerance used while meshing exact BRep evidence
|
|
99
|
+
meshLinearTolerance?: number
|
|
100
|
+
// Angular tolerance in degrees used while meshing exact BRep evidence
|
|
101
|
+
meshAngularToleranceDegrees?: number
|
|
102
|
+
// Default work-unit budget for every claim on this subject
|
|
103
|
+
workUnitLimit?: number
|
|
104
|
+
|
|
105
|
+
// Geometry formats accepted by {@link import ('./load-model.js').loadModel}
|
|
106
|
+
GeoSpecModelFormat: MeshFileFormat | 'step' | 'stp'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Types
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
// Assertion chain returned by `expectGeo(subject)`
|
|
113
|
+
GeoSpecMatcher: {
|
|
114
|
+
// Core-owned negation
|
|
115
|
+
readonly not: Omit<GeoSpecMatcher, 'not'>
|
|
116
|
+
// Assert the fixed rational plate contract
|
|
117
|
+
toSatisfyRationalPlate(): GeoSpecAssertion;
|
|
118
|
+
// Assert the fixed parallel-plane distance contract
|
|
119
|
+
toSatisfyParallelPlaneDistance(): GeoSpecAssertion;
|
|
120
|
+
// Assert axis-aligned bounds, size, or center for a loaded geometry subject
|
|
121
|
+
toHaveBoundingBox(first: Vec3 | GeoSpecBoundingBoxExpectation, second?: Vec3): GeoSpecAssertion;
|
|
122
|
+
// Assert how many spatially disjoint chunks the mesh contains
|
|
123
|
+
toHaveConnectedComponents(expected: GeoSpecConnectedComponentsExpectation): GeoSpecAssertion;
|
|
124
|
+
// Assert closed mesh edge incidence
|
|
125
|
+
toBeWatertight(): GeoSpecAssertion;
|
|
126
|
+
// Assert that separate assembly components do not occupy the same solid volume
|
|
127
|
+
toHaveNoComponentInterference(expected?: GeoSpecComponentInterferenceExpectation): GeoSpecAssertion;
|
|
128
|
+
// Assert that named assembly occurrences exist with expected counts and bounds
|
|
129
|
+
toHaveAssemblyOccurrences(expected: GeoSpecAssemblyOccurrencesExpectation): GeoSpecAssertion;
|
|
130
|
+
// Assert that selected entities satisfy declared spatial relationships
|
|
131
|
+
toHaveSpatialRelationships(expected: GeoSpecSpatialRelationshipsExpectation): GeoSpecAssertion;
|
|
132
|
+
// Assert rendered mesh evidence is internally trustworthy for downstream checks
|
|
133
|
+
toHaveMeshIntegrity(expected: GeoSpecMeshIntegrityExpectation): GeoSpecAssertion;
|
|
134
|
+
// Assert that the subject carries no diagnostics at the rejected severities
|
|
135
|
+
toHaveNoDiagnostics(expected?: GeoSpecNoDiagnosticsExpectation): GeoSpecAssertion;
|
|
136
|
+
// Assert total surface area, preferring exact BRep mass properties when available
|
|
137
|
+
toHaveSurfaceArea(expected: GeoSpecSurfaceAreaExpectation): GeoSpecAssertion;
|
|
138
|
+
// Assert enclosed volume, preferring exact BRep mass properties when available
|
|
139
|
+
toHaveVolume(expected: GeoSpecVolumeExpectation): GeoSpecAssertion;
|
|
140
|
+
// Assert mass derived from exact mass properties or volume times density
|
|
141
|
+
toHaveMass(expected: GeoSpecMassExpectation): GeoSpecAssertion;
|
|
142
|
+
// Assert the center of mass or mesh-derived centroid for a closed subject
|
|
143
|
+
toHaveCenterOfMass(expected: GeoSpecCenterOfMassExpectation): GeoSpecAssertion;
|
|
144
|
+
// Assert that exact BRep evidence reports a valid shape
|
|
145
|
+
toBeValidBrep(expected?: GeoSpecValidBrepExpectation): GeoSpecAssertion;
|
|
146
|
+
// Assert exact BRep topology counts
|
|
147
|
+
toHaveTopologyCounts(expected: GeoSpecTopologyCountsExpectation): GeoSpecAssertion;
|
|
148
|
+
// Assert the STEP unit evidence
|
|
149
|
+
toHaveStepUnits(expected: GeoSpecStepUnitsExpectation): GeoSpecAssertion;
|
|
150
|
+
// Assert STEP product-structure evidence
|
|
151
|
+
toHaveProductStructure(expected: GeoSpecProductStructureExpectation): GeoSpecAssertion;
|
|
152
|
+
// Assert that BRep evidence contains a planar face matching the requested constraints
|
|
153
|
+
toHavePlanarFace(expected: GeoSpecPlanarFaceExpectation): GeoSpecAssertion;
|
|
154
|
+
// Assert that BRep evidence contains a cylindrical face with the requested radius and axis
|
|
155
|
+
toHaveCylindricalFace(expected: GeoSpecCylindricalFaceExpectation): GeoSpecAssertion;
|
|
156
|
+
// Assert that BRep evidence contains a circular hole matching diameter, center, and axis
|
|
157
|
+
toHaveCircularHole(expected: GeoSpecCircularHoleExpectation): GeoSpecAssertion;
|
|
158
|
+
// Assert that BRep evidence contains a repeated circular-hole pattern
|
|
159
|
+
toHaveCircularHolePattern(expected: GeoSpecCircularHolePatternExpectation): GeoSpecAssertion;
|
|
160
|
+
// Assert that BRep evidence contains a chamfer feature with the requested distance
|
|
161
|
+
toHaveChamferFeature(expected: GeoSpecChamferFeatureExpectation): GeoSpecAssertion;
|
|
162
|
+
// Assert that BRep evidence contains a fillet feature with the requested radius
|
|
163
|
+
toHaveFilletFeature(expected: GeoSpecFilletFeatureExpectation): GeoSpecAssertion;
|
|
164
|
+
// Assert that BRep evidence reports a minimum wall thickness satisfying the expectation
|
|
165
|
+
toHaveMinimumWallThickness(expected: GeoSpecMinimumWallThicknessExpectation): GeoSpecAssertion;
|
|
166
|
+
// Assert that the declared waypoints share one connected void, stay isolated from the declared…
|
|
167
|
+
toHaveVoidContinuity(expected: GeoSpecVoidContinuityExpectation): GeoSpecAssertion;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Numeric 3D vector
|
|
171
|
+
Vec3: readonly [number, number, number]
|
|
172
|
+
|
|
173
|
+
// Bounding-box expectation accepted by `expectGeo(...).toHaveBoundingBox(...)`
|
|
174
|
+
GeoSpecBoundingBoxExpectation: {
|
|
175
|
+
min?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>
|
|
176
|
+
max?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>
|
|
177
|
+
size?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>
|
|
178
|
+
center?: Vec3 | Partial<Record<keyof GeoSpecAxisExpectation, GeoSpecNumericExpectation>>
|
|
179
|
+
tolerance?: number
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Connected-components expectation accepted by `expectGeo(...).toHaveConnectedComponents(...)`
|
|
183
|
+
GeoSpecConnectedComponentsExpectation: {
|
|
184
|
+
count: number
|
|
185
|
+
tolerance?: number
|
|
186
|
+
toleranceMm?: number
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Component-interference expectation accepted by `expectGeo(...).toHaveNoComponentInterference(...)`
|
|
190
|
+
GeoSpecComponentInterferenceExpectation: {
|
|
191
|
+
tolerance?: number
|
|
192
|
+
pairs?: GeoSpecComponentInterferencePairExpectation[]
|
|
193
|
+
allowances?: GeoSpecComponentInterferenceAllowance[]
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Assembly occurrence expectation accepted by `expectGeo(...).toHaveAssemblyOccurrences(...)`
|
|
197
|
+
GeoSpecAssemblyOccurrencesExpectation: {
|
|
198
|
+
occurrences: GeoSpecAssemblyOccurrenceExpectation[]
|
|
199
|
+
uniqueNames?: boolean
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Spatial relationship expectation accepted by `expectGeo(...).toHaveSpatialRelationships(...)`
|
|
203
|
+
GeoSpecSpatialRelationshipsExpectation: {
|
|
204
|
+
relationships: GeoSpecSpatialRelationshipExpectation[]
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Mesh integrity expectation accepted by `expectGeo(...).toHaveMeshIntegrity(...)`
|
|
208
|
+
GeoSpecMeshIntegrityExpectation: {
|
|
209
|
+
finitePositions?: boolean
|
|
210
|
+
degenerateTriangles?: {
|
|
211
|
+
count?: number;
|
|
212
|
+
maxCount?: number;
|
|
213
|
+
areaTolerance?: number;
|
|
214
|
+
}
|
|
215
|
+
duplicateFaces?: {
|
|
216
|
+
count?: number;
|
|
217
|
+
maxCount?: number;
|
|
218
|
+
}
|
|
219
|
+
watertight?: boolean
|
|
220
|
+
triangleCount?: GeoSpecNumericExpectation
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Diagnostic severities rejected by `expectGeo(...).toHaveNoDiagnostics(...)`
|
|
224
|
+
GeoSpecNoDiagnosticsExpectation: {
|
|
225
|
+
severities?: Array<GeometryDiagnostic['severity']>
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Surface-area expectation accepted by `expectGeo(...).toHaveSurfaceArea(...)`
|
|
229
|
+
GeoSpecSurfaceAreaExpectation: {
|
|
230
|
+
value: number | GeoSpecNumericExpectation
|
|
231
|
+
tolerance?: number
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Volume expectation accepted by `expectGeo(...).toHaveVolume(...)`
|
|
235
|
+
GeoSpecVolumeExpectation: {
|
|
236
|
+
value: number | GeoSpecNumericExpectation
|
|
237
|
+
tolerance?: number
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Mass expectation accepted by `expectGeo(...).toHaveMass(...)`
|
|
241
|
+
GeoSpecMassExpectation: {
|
|
242
|
+
value: number | GeoSpecNumericExpectation
|
|
243
|
+
density?: number
|
|
244
|
+
tolerance?: number
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Center-of-mass expectation accepted by `expectGeo(...).toHaveCenterOfMass(...)`
|
|
248
|
+
GeoSpecCenterOfMassExpectation: {
|
|
249
|
+
// Exact expected point in millimetres
|
|
250
|
+
point: GeoSpecPointExpectation
|
|
251
|
+
tolerance?: number
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Exact BRep validity expectation accepted by `expectGeo(...).toBeValidBrep(...)`
|
|
255
|
+
GeoSpecValidBrepExpectation: {
|
|
256
|
+
maxTolerance?: number
|
|
257
|
+
freeBounds?: {
|
|
258
|
+
count?: GeoSpecNumericExpectation;
|
|
259
|
+
}
|
|
260
|
+
minEdgeLength?: number
|
|
261
|
+
sameParameter?: boolean
|
|
262
|
+
closedShells?: boolean
|
|
263
|
+
closedWires?: boolean
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Topology-count expectation accepted by `expectGeo(...).toHaveTopologyCounts(...)`
|
|
267
|
+
GeoSpecTopologyCountsExpectation: {
|
|
268
|
+
vertices?: GeoSpecNumericExpectation
|
|
269
|
+
edges?: GeoSpecNumericExpectation
|
|
270
|
+
wires?: GeoSpecNumericExpectation
|
|
271
|
+
faces?: GeoSpecNumericExpectation
|
|
272
|
+
shells?: GeoSpecNumericExpectation
|
|
273
|
+
solids?: GeoSpecNumericExpectation
|
|
274
|
+
compounds?: GeoSpecNumericExpectation
|
|
275
|
+
tolerance?: number
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// STEP unit expectation accepted by `expectGeo(...).toHaveStepUnits(...)`
|
|
279
|
+
GeoSpecStepUnitsExpectation: {
|
|
280
|
+
unit: string
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Product-structure expectation accepted by `expectGeo(...).toHaveProductStructure(...)`
|
|
284
|
+
GeoSpecProductStructureExpectation: {
|
|
285
|
+
names?: string[]
|
|
286
|
+
count?: GeoSpecNumericExpectation
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Planar-face expectation accepted by `expectGeo(...).toHavePlanarFace(...)`
|
|
290
|
+
GeoSpecPlanarFaceExpectation: {
|
|
291
|
+
normal: GeoSpecPointExpectation
|
|
292
|
+
offset: number
|
|
293
|
+
area?: GeoSpecNumericExpectation
|
|
294
|
+
tolerance?: number
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Cylindrical-face expectation accepted by `expectGeo(...).toHaveCylindricalFace(...)`
|
|
298
|
+
GeoSpecCylindricalFaceExpectation: {
|
|
299
|
+
radius: number
|
|
300
|
+
axis: 'x' | 'y' | 'z'
|
|
301
|
+
tolerance?: number
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Circular-hole expectation accepted by `expectGeo(...).toHaveCircularHole(...)`
|
|
305
|
+
GeoSpecCircularHoleExpectation: {
|
|
306
|
+
diameter: number
|
|
307
|
+
through?: boolean
|
|
308
|
+
axis?: 'x' | 'y' | 'z'
|
|
309
|
+
center?: GeoSpecPointExpectation
|
|
310
|
+
tolerance?: number
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Circular-hole-pattern expectation accepted by `expectGeo(...).toHaveCircularHolePattern(...)`
|
|
314
|
+
GeoSpecCircularHolePatternExpectation: {
|
|
315
|
+
count: number
|
|
316
|
+
holeDiameter: number
|
|
317
|
+
boltCircleDiameter?: number
|
|
318
|
+
axis?: 'x' | 'y' | 'z'
|
|
319
|
+
center?: GeoSpecPointExpectation
|
|
320
|
+
tolerance?: number
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Chamfer-feature expectation accepted by `expectGeo(...).toHaveChamferFeature(...)`
|
|
324
|
+
GeoSpecChamferFeatureExpectation: {
|
|
325
|
+
distance: number
|
|
326
|
+
selection?: string
|
|
327
|
+
tolerance?: number
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Fillet-feature expectation accepted by `expectGeo(...).toHaveFilletFeature(...)`
|
|
331
|
+
GeoSpecFilletFeatureExpectation: {
|
|
332
|
+
radius: number
|
|
333
|
+
selection?: string
|
|
334
|
+
tolerance?: number
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Minimum-wall-thickness expectation accepted by `expectGeo(...).toHaveMinimumWallThickness(...)`
|
|
338
|
+
GeoSpecMinimumWallThicknessExpectation: {
|
|
339
|
+
value: GeoSpecNumericExpectation
|
|
340
|
+
tolerance?: number
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Void-continuity expectation accepted by `expectGeo(...).toHaveVoidContinuity(...)`
|
|
344
|
+
GeoSpecVoidContinuityExpectation: {
|
|
345
|
+
// Ordered waypoints (>= 1) known to lie in the void being proven
|
|
346
|
+
path: GeoSpecVoidWaypoint[]
|
|
347
|
+
// Occurrence names whose solids bound the void
|
|
348
|
+
material?: string[]
|
|
349
|
+
// Minimum required bottleneck cross-section (mm²), sampled
|
|
350
|
+
minCrossSection?: number
|
|
351
|
+
// Points that must NOT be reachable from the path void (isolation claim)
|
|
352
|
+
isolatedFrom?: Vec3[]
|
|
353
|
+
// Region bounded for the proof (subject frame)
|
|
354
|
+
bounds?: {
|
|
355
|
+
min: Vec3;
|
|
356
|
+
max: Vec3;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Axis-keyed numeric expectation used by high-level geometry matchers
|
|
361
|
+
GeoSpecAxisExpectation: {
|
|
362
|
+
x?: number
|
|
363
|
+
y?: number
|
|
364
|
+
z?: number
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// Shared scalar expectation used by geometry measurements
|
|
368
|
+
GeoSpecNumericExpectation: number | {
|
|
369
|
+
value?: number;
|
|
370
|
+
greaterThan?: number;
|
|
371
|
+
greaterThanOrEqual?: number;
|
|
372
|
+
lessThan?: number;
|
|
373
|
+
lessThanOrEqual?: number;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// A pair-specific component-interference check accepted by `expectGeo(...).toHaveNoComponentInterference(...)`
|
|
377
|
+
GeoSpecComponentInterferencePairExpectation: {
|
|
378
|
+
left: GeoSpecComponentSelector
|
|
379
|
+
right: GeoSpecComponentSelector
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Intentional component interference allowance accepted by `expectGeo(...).toHaveNoComponentInterference(...)`
|
|
383
|
+
GeoSpecComponentInterferenceAllowance: {
|
|
384
|
+
kind?: 'intentionalInterference'
|
|
385
|
+
left: GeoSpecComponentSelector
|
|
386
|
+
right: GeoSpecComponentSelector
|
|
387
|
+
maxVolume?: number
|
|
388
|
+
reason: string
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// Assembly occurrence rule accepted by `expectGeo(...).toHaveAssemblyOccurrences(...)`
|
|
392
|
+
GeoSpecAssemblyOccurrenceExpectation: {
|
|
393
|
+
name: GeoSpecComponentSelector
|
|
394
|
+
count?: GeoSpecNumericExpectation
|
|
395
|
+
bounds?: {
|
|
396
|
+
within?: GeoSpecComponentSelector;
|
|
397
|
+
min?: Vec3 | GeoSpecAxisExpectation;
|
|
398
|
+
max?: Vec3 | GeoSpecAxisExpectation;
|
|
399
|
+
center?: GeoSpecPointExpectation;
|
|
400
|
+
tolerance?: number;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// One spatial relationship accepted by `expectGeo(...).toHaveSpatialRelationships(...)`
|
|
405
|
+
GeoSpecSpatialRelationshipExpectation: {
|
|
406
|
+
id?: string
|
|
407
|
+
kind: 'contact' | 'clearance' | 'coaxial' | 'concentric' | 'coplanar' | 'parallel' | 'perpendicular' | 'angle' | 'containment' | 'insertion' | 'interference'
|
|
408
|
+
subject: GeoSpecGeometrySelector
|
|
409
|
+
target: GeoSpecGeometrySelector
|
|
410
|
+
tolerance?: number
|
|
411
|
+
angularToleranceDegrees?: number
|
|
412
|
+
// Expected angle in degrees for `kind
|
|
413
|
+
angleDegrees?: number
|
|
414
|
+
// Declared insertion axis (subject-frame direction) for `kind
|
|
415
|
+
axis?: Vec3
|
|
416
|
+
min?: number
|
|
417
|
+
max?: number
|
|
418
|
+
minVolume?: number
|
|
419
|
+
maxVolume?: number
|
|
420
|
+
reason?: string
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Shared scalar expectation used by geometry measurements
|
|
424
|
+
GeoSpecNumericExpectation: number | {
|
|
425
|
+
value?: number;
|
|
426
|
+
greaterThan?: number;
|
|
427
|
+
greaterThanOrEqual?: number;
|
|
428
|
+
lessThan?: number;
|
|
429
|
+
lessThanOrEqual?: number;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Diagnostic emitted by GeoSpec loaders, analyzers, and matchers
|
|
433
|
+
GeometryDiagnostic: {
|
|
434
|
+
code: KernelIssueCode | (string & {})
|
|
435
|
+
severity: 'error' | 'warning' | 'info'
|
|
436
|
+
message: string
|
|
437
|
+
suggestion?: string
|
|
438
|
+
spatial?: {
|
|
439
|
+
min?: Vec3;
|
|
440
|
+
max?: Vec3;
|
|
441
|
+
center?: Vec3;
|
|
442
|
+
}
|
|
443
|
+
details?: unknown
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Shared scalar expectation used by geometry measurements
|
|
447
|
+
GeoSpecNumericExpectation: number | {
|
|
448
|
+
value?: number;
|
|
449
|
+
greaterThan?: number;
|
|
450
|
+
greaterThanOrEqual?: number;
|
|
451
|
+
lessThan?: number;
|
|
452
|
+
lessThanOrEqual?: number;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// Shared scalar expectation used by geometry measurements
|
|
456
|
+
GeoSpecNumericExpectation: number | {
|
|
457
|
+
value?: number;
|
|
458
|
+
greaterThan?: number;
|
|
459
|
+
greaterThanOrEqual?: number;
|
|
460
|
+
lessThan?: number;
|
|
461
|
+
lessThanOrEqual?: number;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
// Shared scalar expectation used by geometry measurements
|
|
465
|
+
GeoSpecNumericExpectation: number | {
|
|
466
|
+
value?: number;
|
|
467
|
+
greaterThan?: number;
|
|
468
|
+
greaterThanOrEqual?: number;
|
|
469
|
+
lessThan?: number;
|
|
470
|
+
lessThanOrEqual?: number;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Point expectation accepted by center and feature matchers
|
|
474
|
+
GeoSpecPointExpectation: Vec3 | GeoSpecAxisExpectation
|
|
475
|
+
|
|
476
|
+
// Shared scalar expectation used by geometry measurements
|
|
477
|
+
GeoSpecNumericExpectation: number | {
|
|
478
|
+
value?: number;
|
|
479
|
+
greaterThan?: number;
|
|
480
|
+
greaterThanOrEqual?: number;
|
|
481
|
+
lessThan?: number;
|
|
482
|
+
lessThanOrEqual?: number;
|
|
483
|
+
}
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
## API reference
|
|
487
|
+
|
|
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.
|
|
489
|
+
|
|
490
|
+
- `api-functions.md` — Functions
|
|
491
|
+
- `api-constants.md` — Constants
|
|
492
|
+
- `api-types.md` — Types
|
|
493
|
+
- `api-classes.md` — Classes
|
|
494
|
+
|
|
495
|
+
Read ranges, not whole files. Never copy a reference into a source file.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# geospec — Classes
|
|
2
|
+
|
|
3
|
+
1 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// Error thrown by {@link import ('./load-model.js').loadModel} when geometry cannot be loaded
|
|
6
|
+
GeoSpecModelLoadError: export declare class GeoSpecModelLoadError extends Error
|
|
7
|
+
|
|
8
|
+
// Structured diagnostics explaining why model loading failed
|
|
9
|
+
readonly diagnostics: readonly GeometryDiagnostic[]
|
|
10
|
+
|
|
11
|
+
// GeoSpecModelLoadError.constructor (constructor)
|
|
12
|
+
constructor(diagnostics: readonly GeometryDiagnostic[]);
|
|
13
|
+
// diagnostics: Geometry diagnostics to expose to callers
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# geospec — Constants
|
|
2
|
+
|
|
3
|
+
4 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// Every matcher name exposed by {@link expectGeo}, derived from the live matcher surface so it can never drift from the real implementation
|
|
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"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# geospec — Functions
|
|
2
|
+
|
|
3
|
+
7 top-level symbols. Signatures are verbatim typescript.
|
|
4
|
+
|
|
5
|
+
// GeoSpec suite helper used inside VM-executed test modules
|
|
6
|
+
// describe (function)
|
|
7
|
+
export declare function describe(name: string, function_: GeoSpecTestCallback): void;
|
|
8
|
+
|
|
9
|
+
// describe.skip (method)
|
|
10
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
11
|
+
|
|
12
|
+
// Start a geometry assertion chain
|
|
13
|
+
// expectGeo (function)
|
|
14
|
+
export declare function expectGeo(subject: GeoSpecSubject, options?: GeoSpecExpectOptions): GeoSpecMatcher;
|
|
15
|
+
// subject: geometry subject under test
|
|
16
|
+
// options: Optional chain options, such as a larger `workUnitLimit` for a claim that refused with `MATCHER_TIMEOUT`
|
|
17
|
+
|
|
18
|
+
// GeoSpec test helper used inside VM-executed test modules
|
|
19
|
+
// it (function)
|
|
20
|
+
export declare function it(name: string, function_: GeoSpecTestCallback): void;
|
|
21
|
+
|
|
22
|
+
// it.skip (method)
|
|
23
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
24
|
+
|
|
25
|
+
// Alias for {@link it}
|
|
26
|
+
// test (function)
|
|
27
|
+
export declare function test(name: string, function_: GeoSpecTestCallback): void;
|
|
28
|
+
|
|
29
|
+
// test.skip (method)
|
|
30
|
+
skip(name: string, function_?: GeoSpecTestCallback): void;
|
|
31
|
+
|
|
32
|
+
// Create a {@link loadModel} function over a host-supplied compiled engine
|
|
33
|
+
// createModelLoader (function)
|
|
34
|
+
export declare function createModelLoader(defaults: CreateModelLoaderOptions): ManagedGeoSpecModelLoader;
|
|
35
|
+
// defaults: The compiled engine plus model loading defaults
|
|
36
|
+
|
|
37
|
+
// Load a CAD model into GeoSpec evidence
|
|
38
|
+
// Remarks: This is the authoring declaration: a GeoSpec runner replaces it with the host's native model loader. Called outside a runner it always throws.
|
|
39
|
+
// Throws: {@link GeoSpecModelLoadError} with `GEOSPEC_MODEL_LOADER_UNAVAILABLE` when no runner is active.
|
|
40
|
+
// loadModel (function)
|
|
41
|
+
export declare function loadModel<Code extends Record<string, string> = Record<string, string>>(_options: LoadModelOptions<Code>): Promise<GeoSpecSubject>;
|
|
42
|
+
// _options: Source, code, or file model load options
|
|
43
|
+
|
|
44
|
+
// resolveRuntimeExportIntent (function)
|
|
45
|
+
export declare function resolveRuntimeExportIntent(options: {
|
|
46
|
+
runtime: GeoSpecRuntimeClient;
|
|
47
|
+
format: RuntimeBackedModelFormat;
|
|
48
|
+
meshLinearTolerance?: number;
|
|
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;
|
|
57
|
+
}): RuntimeExportIntent | RuntimeExportIntentFailure;
|