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,219 +1,6 @@
1
1
  # geospec — Types (3)
2
2
 
3
- 31 top-level symbols. Signatures are verbatim typescript.
4
-
5
- // One positive-only ancillary query
6
- // 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`.
7
- GeoSpecQueryOptions: {
8
- readonly capability: GeoSpecQueryCapability;
9
- readonly claimId?: string;
10
- readonly payload?: unknown;
11
- readonly subject: GeoSpecNativeSubject;
12
- }
13
-
14
- readonly capability: GeoSpecQueryCapability
15
-
16
- readonly claimId?: string
17
-
18
- readonly payload?: unknown
19
-
20
- readonly subject: GeoSpecNativeSubject
21
-
22
- // Complete native minimum and ordered finite witnesses in canonical millimetres/Z-up
23
- MinimumDistanceFact: {
24
- readonly source: 'ap242';
25
- readonly assurance: 'exact-brep';
26
- readonly unit: 'mm';
27
- readonly coordinateSystem: 'z-up';
28
- readonly subjectHash: string;
29
- readonly algorithmProfile: 'geospec-minimum-distance-v1';
30
- readonly occurrences: readonly [string, string];
31
- readonly distance: number;
32
- readonly points: readonly [readonly [number, number, number], readonly [number, number, number]];
33
- }
34
-
35
- readonly source: 'ap242'
36
-
37
- readonly assurance: 'exact-brep'
38
-
39
- readonly unit: 'mm'
40
-
41
- readonly coordinateSystem: 'z-up'
42
-
43
- readonly subjectHash: string
44
-
45
- readonly algorithmProfile: 'geospec-minimum-distance-v1'
46
-
47
- readonly occurrences: readonly [string, string]
48
-
49
- readonly distance: number
50
-
51
- readonly points: readonly [readonly [number, number, number], readonly [number, number, number]]
52
-
53
- // Complete AP242 minimum over two subject-bound occurrence paths
54
- MinimumDistanceQuery: {
55
- readonly capability: 'minimumDistance';
56
- readonly subject: GeoSpecNativeSubject;
57
- readonly payload: {
58
- readonly pair: readonly [{
59
- readonly occurrencePath: string;
60
- }, {
61
- readonly occurrencePath: string;
62
- }];
63
- };
64
- }
65
-
66
- readonly capability: 'minimumDistance'
67
-
68
- readonly subject: GeoSpecNativeSubject
69
-
70
- readonly payload: {
71
- readonly pair: readonly [{
72
- readonly occurrencePath: string;
73
- }, {
74
- readonly occurrencePath: string;
75
- }];
76
- }
77
-
78
- // Geometry refusal and infrastructure interruption never masquerade as facts
79
- MinimumDistanceResult: {
80
- readonly status: 'complete';
81
- readonly fact: MinimumDistanceFact;
82
- } | {
83
- readonly status: 'refused';
84
- readonly code: 'unsupported-evidence' | 'invalid-selection' | 'work-limit' | 'analysis-limit' | 'resource-limit';
85
- readonly message: string;
86
- } | {
87
- readonly status: 'interrupted';
88
- readonly code: 'cancelled' | 'executor-exited' | 'deadline' | 'engine-error';
89
- readonly message: string;
90
- }
91
-
92
- readonly status: 'complete'
93
-
94
- // Flat native query transport options
95
- GeoSpecNativeQueryOptions: Omit<GeoSpecNativeClaimOptions, 'arguments' | 'capability' | 'kind' | 'polarity'> & {
96
- readonly capability: GeoSpecQueryCapability | 'minimumDistance';
97
- readonly payload?: unknown;
98
- }
99
-
100
- readonly engine: GeoSpecNativeEngine
101
-
102
- readonly claimId: string
103
-
104
- readonly evidenceProfile?: GeoSpecNativeEvidenceProfile
105
-
106
- readonly subjectSlot: string
107
-
108
- readonly workUnitLimit: number
109
-
110
- // The host's largest authored budget, reported as `details.maximumLimit` on `MATCHER_TIMEOUT`
111
- readonly maximumWorkUnitLimit?: number
112
-
113
- readonly subject: GeoSpecNativeSubject
114
-
115
- readonly capability: GeoSpecQueryCapability | 'minimumDistance'
116
-
117
- readonly payload?: unknown
118
-
119
- // Existing positive-only ancillary operations owned by the native core
120
- GeoSpecQueryCapability: Exclude<(typeof geoSpecQueryCapabilities)[number], 'minimumDistance'>
121
-
122
- // Explicit support state for one source-attributed inventory field
123
- GeoSpecPmiField: {
124
- readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
125
- readonly value: Value | null;
126
- readonly reason: string | null;
127
- }
128
-
129
- readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported'
130
-
131
- readonly value: Value | null
132
-
133
- readonly reason: string | null
134
-
135
- // Original Part21 entity ID and exact source argument tokens
136
- GeoSpecPmiRawEntity: {
137
- readonly sourceId: number;
138
- readonly kind: string;
139
- readonly arguments: readonly string[];
140
- }
141
-
142
- readonly sourceId: number
143
-
144
- readonly kind: string
145
-
146
- readonly arguments: readonly string[]
147
-
148
- // Source-authored scalar and Rust-normalized reduced rational millimetres
149
- GeoSpecPmiNumber: {
150
- readonly sourceId: number;
151
- readonly authoredText: string;
152
- readonly unitId: number;
153
- readonly unitRecords: readonly GeoSpecPmiRawEntity[];
154
- readonly millimetres: string;
155
- readonly name: string;
156
- }
157
-
158
- readonly sourceId: number
159
-
160
- readonly authoredText: string
161
-
162
- readonly unitId: number
163
-
164
- readonly unitRecords: readonly GeoSpecPmiRawEntity[]
165
-
166
- readonly millimetres: string
167
-
168
- readonly name: string
169
-
170
- // A uniquely forward-transferred face
171
- GeoSpecPmiFaceAssociation: {
172
- readonly sourceFaceId: number;
173
- readonly occurrenceRoute: readonly number[];
174
- readonly occurrence: number | null;
175
- readonly publicFaceOrdinal: number;
176
- }
177
-
178
- readonly sourceFaceId: number
179
-
180
- readonly occurrenceRoute: readonly number[]
181
-
182
- readonly occurrence: number | null
183
-
184
- readonly publicFaceOrdinal: number
185
-
186
- // One ordered role reference, including incomplete source/transfer evidence
187
- GeoSpecPmiShapeReference: {
188
- readonly sourceAspectId: number | null;
189
- readonly sourceUsageIds: readonly number[];
190
- readonly sourceItemIds: readonly number[];
191
- readonly requestedRoute: GeoSpecPmiField<readonly number[]>;
192
- readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>;
193
- }
194
-
195
- readonly sourceAspectId: number | null
196
-
197
- readonly sourceUsageIds: readonly number[]
198
-
199
- readonly sourceItemIds: readonly number[]
200
-
201
- readonly requestedRoute: GeoSpecPmiField<readonly number[]>
202
-
203
- readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>
204
-
205
- // Normalized authored limits
206
- GeoSpecPmiLimits: {
207
- readonly lowerMillimetres: string;
208
- readonly upperMillimetres: string;
209
- readonly basis: 'authored-limits' | 'nominal-plus-minus';
210
- }
211
-
212
- readonly lowerMillimetres: string
213
-
214
- readonly upperMillimetres: string
215
-
216
- readonly basis: 'authored-limits' | 'nominal-plus-minus'
3
+ 21 top-level symbols. Signatures are verbatim typescript.
217
4
 
