geospec 0.1.0-beta.9 → 0.4.1-next.331

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 (105) hide show
  1. package/README.md +34 -9
  2. package/agent/doctrine.md +2 -1
  3. package/agent/geospec-authoring/SKILL.md +3 -3
  4. package/agent/geospec-authoring/api-index.md +20 -92
  5. package/agent/geospec-authoring/api-types.md +85 -480
  6. package/agent/geospec-authoring/public-api-functions.md +21 -1
  7. package/agent/geospec-authoring/public-api-index.md +215 -319
  8. package/agent/geospec-authoring/public-api-types-2.md +480 -352
  9. package/agent/geospec-authoring/public-api-types-3.md +79 -215
  10. package/agent/geospec-authoring/public-api-types.md +334 -849
  11. package/agent/resources.js +12 -13
  12. package/agent/skills.json +2 -3
  13. package/dist/assertion-client/client.d.mts +14 -15
  14. package/dist/assertion-client/client.mjs +1 -1
  15. package/dist/cli/check.mjs +2 -0
  16. package/dist/cli/cli.d.mts +5 -5
  17. package/dist/cli/cli.mjs +20 -3
  18. package/dist/cli/node-host.d.mts +5 -4
  19. package/dist/cli/node-host.mjs +1 -1
  20. package/dist/cli/wire-value.mjs +1 -1
  21. package/dist/config/define-config.d.mts +2 -3
  22. package/dist/config/node/index.mjs +1 -1
  23. package/dist/config/node/load.d.mts +2 -3
  24. package/dist/config/node/load.mjs +1 -1
  25. package/dist/config/read-geospec-config.d.mts +10 -6
  26. package/dist/config/read-geospec-config.mjs +1 -1
  27. package/dist/config/types.d.mts +6 -7
  28. package/dist/create-geospec.d.mts +7 -6
  29. package/dist/engine/client.d.mts +15 -15
  30. package/dist/engine/client.mjs +1 -1
  31. package/dist/engine/matchers.d.mts +10 -11
  32. package/dist/engine/pmi.types.d.mts +11 -12
  33. package/dist/engine/protocol.d.mts +7 -8
  34. package/dist/engine/protocol.mjs +1 -1
  35. package/dist/geometry-unit.d.mts +2 -3
  36. package/dist/index.d.mts +2 -2
  37. package/dist/index.mjs +1 -1
  38. package/dist/mesh/index.d.mts +2 -2
  39. package/dist/mesh/types.d.mts +8 -505
  40. package/dist/model/errors.d.mts +2 -3
  41. package/dist/model/load-model.d.mts +3 -4
  42. package/dist/model/mesh-evidence-matchers.d.mts +2 -3
  43. package/dist/model/native-model-loader.d.mts +14 -17
  44. package/dist/model/native-model-loader.mjs +1 -1
  45. package/dist/model/node/command-exporter.d.mts +3 -4
  46. package/dist/model/node/command-exporter.mjs +1 -1
  47. package/dist/model/node/index.mjs +1 -1
  48. package/dist/model/region-scope.d.mts +3 -6
  49. package/dist/model/region-scope.mjs +1 -1
  50. package/dist/model/subject.d.mts +2 -5
  51. package/dist/model/subject.mjs +1 -1
  52. package/dist/model/types.d.mts +19 -20
  53. package/dist/runner/collector.d.mts +7 -8
  54. package/dist/runner/collector.mjs +3 -1
  55. package/dist/runner/discovery.d.mts +10 -11
  56. package/dist/runner/discovery.mjs +5 -1
  57. package/dist/runner/filter.d.mts +6 -7
  58. package/dist/runner/filter.mjs +3 -1
  59. package/dist/runner/index.d.mts +3 -1
  60. package/dist/runner/index.mjs +1 -1
  61. package/dist/runner/native/native-pool-grants.d.mts +2 -3
  62. package/dist/runner/native/native-serial-runner.d.mts +4 -7
  63. package/dist/runner/native/native-serial-runner.mjs +1 -1
  64. package/dist/runner/node/engine.d.mts +5 -6
  65. package/dist/runner/node/index.mjs +1 -1
  66. package/dist/runner/node/node-vm-filesystem.d.mts +4 -5
  67. package/dist/runner/node/node-vm-filesystem.mjs +1 -1
  68. package/dist/runner/node/pool-runner.d.mts +15 -6
  69. package/dist/runner/node/pool-runner.mjs +1 -1
  70. package/dist/runner/node/pool-worker-entry.d.mts +9 -6
  71. package/dist/runner/node/pool-worker-entry.mjs +1 -1
  72. package/dist/runner/pool/events.mjs +1 -1
  73. package/dist/runner/pool/pool-messages.d.mts +8 -9
  74. package/dist/runner/pool/pool.d.mts +4 -6
  75. package/dist/runner/pool/pool.mjs +1 -1
  76. package/dist/runner/pool/shard-timings.d.mts +3 -4
  77. package/dist/runner/pool/worker-host.d.mts +6 -5
  78. package/dist/runner/pool/worker-host.mjs +1 -1
  79. package/dist/runner/run-geospec-module.d.mts +2 -3
  80. package/dist/runner/run-geospec-module.mjs +2 -2
  81. package/dist/runner/timeout-codes.d.mts +6 -8
  82. package/dist/runner/types.d.mts +56 -53
  83. package/dist/runner/worker/no-matching-tests-issue.d.mts +3 -4
  84. package/dist/runner/worker/runner-types.d.mts +17 -16
  85. package/dist/runner/worker/serial-runner.mjs +1 -1
  86. package/dist/selector/types.d.mts +22 -23
  87. package/dist/step/types.d.mts +4 -119
  88. package/dist/support/filesystem-errors.mjs +1 -0
  89. package/dist/support/hash.mjs +1 -0
  90. package/dist/support/path.mjs +1 -0
  91. package/dist/support/sha256.mjs +1 -0
  92. package/dist/support/types.d.mts +38 -0
  93. package/dist/vitest/adapter.d.mts +5 -6
  94. package/dist/vitest/adapter.mjs +1 -1
  95. package/dist/vitest/index.d.mts +0 -1
  96. package/dist/vitest/index.mjs +1 -1
  97. package/dist/vitest/node/index.d.mts +2 -0
  98. package/dist/vitest/node/index.mjs +1 -0
  99. package/dist/vitest/node/setup-project.d.mts +60 -0
  100. package/dist/vitest/node/setup-project.mjs +1 -0
  101. package/dist/vm/plain-module-vm.d.mts +13 -0
  102. package/dist/vm/plain-module-vm.mjs +8 -0
  103. package/dist/vm/types.d.mts +142 -0
  104. package/package.json +17 -9
  105. package/agent/geospec-authoring/api-types-2.md +0 -85
@@ -1,333 +1,6 @@
1
1
  # geospec — Types (2)
2
2
 
