geospec 0.0.0 → 0.1.0-beta.2

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 (95) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +244 -0
  3. package/agent/doctrine.md +47 -0
  4. package/agent/geospec-authoring/SKILL.md +496 -0
  5. package/agent/geospec-authoring/api-classes.md +13 -0
  6. package/agent/geospec-authoring/api-constants.md +6 -0
  7. package/agent/geospec-authoring/api-functions.md +49 -0
  8. package/agent/geospec-authoring/api-index.md +362 -0
  9. package/agent/geospec-authoring/api-types.md +1700 -0
  10. package/agent/geospec-authoring/public-api-classes.md +22 -0
  11. package/agent/geospec-authoring/public-api-constants.md +19 -0
  12. package/agent/geospec-authoring/public-api-functions.md +196 -0
  13. package/agent/geospec-authoring/public-api-index.md +856 -0
  14. package/agent/geospec-authoring/public-api-types-2.md +1513 -0
  15. package/agent/geospec-authoring/public-api-types.md +2048 -0
  16. package/agent/resources.d.ts +19 -0
  17. package/agent/resources.js +26 -0
  18. package/agent/skills.d.cts +13 -0
  19. package/agent/skills.json +27 -0
  20. package/dist/assertion-client/client.d.mts +124 -0
  21. package/dist/assertion-client/client.mjs +2 -0
  22. package/dist/assertion-client/index.d.mts +5 -0
  23. package/dist/assertion-client/index.mjs +1 -0
  24. package/dist/config/index.d.mts +3 -0
  25. package/dist/config/index.mjs +1 -0
  26. package/dist/config/node/index.d.mts +3 -0
  27. package/dist/config/node/index.mjs +1 -0
  28. package/dist/config/node/load.d.mts +19 -0
  29. package/dist/config/node/load.mjs +1 -0
  30. package/dist/config/tau-project-artifact.d.mts +54 -0
  31. package/dist/config/tau-project-artifact.mjs +3 -0
  32. package/dist/config/types.d.mts +57 -0
  33. package/dist/config/validate.mjs +1 -0
  34. package/dist/create-geospec.d.mts +49 -0
  35. package/dist/create-geospec.mjs +1 -0
  36. package/dist/engine/client.d.mts +93 -0
  37. package/dist/engine/client.mjs +1 -0
  38. package/dist/engine/index.d.mts +3 -0
  39. package/dist/engine/index.mjs +1 -0
  40. package/dist/engine/matchers.d.mts +70 -0
  41. package/dist/engine/matchers.mjs +1 -0
  42. package/dist/engine/pmi.types.d.mts +78 -0
  43. package/dist/engine/protocol.d.mts +20 -0
  44. package/dist/engine/protocol.mjs +1 -0
  45. package/dist/geometry-unit.d.mts +12 -0
  46. package/dist/index.d.mts +6 -0
  47. package/dist/index.mjs +1 -0
  48. package/dist/mesh/index.d.mts +4 -0
  49. package/dist/mesh/index.mjs +1 -0
  50. package/dist/mesh/types.d.mts +575 -0
  51. package/dist/model/errors.d.mts +20 -0
  52. package/dist/model/errors.mjs +2 -0
  53. package/dist/model/export-intent.d.mts +63 -0
  54. package/dist/model/export-intent.mjs +1 -0
  55. package/dist/model/index.d.mts +6 -0
  56. package/dist/model/index.mjs +1 -0
  57. package/dist/model/load-model.d.mts +25 -0
  58. package/dist/model/load-model.mjs +1 -0
  59. package/dist/model/native-model-loader.d.mts +119 -0
  60. package/dist/model/native-model-loader.mjs +1 -0
  61. package/dist/model/subject-assertions.mjs +1 -0
  62. package/dist/model/subject.d.mts +11 -0
  63. package/dist/model/subject.mjs +1 -0
  64. package/dist/model/types.d.mts +207 -0
  65. package/dist/runner/collector.d.mts +62 -0
  66. package/dist/runner/collector.mjs +2 -0
  67. package/dist/runner/discovery.d.mts +93 -0
  68. package/dist/runner/discovery.mjs +1 -0
  69. package/dist/runner/filter.d.mts +50 -0
  70. package/dist/runner/filter.mjs +1 -0
  71. package/dist/runner/index.d.mts +6 -0
  72. package/dist/runner/index.mjs +1 -0
  73. package/dist/runner/native/index.d.mts +4 -0
  74. package/dist/runner/native/index.mjs +1 -0
  75. package/dist/runner/native/native-pool-grants.d.mts +21 -0
  76. package/dist/runner/native/native-pool-grants.mjs +1 -0
  77. package/dist/runner/native/native-serial-runner.d.mts +29 -0
  78. package/dist/runner/native/native-serial-runner.mjs +1 -0
  79. package/dist/runner/pool/pool-messages.d.mts +94 -0
  80. package/dist/runner/run-geospec-module.d.mts +13 -0
  81. package/dist/runner/run-geospec-module.mjs +47 -0
  82. package/dist/runner/types.d.mts +743 -0
  83. package/dist/runner/worker/index.d.mts +4 -0
  84. package/dist/runner/worker/index.mjs +1 -0
  85. package/dist/runner/worker/no-matching-tests-issue.d.mts +12 -0
  86. package/dist/runner/worker/no-matching-tests-issue.mjs +1 -0
  87. package/dist/runner/worker/runner-types.d.mts +146 -0
  88. package/dist/runner/worker/serial-runner.mjs +1 -0
  89. package/dist/selector/types.d.mts +271 -0
  90. package/dist/step/types.d.mts +134 -0
  91. package/dist/vitest/adapter.d.mts +56 -0
  92. package/dist/vitest/adapter.mjs +3 -0
  93. package/dist/vitest/index.d.mts +4 -0
  94. package/dist/vitest/index.mjs +1 -0
  95. package/package.json +114 -5