218
5
  // Source record preserving semantic/presentation separation and ordered roles
219
6
  GeoSpecPmiRecord: {
@@ -405,6 +192,8 @@ GeoSpecCliHost: {
405
192
  configPath: string | undefined;
406
193
  workers: number | undefined;
407
194
  shardTimeout: number | undefined;
195
+ /** In-memory spec sources keyed by project-rooted path, served in place of the disk (`geospec check`). */
196
+ sources?: Readonly<Record<string, string>>;
408
197
  }): GeoSpecRunner;
409
198
  }
410
199
 
@@ -437,6 +226,8 @@ GeoSpecCliHost: {
437
226
  configPath: string | undefined;
438
227
  workers: number | undefined;
439
228
  shardTimeout: number | undefined;
229
+ /** In-memory spec sources keyed by project-rooted path, served in place of the disk (`geospec check`). */
230
+ sources?: Readonly<Record<string, string>>;
440
231
  }): GeoSpecRunner;
441
232
 
442
233
  // Options for {@link createNodeGeoSpecCliHost}
@@ -448,6 +239,8 @@ NodeGeoSpecCliHostOptions: {
448
239
  * can run a project with no `geospec.config.*` (see `GeoSpecExporterModule` in `geospec/runner/node`).
449
240
  */
450
241
  readonly exporterModules?: readonly string[];
242
+ /** URL of a module each pool worker imports for its module VM (see `GeoSpecModuleVmModule` in `geospec/runner`). */
243
+ readonly moduleVmModule?: string;
451
244
  }
452
245
 
453
246
  // Report sink used by embedding hosts and tests
