Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Expose built-in engineering modules through CLI and Forge host
Yuechen Lic1393080c826
diff --git a/Aetheris.CLI.Tests/ModulesCommandTests.cs b/Aetheris.CLI.Tests/ModulesCommandTests.csnew file mode 100644index 00000000..30fdc4d1--- /dev/null+++ b/Aetheris.CLI.Tests/ModulesCommandTests.cs@@ -0,0 +1,20 @@+using System.Text.Json;+using Xunit;++namespace Aetheris.CLI.Tests;++public sealed class ModulesCommandTests+{+ [Fact]+ public void ModulesJsonInspectsStableBuiltInsAndCapabilities()+ {+ var stdout=new StringWriter();var stderr=new StringWriter();var exit=CliRunner.Run(["modules","--json"],stdout,stderr);+ Assert.Equal(0,exit);Assert.Empty(stderr.ToString());using var json=JsonDocument.Parse(stdout.ToString());var modules=json.RootElement.EnumerateArray().ToArray();Assert.Equal(["Aetheris.Core","Aetheris.Piping","Aetheris.Surfacing","Aetheris.SheetMetal"],modules.Select(m=>m.GetProperty("id").GetString()));Assert.Contains(modules.SelectMany(m=>m.GetProperty("capabilities").EnumerateArray()),c=>c.GetString()=="Piping.PipeRoute");+ }++ [Fact]+ public void ModulesTextMakesBuiltInNonPluginScopeExplicit()+ {+ var stdout=new StringWriter();var stderr=new StringWriter();Assert.Equal(0,CliRunner.Run(["modules"],stdout,stderr));Assert.Contains("no dynamic plugins",stdout.ToString());Assert.Contains("Aetheris.Surfacing 0.1.0",stdout.ToString());+ }+}diff --git a/Aetheris.CLI/Aetheris.CLI.csproj b/Aetheris.CLI/Aetheris.CLI.csprojindex 46648e0a..2109e0f4 100644--- a/Aetheris.CLI/Aetheris.CLI.csproj+++ b/Aetheris.CLI/Aetheris.CLI.csproj@@ -25,6 +25,7 @@<ProjectReference Include="..\Aetheris.Kernel.Core\Aetheris.Kernel.Core.csproj" /><ProjectReference Include="..\Aetheris.Firmament.FrictionLab\Aetheris.Firmament.FrictionLab.csproj" /><ProjectReference Include="..\Aetheris.FEA\Aetheris.FEA.csproj" />+ <ProjectReference Include="..\Aetheris.Modules.BuiltIn\Aetheris.Modules.BuiltIn.csproj" /></ItemGroup><ItemGroup>diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex 71c060e1..1c2c660b 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -18,6 +18,9 @@ using Aetheris.FEA.Abaqus;using Aetheris.FEA.Firmament;using Aetheris.FEA.Mechanics;using Aetheris.Semantics;+using Aetheris.Modules.BuiltIn;+using Aetheris.Piping;+using Aetheris.Surfacing;namespace Aetheris.CLI;@@ -211,6 +214,7 @@ public static class CliRunner"canon" => RunCanon(args.Skip(1).ToArray(), stdout, stderr),"asm" => RunAsm(args.Skip(1).ToArray(), stdout, stderr),"experimental" => RunExperimental(args.Skip(1).ToArray(), stdout, stderr),+ "modules" => RunModules(args.Skip(1).ToArray(), stdout, stderr),_ => UnknownCommand(args[0], stderr)};}@@ -462,6 +466,38 @@ public static class CliRunnerreturn 0;}+ private static int RunModules(string[] args, TextWriter stdout, TextWriter stderr)+ {+ if (args.Length > 0 && args[0] == "showcase") return RunModuleShowcase(args.Skip(1).ToArray(), stdout, stderr);+ var json = args.Contains("--json", StringComparer.Ordinal);+ if (args.Any(a => a is not "--json" and not "--help" and not "-h")) { stderr.WriteLine("Usage: aetheris modules [--json] | modules showcase --out-dir <directory>"); return 1; }+ var catalog = BuiltInModules.Catalog;+ if (json)+ {+ stdout.WriteLine(JsonSerializer.Serialize(catalog.Modules.Select(m => new { id=m.Id.Value,name=m.Name,version=m.Version.ToString(),m.BuiltIn,dependencies=m.Dependencies.Select(d=>new{id=d.ModuleId.Value,minimumVersion=d.MinimumVersion.ToString()}),capabilities=m.Capabilities.Select(c=>c.Id),m.Concepts,m.Templates,m.Lowerings,m.Documentation }), JsonOptions));+ return 0;+ }+ stdout.WriteLine("Built-in engineering Modules (explicit registration; no dynamic plugins)");+ foreach (var module in catalog.Modules) stdout.WriteLine($"{module.Id.Value} {module.Version} {(module.Capabilities.Count == 0 ? "(reserved)" : string.Join(", ", module.Capabilities.Select(c=>c.Id)))}");+ return 0;+ }++ private static int RunModuleShowcase(string[] args, TextWriter stdout, TextWriter stderr)+ {+ var index=Array.IndexOf(args,"--out-dir");if(index<0||index+1>=args.Length){stderr.WriteLine("Usage: aetheris modules showcase --out-dir <directory>");return 1;}+ var output=Path.GetFullPath(args[index+1]);Directory.CreateDirectory(output);var started=Stopwatch.GetTimestamp();var catalog=BuiltInModules.Catalog;var registryMs=Stopwatch.GetElapsedTime(started).TotalMilliseconds;started=Stopwatch.GetTimestamp();for(var i=0;i<10_000;i++)_ = BuiltInModules.Catalog.Capabilities.Count;var cachedRegistryLookupMicroseconds=Stopwatch.GetElapsedTime(started).TotalMicroseconds/10_000;+ started=Stopwatch.GetTimestamp();var saddleIr=RuledCanopyTemplate.Create("m0:saddle",80,50,12);var saddlePatch=RuledSurfaceLowering.Lower(saddleIr);var saddlePanel=RuledSurfacePanelMaterializer.Materialize(saddleIr,2);var surfacingMs=Stopwatch.GetElapsedTime(started).TotalMilliseconds;+ if(!saddlePatch.IsSuccess||saddlePanel.Body is null){stderr.WriteLine(string.Join("; ",saddlePanel.Diagnostics.Select(d=>d.Message)));return 1;}+ started=Stopwatch.GetTimestamp();var route=StandardPipeElbowTemplate.Create("m0:pipe-route",20,50,30);var pipe=PipeRouteLowering.Lower(route);var pipingMs=Stopwatch.GetElapsedTime(started).TotalMilliseconds;if(!pipe.IsSuccess){stderr.WriteLine(string.Join("; ",pipe.Diagnostics.Select(d=>d.Message)));return 1;}+ var saddleStep=Step242Exporter.ExportBody(saddlePanel.Body);var pipeStep=Step242Exporter.ExportBody(pipe.Body!);if(!saddleStep.IsSuccess||!pipeStep.IsSuccess){stderr.WriteLine(string.Join("; ",saddleStep.Diagnostics.Concat(pipeStep.Diagnostics).Select(d=>d.Message)));return 1;}+ var saddlePath=Path.Combine(output,"ruled-saddle.step");var pipePath=Path.Combine(output,"pipe-route.step");File.WriteAllText(saddlePath,saddleStep.Value);File.WriteAllText(pipePath,pipeStep.Value);+ string Hash(string text)=>Convert.ToHexString(SHA256.HashData(System.Text.Encoding.UTF8.GetBytes(text)));+ var evidence=new{milestone="AETHERIS-MODULE-M0",registryMs,cachedRegistryLookupMicroseconds,surfacingMs,pipingMs,modules=catalog.Modules.Select(m=>new{module=m.Id.Value,version=m.Version.ToString(),capabilities=m.Capabilities.Select(c=>c.Id)}),surfacing=new{saddleIr.StableId,kind=saddleIr.Kind.ToString(),surface=saddlePatch.Patch!.ExactSurface.Kind.ToString(),boundaries=saddlePatch.Patch.BoundaryProvenance,saddleHash=Hash(saddleStep.Value),faces=saddlePanel.Body.Topology.Faces.Count()},piping=new{ir=new{pipe.Ir!.StableId,elements=pipe.Ir.Elements.Select(e=>e switch{PipeRouteElement.Straight s=>new{kind="Straight",start=s.Start,end=s.End,radius=(double?)null,angle=(double?)null},PipeRouteElement.PlanarCircularBend b=>new{kind="PlanarCircularBend",start=b.Center,end=b.Center,radius=(double?)b.Radius,angle=(double?)b.AngleRadians},_=>throw new InvalidOperationException()})},framePolicy=PipeRouteLowering.CircularFramePolicy,pipeHash=Hash(pipeStep.Value),faces=pipe.Body!.Topology.Faces.Count(),semantics=SemanticValueDescriptor.From(pipe.Semantics!)} };+ File.WriteAllText(Path.Combine(output,"module-registry.json"),JsonSerializer.Serialize(catalog.Modules.Select(m=>new{id=m.Id.Value,version=m.Version.ToString(),dependencies=m.Dependencies,capabilities=m.Capabilities,concepts=m.Concepts,templates=m.Templates}),JsonOptions));+ File.WriteAllText(Path.Combine(output,"semantic-inspection.json"),JsonSerializer.Serialize(SemanticValueDescriptor.From(pipe.Semantics!),JsonOptions));+ File.WriteAllText(Path.Combine(output,"validation-report.json"),JsonSerializer.Serialize(evidence,JsonOptions));stdout.WriteLine(JsonSerializer.Serialize(new{output,saddleStep=saddlePath,pipeStep=pipePath,saddleHash=Hash(saddleStep.Value),pipeHash=Hash(pipeStep.Value)},JsonOptions));return 0;+ }+private static int RunDrawing(string[] args, TextWriter stdout, TextWriter stderr){if (args.Length == 0 || IsHelpFlag(args[0]))@@ -3401,6 +3437,7 @@ public static class CliRunnerstdout.WriteLine(" analyze Analyze STEP topology and analytic surfaces.");stdout.WriteLine(" fea Compile and solve a Firmament linear-elastic analysis and export Abaqus verification input.");stdout.WriteLine(" drawing Compile a Firmament Drawing Template to DrawingIR, SVG, and vector A4 PDF.");+ stdout.WriteLine(" modules Inspect built-in engineering Modules and capabilities.");stdout.WriteLine(" verify Build/reimport and verify a model.");stdout.WriteLine();stdout.WriteLine("Global options:");diff --git a/Aetheris.Forge.Host/Aetheris.Forge.Host.csproj b/Aetheris.Forge.Host/Aetheris.Forge.Host.csprojindex 2be650b1..86f5b811 100644--- a/Aetheris.Forge.Host/Aetheris.Forge.Host.csproj+++ b/Aetheris.Forge.Host/Aetheris.Forge.Host.csproj@@ -9,5 +9,6 @@<ProjectReference Include="..\Aetheris.Kernel.Firmament\Aetheris.Kernel.Firmament.csproj" /><ProjectReference Include="..\Aetheris.Continuum\Aetheris.Continuum.csproj" /><ProjectReference Include="..\Aetheris.FEA\Aetheris.FEA.csproj" />+ <ProjectReference Include="..\Aetheris.Modules.BuiltIn\Aetheris.Modules.BuiltIn.csproj" /></ItemGroup></Project>diff --git a/Aetheris.Forge.Host/ForgeHost.cs b/Aetheris.Forge.Host/ForgeHost.csindex 440dfdbe..a758dedf 100644--- a/Aetheris.Forge.Host/ForgeHost.cs+++ b/Aetheris.Forge.Host/ForgeHost.cs@@ -16,6 +16,8 @@ using Aetheris.Kernel.Firmament.FirmamentV2;using Aetheris.FEA.Abaqus;using Aetheris.FEA.Firmament;using Aetheris.FEA.Mechanics;+using Aetheris.Modules;+using Aetheris.Modules.BuiltIn;namespace Aetheris.Forge.Host;@@ -48,6 +50,9 @@ public sealed class ForgeHostpublic IReadOnlyList<ForgeCapabilityDescriptorV1> Capabilities => registry.InspectCapabilities();+ /// <summary>Engineering-domain capabilities available to ordinary Host users; KernelSDK is not required.</summary>+ public AetherisModuleCatalog EngineeringModules => BuiltInModules.Catalog;+public ForgeModule LoadModule(string path){ArgumentException.ThrowIfNullOrWhiteSpace(path);diff --git a/Aetheris.Modules.BuiltIn/Aetheris.Modules.BuiltIn.csproj b/Aetheris.Modules.BuiltIn/Aetheris.Modules.BuiltIn.csprojnew file mode 100644index 00000000..9c02f723--- /dev/null+++ b/Aetheris.Modules.BuiltIn/Aetheris.Modules.BuiltIn.csproj@@ -0,0 +1,9 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>+ <ItemGroup>+ <ProjectReference Include="..\Aetheris.Modules\Aetheris.Modules.csproj" />+ <ProjectReference Include="..\Aetheris.Surfacing\Aetheris.Surfacing.csproj" />+ <ProjectReference Include="..\Aetheris.Piping\Aetheris.Piping.csproj" />+ <ProjectReference Include="..\Aetheris.SheetMetal\Aetheris.SheetMetal.csproj" />+ </ItemGroup>+</Project>diff --git a/Aetheris.Modules.BuiltIn/BuiltInModules.cs b/Aetheris.Modules.BuiltIn/BuiltInModules.csnew file mode 100644index 00000000..a35eae0d--- /dev/null+++ b/Aetheris.Modules.BuiltIn/BuiltInModules.cs@@ -0,0 +1,13 @@+using Aetheris.Piping;+using Aetheris.SheetMetal;+using Aetheris.Surfacing;++namespace Aetheris.Modules.BuiltIn;++/// <summary>The sole M0 composition root. Explicit code registration keeps discovery deterministic and auditable.</summary>+public static class BuiltInModules+{+ private static readonly Lazy<AetherisModuleCatalog> CatalogValue = new(() => AetherisModuleCatalog.Create(+ [CoreModule.Definition, SurfacingModule.Definition, PipingModule.Definition, SheetMetalModule.Definition]));+ public static AetherisModuleCatalog Catalog => CatalogValue.Value;+}diff --git a/Aetheris.Modules.Tests/Aetheris.Modules.Tests.csproj b/Aetheris.Modules.Tests/Aetheris.Modules.Tests.csprojnew file mode 100644index 00000000..d8a7c64d--- /dev/null+++ b/Aetheris.Modules.Tests/Aetheris.Modules.Tests.csproj@@ -0,0 +1,8 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><IsPackable>false</IsPackable></PropertyGroup>+ <ItemGroup><PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" /><PackageReference Include="xunit" Version="2.9.3" /><PackageReference Include="xunit.runner.visualstudio" Version="3.1.4"><PrivateAssets>all</PrivateAssets></PackageReference></ItemGroup>+ <ItemGroup>+ <ProjectReference Include="..\Aetheris.Modules.BuiltIn\Aetheris.Modules.BuiltIn.csproj" />+ <ProjectReference Include="..\Aetheris.Forge.Host\Aetheris.Forge.Host.csproj" />+ </ItemGroup>+</Project>diff --git a/Aetheris.Modules.Tests/ModuleArchitectureTests.cs b/Aetheris.Modules.Tests/ModuleArchitectureTests.csnew file mode 100644index 00000000..2f4062c3--- /dev/null+++ b/Aetheris.Modules.Tests/ModuleArchitectureTests.cs@@ -0,0 +1,97 @@+using System.Security.Cryptography;+using System.Text;+using Aetheris.Forge.Host;+using Aetheris.Kernel.Core.Geometry;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Core.Step242;+using Aetheris.Modules;+using Aetheris.Modules.BuiltIn;+using Aetheris.Piping;+using Aetheris.Surfacing;+using Xunit;++namespace Aetheris.Modules.Tests;++public sealed class ModuleArchitectureTests+{+ [Fact] public void BuiltInsHaveStableIdentityVersionAndDeterministicOrder()+ {+ var first=BuiltInModules.Catalog;var second=AetherisModuleCatalog.Create(first.Modules.Reverse());+ Assert.Equal(["Aetheris.Core","Aetheris.Piping","Aetheris.Surfacing","Aetheris.SheetMetal"],first.Modules.Select(m=>m.Id.Value));+ Assert.Equal(first.Modules.Select(m=>m.Id.Value),second.Modules.Select(m=>m.Id.Value));+ Assert.Equal("0.1.0",first.Modules.Single(m=>m.Id==SurfacingModule.Id).Version.ToString());+ Assert.Equal(first.Capabilities.Select(c=>c.Id).Order(StringComparer.Ordinal),first.Capabilities.Select(c=>c.Id));+ }++ [Fact] public void DuplicateModuleAndCapabilityOwnershipAreRejected()+ {+ var duplicate=Assert.Throws<ModuleCatalogException>(()=>AetherisModuleCatalog.Create([CoreModule.Definition,CoreModule.Definition]));+ Assert.Contains(duplicate.Diagnostics,d=>d.Kind==ModuleDiagnosticKind.DuplicateModuleId);+ var id=new AetherisModuleId("Aetheris.Other");var other=NewModule(id,capabilities:[new("Surfacing.RuledSurface",id,new(1,0,0),"collision")]);+ var collision=Assert.Throws<ModuleCatalogException>(()=>AetherisModuleCatalog.Create([CoreModule.Definition,SurfacingModule.Definition,other]));+ Assert.Contains(collision.Diagnostics,d=>d.Kind==ModuleDiagnosticKind.DuplicateCapability);+ }++ [Fact] public void DependencyCycleAndMissingDependencyAreTypedAndDeterministic()+ {+ var a=new AetherisModuleId("Aetheris.A");var b=new AetherisModuleId("Aetheris.B");+ var cycle=Assert.Throws<ModuleCatalogException>(()=>AetherisModuleCatalog.Create([NewModule(a,[new(b,new(1,0,0))]),NewModule(b,[new(a,new(1,0,0))])]));+ Assert.Equal("Module dependency cycle: Aetheris.A -> Aetheris.B -> Aetheris.A.",Assert.Single(cycle.Diagnostics).Message);+ var missing=Assert.Throws<ModuleCatalogException>(()=>AetherisModuleCatalog.Create([NewModule(a,[new(b,new(1,0,0))])]));+ Assert.Equal(ModuleDiagnosticKind.MissingDependency,Assert.Single(missing.Diagnostics).Kind);+ }++ [Fact] public void CapabilityRequirementNamesOwnerAndVersion()+ {+ var diagnostic=BuiltInModules.Catalog.RequireCapability("Piping.Future",PipingModule.Id,new(2,0,0));+ Assert.NotNull(diagnostic);Assert.Equal("Piping.Future",diagnostic!.CapabilityId);Assert.Equal(PipingModule.Id,diagnostic.OwningModule);Assert.Equal(new ModuleVersion(2,0,0),diagnostic.RequiredVersion);+ Assert.Null(BuiltInModules.Catalog.RequireCapability(PipingModule.PipeRouteCapability,PipingModule.Id,new(0,1,0)));+ }++ [Fact] public void ForgeHostInspectsEngineeringModulesWithoutKernelSdk()+ {+ var host=new ForgeHost();Assert.Contains(host.EngineeringModules.Modules,m=>m.Id==PipingModule.Id);Assert.DoesNotContain(typeof(ForgeHost).Assembly.GetReferencedAssemblies(),a=>a.Name=="Aetheris.Forge.KernelSDK");+ }++ private static AetherisModule NewModule(AetherisModuleId id,IReadOnlyList<ModuleDependency>? dependencies=null,IReadOnlyList<ModuleCapability>? capabilities=null)=>new(id,id.Value,new(1,0,0),capabilities??[],[],[],[],[],dependencies??[],new("test"));+}++public sealed class SurfacingModuleTests+{+ [Fact] public void LineLineRuledSurfacePreservesIdentityAndProvenance()+ {+ var a=new RuledBoundary.Line("a",new(0,0,0),new(10,0,0));var b=new RuledBoundary.Line("b",new(0,5,1),new(10,5,-1));var ir=new RuledSurfaceIr("surface",RuledConstructionKind.RuledSurface,a,b,new("a","source:a","boundary-a"),new("b","source:b","boundary-b"));var result=RuledSurfaceLowering.Lower(ir);+ Assert.True(result.IsSuccess);Assert.Equal(SurfaceGeometryKind.BSplineSurfaceWithKnots,result.Patch!.ExactSurface.Kind);Assert.Equal("RULED_SURFACE",result.Patch.ExactSurface.BSplineSurfaceWithKnots!.SurfaceForm);Assert.Equal(["a","b"],result.Patch.BoundaryProvenance.Select(p=>p.BoundaryStableId));+ }++ [Fact] public void CoaxialCircleBoundariesLowerToExactCylinder()+ {+ var z=Direction3D.Create(new(0,0,1));var x=Direction3D.Create(new(1,0,0));var c0=new RuledBoundary.Circle("c0",new(0,0,0),z,3,x);var c1=new RuledBoundary.Circle("c1",new(0,0,8),z,3,x);var result=RuledSurfaceLowering.Lower(new("cylinder",RuledConstructionKind.RuledTransition,c0,c1,new("c0","s","section-a"),new("c1","s","section-b")));+ Assert.True(result.IsSuccess);Assert.Equal(SurfaceGeometryKind.Cylinder,result.Patch!.ExactSurface.Kind);Assert.Equal(RuledConstructionKind.RuledTransition,result.Patch.Ir.Kind);+ }++ [Fact] public void SaddleIsExactBilinearAndPanelStepIsDeterministic()+ {+ var ir=RuledSurfaceLowering.Saddle("saddle",4,3,2);var patch=RuledSurfaceLowering.Lower(ir).Patch!;Assert.Equal(new Point3D(0,0,0),patch.Evaluate(.5,.5));Assert.True(patch.Evaluate(0,0).Z>0);Assert.True(patch.Evaluate(1,1).Z>0);+ var panel=RuledSurfacePanelMaterializer.Materialize(ir,1);Assert.NotNull(panel.Body);Assert.Equal(6,panel.Body!.Topology.Faces.Count());var a=Step242Exporter.ExportBody(panel.Body);var b=Step242Exporter.ExportBody(panel.Body);Assert.True(a.IsSuccess);Assert.Equal(Hash(a.Value),Hash(b.Value));+ }+ private static string Hash(string text)=>Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(text)));+}++public sealed class PipingModuleTests+{+ [Fact] public void StraightPathPipeIsExactCylinder()+ {var result=PipeRouteLowering.LowerStraight(40,new(10));Assert.NotNull(result.Body);Assert.Contains(result.Body!.Geometry.Surfaces,s=>s.Value.Kind==SurfaceGeometryKind.Cylinder);Assert.True(Step242Exporter.ExportBody(result.Body).IsSuccess);}++ [Fact] public void RouteLowersLineBendLineWithEndpointSemanticsAndExactTorus()+ {+ var result=PipeRouteLowering.Lower(StandardPipeElbowTemplate.Create("route",20,50,30));Assert.True(result.IsSuccess,string.Join(";",result.Diagnostics.Select(d=>d.Message)));Assert.Equal(3,result.Ir!.Elements.Count);Assert.Contains(result.Body!.Geometry.Surfaces,s=>s.Value.Kind==SurfaceGeometryKind.Torus);Assert.Equal(["bendEnd","bendStart","centerline","diameter","inlet","inletAxis","outlet","outletAxis"],result.Semantics!.ExposedMembers.Keys.Order(StringComparer.Ordinal));Assert.Contains("transported",result.Ir.FramePolicy);Assert.True(Step242Exporter.ExportBody(result.Body).IsSuccess);+ }++ [Fact] public void InvalidBendAndWallAreDomainDiagnostics()+ {var invalid=PipeRouteLowering.Lower(new("bad",10,4,double.Pi/2,10,new(10,1)));Assert.Contains(invalid.Diagnostics,d=>d.Code=="piping-bend-radius-invalid");Assert.Contains(invalid.Diagnostics,d=>d.Code=="piping-wall-not-supported");}++ [Fact] public void RouteStepAndSemanticIdentitiesAreDeterministic()+ {var a=PipeRouteLowering.Lower(StandardPipeElbowTemplate.Create("route",20,50,30));var b=PipeRouteLowering.Lower(StandardPipeElbowTemplate.Create("route",20,50,30));var sa=Step242Exporter.ExportBody(a.Body!);var sb=Step242Exporter.ExportBody(b.Body!);Assert.Equal(Hash(sa.Value),Hash(sb.Value));Assert.Equal(a.Semantics!.StableIdentity,b.Semantics!.StableIdentity);}+ private static string Hash(string text)=>Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(text)));+}diff --git a/Aetheris.Modules/Aetheris.Modules.csproj b/Aetheris.Modules/Aetheris.Modules.csprojnew file mode 100644index 00000000..6c3a8871--- /dev/null+++ b/Aetheris.Modules/Aetheris.Modules.csproj@@ -0,0 +1,7 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup>+ <TargetFramework>net10.0</TargetFramework>+ <ImplicitUsings>enable</ImplicitUsings>+ <Nullable>enable</Nullable>+ </PropertyGroup>+</Project>diff --git a/Aetheris.Modules/ModuleModel.cs b/Aetheris.Modules/ModuleModel.csnew file mode 100644index 00000000..e2813588--- /dev/null+++ b/Aetheris.Modules/ModuleModel.cs@@ -0,0 +1,156 @@+using System.Collections.ObjectModel;++namespace Aetheris.Modules;++public readonly record struct AetherisModuleId+{+ public AetherisModuleId(string value)+ {+ if (string.IsNullOrWhiteSpace(value) || !value.StartsWith("Aetheris.", StringComparison.Ordinal)+ || value.Any(ch => !(char.IsLetterOrDigit(ch) || ch is '.')))+ throw new ArgumentException("Module IDs must be explicit dotted Aetheris identities.", nameof(value));+ Value = value;+ }+ public string Value { get; }+ public override string ToString() => Value;+}++public readonly record struct ModuleVersion : IComparable<ModuleVersion>+{+ public ModuleVersion(int major, int minor, int patch)+ {+ if (major < 0 || minor < 0 || patch < 0) throw new ArgumentOutOfRangeException(nameof(major));+ Major = major; Minor = minor; Patch = patch;+ }+ public int Major { get; }+ public int Minor { get; }+ public int Patch { get; }+ public int CompareTo(ModuleVersion other) => (Major, Minor, Patch).CompareTo((other.Major, other.Minor, other.Patch));+ public override string ToString() => $"{Major}.{Minor}.{Patch}";+}++public sealed record ModuleDependency(AetherisModuleId ModuleId, ModuleVersion MinimumVersion);++/// <summary>Compiler/domain functionality. This is intentionally unrelated to ISemanticCapability.</summary>+public sealed record ModuleCapability(+ string Id,+ AetherisModuleId OwningModule,+ ModuleVersion SinceVersion,+ string Description);++public sealed record ModuleDocumentation(string ArchitecturePath, string? PublicPath = null);++public sealed record AetherisModule(+ AetherisModuleId Id,+ string Name,+ ModuleVersion Version,+ IReadOnlyList<ModuleCapability> Capabilities,+ IReadOnlyList<string> Concepts,+ IReadOnlyList<string> Templates,+ IReadOnlyList<string> Lowerings,+ IReadOnlyList<string> DiagnosticCodes,+ IReadOnlyList<ModuleDependency> Dependencies,+ ModuleDocumentation Documentation,+ bool BuiltIn = true);++public enum ModuleDiagnosticKind { DuplicateModuleId, DuplicateCapability, CapabilityOwnerMismatch, MissingDependency, DependencyVersion, DependencyCycle, CapabilityUnavailable }++public sealed record ModuleDiagnostic(+ ModuleDiagnosticKind Kind,+ string Code,+ string Message,+ string? CapabilityId = null,+ AetherisModuleId? OwningModule = null,+ ModuleVersion? RequiredVersion = null);++public sealed class ModuleCatalogException : InvalidOperationException+{+ public ModuleCatalogException(IReadOnlyList<ModuleDiagnostic> diagnostics)+ : base(string.Join(Environment.NewLine, diagnostics.Select(d => d.Message))) => Diagnostics = diagnostics;+ public IReadOnlyList<ModuleDiagnostic> Diagnostics { get; }+}++/// <summary>Deterministic explicit catalog. Registration is code-owned; no assembly scanning or service location.</summary>+public sealed class AetherisModuleCatalog+{+ private readonly IReadOnlyDictionary<AetherisModuleId, AetherisModule> modules;+ private readonly IReadOnlyDictionary<string, ModuleCapability> capabilities;++ private AetherisModuleCatalog(IReadOnlyList<AetherisModule> ordered)+ {+ Modules = ordered;+ modules = new ReadOnlyDictionary<AetherisModuleId, AetherisModule>(ordered.ToDictionary(m => m.Id));+ capabilities = new ReadOnlyDictionary<string, ModuleCapability>(ordered.SelectMany(m => m.Capabilities).ToDictionary(c => c.Id, StringComparer.Ordinal));+ }++ public IReadOnlyList<AetherisModule> Modules { get; }+ public IReadOnlyList<ModuleCapability> Capabilities => capabilities.Values.OrderBy(c => c.Id, StringComparer.Ordinal).ToArray();+ public bool TryGetModule(AetherisModuleId id, out AetherisModule module) => modules.TryGetValue(id, out module!);+ public bool TryGetCapability(string id, out ModuleCapability capability) => capabilities.TryGetValue(id, out capability!);++ public ModuleDiagnostic? RequireCapability(string id, AetherisModuleId owner, ModuleVersion minimum)+ {+ if (capabilities.TryGetValue(id, out var available) && available.OwningModule == owner+ && modules[owner].Version.CompareTo(minimum) >= 0) return null;+ return new(ModuleDiagnosticKind.CapabilityUnavailable, "module-capability-unavailable",+ $"Capability '{id}' requires module '{owner}' version {minimum} or later.", id, owner, minimum);+ }++ public static AetherisModuleCatalog Create(IEnumerable<AetherisModule> registrations)+ {+ ArgumentNullException.ThrowIfNull(registrations);+ var input = registrations.ToArray();+ var diagnostics = new List<ModuleDiagnostic>();+ foreach (var duplicate in input.GroupBy(m => m.Id).Where(g => g.Count() > 1).OrderBy(g => g.Key.Value, StringComparer.Ordinal))+ diagnostics.Add(new(ModuleDiagnosticKind.DuplicateModuleId, "module-id-duplicate", $"Module ID '{duplicate.Key}' is registered more than once."));+ foreach (var duplicate in input.SelectMany(m => m.Capabilities).GroupBy(c => c.Id, StringComparer.Ordinal).Where(g => g.Count() > 1).OrderBy(g => g.Key, StringComparer.Ordinal))+ diagnostics.Add(new(ModuleDiagnosticKind.DuplicateCapability, "module-capability-duplicate", $"Capability '{duplicate.Key}' has more than one owner.", duplicate.Key));+ foreach (var module in input.OrderBy(m => m.Id.Value, StringComparer.Ordinal))+ foreach (var capability in module.Capabilities.Where(c => c.OwningModule != module.Id).OrderBy(c => c.Id, StringComparer.Ordinal))+ diagnostics.Add(new(ModuleDiagnosticKind.CapabilityOwnerMismatch, "module-capability-owner-mismatch", $"Capability '{capability.Id}' declares owner '{capability.OwningModule}' but is registered by '{module.Id}'.", capability.Id, capability.OwningModule));+ if (diagnostics.Count > 0) throw new ModuleCatalogException(diagnostics);++ var byId = input.ToDictionary(m => m.Id);+ foreach (var module in input.OrderBy(m => m.Id.Value, StringComparer.Ordinal))+ foreach (var dependency in module.Dependencies.OrderBy(d => d.ModuleId.Value, StringComparer.Ordinal))+ {+ if (!byId.TryGetValue(dependency.ModuleId, out var target))+ diagnostics.Add(new(ModuleDiagnosticKind.MissingDependency, "module-dependency-missing", $"Module '{module.Id}' requires missing module '{dependency.ModuleId}'."));+ else if (target.Version.CompareTo(dependency.MinimumVersion) < 0)+ diagnostics.Add(new(ModuleDiagnosticKind.DependencyVersion, "module-dependency-version", $"Module '{module.Id}' requires '{target.Id}' {dependency.MinimumVersion} or later; found {target.Version}."));+ }+ if (diagnostics.Count > 0) throw new ModuleCatalogException(diagnostics);++ var state = new Dictionary<AetherisModuleId, int>();+ var stack = new List<AetherisModuleId>();+ var ordered = new List<AetherisModule>();+ foreach (var module in input.OrderBy(m => m.Id.Value, StringComparer.Ordinal)) Visit(module);+ if (diagnostics.Count > 0) throw new ModuleCatalogException(diagnostics);+ return new AetherisModuleCatalog(ordered);++ void Visit(AetherisModule module)+ {+ if (state.TryGetValue(module.Id, out var current))+ {+ if (current == 2) return;+ if (current == 1)+ {+ var start = stack.IndexOf(module.Id);+ var cycle = stack.Skip(start).Append(module.Id).Select(id => id.Value);+ diagnostics.Add(new(ModuleDiagnosticKind.DependencyCycle, "module-dependency-cycle", $"Module dependency cycle: {string.Join(" -> ", cycle)}."));+ }+ return;+ }+ state[module.Id] = 1; stack.Add(module.Id);+ foreach (var dependency in module.Dependencies.OrderBy(d => d.ModuleId.Value, StringComparer.Ordinal)) Visit(byId[dependency.ModuleId]);+ stack.RemoveAt(stack.Count - 1); state[module.Id] = 2; ordered.Add(module);+ }+ }+}++public static class CoreModule+{+ public static readonly AetherisModuleId Id = new("Aetheris.Core");+ public static AetherisModule Definition { get; } = new(Id, "Core", new(1, 0, 0), [], [], [],+ ["Shared exact geometry, BRep, AIR/ConstructionIR, compiler substrate"], [], [], new("docs/modules/architecture.md"));+}diff --git a/Aetheris.Piping/Aetheris.Piping.csproj b/Aetheris.Piping/Aetheris.Piping.csprojnew file mode 100644index 00000000..6931e3bb--- /dev/null+++ b/Aetheris.Piping/Aetheris.Piping.csproj@@ -0,0 +1,8 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>+ <ItemGroup>+ <ProjectReference Include="..\Aetheris.Modules\Aetheris.Modules.csproj" />+ <ProjectReference Include="..\Aetheris.Kernel.Core\Aetheris.Kernel.Core.csproj" />+ <ProjectReference Include="..\Aetheris.Semantics\Aetheris.Semantics.csproj" />+ </ItemGroup>+</Project>diff --git a/Aetheris.Piping/PipeRoute.cs b/Aetheris.Piping/PipeRoute.csnew file mode 100644index 00000000..8e6b8020--- /dev/null+++ b/Aetheris.Piping/PipeRoute.cs@@ -0,0 +1,83 @@+using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Core.Brep.Features;+using Aetheris.Kernel.Core.Geometry;+using Aetheris.Kernel.Core.Geometry.Curves;+using Aetheris.Kernel.Core.Geometry.Surfaces;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Core.Topology;+using Aetheris.Semantics;++namespace Aetheris.Piping;++public sealed record PipeSection(double OuterDiameter, double? WallThickness = null)+{ public bool IsSolid => WallThickness is null; }+public sealed record PipeRoute(string StableId, double InletLength, double BendRadius, double BendAngleRadians, double OutletLength, PipeSection Section);+public abstract record PipeRouteElement(string StableId)+{+ public sealed record Straight(string Id, Point3D Start, Point3D End) : PipeRouteElement(Id);+ public sealed record PlanarCircularBend(string Id, Point3D Center, double Radius, double AngleRadians) : PipeRouteElement(Id);+}+public sealed record PipeRouteIr(string StableId,IReadOnlyList<PipeRouteElement> Elements,string FramePolicy,string BoundaryProvenance);+public sealed record PipingDiagnostic(string Code,string Message);+public sealed record PipeRouteResult(BrepBody? Body,SemanticValue? Semantics,PipeRouteIr? Ir,IReadOnlyList<PipingDiagnostic> Diagnostics)+{ public bool IsSuccess=>Body is not null&&Semantics is not null&&Diagnostics.Count==0; }++/// <summary>M0 exact route: +X straight, one +90-degree XY bend, then +Y straight.</summary>+public static class PipeRouteLowering+{+ public const string CircularFramePolicy="Circular section: section phase is transported by the route plane normal; twist is immaterial and seam phase is deterministic.";+ public static PipeRouteResult Lower(PipeRoute route)+ {+ var errors=Validate(route); if(errors.Count>0)return new(null,null,null,errors);+ var r=route.Section.OuterDiameter/2;var l0=route.InletLength;var br=route.BendRadius;var l1=route.OutletLength;+ var c0=new Point3D(0,0,0);var c1=new Point3D(l0,0,0);var bc=new Point3D(l0,br,0);var c2=new Point3D(l0+br,br,0);var c3=new Point3D(l0+br,br+l1,0);+ var ir=new PipeRouteIr(route.StableId,[new PipeRouteElement.Straight(route.StableId+":straight-in",c0,c1),new PipeRouteElement.PlanarCircularBend(route.StableId+":bend-0",bc,br,route.BendAngleRadians),new PipeRouteElement.Straight(route.StableId+":straight-out",c2,c3)],CircularFramePolicy,"centerline and four cross-section rings");+ var builder=new TopologyBuilder();var rv=Enumerable.Range(0,4).Select(_=>builder.AddVertex()).ToArray();+ var rings=rv.Select(v=>builder.AddEdge(v,v)).ToArray();var seams=new[]{builder.AddEdge(rv[0],rv[1]),builder.AddEdge(rv[1],rv[2]),builder.AddEdge(rv[2],rv[3])};+ var inlet=AddFace(builder,[Use.F(rings[0])]);+ var side0=AddFace(builder,[Use.F(seams[0]),Use.F(rings[1]),Use.R(seams[0]),Use.R(rings[0])]);+ var bend=AddFace(builder,[Use.F(seams[1]),Use.F(rings[2]),Use.R(seams[1]),Use.R(rings[1])]);+ var side1=AddFace(builder,[Use.F(seams[2]),Use.F(rings[3]),Use.R(seams[2]),Use.R(rings[2])]);+ var outlet=AddFace(builder,[Use.R(rings[3])]);var shell=builder.AddShell([inlet,side0,bend,side1,outlet]);builder.AddBody([shell]);+ var dx=Direction3D.Create(new(1,0,0));var dy=Direction3D.Create(new(0,1,0));var dz=Direction3D.Create(new(0,0,1));var nx=Direction3D.Create(new(-1,0,0));var negY=Direction3D.Create(new(0,-1,0));+ var centers=new[]{c0,c1,c2,c3};var normals=new[]{dx,dx,dy,dy};var refs=new[]{negY,negY,dx,dx};+ var points=new[]{c0+negY.ToVector()*r,c1+negY.ToVector()*r,c2+dx.ToVector()*r,c3+dx.ToVector()*r};+ var geometry=new BrepGeometryStore();var bindings=new BrepBindingModel();var gid=1;+ for(var i=0;i<4;i++){geometry.AddCurve(new(gid),CurveGeometry.FromCircle(new Circle3Curve(centers[i],normals[i],r,refs[i])));bindings.AddEdgeBinding(new(rings[i],new(gid++),new ParameterInterval(0,2*double.Pi)));}+ geometry.AddCurve(new(gid),CurveGeometry.FromLine(new Line3Curve(points[0],dx)));bindings.AddEdgeBinding(new(seams[0],new(gid++),new ParameterInterval(0,l0)));+ geometry.AddCurve(new(gid),CurveGeometry.FromCircle(new Circle3Curve(bc,dz,br+r,negY)));bindings.AddEdgeBinding(new(seams[1],new(gid++),new ParameterInterval(0,double.Pi/2)));+ geometry.AddCurve(new(gid),CurveGeometry.FromLine(new Line3Curve(points[2],dy)));bindings.AddEdgeBinding(new(seams[2],new(gid++),new ParameterInterval(0,l1)));+ var sid=1;geometry.AddSurface(new(sid),SurfaceGeometry.FromPlane(new PlaneSurface(c0,nx,negY)));bindings.AddFaceBinding(new(inlet,new(sid++)));+ geometry.AddSurface(new(sid),SurfaceGeometry.FromCylinder(new CylinderSurface(c0,dx,r,negY)));bindings.AddFaceBinding(new(side0,new(sid++)));+ geometry.AddSurface(new(sid),SurfaceGeometry.FromTorus(new TorusSurface(bc,dz,br,r,negY)));bindings.AddFaceBinding(new(bend,new(sid++)));+ geometry.AddSurface(new(sid),SurfaceGeometry.FromCylinder(new CylinderSurface(c2,dy,r,dx)));bindings.AddFaceBinding(new(side1,new(sid++)));+ geometry.AddSurface(new(sid),SurfaceGeometry.FromPlane(new PlaneSurface(c3,dy,dx)));bindings.AddFaceBinding(new(outlet,new(sid++)));+ var vertexPoints=rv.Select((v,i)=>(v,points[i])).ToDictionary(x=>x.v,x=>x.Item2);var body=new BrepBody(builder.Model,geometry,bindings,vertexPoints);+ var valid=BrepBindingValidator.Validate(body,true);if(!valid.IsSuccess)return new(null,null,ir,valid.Diagnostics.Select(d=>new PipingDiagnostic("piping-brep-invalid",d.Message)).ToArray());+ var semantics=CreateSemantics(route,body,c0,c1,c2,c3,dx,dy);var semanticErrors=SemanticValueValidator.Validate(semantics);+ return semanticErrors.Count==0?new(body,semantics,ir,[]):new(null,semantics,ir,semanticErrors.Select(d=>new PipingDiagnostic(d.Code,d.Message)).ToArray());+ }++ public static (BrepBody? Body, IReadOnlyList<PipingDiagnostic> Diagnostics) LowerStraight(double length, PipeSection section)+ {+ if (!double.IsFinite(length) || length <= 0 || !double.IsFinite(section.OuterDiameter) || section.OuterDiameter <= 0)+ return (null, [new("piping-route-invalid", "Straight PathPipe requires positive finite length and diameter.")]);+ if (!section.IsSolid) return (null, [new("piping-wall-not-supported", "M0 straight PathPipe admits solid circular section only.")]);+ var frame = new ExtrudeFrame3D(Point3D.Origin, Direction3D.Create(new Vector3D(0, 1, 0)), Direction3D.Create(new Vector3D(0, 0, 1)));+ var axis = new RevolveAxis3D(Point3D.Origin, new Vector3D(1, 0, 0));+ var result = BrepRevolve.Create([new(section.OuterDiameter / 2, 0), new(section.OuterDiameter / 2, length)], frame, axis);+ return result.IsSuccess ? (result.Value, []) : (null, result.Diagnostics.Select(d => new PipingDiagnostic("piping-brep-invalid", d.Message)).ToArray());+ }+ private static List<PipingDiagnostic> Validate(PipeRoute route)+ {var d=new List<PipingDiagnostic>();if(string.IsNullOrWhiteSpace(route.StableId)||route.InletLength<=0||route.OutletLength<=0||!double.IsFinite(route.InletLength)||!double.IsFinite(route.OutletLength))d.Add(new("piping-route-invalid","Route identity and positive finite straight lengths are required."));if(!double.IsFinite(route.Section.OuterDiameter)||route.Section.OuterDiameter<=0)d.Add(new("piping-route-invalid","Outer diameter must be finite and positive."));if(!double.IsFinite(route.BendRadius)||route.BendRadius<=route.Section.OuterDiameter/2)d.Add(new("piping-bend-radius-invalid","Centerline bend radius must exceed the pipe outer radius."));if(double.Abs(route.BendAngleRadians-double.Pi/2)>1e-12)d.Add(new("piping-route-invalid","M0 admits one positive 90-degree planar bend."));if(route.Section.WallThickness is not null)d.Add(new("piping-wall-not-supported","M0 exact route materialization admits solid circular section only; wall metadata is reserved."));return d;}+ private static SemanticValue CreateSemantics(PipeRoute route,BrepBody body,Point3D c0,Point3D bendIn,Point3D bendOut,Point3D c3,Direction3D dx,Direction3D dy)+ {SemanticSourceSpan gen=SemanticSourceSpan.Generated("Aetheris.Piping");var members=new[]{Point("inlet",c0),Axis("inletAxis",c0,dx),Point("outlet",c3),Axis("outletAxis",c3,dy),Point("bendStart",bendIn),Point("bendEnd",bendOut),Dimension("diameter",route.Section.OuterDiameter),new SemanticValue(route.StableId+":centerline",new("PipeCenterline"),bindings:[new ConstructionIdentityBinding(route.StableId+":centerline")],provenance:[new("PipingLowering",route.StableId,"exact line-arc-line centerline",gen)],generatedSourceSpan:gen,exposedName:"centerline")};return new(route.StableId,new("PipeRoute"),[new BodyCapability(),new ExactGeometryCapability(),new SelectableCapability()],[new ExactBrepBodyBinding(body,route.StableId+":body")],members,[new("PipingLowering",route.StableId,CircularFramePolicy,gen)],generatedSourceSpan:gen);+ SemanticValue Point(string n,Point3D p)=>new(route.StableId+":"+n,new("Point3"),[new PointCapability()],[new ExactPointBinding(p.X,p.Y,p.Z,route.StableId+":"+n)],provenance:[new("PipingLowering",route.StableId,n,gen)],generatedSourceSpan:gen,exposedName:n);+ SemanticValue Axis(string n,Point3D p,Direction3D a)=>new(route.StableId+":"+n,new("Axis"),[new AxisCapability()],[new ExactAxisBinding(p.X,p.Y,p.Z,a.X,a.Y,a.Z,route.StableId+":"+n)],provenance:[new("PipingLowering",route.StableId,n,gen)],generatedSourceSpan:gen,exposedName:n);+ SemanticValue Dimension(string n,double value)=>new(route.StableId+":"+n,new("Length"),[new DimensionalCapability()],[new TolerancedDimensionBinding(value,0,0,"mm",route.StableId+":"+n)],provenance:[new("PipingLowering",route.StableId,n,gen)],generatedSourceSpan:gen,exposedName:n);}+ private readonly record struct Use(EdgeId Edge,bool Reverse){public static Use F(EdgeId e)=>new(e,false);public static Use R(EdgeId e)=>new(e,true);}+ private static FaceId AddFace(TopologyBuilder b,IReadOnlyList<Use> uses){var loop=b.AllocateLoopId();var ids=uses.Select(_=>b.AllocateCoedgeId()).ToArray();for(var i=0;i<ids.Length;i++)b.AddCoedge(new Coedge(ids[i],uses[i].Edge,loop,ids[(i+1)%ids.Length],ids[(i+ids.Length-1)%ids.Length],uses[i].Reverse));b.AddLoop(new Loop(loop,ids));return b.AddFace([loop]);}+}++public static class StandardPipeElbowTemplate+{public static PipeRoute Create(string stableId,double nominalDiameter,double straightLength,double bendRadius)=>new(stableId,straightLength,bendRadius,double.Pi/2,straightLength,new(nominalDiameter));}diff --git a/Aetheris.Piping/PipingModule.cs b/Aetheris.Piping/PipingModule.csnew file mode 100644index 00000000..bc83f53d--- /dev/null+++ b/Aetheris.Piping/PipingModule.cs@@ -0,0 +1,17 @@+using Aetheris.Modules;++namespace Aetheris.Piping;++public static class PipingModule+{+ public static readonly AetherisModuleId Id = new("Aetheris.Piping");+ public static readonly ModuleVersion Version = new(0, 1, 0);+ public const string PathPipeCapability = "Piping.PathPipe";+ public const string PipeRouteCapability = "Piping.PipeRoute";+ public static AetherisModule Definition { get; } = new(Id, "Piping", Version,+ [new(PathPipeCapability,Id,Version,"Circular pipe driven by an engineering centerline."),new(PipeRouteCapability,Id,Version,"Validated straight/planar-bend pipe route.")],+ ["Piping.PipeRoute","Piping.PipeSection"],["Piping.StandardPipeElbow"],+ ["PipeRouteIR -> analytic cylinders/torus -> exact BRep"],+ ["piping-route-invalid","piping-bend-radius-invalid","piping-wall-not-supported"],+ [new(CoreModule.Id,new(1,0,0))],new("docs/modules/piping.md"));+}diff --git a/Aetheris.SheetMetal/Aetheris.SheetMetal.csproj b/Aetheris.SheetMetal/Aetheris.SheetMetal.csprojnew file mode 100644index 00000000..5caf458b--- /dev/null+++ b/Aetheris.SheetMetal/Aetheris.SheetMetal.csproj@@ -0,0 +1,4 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>+ <ItemGroup><ProjectReference Include="..\Aetheris.Modules\Aetheris.Modules.csproj" /><ProjectReference Include="..\Aetheris.Surfacing\Aetheris.Surfacing.csproj" /></ItemGroup>+</Project>diff --git a/Aetheris.SheetMetal/SheetMetalModule.cs b/Aetheris.SheetMetal/SheetMetalModule.csnew file mode 100644index 00000000..17306373--- /dev/null+++ b/Aetheris.SheetMetal/SheetMetalModule.cs@@ -0,0 +1,13 @@+using Aetheris.Modules;+using Aetheris.Surfacing;++namespace Aetheris.SheetMetal;++public static class SheetMetalModule+{+ public static readonly AetherisModuleId Id = new("Aetheris.SheetMetal");+ public static readonly ModuleVersion Version = new(0, 1, 0);+ public static AetherisModule Definition { get; } = new(Id,"Sheet Metal",Version,[],+ ["SheetMetal.NeutralSurface (reserved)","SheetMetal.FormedState (reserved)"],[],[],[],+ [new(CoreModule.Id,new(1,0,0)),new(SurfacingModule.Id,new(0,1,0))],new("docs/modules/sheet-metal.md"));+}diff --git a/Aetheris.Surfacing/Aetheris.Surfacing.csproj b/Aetheris.Surfacing/Aetheris.Surfacing.csprojnew file mode 100644index 00000000..6931e3bb--- /dev/null+++ b/Aetheris.Surfacing/Aetheris.Surfacing.csproj@@ -0,0 +1,8 @@+<Project Sdk="Microsoft.NET.Sdk">+ <PropertyGroup><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>+ <ItemGroup>+ <ProjectReference Include="..\Aetheris.Modules\Aetheris.Modules.csproj" />+ <ProjectReference Include="..\Aetheris.Kernel.Core\Aetheris.Kernel.Core.csproj" />+ <ProjectReference Include="..\Aetheris.Semantics\Aetheris.Semantics.csproj" />+ </ItemGroup>+</Project>diff --git a/Aetheris.Surfacing/RuledSurfaceIr.cs b/Aetheris.Surfacing/RuledSurfaceIr.csnew file mode 100644index 00000000..dbb5aea4--- /dev/null+++ b/Aetheris.Surfacing/RuledSurfaceIr.cs@@ -0,0 +1,24 @@+using Aetheris.Kernel.Core.Math;++namespace Aetheris.Surfacing;++public abstract record RuledBoundary(string StableId)+{+ public sealed record Line(string Id, Point3D Start, Point3D End) : RuledBoundary(Id);+ public sealed record Circle(string Id, Point3D Center, Direction3D Normal, double Radius, Direction3D ReferenceAxis) : RuledBoundary(Id);+}++public sealed record BoundaryProvenance(string BoundaryStableId, string SourceIdentity, string Role);+public enum RuledConstructionKind { RuledSurface, RuledTransition }++/// <summary>Minimum domain IR: two parameter-compatible boundaries and their source evidence.</summary>+public sealed record RuledSurfaceIr(+ string StableId,+ RuledConstructionKind Kind,+ RuledBoundary BoundaryA,+ RuledBoundary BoundaryB,+ BoundaryProvenance ProvenanceA,+ BoundaryProvenance ProvenanceB,+ bool DevelopabilityEvidencePreserved = true);++public sealed record SurfacingDiagnostic(string Code, string Message);diff --git a/Aetheris.Surfacing/RuledSurfaceLowering.cs b/Aetheris.Surfacing/RuledSurfaceLowering.csnew file mode 100644index 00000000..c04437b5--- /dev/null+++ b/Aetheris.Surfacing/RuledSurfaceLowering.cs@@ -0,0 +1,112 @@+using Aetheris.Kernel.Core.Brep;+using Aetheris.Kernel.Core.Geometry;+using Aetheris.Kernel.Core.Geometry.Curves;+using Aetheris.Kernel.Core.Geometry.Surfaces;+using Aetheris.Kernel.Core.Math;+using Aetheris.Kernel.Core.Topology;++namespace Aetheris.Surfacing;++public sealed record RuledSurfacePatch(+ RuledSurfaceIr Ir,+ SurfaceGeometry ExactSurface,+ Func<double, double, Point3D> Evaluate,+ IReadOnlyList<BoundaryProvenance> BoundaryProvenance);++public sealed record RuledSurfaceLoweringResult(RuledSurfacePatch? Patch, IReadOnlyList<SurfacingDiagnostic> Diagnostics)+{ public bool IsSuccess => Patch is not null && Diagnostics.All(d => !d.Code.EndsWith("invalid", StringComparison.Ordinal)); }++public static class RuledSurfaceLowering+{+ public static RuledSurfaceLoweringResult Lower(RuledSurfaceIr ir)+ {+ ArgumentNullException.ThrowIfNull(ir);+ if (ir.BoundaryA is RuledBoundary.Line a && ir.BoundaryB is RuledBoundary.Line b)+ {+ if ((a.End - a.Start).Length <= 1e-12 || (b.End - b.Start).Length <= 1e-12)+ return Failure("surfacing-boundary-invalid", "Ruled line boundaries must have non-zero length.");+ var surface = Bilinear(a.Start, a.End, b.Start, b.End);+ return Success(ir, SurfaceGeometry.FromBSplineSurfaceWithKnots(surface), (u, v) => Lerp(Lerp(a.Start, a.End, u), Lerp(b.Start, b.End, u), v));+ }+ if (ir.BoundaryA is RuledBoundary.Circle c0 && ir.BoundaryB is RuledBoundary.Circle c1)+ {+ var axis = c0.Normal.ToVector();+ var separation = c1.Center - c0.Center;+ if (c0.Radius <= 0 || c1.Radius <= 0 || axis.Cross(c1.Normal.ToVector()).Length > 1e-10+ || axis.Cross(separation).Length > 1e-10 || double.Abs(separation.Dot(axis)) <= 1e-12)+ return Failure("surfacing-boundary-incompatible", "M0 circle boundaries must be positive, coaxial, parallel, and separated.");+ SurfaceGeometry exact;+ if (double.Abs(c0.Radius - c1.Radius) <= 1e-12)+ exact = SurfaceGeometry.FromCylinder(new CylinderSurface(c0.Center, c0.Normal, c0.Radius, c0.ReferenceAxis));+ else+ {+ var h = separation.Dot(axis);+ var slope = (c1.Radius - c0.Radius) / h;+ var apex = c0.Center - axis * (c0.Radius / slope);+ var coneAxis = slope > 0 ? c0.Normal : Direction3D.Create(-axis);+ exact = SurfaceGeometry.FromCone(new ConeSurface(apex, coneAxis, double.Atan(double.Abs(slope)), c0.ReferenceAxis));+ }+ return Success(ir, exact, (u, v) => Lerp(c0.Center + CircleOffset(c0, u), c1.Center + CircleOffset(c1, u), v));+ }+ return Failure("surfacing-boundary-incompatible", "M0 requires line-line or coaxial circle-circle boundary families.");+ }++ public static RuledSurfaceIr Saddle(string stableId, double halfX, double halfY, double rise)+ {+ if (halfX <= 0 || halfY <= 0 || !double.IsFinite(rise)) throw new ArgumentOutOfRangeException(nameof(halfX));+ var a = new RuledBoundary.Line(stableId + ":y-", new(-halfX, -halfY, rise), new(halfX, -halfY, -rise));+ var b = new RuledBoundary.Line(stableId + ":y+", new(-halfX, halfY, -rise), new(halfX, halfY, rise));+ return new(stableId, RuledConstructionKind.RuledSurface, a, b,+ new(a.StableId, stableId, "boundary-a"), new(b.StableId, stableId, "boundary-b"));+ }++ internal static BSplineSurfaceWithKnots Bilinear(Point3D a0, Point3D a1, Point3D b0, Point3D b1) =>+ new(1, 1, [[a0, b0], [a1, b1]], "RULED_SURFACE", false, false, false, [2, 2], [2, 2], [0, 1], [0, 1], "UNSPECIFIED");+ private static Vector3D CircleOffset(RuledBoundary.Circle c, double u) =>+ c.ReferenceAxis.ToVector() * (c.Radius * double.Cos(u * 2 * double.Pi)) + c.Normal.ToVector().Cross(c.ReferenceAxis.ToVector()) * (c.Radius * double.Sin(u * 2 * double.Pi));+ private static Point3D Lerp(Point3D a, Point3D b, double t) => a + (b - a) * System.Math.Clamp(t, 0, 1);+ private static RuledSurfaceLoweringResult Success(RuledSurfaceIr ir, SurfaceGeometry surface, Func<double,double,Point3D> evaluate) =>+ new(new(ir, surface, evaluate, [ir.ProvenanceA, ir.ProvenanceB]), []);+ private static RuledSurfaceLoweringResult Failure(string code, string message) => new(null, [new(code, message)]);+}++/// <summary>Closed exact panel materialization for line-line ruled patches; preserves the ruled support surfaces.</summary>+public static class RuledSurfacePanelMaterializer+{+ public static (BrepBody? Body, IReadOnlyList<SurfacingDiagnostic> Diagnostics) Materialize(RuledSurfaceIr ir, double thickness)+ {+ if (!double.IsFinite(thickness) || thickness <= 0) return (null, [new("surfacing-panel-thickness-invalid", "Panel thickness must be finite and positive.")]);+ if (ir.BoundaryA is not RuledBoundary.Line a || ir.BoundaryB is not RuledBoundary.Line b)+ return (null, [new("surfacing-boundary-incompatible", "M0 panel materialization admits line-line ruled surfaces only.")]);+ var bottom = new[] { a.Start, a.End, b.End, b.Start };+ var dz = new Vector3D(0, 0, thickness);+ var top = bottom.Select(p => p + dz).ToArray();+ var builder = new TopologyBuilder();+ var vb = bottom.Select(_ => builder.AddVertex()).ToArray(); var vt = top.Select(_ => builder.AddVertex()).ToArray();+ var eb = Enumerable.Range(0,4).Select(i => builder.AddEdge(vb[i], vb[(i+1)%4])).ToArray();+ var et = Enumerable.Range(0,4).Select(i => builder.AddEdge(vt[i], vt[(i+1)%4])).ToArray();+ var ev = Enumerable.Range(0,4).Select(i => builder.AddEdge(vb[i], vt[i])).ToArray();+ var faces = new List<FaceId> { AddFace(builder, eb.Select(Use.F).ToArray()), AddFace(builder, et.Reverse().Select(Use.R).ToArray()) };+ for (var i=0;i<4;i++) faces.Add(AddFace(builder,[Use.F(eb[i]),Use.F(ev[(i+1)%4]),Use.R(et[i]),Use.R(ev[i])]));+ var shell=builder.AddShell(faces); builder.AddBody([shell]);+ var geometry=new BrepGeometryStore(); var bindings=new BrepBindingModel(); var curve=1;+ BindLines(eb,bottom); BindLines(et,top); BindLines(ev,Enumerable.Range(0,4).SelectMany(i=>new[]{bottom[i],top[i]}).ToArray());+ var sid=1;+ geometry.AddSurface(new(sid), SurfaceGeometry.FromBSplineSurfaceWithKnots(RuledSurfaceLowering.Bilinear(a.Start,a.End,b.Start,b.End))); bindings.AddFaceBinding(new(faces[0],new(sid++),false));+ geometry.AddSurface(new(sid), SurfaceGeometry.FromBSplineSurfaceWithKnots(RuledSurfaceLowering.Bilinear(a.Start+dz,a.End+dz,b.Start+dz,b.End+dz))); bindings.AddFaceBinding(new(faces[1],new(sid++),true));+ for(var i=0;i<4;i++) { var u=bottom[(i+1)%4]-bottom[i]; var normal=Direction3D.Create(u.Cross(dz)); geometry.AddSurface(new(sid),SurfaceGeometry.FromPlane(new PlaneSurface(bottom[i],normal,Direction3D.Create(u)))); bindings.AddFaceBinding(new(faces[i+2],new(sid++))); }+ var points=vb.Select((v,i)=>(v,bottom[i])).Concat(vt.Select((v,i)=>(v,top[i]))).ToDictionary(x=>x.v,x=>x.Item2);+ var body=new BrepBody(builder.Model,geometry,bindings,points); var valid=BrepBindingValidator.Validate(body,true);+ return valid.IsSuccess ? (body,[]) : (null,valid.Diagnostics.Select(d=>new SurfacingDiagnostic("surfacing-brep-invalid",d.Message)).ToArray());++ void BindLines(IReadOnlyList<EdgeId> edges,IReadOnlyList<Point3D> points)+ { for(var i=0;i<edges.Count;i++){var p0=points.Count==8?points[i*2]:points[i];var p1=points.Count==8?points[i*2+1]:points[(i+1)%points.Count];var length=(p1-p0).Length;geometry.AddCurve(new(curve),CurveGeometry.FromLine(new Line3Curve(p0,Direction3D.Create(p1-p0))));bindings.AddEdgeBinding(new(edges[i],new(curve++),new ParameterInterval(0,length)));} }+ }+ private readonly record struct Use(EdgeId Edge,bool Reverse){public static Use F(EdgeId e)=>new(e,false);public static Use R(EdgeId e)=>new(e,true);}+ private static FaceId AddFace(TopologyBuilder b,IReadOnlyList<Use> uses){var loop=b.AllocateLoopId();var ids=uses.Select(_=>b.AllocateCoedgeId()).ToArray();for(var i=0;i<ids.Length;i++)b.AddCoedge(new Coedge(ids[i],uses[i].Edge,loop,ids[(i+1)%ids.Length],ids[(i+ids.Length-1)%ids.Length],uses[i].Reverse));b.AddLoop(new Loop(loop,ids));return b.AddFace([loop]);}+}++public static class RuledCanopyTemplate+{+ public static RuledSurfaceIr Create(string stableId, double width, double depth, double rise) => RuledSurfaceLowering.Saddle(stableId,width/2,depth/2,rise);+}diff --git a/Aetheris.Surfacing/SurfacingModule.cs b/Aetheris.Surfacing/SurfacingModule.csnew file mode 100644index 00000000..b89ded59--- /dev/null+++ b/Aetheris.Surfacing/SurfacingModule.cs@@ -0,0 +1,20 @@+using Aetheris.Modules;++namespace Aetheris.Surfacing;++public static class SurfacingModule+{+ public static readonly AetherisModuleId Id = new("Aetheris.Surfacing");+ public static readonly ModuleVersion Version = new(0, 1, 0);+ public const string RuledSurfaceCapability = "Surfacing.RuledSurface";+ public const string RuledTransitionCapability = "Surfacing.RuledTransition";++ public static AetherisModule Definition { get; } = new(+ Id, "Surfacing", Version,+ [new(RuledSurfaceCapability, Id, Version, "Exact ruled surface between compatible boundaries."),+ new(RuledTransitionCapability, Id, Version, "Ruled transition preserving section and boundary provenance.")],+ ["Surfacing.RuledSurface", "Surfacing.RuledTransition"], ["Surfacing.RuledCanopy"],+ ["RuledSurfaceIR -> exact analytic surface/BRep", "RuledTransitionIR -> exact ruled surface/BRep"],+ ["surfacing-boundary-incompatible", "surfacing-panel-thickness-invalid"],+ [new(CoreModule.Id, new(1, 0, 0))], new("docs/modules/surfacing.md"));+}diff --git a/Aetheris.slnx b/Aetheris.slnxindex b4b0a1bb..c0d0a5ef 100644--- a/Aetheris.slnx+++ b/Aetheris.slnx@@ -4,6 +4,12 @@<Project Path="Aetheris.Kernel.Core/Aetheris.Kernel.Core.csproj" /><Project Path="Aetheris.Semantics/Aetheris.Semantics.csproj" /><Project Path="Aetheris.Semantics.Tests/Aetheris.Semantics.Tests.csproj" />+ <Project Path="Aetheris.Modules/Aetheris.Modules.csproj" />+ <Project Path="Aetheris.Surfacing/Aetheris.Surfacing.csproj" />+ <Project Path="Aetheris.Piping/Aetheris.Piping.csproj" />+ <Project Path="Aetheris.SheetMetal/Aetheris.SheetMetal.csproj" />+ <Project Path="Aetheris.Modules.BuiltIn/Aetheris.Modules.BuiltIn.csproj" />+ <Project Path="Aetheris.Modules.Tests/Aetheris.Modules.Tests.csproj" /><Project Path="Aetheris.Continuum/Aetheris.Continuum.csproj" /><Project Path="Aetheris.FEA/Aetheris.FEA.csproj" /><Project Path="Aetheris.FEA.Tests/Aetheris.FEA.Tests.csproj" />diff --git a/docs/firmament-v2/language-reference.md b/docs/firmament-v2/language-reference.mdindex 44773d25..6517bc18 100644--- a/docs/firmament-v2/language-reference.md+++ b/docs/firmament-v2/language-reference.md@@ -10,6 +10,10 @@ This is the canonical implementation-grounded reference for Firmament V2 as of AFirmament is a deterministic, statically evaluated CAD authoring language. Source declarations bind names, units, immutable values, semantic contracts, selections, and construction intent. Compile-time Records, Tables, `with`, Templates, Match, Pattern, and `Require` are erased before feature AIR. Exact geometry lowers through bounded AIR/materializers to BRep and STEP AP242. Tolerance is symbolic engineering intent and does not perturb nominal geometry.+### Engineering Modules (M0)++Engineering Modules own domain vocabulary and lowering above the shared language/kernel. M0 built-ins are `Aetheris.Surfacing`, `Aetheris.Piping`, and the reserved `Aetheris.SheetMetal`. Firmament adds no `Module`, `Use`, or import keyword in M0: module-owned Templates expand to ordinary canonical Firmament/Core construction, while Forge capability boundaries use catalog-qualified IDs such as `Piping.PipeRoute`. This avoids syntax with no native collision to resolve. Module identity, version, ownership, and docs/tooling inspection come from the deterministic built-in catalog, not runtime plug-in discovery. See [Engineering Modules](../modules/architecture.md).+**The 3D semantic model is the product definition. A Drawing is a printable projection of that definition, not a parallel source of engineering truth.** Drawing M0B binds `Source` to an authoritative Part or AssemblyIR Product, retains occurrence identity, derives BOM directly from leaf Part instances, and lowers manually selected views/PMI to zoned DrawingIR plus A4 vector output. See [Drawing concepts and templates](../drawing/templates.md).There are two current frontend lanes:diff --git a/docs/modules/architecture.md b/docs/modules/architecture.mdnew file mode 100644index 00000000..f8008388--- /dev/null+++ b/docs/modules/architecture.md@@ -0,0 +1,37 @@+# Engineering Modules++## Why Modules exist++Aetheris Modules are typed owners of engineering-domain vocabulary, validation, Concepts, Templates, lowering, diagnostics, and public documentation. They are not UI workbenches and are not dynamically discovered plug-ins. Core remains the shared compiler/kernel substrate: exact curves and surfaces, topology, BRep, AIR/ConstructionIR, STEP, `SemanticValue`, Assembly, Drawing, and Continuum.++The M0 composition root is `BuiltInModules`. It registers explicit definitions in code and creates one deterministic `AetherisModuleCatalog`; there is no DLL scanning, reflection namespace inference, package installation, or marketplace. A future external host can pass explicit definitions through the same catalog seam without changing identity semantics.++## Model and ownership++An `AetherisModule` has an explicit dotted `AetherisModuleId`, semantic version, capabilities, Concepts, Templates, lowerings, diagnostics, bounded dependencies, and documentation metadata. IDs never come from filenames. Catalog construction rejects duplicate IDs, duplicate capability ownership, missing/old dependencies, and deterministic dependency cycles. Catalog order is dependency-first and then ordinal by ID.++`ModuleCapability` means compiler/domain functionality such as `Piping.PipeRoute`. `ISemanticCapability` means evidence exposed by a particular `SemanticValue`, such as `AxisCapable` or `BodyCapable`. The former selects an available compiler path; the latter proves what a value can safely supply. They deliberately share no base type.++```mermaid+flowchart TD+ Core["Aetheris.Core\ngeometry/compiler semantics"] --> Piping["Aetheris.Piping\nPipeRoute / PathPipe"]+ Core --> Surfacing["Aetheris.Surfacing\nRuledSurface / RuledTransition"]+ Core --> Sheet["Aetheris.SheetMetal\nreserved"]+ Surfacing --> Sheet+ Piping --> BRep["exact cylinder / torus BRep"]+ Surfacing --> BRep2["exact analytic / degree-(1,1) ruled BRep"]+```++## Module and Forge boundary++A Module owns a domain package and its admitted compiler capabilities. Forge Host invokes capabilities and Templates and exposes `EngineeringModules` for inspection without referencing KernelSDK. KernelSDK remains the advanced seam for implementing new low-level/custom capability executors; ordinary Module callers do not need it. Existing Forge extension packages are not reclassified as engineering Modules.++## Firmament use and collision policy++M0 adds no import keyword. Domain APIs and module-owned Templates resolve the owning Module explicitly, then lower to ordinary Firmament/Core construction or exact BRep. Forge `Construct` uses the fully qualified capability ID (`Piping.PipeRoute`, not an unqualified `PipeRoute`) at the capability boundary. Template-authored Firmament stays pleasant because its expansion uses normal short local declarations.++This choice is intentional: the current canonical Firmament grammar does not have two competing domain declarations requiring an import/name-resolution system. Adding `Use` now would create syntax without a native domain construct consumer. Tooling obtains ownership from the catalog. If native domain declarations later create real collisions, the smallest future import form can enable a Module once per document; fully qualified IDs remain the unambiguous fallback.++## M0 scope and limitations++Modules are built in and in-repository. Registration is static. Module versions are exact semantic versions, while dependencies specify minimum versions. Version ranges, unload/reload, external package acquisition, runtime scanning, and arbitrary service injection are non-goals.diff --git a/docs/modules/artifacts/m0/capability-map.md b/docs/modules/artifacts/m0/capability-map.mdnew file mode 100644index 00000000..58b4b0e5--- /dev/null+++ b/docs/modules/artifacts/m0/capability-map.md@@ -0,0 +1,10 @@+# Capability map++| Capability | Owner | Since | Lowering |+|---|---|---:|---|+| `Piping.PathPipe` | `Aetheris.Piping` | 0.1.0 | straight centerline + circular section -> exact cylinder BRep |+| `Piping.PipeRoute` | `Aetheris.Piping` | 0.1.0 | line/arc/line route -> cylinder/torus/cylinder BRep |+| `Surfacing.RuledSurface` | `Aetheris.Surfacing` | 0.1.0 | compatible boundaries -> exact analytic/degree-(1,1) surface |+| `Surfacing.RuledTransition` | `Aetheris.Surfacing` | 0.1.0 | compatible sections -> ruled surface with transition identity |++`Aetheris.SheetMetal` is registered but owns no implemented M0 capability.diff --git a/docs/modules/artifacts/m0/dependency-graph.md b/docs/modules/artifacts/m0/dependency-graph.mdnew file mode 100644index 00000000..94f9c983--- /dev/null+++ b/docs/modules/artifacts/m0/dependency-graph.md@@ -0,0 +1,9 @@+# Dependency graph++Deterministic dependency-first catalog order: `Aetheris.Core`, `Aetheris.Piping`, `Aetheris.Surfacing`, `Aetheris.SheetMetal`.++- `[email protected] -> Aetheris.Core >=1.0.0`+- `[email protected] -> Aetheris.Core >=1.0.0`+- `[email protected] -> Aetheris.Core >=1.0.0, Aetheris.Surfacing >=0.1.0`++Duplicate identities, missing/old dependencies, and cycles are rejected before a catalog becomes observable.diff --git a/docs/modules/artifacts/m0/inspection-evidence.md b/docs/modules/artifacts/m0/inspection-evidence.mdnew file mode 100644index 00000000..585e6bda--- /dev/null+++ b/docs/modules/artifacts/m0/inspection-evidence.md@@ -0,0 +1,10 @@+# Ground-truth CLI inspection++Generated artifacts were re-imported with `aetheris analyze ... --json` through the normal CLI path.++| Artifact | Bodies / shells | Faces / edges / vertices | Structural assessment | Exact surface families | Bounds (mm) |+|---|---:|---:|---|---|---|+| `pipe-route.step` | 1 / 1 | 5 / 7 / 4 | enclosed-manifold | 2 plane, 2 cylinder, 1 torus | `[0,-10,-10]` to `[90,80,10]` |+| `ruled-saddle.step` | 1 / 1 | 6 / 12 / 8 | enclosed-manifold | 4 plane, 2 B-spline (degree-(1,1) ruled supports) | `[-40,-25,-12]` to `[40,25,14]` |++Both imports had contiguous face, edge, and vertex ID ranges and no unsupported curve family. The pipe uses five circle curves plus two lines; the saddle uses twelve exact lines.diff --git a/docs/modules/artifacts/m0/module-registry.json b/docs/modules/artifacts/m0/module-registry.jsonnew file mode 100644index 00000000..5e223420--- /dev/null+++ b/docs/modules/artifacts/m0/module-registry.json@@ -0,0 +1,140 @@+[+ {+ "id": "Aetheris.Core",+ "version": "1.0.0",+ "dependencies": [],+ "capabilities": [],+ "concepts": [],+ "templates": []+ },+ {+ "id": "Aetheris.Piping",+ "version": "0.1.0",+ "dependencies": [+ {+ "moduleId": {+ "value": "Aetheris.Core"+ },+ "minimumVersion": {+ "major": 1,+ "minor": 0,+ "patch": 0+ }+ }+ ],+ "capabilities": [+ {+ "id": "Piping.PathPipe",+ "owningModule": {+ "value": "Aetheris.Piping"+ },+ "sinceVersion": {+ "major": 0,+ "minor": 1,+ "patch": 0+ },+ "description": "Circular pipe driven by an engineering centerline."+ },+ {+ "id": "Piping.PipeRoute",+ "owningModule": {+ "value": "Aetheris.Piping"+ },+ "sinceVersion": {+ "major": 0,+ "minor": 1,+ "patch": 0+ },+ "description": "Validated straight/planar-bend pipe route."+ }+ ],+ "concepts": [+ "Piping.PipeRoute",+ "Piping.PipeSection"+ ],+ "templates": [+ "Piping.StandardPipeElbow"+ ]+ },+ {+ "id": "Aetheris.Surfacing",+ "version": "0.1.0",+ "dependencies": [+ {+ "moduleId": {+ "value": "Aetheris.Core"+ },+ "minimumVersion": {+ "major": 1,+ "minor": 0,+ "patch": 0+ }+ }+ ],+ "capabilities": [+ {+ "id": "Surfacing.RuledSurface",+ "owningModule": {+ "value": "Aetheris.Surfacing"+ },+ "sinceVersion": {+ "major": 0,+ "minor": 1,+ "patch": 0+ },+ "description": "Exact ruled surface between compatible boundaries."+ },+ {+ "id": "Surfacing.RuledTransition",+ "owningModule": {+ "value": "Aetheris.Surfacing"+ },+ "sinceVersion": {+ "major": 0,+ "minor": 1,+ "patch": 0+ },+ "description": "Ruled transition preserving section and boundary provenance."+ }+ ],+ "concepts": [+ "Surfacing.RuledSurface",+ "Surfacing.RuledTransition"+ ],+ "templates": [+ "Surfacing.RuledCanopy"+ ]+ },+ {+ "id": "Aetheris.SheetMetal",+ "version": "0.1.0",+ "dependencies": [+ {+ "moduleId": {+ "value": "Aetheris.Core"+ },+ "minimumVersion": {+ "major": 1,+ "minor": 0,+ "patch": 0+ }+ },+ {+ "moduleId": {+ "value": "Aetheris.Surfacing"+ },+ "minimumVersion": {+ "major": 0,+ "minor": 1,+ "patch": 0+ }+ }+ ],+ "capabilities": [],+ "concepts": [+ "SheetMetal.NeutralSurface (reserved)",+ "SheetMetal.FormedState (reserved)"+ ],+ "templates": []+ }+]\ No newline at end of filediff --git a/docs/modules/artifacts/m0/ownership-audit.md b/docs/modules/artifacts/m0/ownership-audit.mdnew file mode 100644index 00000000..a5f4a58e--- /dev/null+++ b/docs/modules/artifacts/m0/ownership-audit.md@@ -0,0 +1,27 @@+# AETHERIS-MODULE-M0 ownership audit++| Area | Existing capability | M0/future owner | Pressure observed |+|---|---|---|---|+| Kernel.Core | exact curves/surfaces, topology, BRep, Boolean, STEP, tessellation, JudgmentEngine | Core | Correct shared geometric substrate; must not learn `PipeRoute` or Sheet Metal policy. |+| Firmament | central V2 parser/binder, feature declarations, AIR/materializer route selection | Core compiler + Module frontend adapters | A native domain keyword currently requires parser and central dispatch edits; M0 therefore uses explicit capability IDs/templates and adds no decorative import syntax. |+| Kernel.StandardLibrary | exact coaxial construction IR/materializers, bolts/reusable parts | StandardLibrary | Domain Templates previously had no typed owner; Module metadata now identifies their future home. |+| Forge | package descriptors, Concepts/Templates, extension capabilities | Forge infrastructure | Forge capability IDs and engineering Module capabilities were indistinguishable to tooling. Module catalog now provides separate typed ownership. |+| Forge Host | Template expansion, capability invocation, exact output admission | Forge Host | Host inspection previously exposed extension executors only. `EngineeringModules` now inspects built-ins without KernelSDK. |+| Semantics | `SemanticValue`, structural capabilities, exact bindings/provenance | Core semantics | Ad hoc string checks would conflate value evidence with compiler availability. `ModuleCapability` is a separate type. |+| Assembly | interfaces, mates, product structure, AP242 | Assembly | Domain endpoints can expose ordinary semantic axes/points without Assembly learning pipe semantics. |+| Drawing | DrawingIR, views, PMI, SVG/PDF | Drawing | Consumes ordinary semantic/BRep output; no Module-specific drawing branch is needed in M0. |+| Analysis/Continuum/FEA | exact regions, sampling, mechanics lowering | Analysis | Future domain analysis consumes exact bindings; it should not become capability discovery. |+| CLI | large manual top-level dispatch | Tooling | New domains would require bespoke commands. One generic `modules` catalog command now handles inspection and a bounded showcase path. |+| Surfacing-like | STEP ruled B-spline classification; prismatic transitions; extrusion/revolution surfaces | Surfacing intent over Core primitives | Mathematical ruled intent was recoverable but not first-class at authoring/lowering. |+| Piping-like | cylinders, torus, sweep architecture notes | Piping intent over Core primitives | Generic Sweep would lose diameter/bend/endpoints/frame policy. |+| SheetMetal-like | no coherent domain owner | SheetMetal (reserved) | Developability/flat-pattern work would otherwise leak into generic surface/kernel code. |++## Bad ownership examples++- Adding a new native Firmament feature currently touches central parser/binder/materializer selection.+- Forge extension admission branches on output origin and maintains a distinct capability registry.+- CLI top-level dispatch is a manual switch.+- Semantic capability checks answer what a value proves, but cannot answer whether a domain compiler capability is installed.+- STEP can classify exact ruled degree-(1,1) surfaces, but recovered representation does not establish the original engineering construction owner.++The M0 seam addresses discovery and ownership without moving stable code: explicit Module definitions, dependency/capability catalog, typed missing-capability diagnostics, Host/CLI inspection, and domain-owned lowering projects.diff --git a/docs/modules/artifacts/m0/performance-and-determinism.md b/docs/modules/artifacts/m0/performance-and-determinism.mdnew file mode 100644index 00000000..0b43343f--- /dev/null+++ b/docs/modules/artifacts/m0/performance-and-determinism.md@@ -0,0 +1,10 @@+# Performance and determinism++The showcase command records one-process timing in `validation-report.json`. On the final validation run, cold lazy catalog initialization (including first-use/JIT costs) was approximately 14 ms, saddle lowering/materialization approximately 48 ms, and routed-pipe lowering/materialization approximately 13 ms. The report also records the mean cached catalog inspection cost over 10,000 accesses; cached lookup is the representative compiler/Host plumbing overhead after process initialization.++Two independent showcase invocations emitted identical hashes:++- ruled saddle: `D0C7DB3488FB7D9C2294F6641FC49F387EDE323E1E31FFD512686514F086E451`+- pipe route: `2F52517C5FFAF4C6F02814ABE870158C607346F3EC084B76ED097C6D29539A7D`++Focused tests independently compare repeated catalog ordering, STEP hashes, and semantic stable identities. Timings are diagnostic smoke measurements, not a throughput benchmark or performance guarantee.diff --git a/docs/modules/artifacts/m0/pipe-route.step b/docs/modules/artifacts/m0/pipe-route.stepnew file mode 100644index 00000000..de8e0e28--- /dev/null+++ b/docs/modules/artifacts/m0/pipe-route.step@@ -0,0 +1,127 @@+ISO-10303-21;+HEADER;+FILE_DESCRIPTION(('Aetheris AP242 subset export'),'2;1');+FILE_NAME('aetheris_export.step','1970-01-01T00:00:00',('Aetheris'),('Aetheris'),'Aetheris.Kernel','Aetheris.Kernel','');+FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'));+ENDSEC;+DATA;+#1=CARTESIAN_POINT($,(0,0,0));+#2=DIRECTION($,(-1,0,0));+#3=DIRECTION($,(0,-1,0));+#4=AXIS2_PLACEMENT_3D($,#1,#2,#3);+#5=PLANE($,#4);+#6=CARTESIAN_POINT($,(0,-10,0));+#7=VERTEX_POINT($,#6);+#8=CARTESIAN_POINT($,(0,0,0));+#9=DIRECTION($,(1,0,0));+#10=DIRECTION($,(0,-1,0));+#11=AXIS2_PLACEMENT_3D($,#8,#9,#10);+#12=CIRCLE($,#11,10);+#13=EDGE_CURVE($,#7,#7,#12,.T.);+#14=ORIENTED_EDGE($,$,$,#13,.T.);+#15=EDGE_LOOP($,(#14));+#16=FACE_OUTER_BOUND('',#15,.T.);+#17=ADVANCED_FACE('',(#16),#5,.T.);+#18=CARTESIAN_POINT($,(0,0,0));+#19=DIRECTION($,(1,0,0));+#20=DIRECTION($,(0,-1,0));+#21=AXIS2_PLACEMENT_3D($,#18,#19,#20);+#22=CYLINDRICAL_SURFACE($,#21,10);+#23=CARTESIAN_POINT($,(50,-10,0));+#24=VERTEX_POINT($,#23);+#25=CARTESIAN_POINT($,(0,-10,0));+#26=DIRECTION($,(1,0,0));+#27=VECTOR($,#26,1);+#28=LINE($,#25,#27);+#29=EDGE_CURVE($,#7,#24,#28,.T.);+#30=ORIENTED_EDGE($,$,$,#29,.T.);+#31=CARTESIAN_POINT($,(50,0,0));+#32=DIRECTION($,(1,0,0));+#33=DIRECTION($,(0,-1,0));+#34=AXIS2_PLACEMENT_3D($,#31,#32,#33);+#35=CIRCLE($,#34,10);+#36=EDGE_CURVE($,#24,#24,#35,.T.);+#37=ORIENTED_EDGE($,$,$,#36,.T.);+#38=ORIENTED_EDGE($,$,$,#29,.F.);+#39=ORIENTED_EDGE($,$,$,#13,.F.);+#40=EDGE_LOOP($,(#30,#37,#38,#39));+#41=FACE_OUTER_BOUND('',#40,.T.);+#42=ADVANCED_FACE('',(#41),#22,.T.);+#43=CARTESIAN_POINT($,(50,30,0));+#44=DIRECTION($,(0,0,1));+#45=DIRECTION($,(0,-1,0));+#46=AXIS2_PLACEMENT_3D($,#43,#44,#45);+#47=TOROIDAL_SURFACE($,#46,30,10);+#48=CARTESIAN_POINT($,(90,30,0));+#49=VERTEX_POINT($,#48);+#50=CARTESIAN_POINT($,(50,30,0));+#51=DIRECTION($,(0,0,1));+#52=DIRECTION($,(0,-1,0));+#53=AXIS2_PLACEMENT_3D($,#50,#51,#52);+#54=CIRCLE($,#53,40);+#55=TRIMMED_CURVE($,#54,(PARAMETER_VALUE(0)),(PARAMETER_VALUE(1.5707963267949)),.T.,.PARAMETER.);+#56=EDGE_CURVE($,#24,#49,#55,.T.);+#57=ORIENTED_EDGE($,$,$,#56,.T.);+#58=CARTESIAN_POINT($,(80,30,0));+#59=DIRECTION($,(0,1,0));+#60=DIRECTION($,(1,0,0));+#61=AXIS2_PLACEMENT_3D($,#58,#59,#60);+#62=CIRCLE($,#61,10);+#63=EDGE_CURVE($,#49,#49,#62,.T.);+#64=ORIENTED_EDGE($,$,$,#63,.T.);+#65=ORIENTED_EDGE($,$,$,#56,.F.);+#66=ORIENTED_EDGE($,$,$,#36,.F.);+#67=EDGE_LOOP($,(#57,#64,#65,#66));+#68=FACE_OUTER_BOUND('',#67,.T.);+#69=ADVANCED_FACE('',(#68),#47,.T.);+#70=CARTESIAN_POINT($,(80,30,0));+#71=DIRECTION($,(0,1,0));+#72=DIRECTION($,(1,0,0));+#73=AXIS2_PLACEMENT_3D($,#70,#71,#72);+#74=CYLINDRICAL_SURFACE($,#73,10);+#75=CARTESIAN_POINT($,(90,80,0));+#76=VERTEX_POINT($,#75);+#77=CARTESIAN_POINT($,(90,30,0));+#78=DIRECTION($,(0,1,0));+#79=VECTOR($,#78,1);+#80=LINE($,#77,#79);+#81=EDGE_CURVE($,#49,#76,#80,.T.);+#82=ORIENTED_EDGE($,$,$,#81,.T.);+#83=CARTESIAN_POINT($,(80,80,0));+#84=DIRECTION($,(0,1,0));+#85=DIRECTION($,(1,0,0));+#86=AXIS2_PLACEMENT_3D($,#83,#84,#85);+#87=CIRCLE($,#86,10);+#88=EDGE_CURVE($,#76,#76,#87,.T.);+#89=ORIENTED_EDGE($,$,$,#88,.T.);+#90=ORIENTED_EDGE($,$,$,#81,.F.);+#91=ORIENTED_EDGE($,$,$,#63,.F.);+#92=EDGE_LOOP($,(#82,#89,#90,#91));+#93=FACE_OUTER_BOUND('',#92,.T.);+#94=ADVANCED_FACE('',(#93),#74,.T.);+#95=CARTESIAN_POINT($,(80,80,0));+#96=DIRECTION($,(0,1,0));+#97=DIRECTION($,(1,0,0));+#98=AXIS2_PLACEMENT_3D($,#95,#96,#97);+#99=PLANE($,#98);+#100=ORIENTED_EDGE($,$,$,#88,.F.);+#101=EDGE_LOOP($,(#100));+#102=FACE_OUTER_BOUND('',#101,.T.);+#103=ADVANCED_FACE('',(#102),#99,.T.);+#104=CLOSED_SHELL($,(#17,#42,#69,#94,#103));+#105=MANIFOLD_SOLID_BREP('AetherisBody',#104);+#106=APPLICATION_CONTEXT('mechanical design');+#107=PRODUCT_CONTEXT('',#106,'mechanical');+#108=PRODUCT('AETHERIS','AetherisBody','',(#107));+#109=PRODUCT_DEFINITION_FORMATION('','',#108);+#110=PRODUCT_DEFINITION_CONTEXT('design',#106,'design');+#111=PRODUCT_DEFINITION('','',#109,#110);+#112=PRODUCT_DEFINITION_SHAPE('','',#111);+#113=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));+#114=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));+#115=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());+#116=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNIT_ASSIGNED_CONTEXT((#113,#114,#115))REPRESENTATION_CONTEXT('3','3D'));+#117=SHAPE_REPRESENTATION('AetherisBody',(#105),#116);+#118=SHAPE_DEFINITION_REPRESENTATION(#112,#117);+ENDSEC;+END-ISO-10303-21;diff --git a/docs/modules/artifacts/m0/ruled-saddle.step b/docs/modules/artifacts/m0/ruled-saddle.stepnew file mode 100644index 00000000..7d79b7f6--- /dev/null+++ b/docs/modules/artifacts/m0/ruled-saddle.step@@ -0,0 +1,172 @@+ISO-10303-21;+HEADER;+FILE_DESCRIPTION(('Aetheris AP242 subset export'),'2;1');+FILE_NAME('aetheris_export.step','1970-01-01T00:00:00',('Aetheris'),('Aetheris'),'Aetheris.Kernel','Aetheris.Kernel','');+FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'));+ENDSEC;+DATA;+#1=CARTESIAN_POINT($,(-40,-25,12));+#2=CARTESIAN_POINT($,(-40,25,-12));+#3=CARTESIAN_POINT($,(40,-25,-12));+#4=CARTESIAN_POINT($,(40,25,12));+#5=B_SPLINE_SURFACE_WITH_KNOTS($,1,1,((#1,#2),(#3,#4)),.RULED_SURFACE.,.F.,.F.,.F.,(2,2),(2,2),(0,1),(0,1),.UNSPECIFIED.);+#6=CARTESIAN_POINT($,(-40,-25,12));+#7=VERTEX_POINT($,#6);+#8=CARTESIAN_POINT($,(40,-25,-12));+#9=VERTEX_POINT($,#8);+#10=CARTESIAN_POINT($,(-40,-25,12));+#11=DIRECTION($,(0.957826285221151,0,-0.287347885566345));+#12=VECTOR($,#11,1);+#13=LINE($,#10,#12);+#14=EDGE_CURVE($,#7,#9,#13,.T.);+#15=ORIENTED_EDGE($,$,$,#14,.T.);+#16=CARTESIAN_POINT($,(40,25,12));+#17=VERTEX_POINT($,#16);+#18=CARTESIAN_POINT($,(40,-25,-12));+#19=DIRECTION($,(0,0.901523057468274,0.432731067584771));+#20=VECTOR($,#19,1);+#21=LINE($,#18,#20);+#22=EDGE_CURVE($,#9,#17,#21,.T.);+#23=ORIENTED_EDGE($,$,$,#22,.T.);+#24=CARTESIAN_POINT($,(-40,25,-12));+#25=VERTEX_POINT($,#24);+#26=CARTESIAN_POINT($,(40,25,12));+#27=DIRECTION($,(-0.957826285221151,0,-0.287347885566345));+#28=VECTOR($,#27,1);+#29=LINE($,#26,#28);+#30=EDGE_CURVE($,#17,#25,#29,.T.);+#31=ORIENTED_EDGE($,$,$,#30,.T.);+#32=CARTESIAN_POINT($,(-40,25,-12));+#33=DIRECTION($,(0,-0.901523057468274,0.432731067584771));+#34=VECTOR($,#33,1);+#35=LINE($,#32,#34);+#36=EDGE_CURVE($,#25,#7,#35,.T.);+#37=ORIENTED_EDGE($,$,$,#36,.T.);+#38=EDGE_LOOP($,(#15,#23,#31,#37));+#39=FACE_OUTER_BOUND('',#38,.T.);+#40=ADVANCED_FACE('',(#39),#5,.F.);+#41=CARTESIAN_POINT($,(-40,-25,14));+#42=CARTESIAN_POINT($,(-40,25,-10));+#43=CARTESIAN_POINT($,(40,-25,-10));+#44=CARTESIAN_POINT($,(40,25,14));+#45=B_SPLINE_SURFACE_WITH_KNOTS($,1,1,((#41,#42),(#43,#44)),.RULED_SURFACE.,.F.,.F.,.F.,(2,2),(2,2),(0,1),(0,1),.UNSPECIFIED.);+#46=CARTESIAN_POINT($,(-40,25,-10));+#47=VERTEX_POINT($,#46);+#48=CARTESIAN_POINT($,(-40,-25,14));+#49=VERTEX_POINT($,#48);+#50=CARTESIAN_POINT($,(-40,25,-10));+#51=DIRECTION($,(0,-0.901523057468274,0.432731067584771));+#52=VECTOR($,#51,1);+#53=LINE($,#50,#52);+#54=EDGE_CURVE($,#47,#49,#53,.T.);+#55=ORIENTED_EDGE($,$,$,#54,.F.);+#56=CARTESIAN_POINT($,(40,25,14));+#57=VERTEX_POINT($,#56);+#58=CARTESIAN_POINT($,(40,25,14));+#59=DIRECTION($,(-0.957826285221151,0,-0.287347885566345));+#60=VECTOR($,#59,1);+#61=LINE($,#58,#60);+#62=EDGE_CURVE($,#57,#47,#61,.T.);+#63=ORIENTED_EDGE($,$,$,#62,.F.);+#64=CARTESIAN_POINT($,(40,-25,-10));+#65=VERTEX_POINT($,#64);+#66=CARTESIAN_POINT($,(40,-25,-10));+#67=DIRECTION($,(0,0.901523057468274,0.432731067584771));+#68=VECTOR($,#67,1);+#69=LINE($,#66,#68);+#70=EDGE_CURVE($,#65,#57,#69,.T.);+#71=ORIENTED_EDGE($,$,$,#70,.F.);+#72=CARTESIAN_POINT($,(-40,-25,14));+#73=DIRECTION($,(0.957826285221151,0,-0.287347885566345));+#74=VECTOR($,#73,1);+#75=LINE($,#72,#74);+#76=EDGE_CURVE($,#49,#65,#75,.T.);+#77=ORIENTED_EDGE($,$,$,#76,.F.);+#78=EDGE_LOOP($,(#55,#63,#71,#77));+#79=FACE_OUTER_BOUND('',#78,.T.);+#80=ADVANCED_FACE('',(#79),#45,.T.);+#81=CARTESIAN_POINT($,(-40,-25,12));+#82=DIRECTION($,(0,-1,0));+#83=DIRECTION($,(0.957826285221151,0,-0.287347885566345));+#84=AXIS2_PLACEMENT_3D($,#81,#82,#83);+#85=PLANE($,#84);+#86=ORIENTED_EDGE($,$,$,#14,.T.);+#87=CARTESIAN_POINT($,(40,-25,-12));+#88=DIRECTION($,(0,0,1));+#89=VECTOR($,#88,1);+#90=LINE($,#87,#89);+#91=EDGE_CURVE($,#9,#65,#90,.T.);+#92=ORIENTED_EDGE($,$,$,#91,.T.);+#93=ORIENTED_EDGE($,$,$,#76,.F.);+#94=CARTESIAN_POINT($,(-40,-25,12));+#95=DIRECTION($,(0,0,1));+#96=VECTOR($,#95,1);+#97=LINE($,#94,#96);+#98=EDGE_CURVE($,#7,#49,#97,.T.);+#99=ORIENTED_EDGE($,$,$,#98,.F.);+#100=EDGE_LOOP($,(#86,#92,#93,#99));+#101=FACE_OUTER_BOUND('',#100,.T.);+#102=ADVANCED_FACE('',(#101),#85,.T.);+#103=CARTESIAN_POINT($,(40,-25,-12));+#104=DIRECTION($,(1,0,0));+#105=DIRECTION($,(0,0.901523057468274,0.432731067584771));+#106=AXIS2_PLACEMENT_3D($,#103,#104,#105);+#107=PLANE($,#106);+#108=ORIENTED_EDGE($,$,$,#22,.T.);+#109=CARTESIAN_POINT($,(40,25,12));+#110=DIRECTION($,(0,0,1));+#111=VECTOR($,#110,1);+#112=LINE($,#109,#111);+#113=EDGE_CURVE($,#17,#57,#112,.T.);+#114=ORIENTED_EDGE($,$,$,#113,.T.);+#115=ORIENTED_EDGE($,$,$,#70,.F.);+#116=ORIENTED_EDGE($,$,$,#91,.F.);+#117=EDGE_LOOP($,(#108,#114,#115,#116));+#118=FACE_OUTER_BOUND('',#117,.T.);+#119=ADVANCED_FACE('',(#118),#107,.T.);+#120=CARTESIAN_POINT($,(40,25,12));+#121=DIRECTION($,(0,1,-0));+#122=DIRECTION($,(-0.957826285221151,0,-0.287347885566345));+#123=AXIS2_PLACEMENT_3D($,#120,#121,#122);+#124=PLANE($,#123);+#125=ORIENTED_EDGE($,$,$,#30,.T.);+#126=CARTESIAN_POINT($,(-40,25,-12));+#127=DIRECTION($,(0,0,1));+#128=VECTOR($,#127,1);+#129=LINE($,#126,#128);+#130=EDGE_CURVE($,#25,#47,#129,.T.);+#131=ORIENTED_EDGE($,$,$,#130,.T.);+#132=ORIENTED_EDGE($,$,$,#62,.F.);+#133=ORIENTED_EDGE($,$,$,#113,.F.);+#134=EDGE_LOOP($,(#125,#131,#132,#133));+#135=FACE_OUTER_BOUND('',#134,.T.);+#136=ADVANCED_FACE('',(#135),#124,.T.);+#137=CARTESIAN_POINT($,(-40,25,-12));+#138=DIRECTION($,(-1,0,0));+#139=DIRECTION($,(0,-0.901523057468274,0.432731067584771));+#140=AXIS2_PLACEMENT_3D($,#137,#138,#139);+#141=PLANE($,#140);+#142=ORIENTED_EDGE($,$,$,#36,.T.);+#143=ORIENTED_EDGE($,$,$,#98,.T.);+#144=ORIENTED_EDGE($,$,$,#54,.F.);+#145=ORIENTED_EDGE($,$,$,#130,.F.);+#146=EDGE_LOOP($,(#142,#143,#144,#145));+#147=FACE_OUTER_BOUND('',#146,.T.);+#148=ADVANCED_FACE('',(#147),#141,.T.);+#149=CLOSED_SHELL($,(#40,#80,#102,#119,#136,#148));+#150=MANIFOLD_SOLID_BREP('AetherisBody',#149);+#151=APPLICATION_CONTEXT('mechanical design');+#152=PRODUCT_CONTEXT('',#151,'mechanical');+#153=PRODUCT('AETHERIS','AetherisBody','',(#152));+#154=PRODUCT_DEFINITION_FORMATION('','',#153);+#155=PRODUCT_DEFINITION_CONTEXT('design',#151,'design');+#156=PRODUCT_DEFINITION('','',#154,#155);+#157=PRODUCT_DEFINITION_SHAPE('','',#156);+#158=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));+#159=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));+#160=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());+#161=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNIT_ASSIGNED_CONTEXT((#158,#159,#160))REPRESENTATION_CONTEXT('3','3D'));+#162=SHAPE_REPRESENTATION('AetherisBody',(#150),#161);+#163=SHAPE_DEFINITION_REPRESENTATION(#157,#162);+ENDSEC;+END-ISO-10303-21;diff --git a/docs/modules/artifacts/m0/semantic-inspection.json b/docs/modules/artifacts/m0/semantic-inspection.jsonnew file mode 100644index 00000000..b76cc34e--- /dev/null+++ b/docs/modules/artifacts/m0/semantic-inspection.json@@ -0,0 +1,271 @@+{+ "stableId": "m0:pipe-route",+ "name": null,+ "semanticType": "PipeRoute",+ "capabilities": [+ "BodyCapable",+ "ExactGeometryCapable",+ "Selectable"+ ],+ "bindingKinds": [+ "ExactBrepBody"+ ],+ "members": [+ {+ "stableId": "m0:pipe-route:bendEnd",+ "name": "bendEnd",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "bendEnd",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:bendStart",+ "name": "bendStart",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "bendStart",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:centerline",+ "name": "centerline",+ "semanticType": "PipeCenterline",+ "capabilities": [],+ "bindingKinds": [+ "ConstructionIdentity"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "exact line-arc-line centerline",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:diameter",+ "name": "diameter",+ "semanticType": "Length",+ "capabilities": [+ "DimensionalCapable"+ ],+ "bindingKinds": [+ "TolerancedDimension"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "diameter",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:inlet",+ "name": "inlet",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "inlet",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:inletAxis",+ "name": "inletAxis",+ "semanticType": "Axis",+ "capabilities": [+ "AxisCapable"+ ],+ "bindingKinds": [+ "ExactAxis"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "inletAxis",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:outlet",+ "name": "outlet",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "outlet",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:outletAxis",+ "name": "outletAxis",+ "semanticType": "Axis",+ "capabilities": [+ "AxisCapable"+ ],+ "bindingKinds": [+ "ExactAxis"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "outletAxis",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "Circular section: section phase is transported by the route plane normal; twist is immaterial and seam phase is deterministic.",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+}\ No newline at end of filediff --git a/docs/modules/artifacts/m0/validation-report.json b/docs/modules/artifacts/m0/validation-report.jsonnew file mode 100644index 00000000..c30374cf--- /dev/null+++ b/docs/modules/artifacts/m0/validation-report.json@@ -0,0 +1,380 @@+{+ "milestone": "AETHERIS-MODULE-M0",+ "registryMs": 14.5044,+ "cachedRegistryLookupMicroseconds": 0.46548,+ "surfacingMs": 48.6315,+ "pipingMs": 12.4235,+ "modules": [+ {+ "module": "Aetheris.Core",+ "version": "1.0.0",+ "capabilities": []+ },+ {+ "module": "Aetheris.Piping",+ "version": "0.1.0",+ "capabilities": [+ "Piping.PathPipe",+ "Piping.PipeRoute"+ ]+ },+ {+ "module": "Aetheris.Surfacing",+ "version": "0.1.0",+ "capabilities": [+ "Surfacing.RuledSurface",+ "Surfacing.RuledTransition"+ ]+ },+ {+ "module": "Aetheris.SheetMetal",+ "version": "0.1.0",+ "capabilities": []+ }+ ],+ "surfacing": {+ "stableId": "m0:saddle",+ "kind": "RuledSurface",+ "surface": "BSplineSurfaceWithKnots",+ "boundaries": [+ {+ "boundaryStableId": "m0:saddle:y-",+ "sourceIdentity": "m0:saddle",+ "role": "boundary-a"+ },+ {+ "boundaryStableId": "m0:saddle:y\u002B",+ "sourceIdentity": "m0:saddle",+ "role": "boundary-b"+ }+ ],+ "saddleHash": "D0C7DB3488FB7D9C2294F6641FC49F387EDE323E1E31FFD512686514F086E451",+ "faces": 6+ },+ "piping": {+ "ir": {+ "stableId": "m0:pipe-route",+ "elements": [+ {+ "kind": "Straight",+ "start": {+ "x": 0,+ "y": 0,+ "z": 0+ },+ "end": {+ "x": 50,+ "y": 0,+ "z": 0+ },+ "radius": null,+ "angle": null+ },+ {+ "kind": "PlanarCircularBend",+ "start": {+ "x": 50,+ "y": 30,+ "z": 0+ },+ "end": {+ "x": 50,+ "y": 30,+ "z": 0+ },+ "radius": 30,+ "angle": 1.5707963267948966+ },+ {+ "kind": "Straight",+ "start": {+ "x": 80,+ "y": 30,+ "z": 0+ },+ "end": {+ "x": 80,+ "y": 80,+ "z": 0+ },+ "radius": null,+ "angle": null+ }+ ]+ },+ "framePolicy": "Circular section: section phase is transported by the route plane normal; twist is immaterial and seam phase is deterministic.",+ "pipeHash": "2F52517C5FFAF4C6F02814ABE870158C607346F3EC084B76ED097C6D29539A7D",+ "faces": 5,+ "semantics": {+ "stableId": "m0:pipe-route",+ "name": null,+ "semanticType": "PipeRoute",+ "capabilities": [+ "BodyCapable",+ "ExactGeometryCapable",+ "Selectable"+ ],+ "bindingKinds": [+ "ExactBrepBody"+ ],+ "members": [+ {+ "stableId": "m0:pipe-route:bendEnd",+ "name": "bendEnd",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "bendEnd",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:bendStart",+ "name": "bendStart",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "bendStart",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:centerline",+ "name": "centerline",+ "semanticType": "PipeCenterline",+ "capabilities": [],+ "bindingKinds": [+ "ConstructionIdentity"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "exact line-arc-line centerline",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:diameter",+ "name": "diameter",+ "semanticType": "Length",+ "capabilities": [+ "DimensionalCapable"+ ],+ "bindingKinds": [+ "TolerancedDimension"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "diameter",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:inlet",+ "name": "inlet",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "inlet",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:inletAxis",+ "name": "inletAxis",+ "semanticType": "Axis",+ "capabilities": [+ "AxisCapable"+ ],+ "bindingKinds": [+ "ExactAxis"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "inletAxis",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:outlet",+ "name": "outlet",+ "semanticType": "Point3",+ "capabilities": [+ "PointCapable"+ ],+ "bindingKinds": [+ "ExactPoint"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "outlet",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ },+ {+ "stableId": "m0:pipe-route:outletAxis",+ "name": "outletAxis",+ "semanticType": "Axis",+ "capabilities": [+ "AxisCapable"+ ],+ "bindingKinds": [+ "ExactAxis"+ ],+ "members": [],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "outletAxis",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "provenance": [+ {+ "stage": "PipingLowering",+ "identity": "m0:pipe-route",+ "evidence": "Circular section: section phase is transported by the route plane normal; twist is immaterial and seam phase is deterministic.",+ "sourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ ],+ "authoredSourceSpan": null,+ "generatedSourceSpan": {+ "source": "Aetheris.Piping",+ "start": 0,+ "length": 0+ }+ }+ }+}\ No newline at end of filediff --git a/docs/modules/piping.md b/docs/modules/piping.mdnew file mode 100644index 00000000..e3cf89c2--- /dev/null+++ b/docs/modules/piping.md@@ -0,0 +1,13 @@+# Piping Module++`Aetheris.Piping` 0.1.0 owns `Piping.PathPipe` and `Piping.PipeRoute`. A pipe is authored by engineering intent—centerline, section, bend radius, and route policy—not by exposing generic Sweep and twist knobs.++M0 admits a solid circular section, straight PathPipe, and one planar positive 90-degree route with inlet straight, circular bend, and outlet straight. `PipeRouteIr` preserves line/arc/line centerline elements and their stable identities. Lowering uses shared exact cylinder/torus/cylinder surfaces and one closed BRep shell; Kernel.Core is not taught what a pipe is.++For a circular section, rotation about the tangent does not change geometry. The deterministic frame rule transports section phase with the route-plane normal and fixes the seam at the outward radial direction through the bend. Users do not receive generic sweep-twist controls.++The resulting `SemanticValue` exposes inlet/outlet points and axes, bend start/end, exact centerline construction identity, and diameter. `StandardPipeElbow` is the first module-owned Template. The showcase emits deterministic STEP through the ordinary exporter.++Current limitations are explicit: M0 supports one +90-degree XY bend, solid circular sections, and no branch/junction policy. Wall thickness is represented in the domain section model but diagnosed as unsupported by exact route materialization; hollow pipe, arbitrary 3D routes, reducers, fittings, and route solving remain future work.++Evidence: [M0 validation report](artifacts/m0/validation-report.json), [CLI inspection](artifacts/m0/inspection-evidence.md), and [pipe route STEP](artifacts/m0/pipe-route.step).diff --git a/docs/modules/sheet-metal.md b/docs/modules/sheet-metal.mdnew file mode 100644index 00000000..a4720f3a--- /dev/null+++ b/docs/modules/sheet-metal.md@@ -0,0 +1,7 @@+# Sheet Metal Module design note++`Aetheris.SheetMetal` 0.1.0 is an architecture/design-pressure placeholder, not a Sheet Metal implementation. It depends explicitly on Core and Surfacing and publishes no M0 capability.++The future Module owns developability, neutral surface and thickness, formed/fabricated state, bends and bend allowance, seams/reliefs, and flat-pattern correspondence. Flattening must be based on proved developability and stable boundary/feature provenance, not on tessellated visual similarity.++This pressure changed Surfacing M0 in three ways: `RuledSurfaceIr` retains boundary provenance; ruled construction identity survives exact lowering; and developability evidence has a first-class preservation flag. A future Sheet Metal lowering can distinguish an admitted developable ruled transition from a merely visually similar spline. M0 does not claim all ruled surfaces are developable, calculate Gaussian curvature, infer neutral axes, or emit flat patterns.diff --git a/docs/modules/surfacing.md b/docs/modules/surfacing.mdnew file mode 100644index 00000000..acc7c7b0--- /dev/null+++ b/docs/modules/surfacing.md@@ -0,0 +1,13 @@+# Surfacing Module++Surfacing is not synonymous with NURBS. Aetheris prefers the mathematical construction that explains the shape; spline control is a lower-level refinement mechanism.++`Aetheris.Surfacing` 0.1.0 owns `Surfacing.RuledSurface` and `Surfacing.RuledTransition`. Both lower through the small `RuledSurfaceIr`: stable construction identity, two compatible boundaries, typed construction kind, boundary provenance, and retained developability evidence. Source intent remains `RULED_SURFACE` even where STEP serializes the exact degree-(1,1) form as a B-spline support.++M0 admits line-line boundaries as exact bilinear ruled patches and coaxial circle-circle boundaries as exact cylinders or cones. `RuledTransition` uses the same exact construction but records transition/section intent rather than introducing a generic `Loft`. Arbitrary non-rational splines, mixed curve families, trimming networks, continuity optimization, and NURBS editing are not claimed.++The canonical saddle uses two skew boundary lines. Linear interpolation between them evaluates the bilinear hyperbolic-paraboloid family directly; the closed showcase panel retains two degree-(1,1) ruled support faces and four planar sides. It does not approximate authoring intent with a high-degree patch. `RuledCanopy` is the module-owned Template proof.++Future local spline refinement should consume a selected region of a `RuledSurface`/`RuledTransition`, retain the parent construction and boundary provenance, and emit explicit refinement evidence. Raw spline patches are not the default authoring representation. That seam is documented only; M0 implements no spline editing.++Evidence: [M0 validation report](artifacts/m0/validation-report.json), [CLI inspection](artifacts/m0/inspection-evidence.md), [saddle STEP](artifacts/m0/ruled-saddle.step), and [ownership audit](artifacts/m0/ownership-audit.md).