@@ -0,0 +1,93 @@
1
+ import { GeoSpecFixedMatcherName } from "./matchers.mjs";
2
+ import { JSONValue } from "@taucad/runtime/types";
3
+ //#region src/engine/client.d.ts
4
+ /**
5
+ * Exact core bytes of one claim evaluated in one engine call: the canonical plan, its one
6
+ * canonical claim and the canonical result, as fresh bytes the client retains without copying.
7
+ * @public
8
+ */
9
+ type GeoSpecNativeClaimEvaluation = {
10
+ readonly canonicalClaim: Uint8Array<ArrayBuffer>;
11
+ readonly canonicalPlan: Uint8Array<ArrayBuffer>;
12
+ readonly canonicalResult: Uint8Array<ArrayBuffer>;
13
+ };
14
+ /** Byte-only engine surface consumed by the runner-independent assertion client. @public */
15
+ type GeoSpecNativeEngine = {
16
+ evaluateClaim(request: Uint8Array<ArrayBuffer>): GeoSpecNativeClaimEvaluation;
17
+ processRequest(request: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
18
+ };
19
+ /** Content-addressed subject accepted by a protocol-3 assertion plan. @public */
20
+ type GeoSpecNativeSubject = {
21
+ readonly contentHash?: string;
22
+ readonly subjectHash?: string;
23
+ };
24
+ /** Polarity evaluated exactly once by the native core. @public */
25
+ type GeoSpecClaimPolarity = 'negative' | 'positive';
26
+ /** Canonical claim status returned by the native core. @public */
27
+ type GeoSpecCanonicalClaimStatus = 'cancelled' | 'engine-error' | 'failed' | 'invalid' | 'passed' | 'refused' | 'unsupported' | (string & {});
28
+ /** Full native assertion result with the exact core-owned bytes retained. @public */
29
+ type GeoSpecCanonicalClaimReport = {
30
+ readonly canonicalClaim: Uint8Array<ArrayBuffer>;
31
+ readonly canonicalPlan: Uint8Array<ArrayBuffer>;
32
+ readonly canonicalResult: Uint8Array<ArrayBuffer>;
33
+ readonly claim: Readonly<Record<string, JSONValue>>;
34
+ readonly claimId: string;
35
+ readonly diagnostics: readonly JSONValue[];
36
+ readonly evidence?: JSONValue;
37
+ readonly polarity: GeoSpecClaimPolarity;
38
+ readonly result: Readonly<Record<string, JSONValue>>;
39
+ readonly status: GeoSpecCanonicalClaimStatus;
40
+ };
41
+ /**
42
+ * Success-evidence profile a product selects for its plans (PERF-OUTPUT-01).
43
+ * `complete`, the default, keeps every evidence field. `bounded` keeps verdicts
44
+ * and drops evidence that grows with the subject on success: component gaps
45
+ * (nearest-neighbour gaps on failure), a closed mesh's per-primitive rows,
46
+ * undeclared duplicate faces, and all but the first matching circular hole.
47
+ * @public
48
+ */
49
+ type GeoSpecNativeEvidenceProfile = 'bounded' | 'complete';
50
+ type GeoSpecNativeClaimContext = {
51
+ readonly claimId: string;
52
+ readonly engine: GeoSpecNativeEngine;
53
+ readonly evidenceProfile?: GeoSpecNativeEvidenceProfile;
54
+ readonly polarity: GeoSpecClaimPolarity;
55
+ readonly subject: GeoSpecNativeSubject;
56
+ readonly subjectSlot: string;
57
+ readonly workUnitLimit: number;
58
+ };
59
+ /** One authored matcher call lowered and evaluated by Rust in one engine call. @public */
60
+ type GeoSpecNativeClaimOptions = GeoSpecNativeClaimContext & ({
61
+ readonly arguments: readonly unknown[];
62
+ readonly capability: GeoSpecFixedMatcherName;
63
+ } | {
64
+ readonly arguments: readonly unknown[];
65
+ readonly capability: string;
66
+ readonly kind: string;
67
+ });
68
+ declare const geoSpecQueryCapabilities: readonly ["analyzeMesh", "analyzeBrep", "inspectGeometry", "analyzeMeshOverlap", "queryPmi", "minimumDistance"];
69
+ /** Existing positive-only ancillary operations owned by the native core. @public */
70
+ type GeoSpecQueryCapability = Exclude<(typeof geoSpecQueryCapabilities)[number], 'minimumDistance'>;
71
+ /**
72
+ * Flat native query transport options. Payloads use the existing authoring
73
+ * serializer, including ordinary RegExp values; omitted payloads encode null.
74
+ * The core validates selectors, pairs and all operation-specific constraints.
75
+ * @public
76
+ */
77
+ type GeoSpecNativeQueryOptions = Omit<GeoSpecNativeClaimOptions, 'arguments' | 'capability' | 'kind' | 'polarity'> & {
78
+ readonly capability: GeoSpecQueryCapability | 'minimumDistance';
79
+ readonly payload?: unknown;
80
+ };
81
+ /**
82
+ * Submit an ancillary query with positive polarity through the native core.
83
+ *
84
+ * Queries return full reports even when failed or refused. Protocol errors
85
+ * propagate unchanged. Rust owns defaults, validation and canonical encoding.
86
+ *
87
+ * @param options - Query identity, subject and authored payload.
88
+ * @returns The complete report with exact canonical claim, plan and result bytes.
89
+ * @public
90
+ */
91
+ declare const evaluateGeoSpecNativeQuery: (options: GeoSpecNativeQueryOptions) => GeoSpecCanonicalClaimReport;
92
+ //#endregion
93
+ export { GeoSpecCanonicalClaimReport, GeoSpecCanonicalClaimStatus, GeoSpecClaimPolarity, GeoSpecNativeClaimEvaluation, GeoSpecNativeClaimOptions, GeoSpecNativeEngine, GeoSpecNativeEvidenceProfile, GeoSpecNativeQueryOptions, GeoSpecNativeSubject, GeoSpecQueryCapability, evaluateGeoSpecNativeQuery };
@@ -0,0 +1 @@
1
+ import{assertGeoSpecJsonValue as e,toGeoSpecProtocolJson as t}from"./protocol.mjs";import{geoSpecMatcherDescriptors as n}from"./matchers.mjs";const r=`geospec-jcs-v1`,i=[`analyzeMesh`,`analyzeBrep`,`inspectGeometry`,`analyzeMeshOverlap`,`queryPmi`,`minimumDistance`],a=t=>{let n=JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(t));return e(n),n},o=new TextEncoder().encode(`{"canonicalProfile":"geospec-jcs-v1","method":"initialize","protocolVersion":3,"registryVersion":5,"requestId":"configuration"}`),s=new WeakMap,c=new WeakMap,l=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`GeoSpec engine returned a malformed ${t}.`);return e},u=(e,t)=>{let{contentHash:n,subjectHash:r}=e;if(n===void 0==(r===void 0))throw TypeError(`A native GeoSpec subject requires exactly one of contentHash or subjectHash.`);let i=n??r;if(!/^[0-9a-f]{64}$/u.test(i))throw TypeError(`A native GeoSpec subject hash must contain 64 lowercase hexadecimal characters.`);return n===void 0?{slot:t,subjectHash:i}:{slot:t,contentHash:i}},d=e=>{if(!Number.isSafeInteger(e)||e<=0||e>9007199254740991)throw TypeError(`GeoSpec workUnitLimit must be a positive exact safe integer.`)},f=e=>{if(e.claimId.length===0||e.subjectSlot.length===0)throw TypeError(`GeoSpec claim IDs and subject slots must be non-empty strings.`);d(e.workUnitLimit)},p=(e,t)=>{if(t!==void 0)return d(t),t;let n=s.get(e);if(n!==void 0)return n;let i=l(a(Uint8Array.from(e.processRequest(Uint8Array.from(o)))),`initialize response envelope`);if(i.requestId!==`configuration`)throw TypeError(`GeoSpec engine returned an initialize response with the wrong requestId.`);let u=l(i.result,`initialize result`);if(u.canonicalProfile!==r||u.protocolVersion!==3||u.registryVersion!==5)throw TypeError(`GeoSpec engine returned an initialize response for an incompatible protocol profile.`);let f=l(u.configuration,`initialize configuration`),{capabilities:p}=u,m=Array.isArray(p)?p.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.name===`minimumDistance`):[];if(c.set(e,m.length===1&&m.every(e=>e.profile===`geospec-minimum-distance-v1`&&e.implementation===`implemented`&&e.registryVersion===5)),f.configurationProfile!==`geospec-entry-config-v1`)throw TypeError(`GeoSpec engine returned an unsupported configuration profile.`);let h=f.defaultWorkUnitBudget;if(typeof h!=`number`)throw TypeError(`GeoSpec engine initialize configuration omitted defaultWorkUnitBudget.`);return d(h),s.set(e,h),h},m=e=>(p(e),c.get(e)===!0),h=e=>{if(e.capability===`toSatisfyRationalPlate`||e.capability===`toSatisfyParallelPlaneDistance`){if(e.arguments.length>0)throw TypeError(`GeoSpec matcher ${e.capability} does not accept arguments.`);return _({...e,payload:{contract:n[e.capability].contract}})}if(!(`kind`in e))throw TypeError(`This GeoSpec matcher requires its canonical kind.`);return _({...e,payload:{kind:e.kind,arguments:e.arguments.map(e=>t(e))}})},g=e=>{if(!i.includes(e.capability))throw TypeError(`GeoSpec query capability must name an ancillary operation.`);return _({...e,payload:t(e.payload),polarity:`positive`})},_=e=>{f(e);let t={method:`submitClaims`,requestId:e.claimId,protocolVersion:3,registryVersion:5,canonicalProfile:r,plan:{subjects:[u(e.subject,e.subjectSlot)],claims:[{claimId:e.claimId,capability:e.capability,subjectSlots:[e.subjectSlot],payload:e.payload,polarity:e.polarity,workUnitBudget:e.workUnitLimit}],...e.evidenceProfile===void 0?{}:{evidenceProfile:e.evidenceProfile}}},{canonicalClaim:n,canonicalPlan:i,canonicalResult:o}=e.engine.evaluateClaim(new TextEncoder().encode(JSON.stringify(t))),s=l(a(n),`canonical claim`);if(s.claimId!==e.claimId)throw TypeError(`GeoSpec engine returned a malformed canonical claim for '${e.claimId}'.`);let{results:c}=l(a(o),`canonical result envelope`);if(!Array.isArray(c)||c.length!==1)throw TypeError(`GeoSpec engine returned a canonical result envelope without exactly one result.`);let[d]=c,p=l(d,`canonical claim result`),{claimId:m,diagnostics:h,status:g}=p;if(m!==e.claimId||typeof g!=`string`||!Array.isArray(h))throw TypeError(`GeoSpec engine returned a malformed result for claim '${e.claimId}'.`);return{canonicalClaim:n,canonicalPlan:i,canonicalResult:o,claim:s,claimId:m,diagnostics:h,...p.evidence===void 0?{}:{evidence:p.evidence},polarity:e.polarity,result:p,status:g}};export{h as evaluateGeoSpecNativeClaim,g as evaluateGeoSpecNativeQuery,p as resolveGeoSpecNativeWorkUnitLimit,m as supportsGeoSpecNativeMinimumDistance};
@@ -0,0 +1,3 @@
1
+ import { GeoSpecMatcherDescriptor, GeoSpecMatcherExpectedShape, GeoSpecMatcherMode, GeoSpecMatcherName, geoSpecMatcherDescriptors, normalizeGeoSpecExpected } from "./matchers.mjs";
2
+ import { assertGeoSpecJsonValue, decodeGeoSpecCanonicalJson, encodeGeoSpecCanonicalJson, isGeoSpecJsonValue, toGeoSpecProtocolJson } from "./protocol.mjs";
3
+ export { type GeoSpecMatcherDescriptor, type GeoSpecMatcherExpectedShape, type GeoSpecMatcherMode, type GeoSpecMatcherName, assertGeoSpecJsonValue, decodeGeoSpecCanonicalJson, encodeGeoSpecCanonicalJson, geoSpecMatcherDescriptors, isGeoSpecJsonValue, normalizeGeoSpecExpected, toGeoSpecProtocolJson };
@@ -0,0 +1 @@
1
+ import{assertGeoSpecJsonValue as e,decodeGeoSpecCanonicalJson as t,encodeGeoSpecCanonicalJson as n,isGeoSpecJsonValue as r,toGeoSpecProtocolJson as i}from"./protocol.mjs";import{geoSpecMatcherDescriptors as a,normalizeGeoSpecExpected as o}from"./matchers.mjs";export{e as assertGeoSpecJsonValue,t as decodeGeoSpecCanonicalJson,n as encodeGeoSpecCanonicalJson,a as geoSpecMatcherDescriptors,r as isGeoSpecJsonValue,o as normalizeGeoSpecExpected,i as toGeoSpecProtocolJson};
@@ -0,0 +1,70 @@
1
+ import { GeoSpecAssertion, GeoSpecMatcher } from "../runner/types.mjs";
2
+ //#region src/engine/matchers.d.ts
3
+ /**
4
+ * Every matcher name exposed by `expectGeo(...)`.
5
+ *
6
+ * @public
7
+ */
8
+ type GeoSpecMatcherName = Exclude<keyof GeoSpecMatcher, 'not'>;
9
+ /**
10
+ * How the substrate derives an assertion's recorded `expected` value from the
11
+ * arguments the spec author passed. Data, not code, so the registry stays
12
+ * emittable to non-TypeScript clients (DL13).
13
+ *
14
+ * - `first` — the first argument verbatim.
15
+ * - `first-or-empty` — the first argument, defaulting to `{}`.
16
+ * - `bounds` — `(min, max)` pairs collapse to `{ min, max }`; a lone object
17
+ * argument passes through.
18
+ * - `true` — nullary matchers record the literal `true`.
19
+ *
20
+ * @public
21
+ */
22
+ type GeoSpecMatcherExpectedShape = 'first' | 'first-or-empty' | 'bounds' | 'true';
23
+ /**
24
+ * Whether a matcher settles synchronously (throwing its
25
+ * `GeoSpecAssertionError` inside the `it()` body) or asynchronously (settled
26
+ * before the test completes). Part of the contract: it decides whether the
27
+ * deterministic work-unit budget (R13) brackets the evaluation.
28
+ *
29
+ * @public
30
+ */
31
+ type GeoSpecMatcherMode = 'sync' | 'async';
32
+ /**
33
+ * One matcher's contract entry.
34
+ *
35
+ * @public
36
+ */
37
+ type GeoSpecMatcherDescriptor = {
38
+ readonly kind: GeoSpecAssertion['kind'];
39
+ readonly expected: GeoSpecMatcherExpectedShape;
40
+ readonly mode: GeoSpecMatcherMode;
41
+ };
42
+ /**
43
+ * The 26-entry matcher registry. Insertion order is contract: it fixes
44
+ * `geoSpecMatcherNames`, which `libs/api-extractor` and the LLM prompt
45
+ * pipeline consume.
46
+ *
47
+ * @public
48
+ */
49
+ declare const geoSpecMatcherDescriptors: Readonly<{ [Name in GeoSpecMatcherName]: Name extends GeoSpecFixedMatcherName ? GeoSpecFixedMatcherDescriptor & {
50
+ readonly kind: Name;
51
+ } : GeoSpecMatcherDescriptor; }>;
52
+ /** A canonical fixed-contract matcher. @public */
53
+ type GeoSpecFixedMatcherDescriptor = {
54
+ readonly contract: 'geospec.plate-two-windows/v1' | 'geospec.pmi.parallel-plane-distance/v1';
55
+ readonly expected: 'true';
56
+ readonly mode: 'sync';
57
+ };
58
+ /** Every canonical fixed-contract matcher name. @public */
59
+ type GeoSpecFixedMatcherName = 'toSatisfyRationalPlate' | 'toSatisfyParallelPlaneDistance';
60
+ /**
61
+ * Derive the `expected` value an assertion records from the call arguments.
62
+ *
63
+ * @param shape - Normalization shape from the matcher's registry entry.
64
+ * @param callArguments - Arguments the spec author passed, in order.
65
+ * @returns The value recorded as the assertion's `expected`.
66
+ * @public
67
+ */
68
+ declare const normalizeGeoSpecExpected: (shape: GeoSpecMatcherExpectedShape, callArguments: readonly unknown[]) => unknown;
69
+ //#endregion
70
+ export { GeoSpecFixedMatcherDescriptor, GeoSpecFixedMatcherName, GeoSpecMatcherDescriptor, GeoSpecMatcherExpectedShape, GeoSpecMatcherMode, GeoSpecMatcherName, geoSpecMatcherDescriptors, normalizeGeoSpecExpected };
@@ -0,0 +1 @@
1
+ const e=Object.freeze({toHaveBoundingBox:{kind:`boundingBox`,expected:`bounds`,mode:`sync`},toHaveConnectedComponents:{kind:`connectedComponents`,expected:`first`,mode:`sync`},toBeWatertight:{kind:`watertight`,expected:`true`,mode:`sync`},toHaveNoComponentInterference:{kind:`componentInterference`,expected:`first-or-empty`,mode:`sync`},toHaveAssemblyOccurrences:{kind:`assemblyOccurrences`,expected:`first`,mode:`sync`},toHaveSpatialRelationships:{kind:`spatialRelationships`,expected:`first`,mode:`sync`},toHaveMeshIntegrity:{kind:`meshIntegrity`,expected:`first`,mode:`sync`},toHaveNoDiagnostics:{kind:`noDiagnostics`,expected:`first-or-empty`,mode:`sync`},toHaveSurfaceArea:{kind:`surfaceArea`,expected:`first`,mode:`sync`},toHaveVolume:{kind:`volume`,expected:`first`,mode:`sync`},toHaveMass:{kind:`mass`,expected:`first`,mode:`sync`},toHaveCenterOfMass:{kind:`centerOfMass`,expected:`first`,mode:`sync`},toBeValidBrep:{kind:`validBrep`,expected:`first-or-empty`,mode:`sync`},toHaveTopologyCounts:{kind:`topologyCounts`,expected:`first`,mode:`sync`},toHaveStepUnits:{kind:`stepUnits`,expected:`first`,mode:`sync`},toHaveProductStructure:{kind:`productStructure`,expected:`first`,mode:`sync`},toHavePlanarFace:{kind:`planarFace`,expected:`first`,mode:`sync`},toHaveCylindricalFace:{kind:`cylindricalFace`,expected:`first`,mode:`sync`},toHaveCircularHole:{kind:`circularHole`,expected:`first`,mode:`sync`},toHaveCircularHolePattern:{kind:`circularHolePattern`,expected:`first`,mode:`sync`},toHaveChamferFeature:{kind:`chamferFeature`,expected:`first`,mode:`sync`},toHaveFilletFeature:{kind:`filletFeature`,expected:`first`,mode:`sync`},toHaveMinimumWallThickness:{kind:`minimumWallThickness`,expected:`first`,mode:`sync`},toHaveVoidContinuity:{kind:`voidContinuity`,expected:`first`,mode:`sync`},toSatisfyRationalPlate:{kind:`toSatisfyRationalPlate`,contract:`geospec.plate-two-windows/v1`,expected:`true`,mode:`sync`},toSatisfyParallelPlaneDistance:{kind:`toSatisfyParallelPlaneDistance`,contract:`geospec.pmi.parallel-plane-distance/v1`,expected:`true`,mode:`sync`}}),t=(e,t)=>{switch(e){case`true`:return!0;case`first-or-empty`:return t[0]??{};case`bounds`:return t[1]===void 0?t[0]:{min:t[0],max:t[1]};default:return t[0]}};export{e as geoSpecMatcherDescriptors,t as normalizeGeoSpecExpected};
@@ -0,0 +1,78 @@
1
+ //#region src/engine/pmi.types.d.ts
2
+ /** Explicit support state for one source-attributed inventory field. @public */
3
+ type GeoSpecPmiField<Value> = {
4
+ readonly status: 'supported' | 'missing' | 'invalid' | 'ambiguous' | 'unsupported';
5
+ readonly value: Value | null;
6
+ readonly reason: string | null;
7
+ };
8
+ /** Original Part21 entity ID and exact source argument tokens. @public */
9
+ type GeoSpecPmiRawEntity = {
10
+ readonly sourceId: number;
11
+ readonly kind: string;
12
+ readonly arguments: readonly string[];
13
+ };
14
+ /** Source-authored scalar and Rust-normalized reduced rational millimetres. @public */
15
+ type GeoSpecPmiNumber = {
16
+ readonly sourceId: number;
17
+ readonly authoredText: string;
18
+ readonly unitId: number;
19
+ readonly unitRecords: readonly GeoSpecPmiRawEntity[];
20
+ readonly millimetres: string;
21
+ readonly name: string;
22
+ };
23
+ /** A uniquely forward-transferred face; null occurrence denotes the whole part. @public */
24
+ type GeoSpecPmiFaceAssociation = {
25
+ readonly sourceFaceId: number;
26
+ readonly occurrenceRoute: readonly number[];
27
+ readonly occurrence: number | null;
28
+ readonly publicFaceOrdinal: number;
29
+ };
30
+ /** One ordered role reference, including incomplete source/transfer evidence. @public */
31
+ type GeoSpecPmiShapeReference = {
32
+ readonly sourceAspectId: number | null;
33
+ readonly sourceUsageIds: readonly number[];
34
+ readonly sourceItemIds: readonly number[];
35
+ readonly requestedRoute: GeoSpecPmiField<readonly number[]>;
36
+ readonly associations: GeoSpecPmiField<readonly GeoSpecPmiFaceAssociation[]>;
37
+ };
38
+ /** Normalized authored limits; never an inferred geometric conformance verdict. @public */
39
+ type GeoSpecPmiLimits = {
40
+ readonly lowerMillimetres: string;
41
+ readonly upperMillimetres: string;
42
+ readonly basis: 'authored-limits' | 'nominal-plus-minus';
43
+ };
44
+ /** Source record preserving semantic/presentation separation and ordered roles. @public */
45
+ type GeoSpecPmiRecord = {
46
+ readonly sourceId: number;
47
+ readonly family: 'dimension' | 'datum' | 'tolerance' | 'presentation';
48
+ readonly channel: 'semantic' | 'presentation';
49
+ readonly kind: string;
50
+ readonly name: GeoSpecPmiField<string>;
51
+ readonly first: readonly GeoSpecPmiShapeReference[];
52
+ readonly second: readonly GeoSpecPmiShapeReference[];
53
+ readonly numbers: GeoSpecPmiField<readonly GeoSpecPmiNumber[]>;
54
+ readonly limits: GeoSpecPmiField<GeoSpecPmiLimits>;
55
+ readonly interpretation: GeoSpecPmiField<string>;
56
+ readonly raw: readonly GeoSpecPmiRawEntity[];
57
+ };
58
+ /** Positive-only inventory value inside the ordinary canonical query report. @public */
59
+ type GeoSpecPmiInventory = {
60
+ readonly contract: 'geospec.pmi.inventory/v1';
61
+ readonly status: 'semantic' | 'graphical-only' | 'empty';
62
+ readonly fileSchema: string;
63
+ readonly editionValidation: 'not-validated';
64
+ readonly records: readonly GeoSpecPmiRecord[];
65
+ };
66
+ /** Strict inventory output limits. Exceeding either refuses without truncation. @public */
67
+ type GeoSpecPmiQueryPayload = {
68
+ readonly maxRecords?: number;
69
+ readonly maxOutputBytes?: number;
70
+ };
71
+ /** Complete inventory value; provenance is the unchanged core identity descriptor. @public */
72
+ type GeoSpecPmiQueryValue = {
73
+ readonly inventory: GeoSpecPmiInventory;
74
+ readonly subjectHash: string;
75
+ readonly provenance: Readonly<Record<string, unknown>>;
76
+ };
77
+ //#endregion
78
+ export { GeoSpecPmiFaceAssociation, GeoSpecPmiField, GeoSpecPmiInventory, GeoSpecPmiLimits, GeoSpecPmiNumber, GeoSpecPmiQueryPayload, GeoSpecPmiQueryValue, GeoSpecPmiRawEntity, GeoSpecPmiRecord, GeoSpecPmiShapeReference };
@@ -0,0 +1,20 @@
1
+ import { JSONValue } from "@taucad/runtime/types";
2
+ //#region src/engine/protocol.d.ts
3
+ /** Runtime JSON-value guard used at every protocol trust boundary. @public */
4
+ declare const isGeoSpecJsonValue: (value: unknown, ancestors?: Set<WeakKey>) => value is JSONValue;
5
+ /** Reject a non-wire value rather than letting JSON.stringify erase it. @public */
6
+ declare const assertGeoSpecJsonValue: (value: unknown) => asserts value is JSONValue;
7
+ /** Encode client-owned canonical claim bytes. @public */
8
+ declare const encodeGeoSpecCanonicalJson: (value: JSONValue) => Uint8Array<ArrayBuffer>;
9
+ /** Parse and validate canonical bytes without re-canonicalizing them. @public */
10
+ declare const decodeGeoSpecCanonicalJson: (bytes: Uint8Array<ArrayBuffer>) => JSONValue;
11
+ /**
12
+ * Convert an authoring value to protocol JSON, including the two explicit
13
+ * bindings the TypeScript client needs: regex data and opaque subject refs.
14
+ * Unsupported live objects fail before a request reaches the engine.
15
+ *
16
+ * @public
17
+ */
18
+ declare const toGeoSpecProtocolJson: (value: unknown, ancestors?: Set<WeakKey>) => JSONValue;
19
+ //#endregion
20
+ export { assertGeoSpecJsonValue, decodeGeoSpecCanonicalJson, encodeGeoSpecCanonicalJson, isGeoSpecJsonValue, toGeoSpecProtocolJson };
@@ -0,0 +1 @@
1
+ const e=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},t=(n,r=new Set)=>{if(n===null||typeof n==`string`||typeof n==`boolean`)return!0;if(typeof n==`number`)return Number.isFinite(n);if(!Array.isArray(n)&&!e(n)||r.has(n))return!1;r.add(n);let i=Array.isArray(n)?n.every(e=>t(e,r)):e(n)&&Object.values(n).every(e=>t(e,r));return r.delete(n),i},n=e=>{if(!t(e))throw TypeError(`GeoSpec protocol values must contain only finite JSON data.`)},r=e=>Array.isArray(e)?e.map(e=>r(e)):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,r(t)])):e,i=e=>(n(e),new TextEncoder().encode(JSON.stringify(r(e)))),a=e=>{let t=JSON.parse(new TextDecoder().decode(e));return n(t),t},o=(t,n=new Set)=>{if(t==null)return null;if(typeof t==`string`||typeof t==`boolean`)return t;if(typeof t==`number`){if(!Number.isFinite(t))throw TypeError(`GeoSpec claims cannot contain non-finite numbers.`);return t}if(t instanceof RegExp)return{type:`regexp`,pattern:t.source,flags:t.flags};if(typeof t!=`object`||n.has(t))throw TypeError(`GeoSpec claims cannot contain functions, symbols, bigint values, or cycles.`);let r=Reflect.get(t,`subjectId`);if(typeof r==`string`)return{type:`subject-reference`,subjectId:r};if(n.add(t),Array.isArray(t)){let e=t.map(e=>o(e,n));return n.delete(t),e}if(!e(t))throw TypeError(`GeoSpec claims cannot contain class instances.`);let i={};for(let[e,r]of Object.entries(t))r!==void 0&&(i[e]=o(r,n));return n.delete(t),i};export{n as assertGeoSpecJsonValue,a as decodeGeoSpecCanonicalJson,i as encodeGeoSpecCanonicalJson,t as isGeoSpecJsonValue,o as toGeoSpecProtocolJson};
@@ -0,0 +1,12 @@
1
+ //#region src/geometry-unit.d.ts
2
+ /**
3
+ * Geometry units accepted at GeoSpec evidence-loading boundaries.
4
+ *
5
+ * Loaded subjects normalize coordinates into canonical millimetres; this type
6
+ * describes source and provenance units, not a project-wide configuration.
7
+ *
8
+ * @public
9
+ */
10
+ type GeoSpecUnit = 'mm' | 'cm' | 'm' | 'in' | 'ft' | (string & {});
11
+ //#endregion
12
+ export { GeoSpecUnit };
@@ -0,0 +1,6 @@
1
+ import { GeoSpecUnit } from "./geometry-unit.mjs";
2
+ import { BrepEvidence, GeometryCapability, GeometryDiagnostic, GeometryFileFormat, GeometryProvenance, GeometrySource, GeometrySubject, GeometrySubjectMeshEvidence, MeshEvidence, MeshFileFormat, MeshQualityStats, MeshTriangle, StepEvidence, Vec3 } from "./mesh/types.mjs";
3
+ import { GeoSpecSubject } from "./model/subject.mjs";
4
+ import { GeoSpecAssemblyOccurrenceExpectation, GeoSpecAssemblyOccurrencesExpectation, GeoSpecAssertion, GeoSpecAxisExpectation, GeoSpecBoundingBoxExpectation, GeoSpecCenterOfMassExpectation, GeoSpecChamferFeatureExpectation, GeoSpecCircularHoleExpectation, GeoSpecCircularHolePatternExpectation, GeoSpecComponentInterferenceAllowance, GeoSpecComponentInterferenceExpectation, GeoSpecComponentInterferencePairExpectation, GeoSpecConnectedComponentsExpectation, GeoSpecCylindricalFaceExpectation, GeoSpecFilletFeatureExpectation, GeoSpecGeometrySelector, GeoSpecMassExpectation, GeoSpecMatcher, GeoSpecMeshIntegrityExpectation, GeoSpecMinimumWallThicknessExpectation, GeoSpecNoDiagnosticsExpectation, GeoSpecNumericExpectation, GeoSpecPlanarFaceExpectation, GeoSpecPointExpectation, GeoSpecProductStructureExpectation, GeoSpecSpatialRelationshipExpectation, GeoSpecSpatialRelationshipsExpectation, GeoSpecStepUnitsExpectation, GeoSpecSurfaceAreaExpectation, GeoSpecTopologyCountsExpectation, GeoSpecValidBrepExpectation, GeoSpecVoidContinuityExpectation, GeoSpecVoidWaypoint, GeoSpecVolumeExpectation } from "./runner/types.mjs";
5
+ import { describe, expectGeo, geoSpecMatcherNames, it, test } from "./create-geospec.mjs";
6
+ export { type BrepEvidence, type GeoSpecAssemblyOccurrenceExpectation, type GeoSpecAssemblyOccurrencesExpectation, type GeoSpecAssertion, type GeoSpecAxisExpectation, type GeoSpecBoundingBoxExpectation, type GeoSpecCenterOfMassExpectation, type GeoSpecChamferFeatureExpectation, type GeoSpecCircularHoleExpectation, type GeoSpecCircularHolePatternExpectation, type GeoSpecComponentInterferenceAllowance, type GeoSpecComponentInterferenceExpectation, type GeoSpecComponentInterferencePairExpectation, type GeoSpecConnectedComponentsExpectation, type GeoSpecCylindricalFaceExpectation, type GeoSpecFilletFeatureExpectation, type GeoSpecGeometrySelector, type GeoSpecMassExpectation, type GeoSpecMatcher, type GeoSpecMeshIntegrityExpectation, type GeoSpecMinimumWallThicknessExpectation, type GeoSpecNoDiagnosticsExpectation, type GeoSpecNumericExpectation, type GeoSpecPlanarFaceExpectation, type GeoSpecPointExpectation, type GeoSpecProductStructureExpectation, type GeoSpecSpatialRelationshipExpectation, type GeoSpecSpatialRelationshipsExpectation, type GeoSpecStepUnitsExpectation, type GeoSpecSubject, type GeoSpecSurfaceAreaExpectation, type GeoSpecTopologyCountsExpectation, type GeoSpecUnit, type GeoSpecValidBrepExpectation, type Vec3 as GeoSpecVec3, type GeoSpecVoidContinuityExpectation, type GeoSpecVoidWaypoint, type GeoSpecVolumeExpectation, type GeometryCapability, type GeometryDiagnostic, type GeometryFileFormat, type GeometryProvenance, type GeometrySource, type GeometrySubject, type GeometrySubjectMeshEvidence, type MeshEvidence, type MeshFileFormat, type MeshQualityStats, type MeshTriangle, type StepEvidence, type Vec3, describe, expectGeo, geoSpecMatcherNames, it, test };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{describe as e,expectGeo as t,geoSpecMatcherNames as n,it as r,test as i}from"./create-geospec.mjs";export{e as describe,t as expectGeo,n as geoSpecMatcherNames,r as it,i as test};
@@ -0,0 +1,4 @@
1
+ import { GeoSpecUnit } from "../geometry-unit.mjs";
2
+ import { AabbMeters, BoundingBoxAxisExtremum, BoundingBoxAxisFailure, BoundingBoxFailure, BoundingBoxStats, BrepEvidence, CheckResult, ClusterGap, ClusterReport, ConnectedComponentsFailure, ConnectedComponentsResult, GeometryCapability, GeometryDiagnostic, GeometryEvidenceDiagnostic, GeometryFileFormat, GeometryProvenance, GeometrySource, GeometryStats, GeometrySubject, GeometrySubjectMeshEvidence, MeshEvidence, MeshFileFormat, MeshQualityStats, MeshTriangle, PrimitiveRecord, StepEvidence, Vec3, WatertightFailure, WatertightIrregularEdgeCluster, WatertightIrregularEdgeKind, WatertightIrregularEdgeSample, WatertightPrimitiveBreakdown, WatertightResult } from "./types.mjs";
3
+ import { MeshBufferSource, MeshSource } from "../model/types.mjs";
4
+ export type { AabbMeters, BoundingBoxAxisExtremum, BoundingBoxAxisFailure, BoundingBoxFailure, BoundingBoxStats, BrepEvidence, CheckResult, ClusterGap, ClusterReport, ConnectedComponentsFailure, ConnectedComponentsResult, GeoSpecUnit, GeometryCapability, GeometryDiagnostic, GeometryEvidenceDiagnostic, GeometryFileFormat, GeometryProvenance, GeometrySource, GeometryStats, GeometrySubject, GeometrySubjectMeshEvidence, MeshBufferSource, MeshEvidence, MeshFileFormat, MeshQualityStats, MeshSource, MeshTriangle, PrimitiveRecord, StepEvidence, Vec3, WatertightFailure, WatertightIrregularEdgeCluster, WatertightIrregularEdgeKind, WatertightIrregularEdgeSample, WatertightPrimitiveBreakdown, WatertightResult };
@@ -0,0 +1 @@
1
+ export{};