@@ -456,6 +249,9 @@ NodeGeoSpecCliHostOptions: {
456
249
  // URLs of modules each pool worker imports for exporters that precede the config's, so a host such as `tau test` can run a project with no `geospec.config.*` (see `GeoSpecExporterModule` in `geospec/runner/node`)
457
250
  readonly exporterModules?: readonly string[]
458
251
 
252
+ // URL of a module each pool worker imports for its module VM (see `GeoSpecModuleVmModule` in `geospec/runner`)
253
+ readonly moduleVmModule?: string
254
+
459
255
  // Installed Vitest matcher map and lifecycle settlement hook
460
256
  GeoSpecVitestAdapter: {
461
257
  readonly matchers: GeoSpecVitestMatcherMap;
@@ -467,12 +263,77 @@ GeoSpecVitestAdapter: {
467
263
  // GeoSpecVitestAdapter.flush (method)
468
264
  flush(): Promise<void>;
469
265
 
266
+ // The installed matchers plus the project's model loader
267
+ GeoSpecVitestProject: GeoSpecVitestAdapter & {
268
+ /** Load a model through the config's exporters; its subjects are released after the file. */
269
+ readonly loadModel: (options: LoadModelOptions) => Promise<GeoSpecSubject>;
270
+ /** The config file that was read, when the project has one. */
271
+ readonly configPath: string | undefined;
272
+ /** The build the created engine runs on; absent for a caller-owned engine. */
273
+ readonly binding: GeoSpecEngineBinding | undefined;
274
+ }
275
+
276
+ readonly matchers: GeoSpecVitestMatcherMap
277
+
278
+ // GeoSpecVitestProject.flush (method)
279
+ flush(): Promise<void>;
280
+
281
+ // Load a model through the config's exporters
282
+ readonly loadModel: (options: LoadModelOptions) => Promise<GeoSpecSubject>
283
+
284
+ // The config file that was read, when the project has one
285
+ readonly configPath: string | undefined
286
+
287
+ // The build the created engine runs on
288
+ readonly binding: GeoSpecEngineBinding | undefined
289
+
290
+ // Options for {@link setupGeoSpecVitestProject}
291
+ SetupGeoSpecVitestProjectOptions: Omit<GeoSpecAssertionClientOptions, 'engine' | 'maximumWorkUnitLimit'> & {
292
+ /** Absolute project root: `loadModel({ file })` resolves against it and its `geospec.config.*` is read. */
293
+ readonly projectPath: string;
294
+ /** Explicit config file, resolved relative to the project unless absolute. */
295
+ readonly configPath?: string;
296
+ /** Fields that replace the config's whole, as a CLI flag does: `exporters` and `testTimeout` apply here. */
297
+ readonly overrides?: Pick<GeoSpecConfig, 'exporters' | 'testTimeout'>;
298
+ /**
299
+ * A caller-owned engine, kept open after the file. Omitted creates this process's engine (the native addon, else
300
+ * the WASM build) and closes it after the file.
301
+ */
302
+ readonly engine?: GeoSpecNativeModelEngine;
303
+ }
304
+
305
+ readonly claimId?: (matcher: GeoSpecMatcherName, sequence: number) => string
306
+
307
+ // Success-evidence profile of every claim and query
308
+ readonly evidenceProfile?: GeoSpecNativeEvidenceProfile
309
+
310
+ readonly subjectSlot?: string
311
+
312
+ readonly workUnitLimit?: number
313
+
314
+ // Absolute project root
315
+ readonly projectPath: string
316
+
317
+ // Explicit config file, resolved relative to the project unless absolute
318
+ readonly configPath?: string
319
+
320
+ // Fields that replace the config's whole, as a CLI flag does
321
+ readonly overrides?: Pick<GeoSpecConfig, 'exporters' | 'testTimeout'>
322
+
323
+ // A caller-owned engine, kept open after the file
324
+ readonly engine?: GeoSpecNativeModelEngine
325
+
470
326
  // Options for {@link readGeoSpecConfig}
471
327
  ReadGeoSpecConfigOptions: {
472
328
  /** The project filesystem; paths are rooted, as the spec VM reads them. */
473
329
  readonly filesystem: VmFileSystem;
474
330
  /** Rooted directory holding the config, in the filesystem's spelling: `''` for its root, else `'sub/dir'`. */
475
331
  readonly projectPath: string;
332
+ /**
333
+ * Module VM factory; defaults to GeoSpec's plain VM (native esbuild on Node, refused elsewhere). A host that bundles
334
+ * in a browser injects its own; Tau injects `createEsbuildModuleVm`.
335
+ */
336
+ readonly createModuleVm?: CreateModuleVm;
476
337
  }
477
338
 
478
339
  // The project filesystem
@@ -481,6 +342,9 @@ ReadGeoSpecConfigOptions: {
481
342
  // Rooted directory holding the config, in the filesystem's spelling
482
343
  readonly projectPath: string
483
344
 
345
+ // Module VM factory
346
+ readonly createModuleVm?: CreateModuleVm
347
+
484
348
  // Outcome of {@link readGeoSpecConfig}
485
349
  ReadGeoSpecConfigResult: {
486
350
  readonly status: 'absent';
@@ -502,7 +366,7 @@ ReadGeoSpecConfigResult: {
502
366
  readonly status: 'absent'
503
367
 
504
368
  // Trusted project configuration using existing discovery and runner options
505
- // Remarks: Omitted values keep their existing owner's defaults. Defined overrides replace whole fields, including empty arrays and false. Existing discovery currently treats an absent or empty include array as its default pattern. Preserving [] here does not change that consumer behavior. This is configuration data, not a canonical engine plan or a geometry result.
369
+ // Remarks: Omitted values keep their existing owner's defaults. Defined overrides replace whole fields, including empty arrays and false. Existing discovery treats an absent or empty include array as its default pattern. Preserving [] here does not change that consumer behavior. This is configuration data, not a canonical engine plan or a geometry result.
506
370
  GeoSpecConfig: {
507
371
  include?: readonly string[];
508
372
  exclude?: readonly string[];