3
- 57 top-level symbols. Signatures are verbatim typescript.
4
-
5
- // Inline code-CAD model load options
6
- LoadModelCodeOptions: {
7
- /** Source files keyed by project-relative path. */
8
- code: Code;
9
- /** Entry path to render from {@link code}. */
10
- file: keyof Code & string;
11
- /** Not accepted: inline code has no project folder to resolve in, and a load naming one is refused. */
12
- rootDir?: never;
13
- /** Geometry format to export. Defaults to `glb`. */
14
- format?: GeoSpecModelFormat;
15
- /** Explicit parameters passed to the exporter. */
16
- parameters?: Record<string, unknown>;
17
- /** Absolute project root passed to the exporter. */
18
- projectPath?: string;
19
- /** STEP reader strategy used for STEP exports. */
20
- stepStreaming?: StepStreamingMode;
21
- /** Whether STEP loading should also produce mesh evidence. Defaults to true. */
22
- mesh?: boolean;
23
- /** Linear tolerance used while meshing exact BRep evidence. */
24
- meshLinearTolerance?: number;
25
- /** Angular tolerance in degrees used while meshing exact BRep evidence. */
26
- meshAngularToleranceDegrees?: number;
27
- /**
28
- * Default work-unit budget for every claim on this subject: a positive integer no greater than
29
- * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
30
- * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
31
- */
32
- workUnitLimit?: number;
33
- /**
34
- * Axis-aligned millimetre box the exporter crops the model to before export, so a large mesh model
35
- * can be checked region by region. Only an exporter that declares `region` honours it; any other
36
- * exporter, or a crop the exporter cannot make, refuses with a typed diagnostic instead of loading
37
- * the whole model. The cropped subject is a different subject: its load evidence records `region`,
38
- * so a claim on it never stands for the whole model.
39
- */
40
- region?: GeoSpecLoadRegion;
41
- }
42
-
43
- // Source files keyed by project-relative path
44
- code: Code
45
-
46
- // Entry path to render from {@link code }
47
- file: keyof Code & string
48
-
49
- // Not accepted
50
- rootDir?: never
51
-
52
- // Geometry format to export
53
- format?: GeoSpecModelFormat
54
-
55
- // Explicit parameters passed to the exporter
56
- parameters?: Record<string, unknown>
57
-
58
- // Absolute project root passed to the exporter
59
- projectPath?: string
60
-
61
- // STEP reader strategy used for STEP exports
62
- stepStreaming?: StepStreamingMode
63
-
64
- // Whether STEP loading should also produce mesh evidence
65
- mesh?: boolean
66
-
67
- // Linear tolerance used while meshing exact BRep evidence
68
- meshLinearTolerance?: number
69
-
70
- // Angular tolerance in degrees used while meshing exact BRep evidence
71
- meshAngularToleranceDegrees?: number
72
-
73
- // Default work-unit budget for every claim on this subject
74
- workUnitLimit?: number
75
-
76
- // Axis-aligned millimetre box the exporter crops the model to before export, so a large mesh model can be checked region by region
77
- region?: GeoSpecLoadRegion
78
-
79
- // Filesystem-backed model load options
80
- LoadModelFileOptions: {
81
- /**
82
- * Model file to render, as a path from the project root: the same root every tool's `targetFile` resolves
83
- * against, which the result names as `projectRoot` where the host reports it, as `tau mcp` does.
84
- */
85
- file: string;
86
- /**
87
- * Project-relative folder `file` resolves in, for a suite that loads from somewhere other than the project root:
88
- * `loadModel({ file: 'main.ts', rootDir: 'parts/gear' })` loads `parts/gear/main.ts`. Recorded in the load
89
- * evidence.
90
- */
91
- rootDir?: string;
92
- /** Absolute project root passed to the exporter. */
93
- projectPath?: string;
94
- /** Geometry format to export. Defaults to `glb`. */
95
- format?: GeoSpecModelFormat;
96
- /** Explicit parameters passed to the exporter. */
97
- parameters?: Record<string, unknown>;
98
- /** STEP reader strategy used for STEP exports. */
99
- stepStreaming?: StepStreamingMode;
100
- /** Whether STEP loading should also produce mesh evidence. Defaults to true. */
101
- mesh?: boolean;
102
- /** Linear tolerance used while meshing exact BRep evidence. */
103
- meshLinearTolerance?: number;
104
- /** Angular tolerance in degrees used while meshing exact BRep evidence. */
105
- meshAngularToleranceDegrees?: number;
106
- /**
107
- * Default work-unit budget for every claim on this subject: a positive integer no greater than
108
- * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
109
- * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
110
- */
111
- workUnitLimit?: number;
112
- /**
113
- * Axis-aligned millimetre box the exporter crops the model to before export, so a large mesh model
114
- * can be checked region by region. Only an exporter that declares `region` honours it; any other
115
- * exporter, or a crop the exporter cannot make, refuses with a typed diagnostic instead of loading
116
- * the whole model. The cropped subject is a different subject: its load evidence records `region`,
117
- * so a claim on it never stands for the whole model.
118
- */
119
- region?: GeoSpecLoadRegion;
120
- }
121
-
122
- // Model file to render, as a path from the project root
123
- file: string
124
-
125
- // Project-relative folder `file` resolves in, for a suite that loads from somewhere other than the project root
126
- rootDir?: string
127
-
128
- // Absolute project root passed to the exporter
129
- projectPath?: string
130
-
131
- // Geometry format to export
132
- format?: GeoSpecModelFormat
133
-
134
- // Explicit parameters passed to the exporter
135
- parameters?: Record<string, unknown>
136
-
137
- // STEP reader strategy used for STEP exports
138
- stepStreaming?: StepStreamingMode
139
-
140
- // Whether STEP loading should also produce mesh evidence
141
- mesh?: boolean
142
-
143
- // Linear tolerance used while meshing exact BRep evidence
144
- meshLinearTolerance?: number
145
-
146
- // Angular tolerance in degrees used while meshing exact BRep evidence
147
- meshAngularToleranceDegrees?: number
148
-
149
- // Default work-unit budget for every claim on this subject
150
- workUnitLimit?: number
151
-
152
- // Axis-aligned millimetre box the exporter crops the model to before export, so a large mesh model can be checked region by region
153
- region?: GeoSpecLoadRegion
154
-
155
- // Options accepted by {@link import ('./load-model.js').loadModel}
156
- LoadModelOptions: LoadModelSourceOptions | LoadModelCodeOptions<Code> | LoadModelFileOptions
157
-
158
- // Project-relative folder `file` resolves in, for a suite that loads from somewhere other than the project root
159
- rootDir?: string
160
-
161
- // Geometry format to export
162
- format?: GeoSpecModelFormat
163
-
164
- // Explicit parameters passed to the exporter
165
- parameters?: Record<string, unknown>
166
-
167
- // STEP reader strategy used for STEP exports
168
- stepStreaming?: StepStreamingMode
169
-
170
- // Whether STEP loading should also produce mesh evidence
171
- mesh?: boolean
172
-
173
- // Linear tolerance used while meshing exact BRep evidence
174
- meshLinearTolerance?: number
175
-
176
- // Angular tolerance in degrees used while meshing exact BRep evidence
177
- meshAngularToleranceDegrees?: number
178
-
179
- // Default work-unit budget for every claim on this subject
180
- workUnitLimit?: number
181
-
182
- // Direct geometry-source model load options
183
- LoadModelSourceOptions: {
184
- /** Geometry bytes, path, browser file/blob, or in-memory mesh buffer. */
185
- source: MeshSource | StepSource;
186
- /** Named external resources consumed alongside the direct geometry bytes. */
187
- resources?: ReadonlyArray<{
188
- readonly name: string;
189
- readonly source: MeshSource | StepSource;
190
- }>;
191
- /**
192
- * Project-relative folder a path `source` and each resource path resolve in. Omitted, they resolve against the
193
- * project root. Recorded in the load evidence.
194
- */
195
- rootDir?: string;
196
- /** Source geometry format. Defaults to `glb`. */
197
- format?: GeoSpecModelFormat;
198
- /** Source path recorded in provenance. */
199
- path?: string;
200
- /** Human-readable source name recorded in provenance. */
201
- name?: string;
202
- /** Coordinate unit of raw GLB/glTF or mesh-buffer data before canonical millimetre normalization. */
203
- sourceUnit?: GeoSpecUnit;
204
- /** Explicit parameters recorded in provenance. */
205
- parameters?: Record<string, unknown>;
206
- /** STEP reader strategy used for STEP sources. */
207
- stepStreaming?: StepStreamingMode;
208
- /** Whether STEP loading should also produce mesh evidence. Defaults to true. */
209
- mesh?: boolean;
210
- /** Linear tolerance used while meshing exact BRep evidence. */
211
- meshLinearTolerance?: number;
212
- /** Angular tolerance in degrees used while meshing exact BRep evidence. */
213
- meshAngularToleranceDegrees?: number;
214
- /**
215
- * Default work-unit budget for every claim on this subject: a positive integer no greater than
216
- * the host's maximum (default `geoSpecMaximumWorkUnitLimit`, 512 000 000). `expectGeo(subject, { workUnitLimit })` overrides
217
- * it per chain. Recorded in the load evidence; it never changes the exported or admitted bytes.
218
- */
219
- workUnitLimit?: number;
220
- }
221
-
222
- // Geometry bytes, path, browser file/blob, or in-memory mesh buffer
223
- source: MeshSource | StepSource
224
-
225
- // Named external resources consumed alongside the direct geometry bytes
226
- resources?: ReadonlyArray<{
227
- readonly name: string;
228
- readonly source: MeshSource | StepSource;
229
- }>
230
-
231
- // Project-relative folder a path `source` and each resource path resolve in
232
- rootDir?: string
233
-
234
- // Source geometry format
235
- format?: GeoSpecModelFormat
236
-
237
- // Source path recorded in provenance
238
- path?: string
239
-
240
- // Human-readable source name recorded in provenance
241
- name?: string
242
-
243
- // Coordinate unit of raw GLB/glTF or mesh-buffer data before canonical millimetre normalization
244
- sourceUnit?: GeoSpecUnit
245
-
246
- // Explicit parameters recorded in provenance
247
- parameters?: Record<string, unknown>
248
-
249
- // STEP reader strategy used for STEP sources
250
- stepStreaming?: StepStreamingMode
251
-
252
- // Whether STEP loading should also produce mesh evidence
253
- mesh?: boolean
254
-
255
- // Linear tolerance used while meshing exact BRep evidence
256
- meshLinearTolerance?: number
257
-
258
- // Angular tolerance in degrees used while meshing exact BRep evidence
259
- meshAngularToleranceDegrees?: number
260
-
261
- // Default work-unit budget for every claim on this subject
262
- workUnitLimit?: number
263
-
264
- // Options for {@link commandExporter}
265
- CommandExporterOptions: {
266
- readonly id: string;
267
- /** File extensions without the dot, or `'*'`. */
268
- readonly extensions: readonly string[];
269
- /** Executable and leading arguments, such as `['python', 'export.py']`. */
270
- readonly command: readonly string[];
271
- /** What the command can do. Protocol 1 carries no inline sources, so `inlineSources` must not be set. */
272
- readonly capabilities: GeoSpecExporterCapabilities;
273
- /** Working directory of the command; defaults to the request's project root. */
274
- readonly cwd?: string;
275
- /** Extra environment variables, merged over this process's. */
276
- readonly env?: Readonly<Record<string, string>>;
277
- /** Positive milliseconds one export may run before the command is killed and the export fails. */
278
- readonly exportTimeout?: number;
279
- }
280
-
281
- readonly id: string
282
-
283
- // File extensions without the dot, or `'*'`
284
- readonly extensions: readonly string[]
285
-
286
- // Executable and leading arguments, such as `['python', 'export.py']`
287
- readonly command: readonly string[]
288
-
289
- // What the command can do
290
- readonly capabilities: GeoSpecExporterCapabilities
291
-
292
- // Working directory of the command
293
- readonly cwd?: string
294
-
295
- // Extra environment variables, merged over this process's
296
- readonly env?: Readonly<Record<string, string>>
297
-
298
- // Positive milliseconds one export may run before the command is killed and the export fails
299
- readonly exportTimeout?: number
300
-
301
- // Collects suites, tests, assertions, and async completion state for one GeoSpec module execution
302
- GeoSpecCollector: {
303
- tests: GeoSpecTestCase[];
304
- describe(name: string, function_: GeoSpecTestFunction): void;
305
- describeSkip(name: string, _function?: GeoSpecTestFunction): void;
306
- it(name: string, function_: GeoSpecTestFunction): void;
307
- itSkip(name: string, _function?: GeoSpecTestFunction): void;
308
- expectGeo(subject: unknown, options?: GeoSpecExpectOptions): GeoSpecMatcher;
309
- waitForCompletion(testTimeout?: number, testNamePattern?: GeoSpecTestNamePattern): Promise<void>;
310
- }
311
-
312
- tests: GeoSpecTestCase[]
313
-
314
- // GeoSpecCollector.describe (method)
315
- describe(name: string, function_: GeoSpecTestFunction): void;
316
-
317
- // GeoSpecCollector.describeSkip (method)
318
- describeSkip(name: string, _function?: GeoSpecTestFunction): void;
319
-
320
- // GeoSpecCollector.it (method)
321
- it(name: string, function_: GeoSpecTestFunction): void;
322
-
323
- // GeoSpecCollector.itSkip (method)
324
- itSkip(name: string, _function?: GeoSpecTestFunction): void;
325
-
326
- // GeoSpecCollector.expectGeo (method)
327
- expectGeo(subject: unknown, options?: GeoSpecExpectOptions): GeoSpecMatcher;
328
-
329
- // GeoSpecCollector.waitForCompletion (method)
330
- waitForCompletion(testTimeout?: number, testNamePattern?: GeoSpecTestNamePattern): Promise<void>;
3
+ 72 top-level symbols. Signatures are verbatim typescript.
331
4
 
