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.
Files changed (100) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +244 -0
  3. package/agent/doctrine.md +55 -0
  4. package/agent/geospec-authoring/SKILL.md +495 -0
  5. package/agent/geospec-authoring/api-classes.md +13 -0
  6. package/agent/geospec-authoring/api-constants.md +16 -0
  7. package/agent/geospec-authoring/api-functions.md +57 -0
  8. package/agent/geospec-authoring/api-index.md +377 -0
  9. package/agent/geospec-authoring/api-types.md +1788 -0
  10. package/agent/geospec-authoring/public-api-classes.md +22 -0
  11. package/agent/geospec-authoring/public-api-constants.md +51 -0
  12. package/agent/geospec-authoring/public-api-functions.md +215 -0
  13. package/agent/geospec-authoring/public-api-index.md +893 -0
  14. package/agent/geospec-authoring/public-api-types-2.md +1560 -0
  15. package/agent/geospec-authoring/public-api-types-3.md +217 -0
  16. package/agent/geospec-authoring/public-api-types.md +1948 -0
  17. package/agent/resources.d.ts +19 -0
  18. package/agent/resources.js +27 -0
  19. package/agent/skills.d.cts +13 -0
  20. package/agent/skills.json +28 -0
  21. package/dist/assertion-client/client.d.mts +134 -0
  22. package/dist/assertion-client/client.mjs +2 -0
  23. package/dist/assertion-client/index.d.mts +5 -0
  24. package/dist/assertion-client/index.mjs +1 -0
  25. package/dist/config/index.d.mts +3 -0
  26. package/dist/config/index.mjs +1 -0
  27. package/dist/config/node/index.d.mts +3 -0
  28. package/dist/config/node/index.mjs +1 -0
  29. package/dist/config/node/load.d.mts +19 -0
  30. package/dist/config/node/load.mjs +1 -0
  31. package/dist/config/tau-project-artifact.d.mts +54 -0
  32. package/dist/config/tau-project-artifact.mjs +3 -0
  33. package/dist/config/types.d.mts +57 -0
  34. package/dist/config/validate.mjs +1 -0
  35. package/dist/create-geospec.d.mts +50 -0
  36. package/dist/create-geospec.mjs +1 -0
  37. package/dist/engine/client.d.mts +113 -0
  38. package/dist/engine/client.mjs +1 -0
  39. package/dist/engine/index.d.mts +3 -0
  40. package/dist/engine/index.mjs +1 -0
  41. package/dist/engine/matchers.d.mts +70 -0
  42. package/dist/engine/matchers.mjs +1 -0
  43. package/dist/engine/pmi.types.d.mts +78 -0
  44. package/dist/engine/protocol.d.mts +20 -0
  45. package/dist/engine/protocol.mjs +1 -0
  46. package/dist/geometry-unit.d.mts +12 -0
  47. package/dist/index.d.mts +6 -0
  48. package/dist/index.mjs +1 -0
  49. package/dist/mesh/index.d.mts +4 -0
  50. package/dist/mesh/index.mjs +1 -0
  51. package/dist/mesh/types.d.mts +575 -0
  52. package/dist/model/errors.d.mts +20 -0
  53. package/dist/model/errors.mjs +2 -0
  54. package/dist/model/export-intent.d.mts +79 -0
  55. package/dist/model/export-intent.mjs +1 -0
  56. package/dist/model/index.d.mts +7 -0
  57. package/dist/model/index.mjs +1 -0
  58. package/dist/model/load-model.d.mts +25 -0
  59. package/dist/model/load-model.mjs +1 -0
  60. package/dist/model/native-model-loader.d.mts +142 -0
  61. package/dist/model/native-model-loader.mjs +1 -0
  62. package/dist/model/region-scope.d.mts +23 -0
  63. package/dist/model/region-scope.mjs +1 -0
  64. package/dist/model/subject-assertions.mjs +1 -0
  65. package/dist/model/subject.d.mts +11 -0
  66. package/dist/model/subject.mjs +1 -0
  67. package/dist/model/types.d.mts +254 -0
  68. package/dist/runner/collector.d.mts +64 -0
  69. package/dist/runner/collector.mjs +2 -0
  70. package/dist/runner/discovery.d.mts +93 -0
  71. package/dist/runner/discovery.mjs +1 -0
  72. package/dist/runner/filter.d.mts +50 -0
  73. package/dist/runner/filter.mjs +1 -0
  74. package/dist/runner/index.d.mts +7 -0
  75. package/dist/runner/index.mjs +1 -0
  76. package/dist/runner/native/index.d.mts +4 -0
  77. package/dist/runner/native/index.mjs +1 -0
  78. package/dist/runner/native/native-pool-grants.d.mts +21 -0
  79. package/dist/runner/native/native-pool-grants.mjs +1 -0
  80. package/dist/runner/native/native-serial-runner.d.mts +29 -0
  81. package/dist/runner/native/native-serial-runner.mjs +1 -0
  82. package/dist/runner/pool/pool-messages.d.mts +94 -0
  83. package/dist/runner/run-geospec-module.d.mts +13 -0
  84. package/dist/runner/run-geospec-module.mjs +47 -0
  85. package/dist/runner/timeout-codes.d.mts +45 -0
  86. package/dist/runner/timeout-codes.mjs +1 -0
  87. package/dist/runner/types.d.mts +776 -0
  88. package/dist/runner/worker/index.d.mts +4 -0
  89. package/dist/runner/worker/index.mjs +1 -0
  90. package/dist/runner/worker/no-matching-tests-issue.d.mts +12 -0
  91. package/dist/runner/worker/no-matching-tests-issue.mjs +1 -0
  92. package/dist/runner/worker/runner-types.d.mts +167 -0
  93. package/dist/runner/worker/serial-runner.mjs +1 -0
  94. package/dist/selector/types.d.mts +271 -0
  95. package/dist/step/types.d.mts +134 -0
  96. package/dist/vitest/adapter.d.mts +56 -0
  97. package/dist/vitest/adapter.mjs +3 -0
  98. package/dist/vitest/index.d.mts +4 -0
  99. package/dist/vitest/index.mjs +1 -0
  100. package/package.json +114 -5
