Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add Standard concept pack descriptor scaffold
Yuechen Li7123b378d9c2
diff --git a/Aetheris.Forge/Standard/StandardConceptPack.cs b/Aetheris.Forge/Standard/StandardConceptPack.csnew file mode 100644index 00000000..33c846fb--- /dev/null+++ b/Aetheris.Forge/Standard/StandardConceptPack.cs@@ -0,0 +1,72 @@+using Aetheris.Forge.Abstractions;++namespace Aetheris.Forge.Standard;++public static class StandardConceptPack+{+ public const string PackageId = "Aetheris.Standard";++ public static ForgePackageDescriptor CreatePackage() => new(+ PackageId: PackageId,+ DisplayName: "Aetheris Standard Concept Pack",+ SemanticVersion: "0.2.0",+ Vendor: "Aetheris",+ Description: "Built-in descriptor-only semantic concept pack for blessed Standard CAD authoring concepts.",+ RequestedTrustTier: ForgeTrustTier.SemanticDocsOnly,+ HostRequirements: ["Aetheris.Forge.Abstractions", "MetadataOnly", "NoPluginExecution"],+ Concepts: [CreateCnc(), CreateHole(), CreateShaftHole(), CreateCounterboreHole(), CreateCountersinkHole(), CreateEdgeFinish()],+ Templates: [],+ Capabilities:+ [+ new ForgeCapabilityDescriptor("Standard.MetadataOnly", ForgeTrustTier.SemanticDocsOnly, "Descriptors document semantic contracts only; they do not execute plugins, lowerers, materializers, or BRep helpers.", []),+ new ForgeCapabilityDescriptor("Standard.Hole.AirHoleFeatureMetadata", ForgeTrustTier.SemanticDocsOnly, "Metadata naming AirHoleFeature as the future semantic-hole AIR feature family without executing lowering.", ["AirHoleFeature"]),+ new ForgeCapabilityDescriptor("Standard.StackedHole.Metadata", ForgeTrustTier.SemanticDocsOnly, "Metadata distinguishing counterbore and countersink stacked-hole concepts from a base shaft hole.", []),+ new ForgeCapabilityDescriptor("Standard.Process.CncMetadata", ForgeTrustTier.SemanticDocsOnly, "Metadata for CNC/prismatic process constraints that are not BRep feature lowering contracts.", [])+ ],+ Examples: [new ForgeExampleDescriptor("standard-concept-pack-minimal", "package Aetheris.Standard concepts: Standard.CNC, Standard.Hole, Standard.EdgeFinish", "Descriptor-only package inventory example; not parser syntax.")],+ Fixtures: [],+ LlmGuidance: [new ForgeLlmGuidanceDescriptor("standard-concept-pack-implementation-note", "docs/implementation/forge-x2-standard-concept-pack-scaffold.md", "FORGE-X2 implementation note for the built-in Standard concept pack scaffold.")]);++ public static ForgeConceptDescriptor CreateCnc() => new(+ "Standard.CNC", "Standard CNC", "ManufacturingProcess", "Descriptor-only CNC/prismatic process concept for manufacturing assumptions and constraints; it is not a geometry feature.",+ [+ new ForgeFieldDescriptor("processFamily", ForgeFieldType.String, false, null, "Manufacturing process family metadata.", "CNC/prismatic", ["CNC/prismatic"]),+ new ForgeFieldDescriptor("minimumToolRadius", ForgeFieldType.Length, false, "Length", "Optional lower bound for modeled internal tool radius assumptions."),+ new ForgeFieldDescriptor("minimumWallThickness", ForgeFieldType.Length, false, "Length", "Optional lower bound for wall-thickness manufacturability assumptions."),+ new ForgeFieldDescriptor("preferredInsideCorner", ForgeFieldType.String, false, null, "Optional policy hint for preferred CNC inside corner treatment.", null, ["fillet", "relief", "defer"])+ ],+ [+ new ForgeDiagnosticDescriptor("standard-cnc-invalid-minimum-tool-radius", ForgeDiagnosticSeverity.Error, "Standard.CNC minimumToolRadius must be positive when present.", "Descriptor-level CNC constraint diagnostic."),+ new ForgeDiagnosticDescriptor("standard-cnc-invalid-minimum-wall-thickness", ForgeDiagnosticSeverity.Error, "Standard.CNC minimumWallThickness must be positive when present.", "Descriptor-level CNC constraint diagnostic.")+ ],+ ["Standard.MetadataOnly", "Standard.Process.CncMetadata"], [], [], [], [],+ ManufacturingAssumptions: ["processFamily=CNC/prismatic", "process-concept-not-geometry-feature", "no-brep-lowering-contract"],+ DerivedFields: [], ValidationRuleIds: ["standard-cnc-invalid-minimum-tool-radius", "standard-cnc-invalid-minimum-wall-thickness"]);++ public static ForgeConceptDescriptor CreateHole() => HoleLike("Standard.Hole", "Standard Hole", "Base descriptor-only semantic hole concept.", null, "shaft");+ public static ForgeConceptDescriptor CreateShaftHole() => HoleLike("Standard.ShaftHole", "Standard Shaft Hole", "Descriptor-only simple shaft-hole refinement of Standard.Hole.", "Standard.Hole", "shaft");+ public static ForgeConceptDescriptor CreateCounterboreHole() => HoleLike("Standard.CounterboreHole", "Standard Counterbore Hole", "Descriptor-only counterbore stacked-hole refinement of Standard.Hole.", "Standard.Hole", "counterbore");+ public static ForgeConceptDescriptor CreateCountersinkHole() => HoleLike("Standard.CountersinkHole", "Standard Countersink Hole", "Descriptor-only countersink stacked-hole refinement of Standard.Hole.", "Standard.Hole", "countersink");++ public static ForgeConceptDescriptor CreateEdgeFinish() => new(+ "Standard.EdgeFinish", "Standard Edge Finish", "EdgeFinish", "Descriptor-only concept for fillet/chamfer/round edge-finish intent. Lowering is deferred until a suitable AIR feature exists.",+ [new ForgeFieldDescriptor("target", ForgeFieldType.SemanticReference, true, null, "Semantic reference to edge intent."), new ForgeFieldDescriptor("kind", ForgeFieldType.String, true, null, "Edge-finish kind metadata.", null, ["fillet", "chamfer", "round"]), new ForgeFieldDescriptor("radiusOrDistance", ForgeFieldType.Length, true, "Length", "Nominal radius or chamfer distance metadata."), new ForgeFieldDescriptor("scope", ForgeFieldType.String, false, null, "Optional scope metadata.", "singleEdge", ["singleEdge", "loop", "partialLoop", "featureEdgeRole", "simpleBodyAllEdges"])],+ [new ForgeDiagnosticDescriptor("standard-edge-finish-invalid-target", ForgeDiagnosticSeverity.Error, "Standard.EdgeFinish target must resolve to supported semantic edge intent.", "Descriptor-level target validation diagnostic."), new ForgeDiagnosticDescriptor("standard-edge-finish-invalid-size", ForgeDiagnosticSeverity.Error, "Standard.EdgeFinish radiusOrDistance must be positive.", "Descriptor-level size validation diagnostic."), new ForgeDiagnosticDescriptor("standard-edge-finish-unsupported-scope", ForgeDiagnosticSeverity.Error, "Standard.EdgeFinish scope is unsupported.", "Descriptor-level scope validation diagnostic.")],+ ["Standard.MetadataOnly"], [], [], [], [],+ ManufacturingAssumptions: ["lowering-deferred", "descriptor-only", "no-current-air-feature-claim"], DerivedFields: ["scope defaults to singleEdge when omitted"], ValidationRuleIds: ["standard-edge-finish-invalid-target", "standard-edge-finish-invalid-size", "standard-edge-finish-unsupported-scope"]);++ private static ForgeConceptDescriptor HoleLike(string id, string name, string description, string? baseConceptId, string stackKind)+ {+ var fields = new List<ForgeFieldDescriptor> { new("entryFace", ForgeFieldType.FaceSelector, true, null, "Face receiving the hole."), new("center", ForgeFieldType.FaceLocalPoint2D, true, null, "Face-local hole center."), new("shaftDiameter", ForgeFieldType.Length, true, "Length", "Nominal shaft diameter."), new("endCondition", ForgeFieldType.HoleEndCondition, true, null, "Descriptor-level through/blind/end-condition metadata.") };+ if (stackKind == "counterbore") { fields.Add(new("counterboreDiameter", ForgeFieldType.Length, true, "Length", "Counterbore diameter metadata.")); fields.Add(new("counterboreDepth", ForgeFieldType.Length, true, "Length", "Counterbore depth metadata.")); }+ if (stackKind == "countersink") { fields.Add(new("countersinkDiameter", ForgeFieldType.Length, true, "Length", "Countersink diameter metadata.")); fields.Add(new("countersinkAngle", ForgeFieldType.Angle, true, "Angle", "Countersink included angle metadata.")); }+ var diagnostics = new List<ForgeDiagnosticDescriptor> { new("standard-hole-missing-entry-face", ForgeDiagnosticSeverity.Error, "Standard.Hole requires an entry face.", "Raised when entryFace metadata is absent."), new("standard-hole-invalid-center", ForgeDiagnosticSeverity.Error, "Standard.Hole center must be valid on the entry face.", "Raised when center metadata is invalid."), new("standard-hole-invalid-diameter", ForgeDiagnosticSeverity.Error, "Standard.Hole shaftDiameter must be positive.", "Raised when shaftDiameter metadata is invalid."), new("standard-hole-invalid-end-condition", ForgeDiagnosticSeverity.Error, "Standard.Hole endCondition is unsupported.", "Raised when endCondition metadata is invalid.") };+ if (stackKind == "counterbore") { diagnostics.Add(new("standard-counterbore-invalid-diameter", ForgeDiagnosticSeverity.Error, "Standard.CounterboreHole counterboreDiameter must be positive.", "Counterbore descriptor diagnostic.")); diagnostics.Add(new("standard-counterbore-invalid-depth", ForgeDiagnosticSeverity.Error, "Standard.CounterboreHole counterboreDepth must be positive.", "Counterbore descriptor diagnostic.")); diagnostics.Add(new("standard-counterbore-diameter-not-greater-than-shaft", ForgeDiagnosticSeverity.Error, "Counterbore diameter must be greater than shaft diameter.", "Counterbore stack relationship diagnostic.")); }+ if (stackKind == "countersink") { diagnostics.Add(new("standard-countersink-invalid-diameter", ForgeDiagnosticSeverity.Error, "Standard.CountersinkHole countersinkDiameter must be positive.", "Countersink descriptor diagnostic.")); diagnostics.Add(new("standard-countersink-invalid-angle", ForgeDiagnosticSeverity.Error, "Standard.CountersinkHole countersinkAngle must be valid.", "Countersink descriptor diagnostic.")); diagnostics.Add(new("standard-countersink-diameter-not-greater-than-shaft", ForgeDiagnosticSeverity.Error, "Countersink diameter must be greater than shaft diameter.", "Countersink stack relationship diagnostic.")); }+ var capabilities = stackKind is "counterbore" or "countersink" ? ["Standard.MetadataOnly", "Standard.Hole.AirHoleFeatureMetadata", "Standard.StackedHole.Metadata"] : new[] { "Standard.MetadataOnly", "Standard.Hole.AirHoleFeatureMetadata" };+ return new ForgeConceptDescriptor(id, name, "Hole", description, fields, diagnostics, capabilities,+ [new ForgeLoweringContractDescriptor(id + ".ToAirHoleFeature", id, "AirHoleFeature", ["Standard.Hole.AirHoleFeatureMetadata"], $"Metadata contract naming AirHoleFeature as the target family for {id}; no lowerer is executed.")], [], [], [],+ ManufacturingAssumptions: [.. (baseConceptId is null ? [] : new[] { "baseConceptId=" + baseConceptId }), "targetAirFeatureFamily=AirHoleFeature", "stack=" + stackKind, "descriptor-only-no-lowering-execution"],+ DerivedFields: stackKind is "counterbore" or "countersink" ? ["stackKind=" + stackKind] : [], ValidationRuleIds: diagnostics.Select(d => d.DiagnosticId).ToArray());+ }+}diff --git a/Aetheris.Kernel.Core.Tests/Brep/Features/StandardConceptPackDescriptorTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Features/StandardConceptPackDescriptorTests.csnew file mode 100644index 00000000..37ea418c--- /dev/null+++ b/Aetheris.Kernel.Core.Tests/Brep/Features/StandardConceptPackDescriptorTests.cs@@ -0,0 +1,82 @@+using Aetheris.Forge.Abstractions;+using Aetheris.Forge.Standard;++namespace Aetheris.Kernel.Core.Tests.Brep.Features;++public sealed class StandardConceptPackDescriptorTests+{+ [Fact]+ public void ValidStandardConceptPackPassesValidation()+ {+ var result = ForgeDescriptorValidator.Validate(StandardConceptPack.CreatePackage());+ Assert.True(result.IsValid, string.Join(Environment.NewLine, result.Diagnostics));+ }++ [Fact]+ public void StandardConceptIdsAreStableAndUnique()+ {+ var ids = StandardConceptPack.CreatePackage().Concepts.Select(c => c.ConceptId).ToArray();+ Assert.Equal(["Standard.CNC", "Standard.Hole", "Standard.ShaftHole", "Standard.CounterboreHole", "Standard.CountersinkHole", "Standard.EdgeFinish"], ids);+ Assert.Equal(ids.Length, ids.Distinct(StringComparer.Ordinal).Count());+ }++ [Fact]+ public void StandardHoleTargetsAirHoleFeatureAsMetadata()+ {+ var package = StandardConceptPack.CreatePackage();+ var holeConcepts = package.Concepts.Where(c => c.ConceptId.Contains("Hole", StringComparison.Ordinal)).ToArray();+ Assert.NotEmpty(holeConcepts);+ foreach (var concept in holeConcepts)+ {+ var contract = Assert.Single(concept.LoweringContracts);+ Assert.Equal("AirHoleFeature", contract.TargetAirFeatureFamily);+ Assert.Contains("no lowerer is executed", contract.Description, StringComparison.OrdinalIgnoreCase);+ }+ }++ [Fact]+ public void StandardCncIsProcessConceptAndHasNoBRepLowering()+ {+ var cnc = StandardConceptPack.CreatePackage().Concepts.Single(c => c.ConceptId == "Standard.CNC");+ Assert.Equal("ManufacturingProcess", cnc.Category);+ Assert.Empty(cnc.LoweringContracts);+ Assert.Contains(cnc.ManufacturingAssumptions!, a => a == "processFamily=CNC/prismatic");+ Assert.DoesNotContain(cnc.ManufacturingAssumptions!, a => a.Contains("BRep", StringComparison.OrdinalIgnoreCase) && !a.Contains("no-brep", StringComparison.OrdinalIgnoreCase));+ }++ [Fact]+ public void StandardCounterboreAndCountersinkAreDistinctStackedHoleConcepts()+ {+ var package = StandardConceptPack.CreatePackage();+ var counterbore = package.Concepts.Single(c => c.ConceptId == "Standard.CounterboreHole");+ var countersink = package.Concepts.Single(c => c.ConceptId == "Standard.CountersinkHole");++ Assert.Contains(counterbore.Fields, f => f.FieldName == "counterboreDepth" && f.FieldType == ForgeFieldType.Length);+ Assert.Contains(countersink.Fields, f => f.FieldName == "countersinkAngle" && f.FieldType == ForgeFieldType.Angle);+ Assert.Contains(counterbore.CapabilityRequirements, c => c == "Standard.StackedHole.Metadata");+ Assert.Contains(countersink.CapabilityRequirements, c => c == "Standard.StackedHole.Metadata");+ Assert.Contains(counterbore.ValidationRuleIds!, id => id == "standard-counterbore-diameter-not-greater-than-shaft");+ Assert.Contains(countersink.ValidationRuleIds!, id => id == "standard-countersink-diameter-not-greater-than-shaft");+ }++ [Fact]+ public void StandardEdgeFinishIsDescriptorOnlyAndNotUnsafe()+ {+ var package = StandardConceptPack.CreatePackage();+ var edgeFinish = package.Concepts.Single(c => c.ConceptId == "Standard.EdgeFinish");+ Assert.Empty(edgeFinish.LoweringContracts);+ Assert.Contains(edgeFinish.ManufacturingAssumptions!, a => a == "lowering-deferred");+ Assert.Equal(ForgeTrustTier.SemanticDocsOnly, package.RequestedTrustTier);+ Assert.DoesNotContain(package.Capabilities, c => c.Tier == ForgeTrustTier.UnsafeNativeExperimental);+ }++ [Fact]+ public void StandardConceptPackDoesNotRequirePluginExecution()+ {+ var package = StandardConceptPack.CreatePackage();+ Assert.Contains("NoPluginExecution", package.HostRequirements);+ Assert.DoesNotContain(package.HostRequirements, h => h.Contains("plugin", StringComparison.OrdinalIgnoreCase) && h != "NoPluginExecution");+ Assert.All(package.Capabilities, c => Assert.NotEqual(ForgeTrustTier.LoweringProvider, c.Tier));+ Assert.All(package.Capabilities, c => Assert.NotEqual(ForgeTrustTier.MaterializerProvider, c.Tier));+ }+}diff --git a/docs/implementation/forge-x1-concept-template-descriptor-scaffold.md b/docs/implementation/forge-x1-concept-template-descriptor-scaffold.mdindex 0ef0af29..95dcf34c 100644--- a/docs/implementation/forge-x1-concept-template-descriptor-scaffold.md+++ b/docs/implementation/forge-x1-concept-template-descriptor-scaffold.md@@ -74,3 +74,7 @@ dotnet test Aetheris.slnx -f net10.0 --no-build --filter "Forge|Standard|Hole|Figit diff --checkgit status --short```++## Forward link: FORGE-X2 built-in Standard concept pack++FORGE-X2 promotes the FORGE-X1 `Standard.Hole` descriptor fixture into a built-in metadata-only Standard concept pack scaffold. See `docs/implementation/forge-x2-standard-concept-pack-scaffold.md` for the package-level descriptor, added concepts, and deferred runtime behavior.diff --git a/docs/implementation/forge-x2-standard-concept-pack-scaffold.md b/docs/implementation/forge-x2-standard-concept-pack-scaffold.mdnew file mode 100644index 00000000..24941243--- /dev/null+++ b/docs/implementation/forge-x2-standard-concept-pack-scaffold.md@@ -0,0 +1,44 @@+# FORGE-X2 Standard concept pack scaffold++FORGE-X2 adds the first built-in Standard semantic concept pack scaffold. The descriptor lives in `Aetheris.Forge/Standard/StandardConceptPack.cs` under the `Aetheris.Forge.Standard` namespace and exposes package `Aetheris.Standard` with display name `Aetheris Standard Concept Pack`.++## Concepts added++The pack is metadata-only and currently declares these concepts:++- `Standard.CNC` for CNC/prismatic manufacturing-process constraints.+- `Standard.Hole` for the base semantic hole contract.+- `Standard.ShaftHole` as a simple shaft-hole refinement of `Standard.Hole`.+- `Standard.CounterboreHole` as a stacked-hole concept with counterbore diameter/depth metadata.+- `Standard.CountersinkHole` as a stacked-hole concept with countersink diameter/angle metadata.+- `Standard.EdgeFinish` for fillet/chamfer/round edge-finish intent with deferred lowering.++No templates are added in FORGE-X2. That keeps the milestone focused on high-quality concept descriptors rather than template expansion semantics.++## Relationship to FORGE-A0 and FORGE-X1++FORGE-A0 described Forge as a future semantic CAD extension SDK made of concepts, templates, validation contracts, semantic feature schemas, examples, fixtures, and guidance rather than arbitrary runtime geometry plug-ins. FORGE-X1 introduced the descriptor abstractions and deterministic validation layer in `Aetheris.Forge.Abstractions`, including a descriptor-only `Standard.Hole` example fixture.++FORGE-X2 promotes that direction from a single example into an explicit built-in Standard concept pack descriptor. The pack is still hosted in `Aetheris.Forge` to avoid a new project or package-discovery mechanism.++## Metadata-only boundary++The pack uses `ForgeTrustTier.SemanticDocsOnly` and includes `MetadataOnly`/`NoPluginExecution` host requirements. Capabilities are documentation/contract metadata only. They do not load NuGet packages, scan assemblies, execute plugins, invoke lowerers, call materializers, or run Standard Library BRep helpers.++Existing parser, Firmament syntax, lowering, kernel, materializer, STEP, DisplayIR, frontend, product, and `Aetheris.Kernel.StandardLibrary` runtime behavior is unchanged.++## Hole and AIR relationship++`Standard.Hole`, `Standard.ShaftHole`, `Standard.CounterboreHole`, and `Standard.CountersinkHole` each include a lowering-contract descriptor whose target AIR feature family is `AirHoleFeature`. This is a metadata contract only: it names the conceptual AIR family that future tooling can validate against, but it does not execute lowering.++`Standard.ShaftHole` records `baseConceptId=Standard.Hole` in descriptor assumptions because the FORGE-X1 model does not yet have a first-class base-concept field. Counterbore and countersink descriptors also record stack metadata and diagnostics so tools can distinguish them from base shaft holes.++## Process and edge-finish concepts++`Standard.CNC` proves the pack can represent a manufacturing/process concept rather than only geometry features. It includes optional CNC/prismatic assumptions such as minimum tool radius, minimum wall thickness, preferred inside corner, and process family. It intentionally has no BRep or AIR lowering contract.++`Standard.EdgeFinish` captures target, kind, size, and scope metadata for edge-finish intent. Its lowering is explicitly deferred because FORGE-X2 does not add an AIR feature, BRep operation, or materializer extension point for edge finish descriptors.++## Deferred work++Deferred work includes package discovery, dynamic NuGet loading, assembly scanning, plugin execution, parser integration, new Firmament syntax, template expansion, standards/fit tables, thread/tap geometry, BRep/materializer extension APIs, and runtime migration of existing Forge or Standard Library geometry helpers.