332
5
  // Per-module collector configuration
333
6
  GeoSpecCollectorOptions: {
@@ -499,7 +172,7 @@ GeoSpecTestCase: {
499
172
  status: GeoSpecTestStatus;
500
173
  /** Structured diagnostics emitted by test execution. */
501
174
  diagnostics: GeometryDiagnostic[];
502
- /** Wall-clock cost of the test body plus its pending assertions, in milliseconds (R1). */
175
+ /** Wall-clock cost of the test body plus its pending assertions, in milliseconds. */
503
176
  durationMs?: number;
504
177
  }
505
178
 
@@ -521,7 +194,7 @@ GeoSpecTestCase: {
521
194
  // Structured diagnostics emitted by test execution
522
195
  diagnostics: GeometryDiagnostic[]
523
196
 
524
- // Wall-clock cost of the test body plus its pending assertions, in milliseconds (R1)
197
+ // Wall-clock cost of the test body plus its pending assertions, in milliseconds
525
198
  durationMs?: number
526
199
 
527
200
  // A selected test starting or settling inside a module run
@@ -561,10 +234,15 @@ RunGeoSpecModuleOptions: {
561
234
  }>;
562
235
  /** Additional in-memory modules made available to the VM. */
563
236
  builtinModules?: Record<string, BuiltinModule>;
237
+ /**
238
+ * Module VM factory; defaults to {@link import('../vm/plain-module-vm.js').createPlainModuleVm}, which resolves
239
+ * project files and builtins only. Inject one to resolve npm packages; Tau injects `createEsbuildModuleVm`.
240
+ */
241
+ createModuleVm?: CreateModuleVm;
564
242
  /** Successful bundle cache owned by a serial runner worker. @internal */
565
243
  bundleCache?: GeoSpecModuleBundleCache;
566
244
  /**
567
- * List-only collection pass (R3 shard splitting): execute the module to
245
+ * List-only collection pass (shard splitting): execute the module to
568
246
  * REGISTER tests, skip every body, and return all registered tests as
569
247
  * `skipped` in registration order. Used by the pool to split heavy files
570
248
  * into per-test shards.
@@ -598,12 +276,220 @@ RunGeoSpecModuleOptions: {
598
276
  // Additional in-memory modules made available to the VM
599
277
  builtinModules?: Record<string, BuiltinModule>
600
278
 
279
+ // Module VM factory
280
+ createModuleVm?: CreateModuleVm
281
+
601
282
  // Successful bundle cache owned by a serial runner worker
602
283
  bundleCache?: GeoSpecModuleBundleCache
603
284
 
604
- // List-only collection pass (R3 shard splitting)
285
+ // List-only collection pass (shard splitting)
605
286
  collectOnly?: boolean
606
287
 
288
+ // A pre-bundled module served from memory under its import specifier
289
+ BuiltinModule: {
290
+ /** ESM source of the module. */
291
+ code: string;
292
+ /** Version reported for the module. */
293
+ version: string;
294
+ /** Script global that bundles bind to this module; bound only when `registryExpression` is set. */
295
+ globalName?: string;
296
+ /** The npm package this module stands for, as a project declares it in `package.json`. */
297
+ package?: {
298
+ readonly name: string;
299
+ readonly spec: string;
300
+ };
301
+ /** JavaScript expression evaluating to the module's exports, which a bundle binds to `globalName`. */
302
+ registryExpression?: string;
303
+ }
304
+
305
+ // ESM source of the module
306
+ code: string
307
+
308
+ // Version reported for the module
309
+ version: string
310
+
311
+ // Script global that bundles bind to this module
312
+ globalName?: string
313
+
314
+ // The npm package this module stands for, as a project declares it in `package.json`
315
+ package?: {
316
+ readonly name: string;
317
+ readonly spec: string;
318
+ }
319
+
320
+ // JavaScript expression evaluating to the module's exports, which a bundle binds to `globalName`
321
+ registryExpression?: string
322
+
323
+ // Outcome of bundling an entry point
324
+ BundleResult: {
325
+ code: string;
326
+ sourceMap?: string;
327
+ issues: VmIssue[];
328
+ success: boolean;
329
+ dependencies: string[];
330
+ unresolvedPaths: string[];
331
+ }
332
+
333
+ code: string
334
+
335
+ sourceMap?: string
336
+
337
+ issues: VmIssue[]
338
+
339
+ success: boolean
340
+
341
+ dependencies: string[]
342
+
343
+ unresolvedPaths: string[]
344
+
345
+ // Create a module VM
346
+ CreateModuleVm: (options: ModuleVmOptions) => Promise<ModuleVm>
347
+
348
+ // A module a Node pool worker imports by URL for its module VM
349
+ GeoSpecModuleVmModule: {
350
+ default: CreateModuleVm;
351
+ }
352
+
353
+ default: CreateModuleVm
354
+
355
+ // The ESM module VM GeoSpec bundles and executes specs and configs with
356
+ ModuleVm: {
357
+ /** Detect bare specifiers and project dependencies without fetching anything. */
358
+ detectImports(entryPath: string, signal?: AbortSignal): Promise<{
359
+ detectedModules: string[];
360
+ dependencies: string[];
361
+ }>;
362
+ /** Bundle an ESM entry point and its transitive dependency graph. */
363
+ bundle(entryPath: string, signal?: AbortSignal): Promise<BundleResult>;
364
+ /** Execute bundled ESM code in the current JavaScript environment. */
365
+ execute<T = unknown>(code: string, signal?: AbortSignal): Promise<VmExecuteResult<T>>;
366
+ /** Register an in-memory builtin module. */
367
+ registerModule(name: string, module: BuiltinModule): void;
368
+ /** Release VM-owned resources. */
369
+ dispose(): void;
370
+ }
371
+
372
+ // Detect bare specifiers and project dependencies without fetching anything
373
+ // ModuleVm.detectImports (method)
374
+ detectImports(entryPath: string, signal?: AbortSignal): Promise<{
375
+ detectedModules: string[];
376
+ dependencies: string[];
377
+ }>;
378
+
379
+ // Bundle an ESM entry point and its transitive dependency graph
380
+ // ModuleVm.bundle (method)
381
+ bundle(entryPath: string, signal?: AbortSignal): Promise<BundleResult>;
382
+
383
+ // Execute bundled ESM code in the current JavaScript environment
384
+ // ModuleVm.execute (method)
385
+ execute<T = unknown>(code: string, signal?: AbortSignal): Promise<VmExecuteResult<T>>;
386
+
387
+ // Register an in-memory builtin module
388
+ // ModuleVm.registerModule (method)
389
+ registerModule(name: string, module: BuiltinModule): void;
390
+
391
+ // Release VM-owned resources
392
+ // ModuleVm.dispose (method)
393
+ dispose(): void;
394
+
395
+ // Options GeoSpec passes when it creates a module VM
396
+ ModuleVmOptions: {
397
+ /** Filesystem the VM reads project files from. */
398
+ filesystem: VmFileSystem;
399
+ }
400
+
401
+ // Filesystem the VM reads project files from
402
+ filesystem: VmFileSystem
403
+
404
+ // Result of executing bundled ESM code
405
+ VmExecuteResult: {
406
+ success: true;
407
+ value: T;
408
+ entryUrl?: string;
409
+ } | {
410
+ success: false;
411
+ issues: VmIssue[];
412
+ }
413
+
414
+ success: true
415
+
416
+ // Minimal filesystem contract required by the VM bundler
417
+ VmFileSystem: {
418
+ /** Return true when a path exists. */
419
+ exists(path: string): Promise<boolean>;
420
+ /** Read a file as binary bytes. */
421
+ readFile(path: string): Promise<Uint8Array<ArrayBuffer>>;
422
+ /** Read a file as UTF-8 text. */
423
+ readFile(path: string, encoding: 'utf8'): Promise<string>;
424
+ /** Write a UTF-8 text file. */
425
+ writeFile(path: string, content: string): Promise<void>;
426
+ /** Ensure a directory exists, creating parents as needed. */
427
+ ensureDir(path: string): Promise<void>;
428
+ }
429
+
430
+ // Return true when a path exists
431
+ // VmFileSystem.exists (method)
432
+ exists(path: string): Promise<boolean>;
433
+
434
+ // Read a file as binary bytes
435
+ // VmFileSystem.readFile (method)
436
+ readFile(path: string): Promise<Uint8Array<ArrayBuffer>>;
437
+ readFile(path: string, encoding: 'utf8'): Promise<string>;
438
+
439
+ // Write a UTF-8 text file
440
+ // VmFileSystem.writeFile (method)
441
+ writeFile(path: string, content: string): Promise<void>;
442
+
443
+ // Ensure a directory exists, creating parents as needed
444
+ // VmFileSystem.ensureDir (method)
445
+ ensureDir(path: string): Promise<void>;
446
+
447
+ // A diagnostic emitted while bundling or executing a VM module
448
+ VmIssue: {
449
+ /** Human-readable diagnostic message. */
450
+ message: string;
451
+ /** Stable machine-readable code. */
452
+ code: string;
453
+ /** Diagnostic category. */
454
+ type: string;
455
+ /** Diagnostic severity. */
456
+ severity: 'error' | 'warning' | 'info';
457
+ /** Optional source location. */
458
+ location?: {
459
+ fileName?: string;
460
+ startLineNumber?: number;
461
+ startColumn?: number;
462
+ endLineNumber?: number;
463
+ endColumn?: number;
464
+ };
465
+ /** Optional original error object or metadata. */
466
+ details?: unknown;
467
+ }
468
+
469
+ // Human-readable diagnostic message
470
+ message: string
471
+
472
+ // Stable machine-readable code
473
+ code: string
474
+
475
+ // Diagnostic category
476
+ type: string
477
+
478
+ // Diagnostic severity
479
+ severity: 'error' | 'warning' | 'info'
480
+
481
+ // Optional source location
482
+ location?: {
483
+ fileName?: string;
484
+ startLineNumber?: number;
485
+ startColumn?: number;
486
+ endLineNumber?: number;
487
+ endColumn?: number;
488
+ }
489
+
490
+ // Optional original error object or metadata
491
+ details?: unknown
492
+
607
493
  // Native assertion options whose engine can also admit and release subjects
608
494
  GeoSpecNativeRunnerAssertions: Omit<GeoSpecAssertionClientOptions, 'engine'> & {
609
495
  readonly engine: GeoSpecNativeModelEngine;
@@ -639,6 +525,9 @@ GeoSpecNativeRunnerOptions: Omit<GeoSpecRunnerOptions, 'nativeAssertions' | 'nat
639
525
  // Additional in-memory modules made available to the VM
640
526
  builtinModules?: RunGeoSpecModuleOptions['builtinModules']
641
527
 
528
+ // Module VM factory for every file
529
+ createModuleVm?: RunGeoSpecModuleOptions['createModuleVm']
530
+
642
531
  // Actual protocol-3 engine used by authored assertions
643
532
  readonly nativeAssertions: GeoSpecNativeRunnerAssertions
644
533
 
@@ -749,7 +638,7 @@ GeoSpecNativeModelEngine: GeoSpecNativeEngine & {
749
638
  releaseSubject(request: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
750
639
 
751
640
  // Model loader injected into native VM runs
752
- // Remarks: Direct `source` loads read their source again on every call and the engine digests those exact bytes; bytes equal to an admitted subject's reuse that subject by digest, length and descriptor, and edited bytes admit a new subject. Exported loads are coalesced per release scope (one run): a load whose file, inline code, project path, parameters, format, tolerances, region and ingest options equal an earlier successful load's reuses that admission without exporting or ingesting again. A file load is reused only while the exporter's `revision` still matches the earlier load's complete source revision; otherwise, or when every owner of the earlier admission has released it, the load exports afresh. Failures are never reused.
641
+ // Remarks: Direct `source` loads read their source again on every call and the engine digests those exact bytes; bytes equal to an admitted subject's reuse that subject by digest, length and descriptor, and edited bytes admit a new subject. Exported loads are coalesced per release scope (one run): a load whose options all equal an earlier successful load's (file, code, project path, parameters, format, tolerances, region, ingest) reuses that admission. A file load is reused only while the exporter's `revision` still matches the earlier load's complete source revision; otherwise, or when every owner of the earlier admission has released it, the load exports afresh. Failures are never reused.
753
642
  GeoSpecNativeModelLoader: <Code extends Record<string, string> = Record<string, string>>(options: GeoSpecNativeLoadModelOptions<Code>) => Promise<GeoSpecNativeModelSubject>
754
643
 
755
644
  // Subject identity returned by native STEP/GLB admission
@@ -839,6 +728,11 @@ GeoSpecNodePoolOptions: {
839
728
  * `GeoSpecExporterModule`). A host that composes its own exporters, such as `tau test`, passes them here.
840
729
  */
841
730
  exporterModules?: readonly string[];
731
+ /**
732
+ * URL of a module each worker imports whose default export creates its module VM (see `GeoSpecModuleVmModule`);
733
+ * absent for GeoSpec's plain VM. A host that resolves npm packages in specs, such as `tau test`, passes it here.
734
+ */
735
+ moduleVmModule?: string;
842
736
  /** Number of outer worker isolates; defaults to one. */
843
737
  workers?: number;
844
738
  /**
@@ -850,6 +744,11 @@ GeoSpecNodePoolOptions: {
850
744
  budget?: number;
851
745
  /** Non-verdict shard watchdog in milliseconds. */
852
746
  shardTimeout?: number;
747
+ /**
748
+ * Spec sources each worker serves from memory, keyed by project-rooted path, in place of the file on disk. A path
749
+ * here is never read from or written to the project; `geospec check` runs its bundled spec this way.
750
+ */
751
+ sources?: Readonly<Record<string, string>>;
853
752
  }
854
753
 
855
754
  // Absolute project root
@@ -861,6 +760,9 @@ GeoSpecNodePoolOptions: {
861
760
  // URLs of modules each worker imports whose default export creates exporters that precede the config's (see `GeoSpecExporterModule`)
862
761
  exporterModules?: readonly string[]
863
762
 
763
+ // URL of a module each worker imports whose default export creates its module VM (see `GeoSpecModuleVmModule`)
764
+ moduleVmModule?: string
765
+
864
766
  // Number of outer worker isolates
865
767
  workers?: number
866
768
 
@@ -870,6 +772,9 @@ GeoSpecNodePoolOptions: {
870
772
  // Non-verdict shard watchdog in milliseconds
871
773
  shardTimeout?: number
872
774
 
775
+ // Spec sources each worker serves from memory, keyed by project-rooted path, in place of the file on disk
776
+ sources?: Readonly<Record<string, string>>
777
+
873
778
  // The slice of `node:worker_threads`' `Worker` the pool drives
874
779
  // Remarks: Declared structurally so the adapter can be exercised against a stub as well as against a real thread (D-8: vitest cannot host a TypeScript worker).
875
780
  NodeWorkerLike: {
@@ -910,7 +815,7 @@ GeoSpecPoolHostMessage: {
910
815
  testNamePattern?: string;
911
816
  testTimeout?: number;
912
817
  } | {
913
- /** List-only collection pass: register tests, run no bodies (R3 splitting). */
818
+ /** List-only collection pass: register tests, run no bodies (shard splitting). */
914
819
  type: 'list-tests';
915
820
  shardId: number;
916
821
  file: string;
@@ -927,7 +832,7 @@ GeoSpecPoolShard: {
927
832
  id: number;
928
833
  /** GeoSpec file this shard executes. */
929
834
  file: string;
930
- /** Exact-test pattern for split shards (R3: `(file, testNamePattern)` work units). */
835
+ /** Exact-test pattern for split shards (`(file, testNamePattern)` work units). */
931
836
  testNamePattern?: string;
932
837
  }
933
838
 
@@ -937,7 +842,7 @@ GeoSpecPoolShard: {
937
842
  // GeoSpec file this shard executes
938
843
  file: string
939
844
 
940
- // Exact-test pattern for split shards (R3
845
+ // Exact-test pattern for split shards (`(file, testNamePattern)` work units)
941
846
  testNamePattern?: string
942
847
 
943
848
  GeoSpecPoolWorkerHandle: {
@@ -947,7 +852,7 @@ GeoSpecPoolWorkerHandle: {
947
852
  unexpected: boolean;
948
853
  message?: string;
949
854
  }) => void): void;
950
- /** Hard-stop the worker thread (R11 watchdog primitive). */
855
+ /** Hard-stop the worker thread (the watchdog primitive). */
951
856
  terminate(): Promise<void> | void;
952
857
  }
953
858
 
@@ -963,7 +868,7 @@ GeoSpecPoolWorkerHandle: {
963
868
  message?: string;
964
869
  }) => void): void;
965
870
 
966
- // Hard-stop the worker thread (R11 watchdog primitive)
871
+ // Hard-stop the worker thread (the watchdog primitive)
967
872
  // GeoSpecPoolWorkerHandle.terminate (method)
968
873
  terminate(): Promise<void> | void;
969
874
 
@@ -1080,11 +985,11 @@ GeoSpecRunnerFileResult: {
1080
985
  file: string;
1081
986
  /** Low-level module execution result for this file. */
1082
987
  result: GeoSpecRunResult;
1083
- /** Wall-clock cost of executing this file, in milliseconds (R1). */
988
+ /** Wall-clock cost of executing this file, in milliseconds. */
1084
989
  durationMs?: number;
1085
- /** First deterministic model-load cache key observed in this file (R9 affinity telemetry). */
990
+ /** First deterministic model-load cache key observed in this file (affinity telemetry). */
1086
991
  primaryLoadKey?: string;
1087
- /** Executing worker's isolate-resident memory at file completion, in bytes (R15 memory-class telemetry). */
992
+ /** Executing worker's isolate-resident memory at file completion, in bytes (memory-class telemetry). */
1088
993
  workerMemoryBytes?: number;
1089
994
  }
1090
995
 
@@ -1094,13 +999,13 @@ GeoSpecRunnerFileResult: {
1094
999
  // Low-level module execution result for this file
1095
1000
  result: GeoSpecRunResult
1096
1001
 
1097
- // Wall-clock cost of executing this file, in milliseconds (R1)
1002
+ // Wall-clock cost of executing this file, in milliseconds
1098
1003
  durationMs?: number
1099
1004
 
1100
- // First deterministic model-load cache key observed in this file (R9 affinity telemetry)
1005
+ // First deterministic model-load cache key observed in this file (affinity telemetry)
1101
1006
  primaryLoadKey?: string
1102
1007
 
1103
- // Executing worker's isolate-resident memory at file completion, in bytes (R15 memory-class telemetry)
1008
+ // Executing worker's isolate-resident memory at file completion, in bytes (memory-class telemetry)
1104
1009
  workerMemoryBytes?: number
1105
1010
 
1106
1011
  // Shared options for GeoSpec runner factories
@@ -1113,6 +1018,8 @@ GeoSpecRunnerOptions: {
1113
1018
  nativeModelLoader?: ManagedGeoSpecNativeModelLoader;
1114
1019
  /** Additional in-memory modules made available to the VM. */
1115
1020
  builtinModules?: RunGeoSpecModuleOptions['builtinModules'];
1021
+ /** Module VM factory for every file; defaults to GeoSpec's plain VM (see `RunGeoSpecModuleOptions`). */
1022
+ createModuleVm?: RunGeoSpecModuleOptions['createModuleVm'];
1116
1023
  }
1117
1024
 
1118
1025
  // Filesystem containing the project and test modules
@@ -1127,6 +1034,9 @@ GeoSpecRunnerOptions: {
1127
1034
  // Additional in-memory modules made available to the VM
1128
1035
  builtinModules?: RunGeoSpecModuleOptions['builtinModules']
1129
1036
 
1037
+ // Module VM factory for every file
1038
+ createModuleVm?: RunGeoSpecModuleOptions['createModuleVm']
1039
+
1130
1040
  // Aggregate result returned by GeoSpec worker-style runners
1131
1041
  GeoSpecRunnerResult: {
1132
1042
  /** True when no files or tests failed and at least one test was selected. */
@@ -1141,7 +1051,7 @@ GeoSpecRunnerResult: {
1141
1051
  files: GeoSpecRunnerFileResult[];
1142
1052
  /** Run-level issues such as aborts or empty filter selections. */
1143
1053
  issues?: VmIssue[];
1144
- /** Wall-clock cost of the whole run, in milliseconds (R1). */
1054
+ /** Wall-clock cost of the whole run, in milliseconds. */
1145
1055
  durationMs?: number;
1146
1056
  /** Complete requested-file accounting; discovery may remain unknown in unstarted or broken modules. */
1147
1057
  accounting?: GeoSpecRunnerAccounting;
@@ -1167,7 +1077,7 @@ GeoSpecRunnerResult: {
1167
1077
  // Run-level issues such as aborts or empty filter selections
1168
1078
  issues?: VmIssue[]
1169
1079
 
1170
- // Wall-clock cost of the whole run, in milliseconds (R1)
1080
+ // Wall-clock cost of the whole run, in milliseconds
1171
1081
  durationMs?: number
1172
1082
 
1173
1083
  // Complete requested-file accounting
@@ -1191,7 +1101,7 @@ GeoSpecRunnerRunOptions: {
1191
1101
  */
1192
1102
  workUnitLimit?: number;
1193
1103
  /**
1194
- * Stop after the first failing file (R1). Interactive fail-fast only —
1104
+ * Stop after the first failing file. Interactive fail-fast only —
1195
1105
  * never the default for reward runs, which want the complete red set.
1196
1106
  */
1197
1107
  bail?: boolean;
@@ -1209,7 +1119,7 @@ GeoSpecRunnerRunOptions: {
1209
1119
  // Engine work-unit budget for this run's claims, replacing the runner's `nativeAssertions.workUnitLimit`
1210
1120
  workUnitLimit?: number
1211
1121
 
1212
- // Stop after the first failing file (R1)
1122
+ // Stop after the first failing file
1213
1123
  bail?: boolean
1214
1124
 
1215
1125
  // Everything the pool needs that differs between Node and the browser
@@ -1224,7 +1134,7 @@ GeoSpecPoolOptions: {
1224
1134
  workers: number;
1225
1135
  /** Optional scheduling telemetry. Absent = declared order, no memory class. */
1226
1136
  timings?: ShardTimings;
1227
- /** Per-shard non-verdict watchdog, milliseconds (R11). */
1137
+ /** Per-shard non-verdict watchdog, milliseconds. */
1228
1138
  shardTimeout?: number;
1229
1139
  /** Split files whose recorded duration exceeds this. Milliseconds. */
1230
1140
  splitThreshold?: number;
@@ -1245,7 +1155,7 @@ GeoSpecPoolOptions: {
1245
1155
  // Optional scheduling telemetry
1246
1156
  timings?: ShardTimings
1247
1157
 
1248
- // Per-shard non-verdict watchdog, milliseconds (R11)
1158
+ // Per-shard non-verdict watchdog, milliseconds
1249
1159
  shardTimeout?: number
1250
1160
 
1251
1161
  // Split files whose recorded duration exceeds this
@@ -1303,11 +1213,13 @@ GeoSpecPoolWorkerHostOptions: {
1303
1213
  nativeModelLoader: ManagedGeoSpecNativeModelLoader;
1304
1214
  /** Additional in-memory modules made available to the VM. */
1305
1215
  builtinModules?: GeoSpecRunnerOptions['builtinModules'];
1216
+ /** Module VM factory for every shard; defaults to GeoSpec's plain VM. */
1217
+ createModuleVm?: GeoSpecRunnerOptions['createModuleVm'];
1306
1218
  /** Post a message to the pool host. */
1307
1219
  postMessage: (message: GeoSpecPoolWorkerMessage) => void;
1308
1220
  /** Subscribe to pool-host messages. */
1309
1221
  onHostMessage: (listener: (message: GeoSpecPoolHostMessage) => void) => void;
1310
- /** Sample this worker's resident memory in bytes (R15 telemetry); optional. */
1222
+ /** Sample this worker's resident memory in bytes, as telemetry; optional. */
1311
1223
  measureMemoryBytes?: () => number | undefined;
1312
1224
  /** Release platform resources on shutdown, after the native subjects are released. */
1313
1225
  onShutdown?: () => Promise<void> | void;
@@ -1325,13 +1237,16 @@ GeoSpecPoolWorkerHostOptions: {
1325
1237
  // Additional in-memory modules made available to the VM
1326
1238
  builtinModules?: GeoSpecRunnerOptions['builtinModules']
1327
1239
 
1240
+ // Module VM factory for every shard
1241
+ createModuleVm?: GeoSpecRunnerOptions['createModuleVm']
1242
+
1328
1243
  // Post a message to the pool host
1329
1244
  postMessage: (message: GeoSpecPoolWorkerMessage) => void
1330
1245
 
1331
1246
  // Subscribe to pool-host messages
1332
1247
  onHostMessage: (listener: (message: GeoSpecPoolHostMessage) => void) => void
1333
1248
 
1334
- // Sample this worker's resident memory in bytes (R15 telemetry)
1249
+ // Sample this worker's resident memory in bytes, as telemetry
1335
1250
  measureMemoryBytes?: () => number | undefined
1336
1251
 
1337
1252
  // Release platform resources on shutdown, after the native subjects are released
@@ -1419,3 +1334,216 @@ GeoSpecAuthoringInvocation: {
1419
1334
  GeoSpecMatcherMethods: {
1420
1335
  [Name in GeoSpecMatcherName]: (...arguments_: Parameters<GeoSpecMatcher[Name]>) => Result;
1421
1336
  }
1337
+
1338
+ // One positive-only ancillary query
1339
+ // Remarks: An explicit claimId leaves the automatic sequence unchanged. Queries return full reports without assertion errors. A query asserts nothing, so it never fails: one whose evidence is missing or cannot decide returns a refused report whose diagnostic names the reason, such as `GEOSPEC_UNSUPPORTED_EVIDENCE`.
1340
+ GeoSpecQueryOptions: {
1341
+ readonly capability: GeoSpecQueryCapability;
1342
+ readonly claimId?: string;
1343
+ readonly payload?: unknown;
1344
+ readonly subject: GeoSpecNativeSubject;
1345
+ }
1346
+
1347
+ readonly capability: GeoSpecQueryCapability
1348
+
1349
+ readonly claimId?: string
1350
+
1351
+ readonly payload?: unknown
1352
+
1353
+ readonly subject: GeoSpecNativeSubject
1354
+
1355
+ // Complete native minimum and ordered finite witnesses in canonical millimetres/Z-up
1356
+ MinimumDistanceFact: {
1357
+ readonly source: 'ap242';
1358
+ readonly assurance: 'exact-brep';
1359
+ readonly unit: 'mm';
1360
+ readonly coordinateSystem: 'z-up';
1361
+ readonly subjectHash: string;
1362
+ readonly algorithmProfile: 'geospec-minimum-distance-v1';
1363
+ readonly occurrences: readonly [string, string];
1364
+ readonly distance: number;
1365
+ readonly points: readonly [readonly [number, number, number], readonly [number, number, number]];
1366
+ }
1367
+
1368
+ readonly source: 'ap242'
1369
+
1370
+ readonly assurance: 'exact-brep'
1371
+
1372
+ readonly unit: 'mm'
1373
+
1374
+ readonly coordinateSystem: 'z-up'
1375
+
1376
+ readonly subjectHash: string
1377
+
1378
+ readonly algorithmProfile: 'geospec-minimum-distance-v1'
1379
+
1380
+ readonly occurrences: readonly [string, string]
1381
+
1382
+ readonly distance: number
1383
+
1384
+ readonly points: readonly [readonly [number, number, number], readonly [number, number, number]]
1385
+
1386
+ // Complete AP242 minimum over two subject-bound occurrence paths
1387
+ MinimumDistanceQuery: {
1388
+ readonly capability: 'minimumDistance';
1389
+ readonly subject: GeoSpecNativeSubject;
1390
+ readonly payload: {
1391
+ readonly pair: readonly [{
1392
+ readonly occurrencePath: string;
1393
+ }, {
1394
+ readonly occurrencePath: string;
1395
+ }];
1396
+ };
1397
+ }
1398
+
1399
+ readonly capability: 'minimumDistance'
1400
+
1401
+ readonly subject: GeoSpecNativeSubject
1402
+
1403
+ readonly payload: {
1404
+ readonly pair: readonly [{
1405
+ readonly occurrencePath: string;
1406
+ }, {
1407
+ readonly occurrencePath: string;
1408
+ }];
1409
+ }
1410
+
1411
+ // Geometry refusal and infrastructure interruption never masquerade as facts
1412
+ MinimumDistanceResult: {
1413
+ readonly status: 'complete';
1414
+ readonly fact: MinimumDistanceFact;
1415
+ } | {
1416
+ readonly status: 'refused';
1417
+ readonly code: 'unsupported-evidence' | 'invalid-selection' | 'work-limit' | 'analysis-limit' | 'resource-limit';
1418
+ readonly message: string;
1419
+ } | {
1420
+ readonly status: 'interrupted';
1421
+ readonly code: 'cancelled' | 'executor-exited' | 'deadline' | 'engine-error';
1422
+ readonly message: string;
1423
+ }
1424
+
1425
+ readonly status: 'complete'
1426
+
1427
+ // Flat native query transport options
1428
+ GeoSpecNativeQueryOptions: Omit<GeoSpecNativeClaimOptions, 'arguments' | 'capability' | 'kind' | 'polarity'> & {
1429
+ readonly capability: GeoSpecQueryCapability | 'minimumDistance';
1430
+ readonly payload?: unknown;
1431
+ }
1432
+
1433
+ readonly engine: GeoSpecNativeEngine
1434
+
1435
+ readonly claimId: string
1436
+
1437
+ readonly evidenceProfile?: GeoSpecNativeEvidenceProfile
1438
+
1439
+ readonly subjectSlot: string
1440
+
1441
+ readonly workUnitLimit: number
1442
+
1443
+ // The host's largest authored budget, reported as `details.maximumLimit` on `MATCHER_TIMEOUT`
1444
+ readonly maximumWorkUnitLimit?: number
1445
+
1446
+ readonly subject: GeoSpecNativeSubject
1447
+
1448
+ readonly capability: GeoSpecQueryCapability | 'minimumDistance'
1449
+
1450
+ readonly payload?: unknown
1451
+
1452
+ // Existing positive-only ancillary operations owned by the native core
1453
+ GeoSpecQueryCapability: Exclude<(typeof geoSpecQueryCapabilities)[number], 'minimumDistance'>
1454
+
1455
+ // Explicit support state for one source-attributed inventory field
1456
+ GeoSpecPmiField: {
1457
+ readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
1458
+ readonly value: Value | null;
1459
+ readonly reason: string | null;
1460
+ }
1461
+
1462
+ readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported'
1463
+
1464
+ readonly value: Value | null
1465
+
1466
+ readonly reason: string | null
1467
+
1468
+ // Original Part21 entity ID and exact source argument tokens
1469
+ GeoSpecPmiRawEntity: {
1470
+ readonly sourceId: number;
1471
+ readonly kind: string;
1472
+ readonly arguments: readonly string[];
1473
+ }
1474
+
1475
+ readonly sourceId: number
1476
+
1477
+ readonly kind: string
1478
+
1479
+ readonly arguments: readonly string[]
1480
+
1481
+ // Source-authored scalar and Rust-normalized reduced rational millimetres
1482
+ GeoSpecPmiNumber: {
1483
+ readonly sourceId: number;
1484
+ readonly authoredText: string;
1485
+ readonly unitId: number;
1486
+ readonly unitRecords: readonly GeoSpecPmiRawEntity[];
1487
+ readonly millimetres: string;
1488
+ readonly name: string;
1489
+ }
1490
+
1491
+ readonly sourceId: number
1492
+
1493
+ readonly authoredText: string
1494
+
1495
+ readonly unitId: number
1496
+
1497
+ readonly unitRecords: readonly GeoSpecPmiRawEntity[]
1498
+
1499
+ readonly millimetres: string
1500
+
1501
+ readonly name: string
1502
+
1503
+ // A uniquely forward-transferred face
1504
+ GeoSpecPmiFaceAssociation: {
1505
+ readonly sourceFaceId: number;
1506
+ readonly occurrenceRoute: readonly number[];
1507
+ readonly occurrence: number | null;
1508
+ readonly publicFaceOrdinal: number;
1509
+ }
1510
+
1511
+ readonly sourceFaceId: number
1512
+
1513
+ readonly occurrenceRoute: readonly number[]
1514
+
1515
+ readonly occurrence: number | null
1516
+
1517
+ readonly publicFaceOrdinal: number
1518
+
1519
+ // One ordered role reference, including incomplete source/transfer evidence
1520
+ GeoSpecPmiShapeReference: {
1521
+ readonly sourceAspectId: number | null;
1522
+ readonly sourceUsageIds: readonly number[];
1523
+ readonly sourceItemIds: readonly number[];
1524
+ readonly requestedRoute: GeoSpecPmiField<readonly number[]>;
1525
+ readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>;
1526
+ }
1527
+
1528
+ readonly sourceAspectId: number | null
1529
+
1530
+ readonly sourceUsageIds: readonly number[]
1531
+
1532
+ readonly sourceItemIds: readonly number[]
1533
+
1534
+ readonly requestedRoute: GeoSpecPmiField<readonly number[]>
1535
+
1536
+ readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>
1537
+
1538
+ // Normalized authored limits
1539
+ GeoSpecPmiLimits: {
1540
+ readonly lowerMillimetres: string;
1541
+ readonly upperMillimetres: string;
1542
+ readonly basis: 'authored-limits' | 'nominal-plus-minus';
1543
+ }
1544
+
1545
+ readonly lowerMillimetres: string
1546
+
1547
+ readonly upperMillimetres: string
1548
+
1549
+ readonly basis: 'authored-limits' | 'nominal-plus-minus'