@@ -0,0 +1,22 @@
1
+ # geospec — Classes
2
+
3
+ 2 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
14
+
15
+ // Assertion error thrown by GeoSpec matchers when an expectation does not hold
16
+ // Remarks: Runner, CLI, and tool adapters unwrap this error to preserve structured diagnostics instead of collapsing them into a single string.
17
+ GeoSpecAssertionError: export declare class GeoSpecAssertionError extends Error
18
+
19
+ readonly diagnostics: readonly GeometryDiagnostic[]
20
+
21
+ // GeoSpecAssertionError.constructor (constructor)
22
+ constructor(diagnostics: readonly GeometryDiagnostic[]);
@@ -0,0 +1,51 @@
1
+ # geospec — Constants
2
+
3
+ 9 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 26-entry matcher registry
9
+ geoSpecMatcherDescriptors: Readonly<{
10
+ [Name in GeoSpecMatcherName]: Name extends GeoSpecFixedMatcherName ? GeoSpecFixedMatcherDescriptor & {
11
+ readonly kind: Name;
12
+ } : GeoSpecMatcherDescriptor;
13
+ }>
14
+
15
+ // The matchers mesh evidence answers, as the GeoSpec authoring skill lists them (`packages/geospec/agent/geospec-authoring/SKILL.md`)
16
+ geoSpecMeshEvidenceMatchers: readonly ["toHaveBoundingBox", "toHaveVolume", "toHaveSurfaceArea", "toHaveConnectedComponents", "toBeWatertight"]
17
+
18
+ // The claims a region-cropped subject answers
19
+ // Remarks: Every other kind quantifies over the whole model (component counts, all-components interference, occurrences, watertightness, integrity, topology, diagnostics) or relates parts the crop may have cut, so a crop can neither prove nor disprove it.
20
+ geoSpecRegionScopedKinds: ReadonlySet<GeoSpecAssertion['kind']>
21
+
22
+ // Diagnostic code of a whole-model claim made on a region-cropped subject
23
+ geoSpecRegionWholeModelClaimCode: "GEOSPEC_REGION_WHOLE_MODEL_CLAIM"
24
+
25
+ // Directories skipped by recursive GeoSpec discovery unless callers provide their own ignored-directory list
26
+ defaultGeoSpecIgnoredDirectories: readonly [".git", "node_modules", "dist", "coverage", ".tau/cache", ".tau/artifacts", ".tau/transcripts"]
27
+
28
+ // Default file globs used by GeoSpec test discovery
29
+ defaultGeoSpecInclude: readonly ["**/*.geospec.{ts,js}"]
30
+
31
+ // Codes for GeoSpec wall-clock timeouts, one per bound
32
+ geoSpecTimeoutCode: {
33
+ /** A test's async body outlived `testTimeout` / `--test-timeout`. */
34
+ readonly test: "GEOSPEC_TEST_TIMEOUT";
35
+ /** A pool shard outlived the non-verdict `--shard-timeout` watchdog. */
36
+ readonly shard: "GEOSPEC_SHARD_TIMEOUT";
37
+ /** A whole run outlived its host run budget. */
38
+ readonly run: "GEOSPEC_RUN_TIMEOUT";
39
+ }
40
+
41
+ // A test's async body outlived `testTimeout` / `--test-timeout`
42
+ readonly test: "GEOSPEC_TEST_TIMEOUT"
43
+
44
+ // A pool shard outlived the non-verdict `--shard-timeout` watchdog
45
+ readonly shard: "GEOSPEC_SHARD_TIMEOUT"
46
+
47
+ // A whole run outlived its host run budget
48
+ readonly run: "GEOSPEC_RUN_TIMEOUT"
49
+
50
+ // Default largest work-unit budget a spec may author through `loadModel` or `expectGeo` options
51
+ geoSpecMaximumWorkUnitLimit: 512000000
@@ -0,0 +1,215 @@
1
+ # geospec — Functions
2
+
3
+ 36 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
+ // Derive the `expected` value an assertion records from the call arguments
33
+ // normalizeGeoSpecExpected (function)
34
+ export declare function normalizeGeoSpecExpected(shape: GeoSpecMatcherExpectedShape, callArguments: readonly unknown[]): unknown;
35
+ // shape: Normalization shape from the matcher's registry entry
36
+ // callArguments: Arguments the spec author passed, in order
37
+
38
+ // Reject a non-wire value rather than letting JSON.stringify erase it
39
+ // assertGeoSpecJsonValue (function)
40
+ export declare function assertGeoSpecJsonValue(value: unknown): asserts value is JSONValue;
41
+
42
+ // Parse and validate canonical bytes without re-canonicalizing them
43
+ // decodeGeoSpecCanonicalJson (function)
44
+ export declare function decodeGeoSpecCanonicalJson(bytes: Uint8Array<ArrayBuffer>): JSONValue;
45
+
46
+ // Encode client-owned canonical claim bytes
47
+ // encodeGeoSpecCanonicalJson (function)
48
+ export declare function encodeGeoSpecCanonicalJson(value: JSONValue): Uint8Array<ArrayBuffer>;
49
+
50
+ // Runtime JSON-value guard used at every protocol trust boundary
51
+ // isGeoSpecJsonValue (function)
52
+ export declare function isGeoSpecJsonValue(value: unknown, ancestors?: Set<object>): value is JSONValue;
53
+
54
+ // Convert an authoring value to protocol JSON, including the two explicit bindings the TypeScript client needs
55
+ // toGeoSpecProtocolJson (function)
56
+ export declare function toGeoSpecProtocolJson(value: unknown, ancestors?: Set<object>): JSONValue;
57
+
58
+ // Create a {@link loadModel} function over a host-supplied compiled engine
59
+ // createModelLoader (function)
60
+ export declare function createModelLoader(defaults: CreateModelLoaderOptions): ManagedGeoSpecModelLoader;
61
+ // defaults: The compiled engine plus model loading defaults
62
+
63
+ // Load a CAD model into GeoSpec evidence
64
+ // 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.
65
+ // Throws: {@link GeoSpecModelLoadError} with `GEOSPEC_MODEL_LOADER_UNAVAILABLE` when no runner is active.
66
+ // loadModel (function)
67
+ export declare function loadModel<Code extends Record<string, string> = Record<string, string>>(_options: LoadModelOptions<Code>): Promise<GeoSpecSubject>;
68
+ // _options: Source, code, or file model load options
69
+
70
+ // resolveRuntimeExportIntent (function)
71
+ export declare function resolveRuntimeExportIntent(options: {
72
+ runtime: GeoSpecRuntimeClient;
73
+ format: RuntimeBackedModelFormat;
74
+ meshLinearTolerance?: number;
75
+ meshAngularToleranceDegrees?: number;
76
+ /**
77
+ * The kernel that evaluates this source, when the host knows it. Routes are
78
+ * then chosen among that kernel's own, so a mesh-only kernel is told its
79
+ * BRep matchers are unsupported instead of being sent to another kernel's
80
+ * STEP route.
81
+ */
82
+ kernelId?: string;
83
+ }): RuntimeExportIntent | RuntimeExportIntentFailure;
84
+
85
+ // clearCollectorGlobals (function)
86
+ export declare function clearCollectorGlobals(): void;
87
+
88
+ // Create the collector used by the embedded GeoSpec runner
89
+ // createCollector (function)
90
+ export declare function createCollector(options: GeoSpecCollectorOptions): GeoSpecCollector;
91
+ // options: The native assertion client configuration for this module
92
+
93
+ // installCollector (function)
94
+ export declare function installCollector(collector: GeoSpecCollector): void;
95
+
96
+ // Compile a Vitest-style test-name pattern once for a GeoSpec run
97
+ // Remarks: String inputs are JavaScript regular expression sources matched against the full `suite > test` name. `RegExp` inputs are used as-is.
98
+ // compileGeoSpecTestNamePattern (function)
99
+ export declare function compileGeoSpecTestNamePattern(testNamePattern: string | RegExp | undefined): {
100
+ success: true;
101
+ pattern?: GeoSpecTestNamePattern;
102
+ } | {
103
+ success: false;
104
+ issue: VmIssue;
105
+ };
106
+ // testNamePattern: Optional regex source or precompiled expression
107
+
108
+ // Filter collected GeoSpec tests by compiled test-name pattern
109
+ // filterGeoSpecTests (function)
110
+ export declare function filterGeoSpecTests(tests: readonly GeoSpecTestCase[], testNamePattern: GeoSpecTestNamePattern | undefined): GeoSpecTestCase[];
111
+ // tests: collected tests
112
+ // testNamePattern: optional compiled regex
113
+
114
+ // Return true when a collected GeoSpec test matches the supplied compiled Vitest-style test-name pattern
115
+ // matchesGeoSpecTestName (function)
116
+ export declare function matchesGeoSpecTestName(test: Pick<GeoSpecTestCase, "suite" | "name">, testNamePattern: GeoSpecTestNamePattern | undefined): boolean;
117
+ // test: collected test metadata
118
+ // testNamePattern: optional compiled regex
119
+
120
+ // Discover GeoSpec test files from exact files or directory roots
121
+ // Remarks: The returned `files` are project-relative paths suitable for `runGeoSpecModule` and runner factory APIs.
122
+ // discoverGeoSpecFiles (function)
123
+ export declare function discoverGeoSpecFiles(options: DiscoverGeoSpecFilesOptions): Promise<GeoSpecDiscoveryResult>;
124
+ // options: Discovery options containing a filesystem adapter and project roots
125
+
126
+ // Return true when a project-relative path names a GeoSpec test file
127
+ // isGeoSpecTestFile (function)
128
+ export declare function isGeoSpecTestFile(path: string): boolean;
129
+ // path: Project-relative path to inspect
130
+
131
+ // Execute an ESM GeoSpec module using the shared Tau VM substrate
132
+ // runGeoSpecModule (function)
133
+ export declare function runGeoSpecModule(options: RunGeoSpecModuleOptions): Promise<GeoSpecRunResult>;
134
+ // options: filesystem and test entry path
135
+
136
+ // Whether a diagnostic or issue code belongs to the GeoSpec timeout family
137
+ // isGeoSpecTimeoutCode (function)
138
+ export declare function isGeoSpecTimeoutCode(code: string): code is GeoSpecTimeoutCode;
139
+ // code: Any diagnostic or issue code
140
+
141
+ // Compose compiled assertion and model bindings with the SDK's serial lifecycle
142
+ // createNativeGeoSpecRunner (function)
143
+ export declare function createNativeGeoSpecRunner(options: GeoSpecNativeRunnerOptions): GeoSpecRunner;
144
+ // options: VM filesystem, native engine/client options and model defaults
145
+
146
+ // Assign a bounded CPU budget across already-selected worker isolates
147
+ // allocateNativePoolGrants (function)
148
+ export declare function allocateNativePoolGrants(options: {
149
+ workers: number;
150
+ budget?: number;
151
+ hostCap: number;
152
+ }): readonly number[];
153
+ // options: Worker count, optional total budget, and host CPU cap
154
+
155
+ // Create a native model loader that admits actual STEP/GLB bytes and retains generation-checked handles until the owning runner finishes
156
+ // createGeoSpecNativeModelLoader (function)
157
+ export declare function createGeoSpecNativeModelLoader(defaults: CreateGeoSpecNativeModelLoaderOptions): ManagedGeoSpecNativeModelLoader;
158
+ // defaults: Native engine, Runtime defaults, and optional source reader
159
+
160
+ // Create a run-level issue when filters select no tests
161
+ // createNoMatchingGeoSpecTestsIssue (function)
162
+ export declare function createNoMatchingGeoSpecTestsIssue(): VmIssue;
163
+
164
+ // Create a standalone native GeoSpec assertion client
165
+ // createGeoSpecAssertionClient (function)
166
+ export declare function createGeoSpecAssertionClient(options: GeoSpecAssertionClientOptions): GeoSpecAssertionClient;
167
+ // options: Engine, deterministic work limit and optional logical-ID controls
168
+
169
+ // Create the one registry-derived matcher surface used by every JavaScript host
170
+ // createGeoSpecMatcherMethods (function)
171
+ export declare function createGeoSpecMatcherMethods<Result>(options: {
172
+ readonly invoke: (invocation: GeoSpecAuthoringInvocation) => Result;
173
+ readonly polarity: GeoSpecClaimPolarity;
174
+ readonly subject: unknown;
175
+ }): GeoSpecMatcherMethods<Result>;
176
+ // options: Subject, polarity and host invocation function
177
+
178
+ // Submit an ancillary query with positive polarity through the native core
179
+ // Remarks: Queries return full reports even when failed or refused. Protocol errors propagate unchanged. Rust owns defaults, validation and canonical encoding.
180
+ // evaluateGeoSpecNativeQuery (function)
181
+ export declare function evaluateGeoSpecNativeQuery(options: GeoSpecNativeQueryOptions): GeoSpecCanonicalClaimReport;
182
+ // options: Query identity, subject and authored payload
183
+
184
+ // Resolve a host's largest authored work-unit budget
185
+ // Throws: TypeError when the configured maximum is not a positive safe integer.
186
+ // resolveGeoSpecMaximumWorkUnitLimit (function)
187
+ export declare function resolveGeoSpecMaximumWorkUnitLimit(maximum?: number): number;
188
+ // maximum: The host's configured maximum, when it sets one
189
+
190
+ // Create Vitest matchers over an existing runner-independent client
191
+ // createGeoSpecVitestAdapter (function)
192
+ export declare function createGeoSpecVitestAdapter(client: GeoSpecAssertionClient): GeoSpecVitestAdapter;
193
+ // client: Native GeoSpec assertion client shared with standalone use
194
+
195
+ // Register GeoSpec matchers and their settlement hook in the active Vitest file
196
+ // installGeoSpecVitest (function)
197
+ export declare function installGeoSpecVitest(client: GeoSpecAssertionClient): GeoSpecVitestAdapter;
198
+ // client: Native client shared with standalone assertion calls
199
+
200
+ // Create a native client and register it with the active Vitest file
201
+ // setupGeoSpecVitest (function)
202
+ export declare function setupGeoSpecVitest(options: GeoSpecAssertionClientOptions): GeoSpecVitestAdapter;
203
+ // options: Flat native assertion-client options
204
+
205
+ // Export one Tau project from Runtime's coherent source snapshot
206
+ // Remarks: This helper preserves finalized bytes and provenance metadata. It does not certify mathematical geometry or grant the runtime trusted-evaluator authority.
207
+ // exportTauProjectArtifact (function)
208
+ export declare function exportTauProjectArtifact(options: ExportTauProjectArtifactOptions): Promise<KernelResult<GeoSpecTauProjectArtifact>>;
209
+ // options: Descriptor, fresh-runtime factory, and optional cancellation signal
210
+
211
+ // Load one trusted project config using Node's native module loader
212
+ // Remarks: Explicit selection or exactly one geospec.config.js/.mjs/.ts/.mts is allowed. TypeScript must use erasable syntax; JSON imports use standard attributes. Executable config/imports are trusted developer code, not sandboxed code. Node's same-process module cache is unchanged: load once per run and use a fresh process when fresh executable imports are required. No reload guarantee or transitive-source identity is supplied here.
213
+ // loadGeoSpecConfig (function)
214
+ export declare function loadGeoSpecConfig(options: LoadGeoSpecConfigOptions): Promise<LoadedGeoSpecConfig>;
215
+ // options: Project, optional explicit config and defined option overrides