Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Expose authored material and improve FEA diagnostics

Yuechen Li8b15c80376cc
diff --git a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs b/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs
index fafe7dd4..090293d5 100644
--- a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs
+++ b/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs
@@ -28,6 +28,8 @@ public sealed class CliHelpAndUsageTests
Assert.Contains("inspect", text, StringComparison.Ordinal);
Assert.Contains("verify", text, StringComparison.Ordinal);
Assert.Contains("view", text, StringComparison.Ordinal);
+ Assert.Contains("sheetmetal flatten bracket.firmament --step bracket-flat.step --svg bracket-flat.svg --json", text, StringComparison.Ordinal);
+ Assert.DoesNotContain("sheetmetal flatten formed.step --output formed-flat.svg", text, StringComparison.Ordinal);
}
[Theory]
diff --git a/Aetheris.CLI.Tests/FeaCliTests.cs b/Aetheris.CLI.Tests/FeaCliTests.cs
index 93ef56d4..db2ec75f 100644
--- a/Aetheris.CLI.Tests/FeaCliTests.cs
+++ b/Aetheris.CLI.Tests/FeaCliTests.cs
@@ -37,5 +37,34 @@ public sealed class FeaCliTests
finally { if(Directory.Exists(output))Directory.Delete(output,true); }
}
+ [Fact]
+ public void FeaCommand_UnknownInlineStepFace_ReturnsActionableDiagnostic()
+ {
+ var root=FindRoot();var temp=Path.Combine(Path.GetTempPath(),"aetheris-fea-bad-face-"+Guid.NewGuid().ToString("N"));
+ try
+ {
+ var feaDirectory=Directory.CreateDirectory(Path.Combine(temp,"FEA")).FullName;
+ var stepDirectory=Directory.CreateDirectory(Path.Combine(temp,"InlineStep","testdata")).FullName;
+ var canonicalSource=Path.Combine(root,"fixtures","FirmamentV2","FEA","inline-step-through-hole.firmament");
+ var source=Path.Combine(feaDirectory,"bad-face.firmament");
+ File.WriteAllText(source,File.ReadAllText(canonicalSource).Replace("body.face(#170)","body.face(#999999)",StringComparison.Ordinal));
+ File.Copy(Path.Combine(root,"fixtures","FirmamentV2","InlineStep","testdata","canonical-through-hole.step"),Path.Combine(stepDirectory,"canonical-through-hole.step"));
+ var stdout=new StringWriter();var stderr=new StringWriter();
+
+ var exit=CliRunner.Run(["fea",source,"--out-dir",Path.Combine(temp,"output"),"--json"],stdout,stderr);
+
+ Assert.Equal(1,exit);
+ Assert.Empty(stderr.ToString());
+ using var report=JsonDocument.Parse(stdout.ToString());
+ Assert.False(report.RootElement.GetProperty("success").GetBoolean());
+ var diagnostics=report.RootElement.GetProperty("diagnostics").ToString();
+ Assert.Contains("firmament-analysis-inline-step-face-missing",diagnostics,StringComparison.Ordinal);
+ Assert.Contains("body.face(#999999)",diagnostics,StringComparison.Ordinal);
+ Assert.Contains("body.face(#141)",diagnostics,StringComparison.Ordinal);
+ Assert.DoesNotContain("Nullable object must have a value",diagnostics,StringComparison.Ordinal);
+ }
+ finally { if(Directory.Exists(temp))Directory.Delete(temp,true); }
+ }
+
private static string FindRoot(){var directory=new DirectoryInfo(AppContext.BaseDirectory);while(directory is not null&&!File.Exists(Path.Combine(directory.FullName,"Aetheris.slnx")))directory=directory.Parent;return directory?.FullName??throw new DirectoryNotFoundException();}
}
diff --git a/Aetheris.CLI.Tests/PublicDocumentationQualificationTests.cs b/Aetheris.CLI.Tests/PublicDocumentationQualificationTests.cs
index 5fd58e17..694737bf 100644
--- a/Aetheris.CLI.Tests/PublicDocumentationQualificationTests.cs
+++ b/Aetheris.CLI.Tests/PublicDocumentationQualificationTests.cs
@@ -69,6 +69,27 @@ public sealed class PublicDocumentationQualificationTests
Assert.Equal(32, summary.GetProperty("faceCount").GetInt32());
}
+ [Fact]
+ public void A4MachinedPart_ReportsEveryAuthoredManufacturingFeature()
+ {
+ using var temp = TempDirectory.Create();
+ var output = new StringWriter(); var error = new StringWriter();
+ var source = Path.Combine(RepoRoot, "fixtures/FirmamentV2/Canonical/valid/a4-machined-mounting-block.firmament");
+ var step = Path.Combine(temp.Path, "a4-machined.step");
+
+ Assert.Equal(0, CliRunner.Run(["build", source, "--output", step, "--json"], output, error));
+ Assert.Empty(error.ToString());
+ using var build = JsonDocument.Parse(output.ToString());
+ Assert.Equal(6, build.RootElement.GetProperty("featureCount").GetInt32());
+ Assert.Equal(
+ ["Boss", "EdgeFinish", "Pocket"],
+ build.RootElement.GetProperty("engineeringFeatures").EnumerateArray()
+ .Select(item => item.GetProperty("kind").GetString()!)
+ .Order(StringComparer.Ordinal)
+ .ToArray());
+ Assert.True(File.Exists(step));
+ }
+
[Theory]
[InlineData("fixtures/FirmamentV2/SheetMetal/preview3-l-bracket-hole.firmament")]
[InlineData("fixtures/FirmamentV2/PublicDogfood/ai-sheet-metal.firmament")]
diff --git a/Aetheris.CLI.Tests/SheetMetalCliTests.cs b/Aetheris.CLI.Tests/SheetMetalCliTests.cs
index 39dd3057..791058e2 100644
--- a/Aetheris.CLI.Tests/SheetMetalCliTests.cs
+++ b/Aetheris.CLI.Tests/SheetMetalCliTests.cs
@@ -27,6 +27,7 @@ public sealed class SheetMetalCliTests
var output=new StringWriter();var error=new StringWriter();var input=Path.Combine(RepoRoot,"fixtures/FirmamentV2/SheetMetal/simple-u-channel.firmament");
var exit=CliRunner.Run(["sheetmetal","flatten",input,"--output",temp,"--k-factor","0.42","--json"],output,error);Assert.Equal(0,exit);Assert.Empty(error.ToString());
var svg=File.ReadAllText(temp);Assert.Contains("id=\"bend-lines\"",svg);Assert.Contains("id=\"bend-labels\" stroke=\"none\"",svg);Assert.Contains("id=\"cut-contours\"",svg);Assert.Contains("MountA",svg);Assert.Contains("Up 90°",svg);Assert.DoesNotContain("x1=\"35.66\" y1=\"42\" x2=\"35.66\" y2=\"42\"",svg);
+ using var report=JsonDocument.Parse(output.ToString());Assert.Equal("5052-H32 Aluminum",report.RootElement.GetProperty("material").GetProperty("authored").GetString());
}
finally{if(File.Exists(temp))File.Delete(temp);}
}
@@ -55,6 +56,7 @@ public sealed class SheetMetalCliTests
Assert.Equal(0,exit);Assert.Empty(error.ToString());
using var report=JsonDocument.Parse(output.ToString());
Assert.Equal(1,report.RootElement.GetProperty("part").GetProperty("features").GetInt32());
+ Assert.Equal("5052-H32 Aluminum",report.RootElement.GetProperty("part").GetProperty("material").GetString());
var analysis=StepAnalyzer.Analyze(temp);
Assert.Equal(3,analysis.Summary.SurfaceFamilies["cylinder"]);
}
diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.cs
index 38b4546c..1eb1fa0c 100644
--- a/Aetheris.CLI/CliRunner.cs
+++ b/Aetheris.CLI/CliRunner.cs
@@ -495,8 +495,8 @@ public static class CliRunner
var export=Step242Exporter.ExportBody(authored.Part.FormedBody,semanticPmi,new Step242ExportOptions{BrepExportPreflightMode=BrepExportPreflightMode.Enforce,ProductName=authored.Spec?.Name??"SheetMetalPart"});
if(!export.IsSuccess){if(json)stdout.WriteLine(JsonSerializer.Serialize(new{command="build",success=false,input=Path.GetFullPath(sourcePath),domain="SheetMetal",diagnostics=export.Diagnostics.Select(d=>new{d.Message,d.Source})},JsonOptions));else foreach(var d in export.Diagnostics)stderr.WriteLine(d.Message);return 1;}
var output=Path.GetFullPath(outPath??Path.ChangeExtension(sourcePath,".step"));Directory.CreateDirectory(Path.GetDirectoryName(output)!);File.WriteAllText(output,export.Value);
- if(json)stdout.WriteLine(JsonSerializer.Serialize(new{command="build",success=true,input=Path.GetFullPath(sourcePath),output,domain="SheetMetal",part=new{authored.Part.StableId,authored.Part.Thickness,regions=authored.Part.Regions.Count,bends=authored.Part.Bends.Count,features=authored.Part.Features.Count},manufacturing=new{release=authored.Spec?.Manufacturing.ReleaseName,semanticPmi=semanticPmi.Count},flatPattern=new{authored.FlatPattern!.Status,authored.FlatPattern.Bounds,authored.FlatPattern.DeterministicHash}},JsonOptions));
- else{stdout.WriteLine($"Built {Path.GetFileName(sourcePath)}");stdout.WriteLine($"STEP: {output}");stdout.WriteLine($"Model: {authored.Part.StableId} (SheetMetal, {authored.Part.Bends.Count} bends)");}
+ if(json)stdout.WriteLine(JsonSerializer.Serialize(new{command="build",success=true,input=Path.GetFullPath(sourcePath),output,domain="SheetMetal",part=new{authored.Part.StableId,authored.Part.Thickness,authored.Part.Material,regions=authored.Part.Regions.Count,bends=authored.Part.Bends.Count,features=authored.Part.Features.Count},manufacturing=new{release=authored.Spec?.Manufacturing.ReleaseName,materialSpecification=authored.Spec?.Manufacturing.MaterialSpecification,semanticPmi=semanticPmi.Count},flatPattern=new{authored.FlatPattern!.Status,authored.FlatPattern.Bounds,authored.FlatPattern.DeterministicHash}},JsonOptions));
+ else{stdout.WriteLine($"Built {Path.GetFileName(sourcePath)}");stdout.WriteLine($"STEP: {output}");stdout.WriteLine($"Model: {authored.Part.StableId} (SheetMetal, {authored.Part.Bends.Count} bends)");if(authored.Part.Material is not null)stdout.WriteLine($"Material: {authored.Part.Material}");}
return 0;
}
@@ -552,10 +552,10 @@ public static class CliRunner
? Regex.Matches(source,"(DRAUGHTING_MODEL|GEOMETRIC_TOLERANCE|DATUM_FEATURE|ANNOTATION_OCCURRENCE|SHAPE_ASPECT)",RegexOptions.IgnoreCase).Count
: authoredSpec.Manufacturing.Datums.Count+authoredSpec.Manufacturing.Dimensions.Count+authoredSpec.Manufacturing.GeometricTolerances.Count+authoredSpec.Manufacturing.Annotations.Count;
var exactValidation=flat.ExactBlankContour is null?null:PlanarContourKernel.Validate(flat.ExactBlankContour);
- var report=new{command=$"sheetmetal {operation}",success=true,input,sourceAuthority=SheetMetalFirmament.LooksLikeSheetMetal(source)?(source.Contains("Intent: Reconstructed",StringComparison.OrdinalIgnoreCase)?"Firmament reconstructed engineering authority":source.Contains("RecoveredRegion",StringComparison.Ordinal)?"Firmament recovered sheet-metal semantics":"Firmament authored semantics"):"STEP formed BRep (not mutated)",recognitionStatus=part.RecognitionStatus,thickness=new{nominal=part.Thickness,tolerance=authoredSpec?.Manufacturing.ThicknessTolerancePlus??thickness?.Tolerance,evidencePairs=thickness?.SourcePairs.Count(p=>p.Admitted)??0,outlierFaces=thickness?.OutlierFaceIds.Count??0},geometry=new{bodies=body?.Topology.Bodies.Count()??0,shells=body?.Topology.Shells.Count()??0,faces=body?.Topology.Faces.Count()??0,edges=body?.Topology.Edges.Count()??0,vertices=body?.Topology.Vertices.Count()??0,supportFamilies,pmiIndicators},manufacturing=authoredSpec?.Manufacturing,sheetMetal=new{baseRegion=part.BaseRegionId,regions=part.Regions.Select(r=>new{r.StableId,r.Kind,r.ApproximateArea,sourceFaces=r.Source.FaceIds}),attachmentPaths=(part.AttachmentPaths??[]).Select(p=>new{p.StableId,p.OwningRegionId,p.CarrierPath,p.Inset,length=(p.End-p.Start).Length,p.SpanOffset,p.Start,p.End,p.Tangent,p.InPlaneNormal,p.RegionNormal,p.Capabilities}),bends=part.Bends.Select(b=>new{b.StableId,b.AxisOrigin,b.AxisDirection,angleDegrees=b.BendAngleRadians*180/Math.PI,b.InsideRadius,b.Direction,b.AdjacentRegionA,b.AdjacentRegionB,sourceFaces=b.Source.FaceIds}),cuts=part.Features.Select(f=>new{f.StableId,f.Kind,f.OwningRegionId,f.Diameter,sourceFaces=f.Source.FaceIds}),reliefs=part.Reliefs?.Count??0,semanticLayout=authoredSpec?.SemanticLayout,conceptPaths,templateInstantiations},flatPattern=new{flat.Status,flat.Bounds,bendLines=flat.BendLines.Count,cuts=flat.CutLoops.Count,reliefs=flat.ReliefLoops?.Count??0,exactBlank=flat.ExactBlankContour is not null,outerLoops=flat.ExactBlankContour is null?0:1,innerLoops=flat.ExactBlankContour?.InnerLoops.Count??0,connectedMaterialRegions=flat.ExactBlankContour is null?0:1,selfIntersects=exactValidation?.Diagnostics.Any(x=>x.Code=="planar-contour-self-intersection")??false,exactContoursValid=exactValidation?.IsValid??false,fallbackUsed=authoredSpec is not null&&flat.ExactBlankContour is null,kFactor=flat.Policy.KFactor,flat.DeterministicHash,svg=output,step=flatStepOutput,firmament=firmamentOutput},dfm=new{dfm.Overall,findings=dfm.Findings},diagnostics=allDiagnostics,timingsMilliseconds=new{parse=authoredTimings?.ParseMilliseconds,semanticResolve=authoredTimings?.SemanticResolveMilliseconds,formedLower=authoredTimings?.FormedLowerMilliseconds,authoredFlatLower=authoredTimings?.FlatLowerMilliseconds,import=importTime.TotalMilliseconds,recognition=recognitionTime.TotalMilliseconds,flatten=flattenClock.Elapsed.TotalMilliseconds}};
+ var report=new{command=$"sheetmetal {operation}",success=true,input,sourceAuthority=SheetMetalFirmament.LooksLikeSheetMetal(source)?(source.Contains("Intent: Reconstructed",StringComparison.OrdinalIgnoreCase)?"Firmament reconstructed engineering authority":source.Contains("RecoveredRegion",StringComparison.Ordinal)?"Firmament recovered sheet-metal semantics":"Firmament authored semantics"):"STEP formed BRep (not mutated)",recognitionStatus=part.RecognitionStatus,material=new{authored=part.Material,manufacturingSpecification=authoredSpec?.Manufacturing.MaterialSpecification},thickness=new{nominal=part.Thickness,tolerance=authoredSpec?.Manufacturing.ThicknessTolerancePlus??thickness?.Tolerance,evidencePairs=thickness?.SourcePairs.Count(p=>p.Admitted)??0,outlierFaces=thickness?.OutlierFaceIds.Count??0},geometry=new{bodies=body?.Topology.Bodies.Count()??0,shells=body?.Topology.Shells.Count()??0,faces=body?.Topology.Faces.Count()??0,edges=body?.Topology.Edges.Count()??0,vertices=body?.Topology.Vertices.Count()??0,supportFamilies,pmiIndicators},manufacturing=authoredSpec?.Manufacturing,sheetMetal=new{baseRegion=part.BaseRegionId,regions=part.Regions.Select(r=>new{r.StableId,r.Kind,r.ApproximateArea,sourceFaces=r.Source.FaceIds}),attachmentPaths=(part.AttachmentPaths??[]).Select(p=>new{p.StableId,p.OwningRegionId,p.CarrierPath,p.Inset,length=(p.End-p.Start).Length,p.SpanOffset,p.Start,p.End,p.Tangent,p.InPlaneNormal,p.RegionNormal,p.Capabilities}),bends=part.Bends.Select(b=>new{b.StableId,b.AxisOrigin,b.AxisDirection,angleDegrees=b.BendAngleRadians*180/Math.PI,b.InsideRadius,b.Direction,b.AdjacentRegionA,b.AdjacentRegionB,sourceFaces=b.Source.FaceIds}),cuts=part.Features.Select(f=>new{f.StableId,f.Kind,f.OwningRegionId,f.Diameter,sourceFaces=f.Source.FaceIds}),reliefs=part.Reliefs?.Count??0,semanticLayout=authoredSpec?.SemanticLayout,conceptPaths,templateInstantiations},flatPattern=new{flat.Status,flat.Bounds,bendLines=flat.BendLines.Count,cuts=flat.CutLoops.Count,reliefs=flat.ReliefLoops?.Count??0,exactBlank=flat.ExactBlankContour is not null,outerLoops=flat.ExactBlankContour is null?0:1,innerLoops=flat.ExactBlankContour?.InnerLoops.Count??0,connectedMaterialRegions=flat.ExactBlankContour is null?0:1,selfIntersects=exactValidation?.Diagnostics.Any(x=>x.Code=="planar-contour-self-intersection")??false,exactContoursValid=exactValidation?.IsValid??false,fallbackUsed=authoredSpec is not null&&flat.ExactBlankContour is null,kFactor=flat.Policy.KFactor,flat.DeterministicHash,svg=output,step=flatStepOutput,firmament=firmamentOutput},dfm=new{dfm.Overall,findings=dfm.Findings},diagnostics=allDiagnostics,timingsMilliseconds=new{parse=authoredTimings?.ParseMilliseconds,semanticResolve=authoredTimings?.SemanticResolveMilliseconds,formedLower=authoredTimings?.FormedLowerMilliseconds,authoredFlatLower=authoredTimings?.FlatLowerMilliseconds,import=importTime.TotalMilliseconds,recognition=recognitionTime.TotalMilliseconds,flatten=flattenClock.Elapsed.TotalMilliseconds}};
if(json)stdout.WriteLine(JsonSerializer.Serialize(report,JsonOptions));else
{
- stdout.WriteLine($"Sheet Metal: {part.RecognitionStatus} ({report.sourceAuthority})");stdout.WriteLine($"Thickness: {part.Thickness:G8} mm{(thickness is null?" authored/recovered":$" ± {thickness.Tolerance:G4} mm, {thickness.SourcePairs.Count(p=>p.Admitted)} paired supports")}");stdout.WriteLine($"Regions: {part.Regions.Count} ({part.Regions.Count(r=>r.Kind==SheetRegionKind.Planar)} planar, {part.Regions.Count(r=>r.Kind==SheetRegionKind.CylindricalBend)} cylindrical)");stdout.WriteLine($"Bends: {part.Bends.Count}; cuts: {part.Features.Count}; base: {part.BaseRegionId}");foreach(var bend in part.Bends)stdout.WriteLine($" {bend.StableId}: {bend.BendAngleRadians*180/Math.PI:G5} deg, R{bend.InsideRadius:G6}, {bend.Direction}, {bend.AdjacentRegionA} -> {bend.AdjacentRegionB}");stdout.WriteLine($"Flat pattern: {flat.Status}; {(flat.Bounds is null?"no bounds":$"{flat.Bounds.Width:G8} x {flat.Bounds.Height:G8} mm")}; K={flat.Policy.KFactor:G4}; hash={flat.DeterministicHash}");if(flatStepOutput is not null)stdout.WriteLine($"STEP: {flatStepOutput}");if(firmamentOutput is not null)stdout.WriteLine($"Firmament: {firmamentOutput}");if(output is not null)stdout.WriteLine($"SVG: {output}");foreach(var d in allDiagnostics)stdout.WriteLine($" [{d.Severity}] {d.Code}: {d.Message}");
+ stdout.WriteLine($"Sheet Metal: {part.RecognitionStatus} ({report.sourceAuthority})");if(part.Material is not null)stdout.WriteLine($"Material: {part.Material}");stdout.WriteLine($"Thickness: {part.Thickness:G8} mm{(thickness is null?" authored/recovered":$" ± {thickness.Tolerance:G4} mm, {thickness.SourcePairs.Count(p=>p.Admitted)} paired supports")}");stdout.WriteLine($"Regions: {part.Regions.Count} ({part.Regions.Count(r=>r.Kind==SheetRegionKind.Planar)} planar, {part.Regions.Count(r=>r.Kind==SheetRegionKind.CylindricalBend)} cylindrical)");stdout.WriteLine($"Bends: {part.Bends.Count}; cuts: {part.Features.Count}; base: {part.BaseRegionId}");foreach(var bend in part.Bends)stdout.WriteLine($" {bend.StableId}: {bend.BendAngleRadians*180/Math.PI:G5} deg, R{bend.InsideRadius:G6}, {bend.Direction}, {bend.AdjacentRegionA} -> {bend.AdjacentRegionB}");stdout.WriteLine($"Flat pattern: {flat.Status}; {(flat.Bounds is null?"no bounds":$"{flat.Bounds.Width:G8} x {flat.Bounds.Height:G8} mm")}; K={flat.Policy.KFactor:G4}; hash={flat.DeterministicHash}");if(flatStepOutput is not null)stdout.WriteLine($"STEP: {flatStepOutput}");if(firmamentOutput is not null)stdout.WriteLine($"Firmament: {firmamentOutput}");if(output is not null)stdout.WriteLine($"SVG: {output}");foreach(var d in allDiagnostics)stdout.WriteLine($" [{d.Severity}] {d.Code}: {d.Message}");
}
return flat.Status is FlatPatternStatus.Unsupported or FlatPatternStatus.Overlapping?2:0;
void WriteFailure(IReadOnlyList<SheetMetalDiagnostic> ds){if(json)stdout.WriteLine(JsonSerializer.Serialize(new{command=$"sheetmetal {operation}",success=false,input,diagnostics=ds},JsonOptions));else foreach(var d in ds)stderr.WriteLine($"[{d.Severity}] {d.Code}: {d.Message}");}
@@ -765,11 +765,26 @@ Model CanonicalPanel {
else if(args[index]=="--lattice"&&index+1<args.Length){var values=args[++index].Split(',').Select(value=>int.TryParse(value,out var parsed)?parsed:0).ToArray();if(values.Length!=3||values.Any(value=>value<1)){stderr.WriteLine("Lattice override requires three positive integers.");return 1;}latticeOverride=(values[0],values[1],values[2]);}
else { stderr.WriteLine(FeaUsage); return 1; }
}
- if (!File.Exists(input)) { stderr.WriteLine($"Analysis source was not found: {input}"); return 1; }
+ if (!File.Exists(input))
+ {
+ var message = $"Analysis source was not found: {input}";
+ if (json) stdout.WriteLine(JsonSerializer.Serialize(new { command = "fea", success = false, input, diagnostics = new[] { new { code = "firmament-analysis-source-missing", severity = "Error", message } } }, JsonOptions));
+ else stderr.WriteLine(message);
+ return 1;
+ }
var compiled = FirmamentAnalysisCompiler.Compile(File.ReadAllText(input), input, Path.GetDirectoryName(input));
if (!compiled.IsSuccess || compiled.Analysis is null)
{
- foreach (var diagnostic in compiled.Diagnostics) stderr.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
+ if (json)
+ stdout.WriteLine(JsonSerializer.Serialize(new
+ {
+ command = "fea",
+ success = false,
+ input,
+ diagnostics = compiled.Diagnostics.Select(diagnostic => new { diagnostic.Code, severity = diagnostic.Severity.ToString(), diagnostic.Message })
+ }, JsonOptions));
+ else
+ foreach (var diagnostic in compiled.Diagnostics) stderr.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
return 1;
}
if(latticeOverride is { } requestedLattice)compiled=compiled with{Analysis=compiled.Analysis with{Lattice=new Aetheris.Continuum.Lattice.LatticeSpec(compiled.Analysis.Body.ContinuumRegion.Bounds,requestedLattice.X,requestedLattice.Y,requestedLattice.Z)}};
@@ -781,7 +796,17 @@ Model CanonicalPanel {
RetryEmptyCutCells:compiled.Analysis.Body.ContinuumRegion is not Aetheris.FEA.Geometry.ImportedBrepAnalysisRegion);var result = LinearElasticSolver.Solve(compiled.Analysis,solveOptions);
if (!result.IsSuccess)
{
- foreach (var diagnostic in result.Diagnostics.Where(item => item.Severity == Aetheris.FEA.Analysis.AnalysisDiagnosticSeverity.Error)) stderr.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
+ var errors = result.Diagnostics.Where(item => item.Severity == Aetheris.FEA.Analysis.AnalysisDiagnosticSeverity.Error).ToArray();
+ if (json)
+ stdout.WriteLine(JsonSerializer.Serialize(new
+ {
+ command = "fea",
+ success = false,
+ input,
+ diagnostics = errors.Select(diagnostic => new { diagnostic.Code, severity = diagnostic.Severity.ToString(), diagnostic.Message })
+ }, JsonOptions));
+ else
+ foreach (var diagnostic in errors) stderr.WriteLine($"{diagnostic.Code}: {diagnostic.Message}");
return 1;
}
var abaqus = AbaqusInpExporter.Export(compiled.Analysis,orientation); var validation = AbaqusInpValidator.Validate(abaqus.Text);
@@ -3755,7 +3780,7 @@ Model CanonicalPanel {
stdout.WriteLine(" aetheris fea plate-with-hole.firmament --out-dir artifacts --json");
stdout.WriteLine(" aetheris drawing compile bearing-block-drawing.firmament --out-dir artifacts/drawing --json");
stdout.WriteLine(" aetheris asm inspect bearing-module.firmament --json");
- stdout.WriteLine(" aetheris sheetmetal flatten formed.step --output formed-flat.svg");
+ stdout.WriteLine(" aetheris sheetmetal flatten bracket.firmament --step bracket-flat.step --svg bracket-flat.svg --json");
stdout.WriteLine(" aetheris reconstruct mesh scan.ply --mode fast --out scan-remesh.obj --report scan-report.json");
stdout.WriteLine();
stdout.WriteLine("Run 'aetheris <command> --help' for command-specific usage.");
diff --git a/Aetheris.FEA.Tests/ProductionFeaX1Tests.cs b/Aetheris.FEA.Tests/ProductionFeaX1Tests.cs
index 75d0d5a2..a88c9b72 100644
--- a/Aetheris.FEA.Tests/ProductionFeaX1Tests.cs
+++ b/Aetheris.FEA.Tests/ProductionFeaX1Tests.cs
@@ -86,6 +86,21 @@ public sealed class ProductionFeaX1Tests
Assert.Equal(500, result.BoundaryLoads!.Single().IntegratedResultant.Length, 6);
}
+ [Fact]
+ public void InlineStepUnknownFace_IsAStableActionableDiagnostic()
+ {
+ var root = FindRoot();
+ var path = Path.Combine(root, "fixtures", "FirmamentV2", "FEA", "inline-step-through-hole.firmament");
+ var source = File.ReadAllText(path).Replace("body.face(#170)", "body.face(#999999)", StringComparison.Ordinal);
+
+ var compilation = FirmamentAnalysisCompiler.Compile(source, path, Path.GetDirectoryName(path));
+
+ Assert.False(compilation.IsSuccess);
+ var diagnostic = Assert.Single(compilation.Diagnostics, item => item.Code == "firmament-analysis-inline-step-face-missing");
+ Assert.Contains("body.face(#999999)", diagnostic.Message, StringComparison.Ordinal);
+ Assert.Contains("body.face(#141)", diagnostic.Message, StringComparison.Ordinal);
+ }
+
[Fact]
public void InvalidLatticeAndResultRequest_AreStableDiagnostics()
{
diff --git a/Aetheris.FEA/Firmament/FirmamentAnalysisSemanticProducer.cs b/Aetheris.FEA/Firmament/FirmamentAnalysisSemanticProducer.cs
index baa346ed..9ba8767a 100644
--- a/Aetheris.FEA/Firmament/FirmamentAnalysisSemanticProducer.cs
+++ b/Aetheris.FEA/Firmament/FirmamentAnalysisSemanticProducer.cs
@@ -23,6 +23,20 @@ internal static partial class FirmamentAnalysisSemanticProducer
var side = match.Groups["side"].Value.ToUpperInvariant();
var token = side switch { "-X" => "x-min", "+X" => "x-max", "-Y" => "y-min", "+Y" => "y-max", "-Z" => "z-min", "+Z" => "z-max", _ => side };
exactFaceIds.TryGetValue(token, out var faceId);
+ if (origin == "InlineStep" && (token.StartsWith('#') || char.IsDigit(token[0])) && faceId is null)
+ {
+ var available = exactFaceIds.Keys
+ .Where(key => key.StartsWith('#'))
+ .OrderBy(key => int.TryParse(key.AsSpan(1), out var entityId) ? entityId : int.MaxValue)
+ .Take(12)
+ .Select(key => $"{expectedBody}.face({key})")
+ .ToArray();
+ var suffix = available.Length == 0
+ ? " The imported STEP artifact exposes no selectable ADVANCED_FACE identities."
+ : $" Available selectors include {string.Join(", ", available)}.";
+ return (null, new("firmament-analysis-inline-step-face-missing",
+ $"Imported boundary selector '{authoredPath}' does not match an ADVANCED_FACE in the STEP artifact.{suffix}", sourceSpan));
+ }
var stableId = $"analysis-region:{origin}:{expectedBody}:face({side})" + (faceId is null ? string.Empty : ":" + faceId);
return (new SemanticValue(stableId, new("BoundaryRegion"),
[new BoundaryRegionCapability(), new AnalysisRegionCapability(), new ExactGeometryCapability()],
diff --git a/Aetheris.Forge.Host.Tests/ForgeProtocolV1Tests.cs b/Aetheris.Forge.Host.Tests/ForgeProtocolV1Tests.cs
index 266957ca..04a6fb64 100644
--- a/Aetheris.Forge.Host.Tests/ForgeProtocolV1Tests.cs
+++ b/Aetheris.Forge.Host.Tests/ForgeProtocolV1Tests.cs
@@ -105,6 +105,24 @@ public sealed class ForgeProtocolV1Tests
Assert.True(File.Exists(System.IO.Path.Combine(outputDirectory.Path, "part.step")));
}
+ [Theory]
+ [InlineData(99, Enclosure, false, 2)]
+ [InlineData(1, "Standard.SheetMetal.DoesNotExist", false, 3)]
+ [InlineData(1, Enclosure, true, 4)]
+ public void ProcessCommandUsesDocumentedFailureExitCodes(int protocolVersion, string template, bool violateSemanticRequirement, int expectedExitCode)
+ {
+ using var outputDirectory = TempDirectory.Create();
+ var arguments = ValidArguments();
+ if (violateSemanticRequirement) arguments["lidLipHeight"] = "1 mm";
+ var request = JsonSerializer.Serialize(new ForgeTemplateInvocationRequest(protocolVersion, Elements(arguments), [ForgeArtifactKind.StepAp242]),
+ ForgeProtocolJsonContext.Default.ForgeTemplateInvocationRequest);
+
+ var exitCode = Program.Run(["invoke", template, "--request", "-", "--out", outputDirectory.Path],
+ new StringReader(request), new StringWriter());
+
+ Assert.Equal(expectedExitCode, exitCode);
+ }
+
[Fact]
public void PublicInteropRequestInvokesTheProductionTemplate()
{
diff --git a/Aetheris.Forge.Host/Program.cs b/Aetheris.Forge.Host/Program.cs
index 80c084e0..dee04cbf 100644
--- a/Aetheris.Forge.Host/Program.cs
+++ b/Aetheris.Forge.Host/Program.cs
@@ -35,7 +35,7 @@ public static class Program
return WriteError(output, "forge-host-request-invalid", "Invocation request was empty.", 2);
var result = host.InvokeTemplate(args[1], request, outputDirectory);
Write(output, result, ForgeProtocolJsonContext.Default.ForgeTemplateInvocationResult);
- return result.Success ? 0 : 4;
+ return result.Success ? 0 : InvocationFailureExitCode(result);
}
return WriteError(output, "forge-host-command-invalid",
"Usage: forge-host info | list | describe <template-id> | invoke <template-id> [--request <json|->] --out <directory>", 2);
@@ -50,6 +50,18 @@ public static class Program
}
}
+ private static int InvocationFailureExitCode(ForgeTemplateInvocationResult result)
+ {
+ if (result.Diagnostics.Any(diagnostic => diagnostic.Code == "forge-host-template-not-found")) return 3;
+ if (result.Diagnostics.Any(diagnostic =>
+ diagnostic.Code == "forge-host-protocol-version-unsupported" ||
+ diagnostic.Code == "forge-host-artifact-unsupported" ||
+ diagnostic.Code == "forge-host-argument-transport-type" ||
+ diagnostic.Code.StartsWith("firmament-template-record-", StringComparison.Ordinal)))
+ return 2;
+ return 4;
+ }
+
private static string? Option(string[] args, string name)
{
var index = Array.IndexOf(args, name);
diff --git a/Aetheris.Kernel.Firmament.Tests/BossPocketSemanticFeatureTests.cs b/Aetheris.Kernel.Firmament.Tests/BossPocketSemanticFeatureTests.cs
index 56ac5083..245a753a 100644
--- a/Aetheris.Kernel.Firmament.Tests/BossPocketSemanticFeatureTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/BossPocketSemanticFeatureTests.cs
@@ -106,7 +106,7 @@ public sealed class BossPocketSemanticFeatureTests
" Modify Body { EdgeFinish BossTop { Target: RectBossProfile.Outer On: Top Kind: Chamfer Distance: 1mm } }\n");
var build = FirmamentBuildAndExport.CompileSource(source);
Assert.True(build.IsSuccess, string.Join("; ", build.Diagnostics.Select(item => item.Message)));
- Assert.Equal(["Boss", "Pocket"], build.Value!.EngineeringFeatures!.Select(item => item.Kind).Order().ToArray());
+ Assert.Equal(["Boss", "EdgeFinish", "Pocket"], build.Value!.EngineeringFeatures!.Select(item => item.Kind).Order().ToArray());
var imported = Step242Importer.ImportBody(build.Value.StepText);
Assert.True(imported.IsSuccess, string.Join("; ", imported.Diagnostics.Select(item => item.Message)));
Assert.True(BrepMassProperties.Evaluate(imported.Value!).IsEnclosed);
diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
index 67eca174..70573ef7 100644
--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
@@ -43,18 +43,19 @@ public static class FirmamentBuildAndExport
return KernelResult<FirmamentBuildAndExportResult>.Failure(exportResult.Diagnostics);
}
- var pmiParity = VerifyV2PmiExportParity(sourceText, Path.GetDirectoryName(fullSourcePath), exportResult.Value);
+ var enrichedExport = AttachAuthoredFeatureReports(sourceText, Path.GetDirectoryName(fullSourcePath), exportResult.Value);
+ var pmiParity = VerifyV2PmiExportParity(sourceText, Path.GetDirectoryName(fullSourcePath), enrichedExport);
if (!pmiParity.IsSuccess)
{
return KernelResult<FirmamentBuildAndExportResult>.Failure(pmiParity.Diagnostics);
}
- var assertions = EvaluateVolumeAssertions(sourceText, Path.GetDirectoryName(fullSourcePath), exportResult.Value);
+ var assertions = EvaluateVolumeAssertions(sourceText, Path.GetDirectoryName(fullSourcePath), enrichedExport);
if (!assertions.IsSuccess)
{
return KernelResult<FirmamentBuildAndExportResult>.Failure(assertions.Diagnostics);
}
- var export = exportResult.Value with { Assertions = assertions.Value };
+ var export = enrichedExport with { Assertions = assertions.Value };
var resolvedOutputPath = string.IsNullOrWhiteSpace(outputPath)
? ResolveDefaultOutputPath(fullSourcePath)
: Path.GetFullPath(outputPath);
@@ -85,14 +86,50 @@ public static class FirmamentBuildAndExport
// available only to the explicitly versioned file compatibility route.
var export = ExportSource(normalized, sourceDirectory, allowV1Compatibility: false);
if (!export.IsSuccess) return export;
- var pmiParity = VerifyV2PmiExportParity(normalized, sourceDirectory, export.Value);
+ var enrichedExport = AttachAuthoredFeatureReports(normalized, sourceDirectory, export.Value);
+ var pmiParity = VerifyV2PmiExportParity(normalized, sourceDirectory, enrichedExport);
if (!pmiParity.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(pmiParity.Diagnostics);
- var assertions = EvaluateVolumeAssertions(normalized, sourceDirectory, export.Value);
+ var assertions = EvaluateVolumeAssertions(normalized, sourceDirectory, enrichedExport);
return assertions.IsSuccess
- ? KernelResult<FirmamentStepExportResult>.Success(export.Value with { Assertions = assertions.Value }, export.Diagnostics)
+ ? KernelResult<FirmamentStepExportResult>.Success(enrichedExport with { Assertions = assertions.Value }, export.Diagnostics)
: KernelResult<FirmamentStepExportResult>.Failure(assertions.Diagnostics);
}
+ private static FirmamentStepExportResult AttachAuthoredFeatureReports(
+ string source,
+ string? sourceDirectory,
+ FirmamentStepExportResult export)
+ {
+ var parsed = FirmamentV2Parser.Parse(source, sourceDirectory);
+ if (!parsed.IsSuccess || parsed.Document is null) return export;
+
+ var edgeFinishes = (parsed.Document.ModifyBlocks ?? [])
+ .SelectMany(modification => (modification.EdgeFinishes ?? []).Select(finish => new FirmamentEngineeringFeatureReport(
+ finish.Name,
+ "EdgeFinish",
+ $"edgefinish:{finish.Name}",
+ modification.TargetSolid,
+ finish.FaceAxis,
+ finish.Target,
+ finish.Distance,
+ string.Equals(finish.Kind, "Fillet", StringComparison.Ordinal) ? "Radius" : "Distance",
+ "Remove",
+ PolicySource: finish.Kind,
+ MaterializationRoute: "SemanticEdgeFinish")))
+ .ToArray();
+ if (edgeFinishes.Length == 0) return export;
+
+ var existing = export.EngineeringFeatures ?? [];
+ return export with
+ {
+ EngineeringFeatures = existing
+ .Concat(edgeFinishes)
+ .DistinctBy(feature => feature.FeatureId, StringComparer.Ordinal)
+ .OrderBy(feature => feature.FeatureId, StringComparer.Ordinal)
+ .ToArray()
+ };
+ }
+
private static KernelResult<IReadOnlyList<FirmamentV2VolumeAssertionResult>> EvaluateVolumeAssertions(string source, string? sourceDirectory, FirmamentStepExportResult export)
{
var parsed = FirmamentV2Parser.Parse(source, sourceDirectory);
@@ -533,7 +570,18 @@ public static class FirmamentBuildAndExport
DatumInspection: canonicalDocument?.Pmi?.Where(p => p.Kind == FirmamentV2PmiKind.DatumPlane).Select(p => new FirmamentPmiInspectionDatum(p.Name, "planar", p.Target)).ToArray() ?? [],
DimensionInspection: canonicalDocument?.Pmi?.Where(p => p.Kind == FirmamentV2PmiKind.HoleDiameter).Select(p => new FirmamentPmiInspectionDimension("Diameter", p.Target, null, p.Value ?? 0d, "explicit-v2-record-pmi", p.Name)).ToArray() ?? [],
Features: CompositionHoleReports(stack.Feature),
- EngineeringFeatures: EngineeringFeatureReports(stack.Feature)));
+ EngineeringFeatures: EngineeringFeatureReports(stack.Feature).Append(new FirmamentEngineeringFeatureReport(
+ target.StableId["edgefinish:".Length..],
+ "EdgeFinish",
+ target.StableId,
+ target.HostBodyId,
+ target.Side.ToString(),
+ $"{target.ProfileId}.{target.LoopId}",
+ distance,
+ "Distance",
+ "Remove",
+ PolicySource: "Chamfer",
+ MaterializationRoute: "ComposedProfileBoundaryChamfer")).ToArray()));
}
if (emitted.Body is null || emitted.Correspondence is null) return Fail("MissingCorrespondenceEvidence");
var composedCurves = stack.Slabs.MaxBy(s => s.To)!.Region.Outer.Loops.Single().Segments.Select(segment => segment.Geometry).ToArray();
diff --git a/Aetheris.Server.Tests/KernelApiIntegrationTests.cs b/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
index bdc1f8f2..6423ac3a 100644
--- a/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
+++ b/Aetheris.Server.Tests/KernelApiIntegrationTests.cs
@@ -986,6 +986,7 @@ public sealed class KernelApiIntegrationTests : IClassFixture<WebApplicationFact
Assert.NotNull(loaded.Data);
Assert.Equal("cadmata-concept-viz-x1", loaded.Data!.Visualization.SchemaVersion);
Assert.Contains(loaded.Data.Visualization.Entities, entity => entity.StableId == expectedEntityId);
+ Assert.DoesNotContain(loaded.Data.Visualization.Entities, entity => entity.Consumer?.Contains("Materializer", StringComparison.Ordinal) == true);
Assert.Equal(
loaded.Data.Visualization.Entities.Count,
loaded.Data.Visualization.Entities.Select(entity => entity.StableId).Distinct(StringComparer.Ordinal).Count());
diff --git a/Aetheris.Server/Api/CadmataFixtureService.cs b/Aetheris.Server/Api/CadmataFixtureService.cs
index ab68e9ff..d7e552e5 100644
--- a/Aetheris.Server/Api/CadmataFixtureService.cs
+++ b/Aetheris.Server/Api/CadmataFixtureService.cs
@@ -261,7 +261,7 @@ internal static class CadmataFixtureService
if (fixtureId == "semantic-shaft-hole")
{
const string id = "hole:base.mount";
- entities.Add(new(id, "HoleFeature", "mount", "conceptAxes", "SemanticHole", new("circle", Center: new(1.5, -1, 5), Radius: 2), "offset:0", null, null, null, correspondence?.Descendants.Select(d => d.StableId).ToArray(), null, null, "AirHoleSimpleShaftMaterializer", null, new Dictionary<string, string> { ["diameter"] = "4 mm", ["axis"] = "+Z", ["endCondition"] = "throughAll" }));
+ entities.Add(new(id, "HoleFeature", "mount", "conceptAxes", "SemanticHole", new("circle", Center: new(1.5, -1, 5), Radius: 2), "offset:0", null, null, null, correspondence?.Descendants.Select(d => d.StableId).ToArray(), null, null, "SemanticShaftHole", null, new Dictionary<string, string> { ["diameter"] = "4 mm", ["axis"] = "+Z", ["endCondition"] = "throughAll" }));
entities.Add(new("concept:base.mount.axis", "ConceptAxis", "mount axis", "conceptAxes", "HoleAxis", new("polyline", [new(1.5, -1, -5), new(1.5, -1, 5)]), "offset:0", [id], null, null, null, null, null, null, null, null));
}
if (semanticHoleEvidence is { PlacementKind: "ConstructionPlane", FrameOrigin: { } origin, AxisX: { } axisX, AxisY: { } axisY, AxisZ: { } axisZ, WorldMouthCenter: { } mouth, HostInterval: { } interval })
diff --git a/docs/public/README.md b/docs/public/README.md
index 5348bc17..23d3704b 100644
--- a/docs/public/README.md
+++ b/docs/public/README.md
@@ -7,6 +7,8 @@ Start with [Getting Started](getting-started.md), then use these guides:
- Firmament: [overview](firmament/overview.md), [syntax](firmament/syntax.md), [geometry](firmament/geometry.md), [Templates](firmament/templates.md), [materials](firmament/materials.md), [PMI](firmament/pmi.md), [Sheet Metal](firmament/sheet-metal.md), [FEA](firmament/fea.md), and [STEP import](firmament/step-import.md)
- Interoperability: [Forge Host Protocol v1](forge/interop.md)
- Inspection: [Cadmata](cadmata/overview.md) and [Cadmata PMI](cadmata/pmi.md)
-- Reference: [CLI](reference/cli.md), [targets/selectors](reference/targets.md), [diagnostics](reference/diagnostics.md), and [supported features](reference/supported-features.md)
+- Reference: [CLI](reference/cli.md), [targets/selectors](reference/targets.md), [diagnostics](reference/diagnostics.md), [supported features](reference/supported-features.md), [known issues](reference/known-issues.md), and [release notes](reference/release-notes.md)
+
+The Windows ZIP begins with the tested [release-bundle walkthrough](release-bundle.md).
All linked example source files are exercised by the public-example qualification tests. Preview 3's reliability rule is simple: a supported requested semantic operation is produced, and an unsupported operation fails with a named diagnostic; successful builds must not silently discard engineering intent.
diff --git a/docs/public/forge/interop.md b/docs/public/forge/interop.md
index 50d93174..25bfc8ee 100644
--- a/docs/public/forge/interop.md
+++ b/docs/public/forge/interop.md
@@ -5,14 +5,16 @@ Forge interop has three operations: list Templates, describe one Template, and i
C# can use the direct Forge API. Python, Go, Rust, and TypeScript/Node use the process protocol:
```powershell
-dotnet build Aetheris.Forge.Host -c Release
-$host = "Aetheris.Forge.Host/bin/Release/net10.0/win-x64/Aetheris.Forge.Host.exe"
+$host = ".\forge-host\Aetheris.Forge.Host.exe"
& $host list
& $host describe Standard.SheetMetal.ElectronicsEnclosure
-python samples/forge-interop-x1/python/client.py $host samples/forge-interop-x1/request.json artifacts/forge-python
-go run samples/forge-interop-x1/go/main.go $host samples/forge-interop-x1/request.json artifacts/forge-go
-rustc samples/forge-interop-x1/rust/client.rs -o artifacts/forge-rust.exe
-node samples/forge-interop-x1/typescript/client.ts $host samples/forge-interop-x1/request.json artifacts/forge-typescript
+python .\samples\forge-interop-x1\python\client.py $host .\samples\forge-interop-x1\request.json .\out\forge-python
+go run .\samples\forge-interop-x1\go\main.go $host .\samples\forge-interop-x1\request.json .\out\forge-go
+rustc .\samples\forge-interop-x1\rust\client.rs -o .\out\forge-rust.exe
+.\out\forge-rust.exe $host .\samples\forge-interop-x1\request.json .\out\forge-rust
+node .\samples\forge-interop-x1\typescript\client.ts $host .\samples\forge-interop-x1\request.json .\out\forge-typescript
```
+These commands run from the extracted `Aetheris-win-x64` directory and require no source checkout. Repository developers can publish the same host from `Aetheris.Forge.Host`; the released NativeAOT executable above is the qualified product path.
+
The shared production request is [`request.json`](../../../samples/forge-interop-x1/request.json), and the tiny clients are under [`samples/forge-interop-x1`](../../../samples/forge-interop-x1). Protocol v1 is language-neutral. The shipped NativeAOT binary and release bundle are qualified only for `win-x64`; framework-dependent tests on other operating systems establish protocol logic, not release-binary qualification.
diff --git a/docs/public/reference/known-issues.md b/docs/public/reference/known-issues.md
new file mode 100644
index 00000000..56dc6991
--- /dev/null
+++ b/docs/public/reference/known-issues.md
@@ -0,0 +1,9 @@
+# Preview 3 known issues and limitations
+
+- Release binaries are qualified for Windows x64 only. Framework tests on other platforms are not a binary-support promise.
+- `inlineSTEP` FEA supports the documented single-body imported class and stable imported face identities. Arbitrary imported containment and multi-root assembly-like STEP are rejected explicitly; some OCCT B-spline containment cases remain outside the qualified class.
+- The generic tessellated mass verifier can report `Unavailable` for some valid combined analytic Boss/Pocket/hole models when a face cannot be triangulated. STEP reimport, manifold checks, analytic surface inventory, bounds, and route-specific analytic volume remain available; do not interpret an unavailable tessellation estimate as a topology failure.
+- Compose-host Countersink is outside the current section-stack feature family. Model-domain Countersink remains supported. Sheet Metal Counterbore and Countersink are rejected because those formed-opening semantics are not implemented.
+- Imported STEP analysis currently reports millimetres as the qualified public length unit but does not preserve the source unit entity in imported topology metadata. Use millimetre AP242 input for Preview 3 workflows.
+- Standard Library material resolution is qualified for Firmament FEA and authored Sheet Metal. Ordinary prismatic CAD STEP export does not yet persist a general solid-material designation; do not infer one from the geometry artifact.
+- Cadmata may emit one Three.js `Clock` deprecation warning in the browser developer console. It does not affect loading, navigation, selection, PMI interaction, or model switching.
diff --git a/docs/public/reference/release-notes.md b/docs/public/reference/release-notes.md
new file mode 100644
index 00000000..862e5ded
--- /dev/null
+++ b/docs/public/reference/release-notes.md
@@ -0,0 +1,25 @@
+# Aetheris 2.0.0-preview.3 release notes
+
+Preview 3 is a Windows x64 release candidate for integrated engineering workflows.
+
+User-visible areas include:
+
+- Firmament V2 authoring with typed Records, Templates, Static specialization, tables, semantic references, and explicit diagnostics.
+- Bounded analytic and prismatic CAD, including first-class connected Boss and finite-depth Pocket semantics, semantic holes, admitted EdgeFinish routes, and deterministic STEP AP242 export.
+- Bounded Sheet Metal base/flange/bend/opening workflows with formed STEP, flat STEP, SVG, material identity, bend identity, and DFM evidence.
+- Semantic AP242 PMI for the qualified manufacturing families, including datums, dimensions, position controls, engineering annotations, and feature associations.
+- Cadmata geometry inspection, selection, PMI filtering, datum/feature interaction, geometry-to-PMI discovery, and presentation-only callout dragging.
+- A deployed Standard Library material catalog used by authored Sheet Metal and Firmament FEA.
+- Bounded linear-elastic FEA over native Firmament geometry or qualified `inlineSTEP` bodies, with Fixed/Force conditions and typed displacement, strain, stress, and reaction-force results.
+- Forge Host Protocol v1 discovery and deterministic invocation from foreign-language processes through the shipped NativeAOT host.
+- A release ZIP containing the public documentation, executable examples, material catalog, CLI, Cadmata, Forge Host, and foreign-language clients.
+
+Important boundaries:
+
+- Only `win-x64` release binaries are qualified.
+- Geometry support is bounded; there is no general loft, helix, freeform feature family, or arbitrary solid Boolean authoring.
+- Ordinary prismatic CAD STEP does not persist a general solid-material designation; material identity is qualified on the Sheet Metal and FEA paths.
+- Sheet Metal and FEA support the documented bounded manufacturing and linear-elastic classes, not general formed-feature or physics systems.
+- Protocol version `1` is independent of Aetheris version `2.0.0-preview.3`.
+
+See `known-issues.md` and `supported-features.md` for the precise release boundary.
diff --git a/docs/public/release-bundle.md b/docs/public/release-bundle.md
new file mode 100644
index 00000000..2b0bc284
--- /dev/null
+++ b/docs/public/release-bundle.md
@@ -0,0 +1,17 @@
+# Aetheris 2.0.0-preview.3 Windows bundle
+
+This bundle is the qualified `win-x64` Preview 3 product. Run commands from the `Aetheris-win-x64` directory.
+
+```powershell
+.\aetheris.exe --help
+.\aetheris.exe validate .\fixtures\FirmamentV2\Canonical\valid\box-hole-pmi.firmament --json
+.\aetheris.exe build .\fixtures\FirmamentV2\Canonical\valid\box-hole-pmi.firmament --output .\out\first-part.step --json
+.\aetheris.exe analyze .\out\first-part.step --json
+.\aetheris.exe view .\out\first-part.step
+.\forge-host\Aetheris.Forge.Host.exe info
+.\forge-host\Aetheris.Forge.Host.exe list
+```
+
+The complete public guide is under `docs/public`, executable Firmament examples are under `fixtures/FirmamentV2`, foreign-language Forge clients are under `samples/forge-interop-x1`, and the deployed Standard Library material catalog is under `Materials`.
+
+Cadmata and the NativeAOT Forge Host are included. The standalone CLI NuGet tool does not include Cadmata. Preview 3 is qualified only for Windows x64 and intentionally supports bounded geometry, Sheet Metal, PMI, FEA, and STEP-import classes; read `docs/public/reference/supported-features.md` and `docs/public/reference/known-issues.md` before relying on a boundary case.
diff --git a/docs/release/PREVIEW3-HARDEN-A4.md b/docs/release/PREVIEW3-HARDEN-A4.md
new file mode 100644
index 00000000..4842b356
--- /dev/null
+++ b/docs/release/PREVIEW3-HARDEN-A4.md
@@ -0,0 +1,171 @@
+# PREVIEW3-HARDEN-A4
+
+## Executive verdict
+
+Yes. Preview 3 behaves as one coherent release candidate across the qualified Windows x64 surface. Packaged Firmament, STEP AP242, Sheet Metal, semantic PMI, Cadmata, Standard Library materials, native and `inlineSTEP` FEA, and the NativeAOT Forge Host were exercised through reused artifacts rather than isolated fixtures. All A4 ReleaseBlocker and MustFix findings were fixed and rerun through the packaged path that exposed them.
+
+The release boundary remains bounded and explicit. Ordinary prismatic STEP does not persist a general solid-material designation; material identity is qualified for authored Sheet Metal and Firmament FEA. This is documented rather than widened during freeze.
+
+## Integrated workflow matrix
+
+| Workflow | Packaged path | Result | Findings | Release status |
+| -------- | ------------- | ------ | -------- | -------------- |
+| A — machined mounting block | ZIP CLI: Firmament -> BRep -> AP242 -> reimport -> Cadmata | 6 truthful features; 64 faces; enclosed manifold; 1 datum and 2 dimensions; byte-stable STEP | EdgeFinish was absent from structured inventory; fixed. General CAD material persistence is not supported and is now documented. | Pass with documented boundary |
+| B — Sheet Metal bracket | ZIP CLI: authored bracket -> formed STEP + flat STEP + SVG -> reimport | 3 regions, 1 bend, 1 circular opening; 5052-H32 identity; all DFM rules pass | Material was absent from CLI summaries and help showed a stale invocation; fixed. | Pass |
+| C — manufacturing PMI | packaged CLI + production Cadmata: CTC-03 AP242 | 3 datums, 13 dimensions, 5 position controls, 8 annotations, 23 face-associated PMI items | One internal materializer class name leaked through a consumer label; fixed. | Pass |
+| D — native FEA | ZIP CLI + shipped SQLite catalog | ASTM A36, 500 N load, converged displacement/stress/reaction results, equilibrium residual below 1e-9 N | JSON failures previously went only to stderr; fixed. | Pass |
+| E — generated STEP `inlineSTEP` FEA | ZIP CLI Firmament STEP -> generated analysis source -> FEA | imported face selection, Al 6061-T6, converged solve, equilibrium residual below 1e-8 N, repeatable Abaqus identity | Unknown face produced an internal nullable exception; fixed with selector inventory. | Pass |
+| F — Forge foreign-language generation | published NativeAOT host + shipped Python and Go clients | Protocol v1 discovery/invoke; equivalent artifacts byte-identical; generated STEP reimports enclosed | Error categories all returned exit 4; fixed to request 2, missing template 3, invocation 4. | Pass |
+| Release ZIP | clean extraction in a path containing spaces | CLI, examples, docs, licenses, materials, Forge, Cadmata, and FEA work without checkout | Public docs/examples/licenses were missing; PS 5.1 release script APIs failed; incremental compiler state changed ZIP bytes. All fixed. | Pass |
+| External NuGet consumer | fresh project, generated packages only | versions load, SQLite material resolves, direct C# Forge API emits reimportable STEP | Smoke consumer needed an explicit Standard Library package reference for its direct API use; fixed. | Pass |
+
+## Bugs found and fixed
+
+### ReleaseBlocker
+
+- The candidate ZIP omitted public documentation, executable examples, foreign-language Forge clients, `LICENSE`, and `THIRD_PARTY_NOTICES.md`. The release composition now includes the complete public walkthrough surface and its exact dependencies.
+- Consecutive release builds could inherit shared managed compiler output from a prior NativeAOT publish. The resulting ZIPs differed in 15 managed assemblies. The release script now cleans the Release graph before publishing; two independent builds subsequently contained 672 files each with zero hash differences.
+
+### MustFix
+
+- Windows PowerShell 5.1 could not call `Path.GetRelativePath`, and pipeline binding to `Get-FileHash` failed. Both release-script paths are now PS 5.1 compatible.
+- Authored `EdgeFinish` was missing from the engineering feature inventory even when the emitted chamfer was present. The report now retains stable EdgeFinish identity for admitted composed and external modification routes.
+- Sheet Metal build/flatten output omitted authored material identity and manufacturing specification. JSON and human output now report them.
+- FEA `--json` failures emitted plain stderr or an internal nullable exception for a missing imported face. Failures now emit structured diagnostics on stdout, including available imported face selectors.
+- Forge Host invocation failures did not preserve the documented protocol exit classes. Packaged smoke now proves 2/3/4/0 for bad request/missing template/invocation failure/subsequent valid invocation.
+- Top-level CLI help showed a stale Sheet Metal flatten form. It now uses the supported Firmament/flat STEP/SVG arguments.
+- Cadmata fixture metadata exposed `AirHoleSimpleShaftMaterializer`. The public consumer label is now semantic and implementation-neutral.
+- The initial release-bundle walkthrough used nonexistent `firmament validate/build` command prefixes. The clean-install commands now match the shipped CLI.
+
+### DocsFix
+
+- Forge interoperability docs now use the shipped NativeAOT host instead of directing release users to build from source.
+- Release notes and known issues now state the Windows x64, imported-unit, imported-containment, mass-verifier, Sheet Metal opening, and general CAD material-persistence boundaries.
+
+No open ReleaseBlocker or MustFix remains.
+
+## Cross-subsystem evidence
+
+- Firmament machined STEP -> packaged CLI reimport -> Cadmata: SHA-256 `19CC6E25BB31C563E078EF5A2F5699D6296CE4D16A788BB7084BB358115DB98A`; 64 faces; enclosed manifold; Boss, Pocket, EdgeFinish, shaft hole, and two counterbores reported as 6 features.
+- Firmament through-hole STEP -> `inlineSTEP` FEA: geometry identity `0f572512346ec480aee64b2e84cb4898eb2136df017cfbb99674ae0f29ea5823`; repeat Abaqus SHA-256 `CAF0772E625E024E159CEB31F04F6A5C118BABFBB536A7081242B8355E7FF5A4`.
+- Sheet Metal bracket -> formed/flat/reimport: formed STEP `347A5D2968A01D2C94F439516A775262C3FC553EACD103CB1A7998A1476340FC`; flat STEP `7DABD84D3D9089055DAB5205A6270F571F8B820FD86ED989046901B43614C0A4`; SVG `0E10E0ECA045927A4FABD17DD4B98B5EBF846A79C84E98CFCB0C9551E5CF3336`.
+- Manufacturing AP242 -> packaged CLI -> Cadmata: 129-face enclosed manifold, millimetre public basis, 3 datums, 8 diameters, 5 linear dimensions, 5 positions, 8 engineering annotations, and 23 geometrically associated items.
+- Forge Python/Go -> packaged CLI: STEP `114CD7C0C6A8A364B2943CC955A12D8A96B576A187DFC1957EA9F769296872BE`, flat STEP `88C437373FE4FDF91E8F0A5B5E0E5C135B290F0DFE18449EC3EE7C0970C1D075`, SVG `1657E3BBC3EF418617B45C5D9AB76A96D70B0BA6356C0E88A7BA07EDC18B6519`; zero cross-language artifact differences; generated STEP reimported as a 46-face enclosed manifold.
+- External NuGet consumer -> Standard Library -> direct Forge API -> STEP importer: pass without project references or source-checkout runtime files.
+
+## Cadmata whole-product dogfood
+
+The production bundle loaded a small PMI witness, full CTC-03 manufacturing AP242, a plain Boss/Pocket part, a Sheet Metal part, and CTC-03 again. Orbit, pan, zoom, reset, selection/deselection, viewport resize, PMI filters, datum selection, feature inspection, geometry-to-PMI discovery, and model switching all remained usable.
+
+CTC-03 displayed 3 datums, 13 dimensions, 5 position controls, and 8 annotations. Face 123 discovered its diameter, position, and engineering note. Dragging the `FrontMountPosition` callout changed presentation position while semantic identity `step-pmi:4030` remained unchanged. The note `MountHoleRework` remained associated with feature `FrontMountHoles` and faces 123/124. Switching PMI-heavy -> plain -> Sheet Metal -> PMI-heavy cleared selection, callouts, names, and filters without cross-model contamination. One non-fatal Three.js `Clock` deprecation warning remains documented.
+
+The final clean ZIP Cadmata executable served its production UI with HTTP 200 and exited cleanly.
+
+## Error recovery and unsupported boundaries
+
+- Unknown material -> `firmament-material-unknown` -> corrected native FEA succeeds.
+- 40 mm Pocket in 12 mm stock -> `firmament-pocket-through-depth` with remaining floor `-28mm` and required floor `3mm` -> corrected part succeeds.
+- Imported `body.face(#9999)` -> `firmament-analysis-inline-step-face-missing` plus supported selectors -> corrected imported analysis succeeds.
+- Forge bad protocol, missing template, extra argument, and failed template requirement -> structured diagnostics and exit 2/3/2/4 -> valid invocation afterward exits 0.
+- Packaged CLI probes reject general loft, helix, and arbitrary public solid Boolean records with fatal `firmament-v2-unknown-record-type`; reject a spindle/generalized torus with `firmament-v2-primitive-field-invalid`; and reject Sheet Metal Counterbore/Countersink with the actionable `sheetmetal-hole-domain-syntax` boundary. The serial FEA corpus verifies `firmament-analysis-inline-step-containment-unsupported`. No crash, silent omission, or new feature implementation was introduced.
+
+## Release ZIP walkthrough
+
+The final ZIP was extracted under `%TEMP%` to a directory whose name contains spaces. No command used the repository checkout for runtime dependencies.
+
+1. Top-level help returned exit 0 and exposed validate, build, inspect/analyze, Sheet Metal, FEA, and related command discovery.
+2. The bundled A4 machined source validated in 188 ms, built in 459 ms, and reimported in 201 ms.
+3. The bundled Standard Library catalog resolved ASTM A36 and Al 6061-T6 during native/imported FEA.
+4. The Sheet Metal bracket produced formed STEP, flat STEP, and SVG with material, bend, cut, and DFM evidence.
+5. Native and generated-STEP FEA solved with typed SI-unit results and equilibrium evidence.
+6. NativeAOT Forge `info`, `list`, `describe`, and `invoke` succeeded; Python and Go clients emitted identical artifacts.
+7. A Forge-generated STEP was inspected by the packaged CLI.
+8. The shipped Cadmata host served the production bundle.
+
+The ZIP root now contains `README.md`, `LICENSE`, `THIRD_PARTY_NOTICES.md`, `docs/public`, tracked examples and their dependencies, `Materials`, the CLI, Cadmata, Forge Host, and all four foreign-language client sources.
+
+## Performance sanity
+
+Representative wall-clock observations on the qualification machine:
+
+| Operation | Approximate time |
+| --------- | ---------------- |
+| Machined validate | 0.19 s |
+| Machined build | 0.46 s |
+| Machined STEP reimport | 0.20 s |
+| Sheet Metal formed build | 0.27 s |
+| Sheet Metal flatten + STEP + SVG | 0.39 s |
+| Forge host invocation | 16–20 ms template execution; 0.11 s Python process roundtrip |
+| Go client | 9.44 s including `go run` compilation |
+| Native ASTM A36 FEA | 0.70 s |
+| Imported STEP FEA | 1.49 s |
+
+No severe performance regression was observed. Twenty packaged Forge invocations completed in 676 ms, twenty STEP reimports in 3.85 s, and twenty material-backed native FEA runs in 12.58 s, all with zero failures or obvious handle/process leakage.
+
+## FEA evidence and units
+
+- Native ASTM A36 cantilever: 500 N load, maximum displacement `2.50619032107412e-5 m`, maximum von Mises stress `9.90827051725881e6 Pa`, reaction magnitude approximately 500 N, equilibrium residual `8.911281496689226e-10 N`.
+- Generated imported STEP: Al 6061-T6, maximum displacement `1.26136842667411e-5 m`, maximum von Mises stress `4.65430702810233e6 Pa`, equilibrium residual `9.93853727025691e-9 N`.
+- Firmament and STEP public geometry are millimetre-first; Standard Library elasticity values are Pa; loads and reactions are N; FEA displacement is reported in m. AP242 inspection reports mm and explicitly labels the imported-unit preservation limitation.
+
+## Determinism and provenance
+
+After adding a clean managed build boundary to the release script, two complete release builds each contained 672 files and produced zero file/hash differences. The final release ZIP SHA-256 is `88B0A38A14654C96CE9188D8EFED6085EB0EAC5B2FB515EA28A5F8E8F827DF12`; the VSIX is `DEF44BC6A83AED90A67505987EC36D00AA134D900FAB734C48B83D0AEB59F361`; and the CLI NuGet tool package is `1D1233B72E64B92662B437B46C7BF53CA0AE09A79D9DD18ADBF038AE074FCD43`.
+
+Representative model and Forge hashes are listed in Cross-subsystem evidence. Timing fields vary as documented; semantic identities and artifact bytes do not. Output contains release version/protocol identity and no developer-machine paths or random GUID-based product identity.
+
+## Known issues
+
+Public release limitations are maintained in [`docs/public/reference/known-issues.md`](../public/reference/known-issues.md). The release-relevant set is:
+
+- qualified release binaries are Windows x64 only;
+- `inlineSTEP` is a bounded single-body/face-identity class and does not promise arbitrary imported containment;
+- the generic tessellated mass verifier can be unavailable for some valid combined analytic bodies;
+- Compose-host Countersink and Sheet Metal Counterbore/Countersink remain outside their admitted domains;
+- imported STEP topology does not preserve source unit metadata and the qualified input is millimetre AP242;
+- ordinary prismatic STEP does not persist a general solid-material designation;
+- one harmless Three.js clock deprecation warning can appear in developer tools.
+
+These are DocumentForPreview limitations, not unresolved ReleaseBlockers.
+
+## Feature-freeze audit
+
+Feature freeze status: **intact**.
+
+The post-freeze capability exception remains only A3b first-class connected Boss and finite-depth Pocket semantics. A4 changes are correctness, diagnostics, structured-output truthfulness, packaging, release determinism, test coverage, and documentation corrections. No CAD/Sheet Metal/PMI/FEA/Forge/Cadmata feature family, protocol verb, physics mode, platform RID, C ABI, or architecture was added.
+
+## Release notes draft
+
+The factual public draft is [`docs/public/reference/release-notes.md`](../public/reference/release-notes.md). It covers Firmament V2, analytic/prismatic CAD, Boss/Pocket, Sheet Metal, AP242 and semantic PMI, Cadmata, materials, bounded linear-elastic FEA, NativeAOT Forge interoperability, and the Windows x64/bounded-feature limitations without expanding the release promise.
+
+## Finding classification
+
+- **ReleaseBlocker (resolved):** incomplete release ZIP; release ZIP nondeterminism from inherited publish state.
+- **MustFix (resolved):** PS 5.1 packaging failures; untruthful EdgeFinish and Sheet Metal material summaries; FEA JSON and missing-face diagnostics; Forge exit mapping; stale CLI help; internal Cadmata label; invalid release walkthrough commands.
+- **DocsFix (resolved):** shipped-host Forge instructions, units/material boundary, release notes, known issues.
+- **DocumentForPreview:** Windows x64 qualification; bounded imported containment; imported STEP unit metadata; combined-body generic mass verifier; Compose/Sheet Metal opening boundaries; general CAD material persistence; Three.js warning.
+- **DeferredPostPreview3:** new geometry/formed-feature families, arbitrary Boolean authoring, additional FEA physics, new protocol verbs, UI controls, and additional RIDs.
+
+## Validation
+
+- Release build: `dotnet build Aetheris.slnx -c Release -m:1 --no-restore` — pass, 0 warnings, 0 errors.
+- Full serial .NET suite: 3,017 passed, 0 failed, 0 skipped. `Aetheris.FrictionLab.Tests` remains a pre-existing assembly with no discoverable tests.
+- Cadmata: typecheck pass; 16 test files / 81 tests pass; production build pass; lint pass; packaged production-host and interactive dogfood pass.
+- VS Code extension: 13 tests pass; typecheck/build/package pass.
+- Public docs/examples: public qualification tests pass; bundled Getting Started, Boss/Pocket, material, PMI, Sheet Metal, native FEA, `inlineSTEP`, and Forge examples run through the packaged CLI/host.
+- Public libraries: 16 Preview 3 packages generated; fresh external restore/run and direct Forge API/STEP reimport pass.
+- NativeAOT Forge publish: pass with the existing audited trim/AOT warnings; packaged protocol and foreign-language smoke pass.
+- Release ZIP: build pass; clean extraction walkthrough pass; required docs/examples/licenses present; no source checkout dependency.
+- Forge protocol: Protocol v1 remains distinct from Aetheris `2.0.0-preview.3`; error recovery and valid invoke pass.
+- STEP corpus: machined, Sheet Metal, Forge, primitive, and manufacturing PMI export/reimport tests pass.
+- PMI/AP242/Cadmata: semantic counts, associations, filters, selection, dragging, and model-reset flow pass.
+- Native FEA and generated-artifact `inlineSTEP` FEA: converged, equilibrated, typed, repeatable.
+- Resource sanity: 20 Forge invokes, 20 STEP imports, and 20 material/FEA runs pass without obvious leakage.
+- Release logging: ordinary successful CLI/host output contains no stack traces, parser traces, debug spam, developer paths, or internal materializer names.
+- Stale-development leakage scan over public docs and packaged README/samples: clean for milestone/debug implementation names and developer paths.
+- Deterministic reruns: representative STEP/flat STEP/SVG/Abaqus/Forge artifacts stable; two complete post-fix release trees match file-for-file.
+- `git diff --check`: pass.
+
+## Acceptance
+
+The preserved A4 corpus covers the realistic machined part, practical Sheet Metal bracket, CTC-03 manufacturing PMI/Cadmata interaction, native material-backed FEA, generated-STEP `inlineSTEP` FEA, published Forge Host with Python/Go clients, clean release ZIP, and external NuGet consumer. All A4 ReleaseBlocker and MustFix findings are resolved and rerun through their original integrated workflows.
diff --git a/fixtures/FirmamentV2/Canonical/valid/a4-machined-mounting-block.firmament b/fixtures/FirmamentV2/Canonical/valid/a4-machined-mounting-block.firmament
new file mode 100644
index 00000000..71e7b4ad
--- /dev/null
+++ b/fixtures/FirmamentV2/Canonical/valid/a4-machined-mounting-block.firmament
@@ -0,0 +1,80 @@
+Model A4MachinedMountingBlock {
+ Units: mm
+
+ Concept Struct Layout On XY {
+ Rect2 Stock { Center: [0mm, 0mm]; Size: [70mm, 44mm] }
+ Rect2 BossPad { Center: [-16mm, 0mm]; Size: [14mm, 14mm] }
+ Rect2 Recess { Center: [10mm, 0mm]; Size: [20mm, 16mm] }
+ }
+
+ Profile BaseProfile Using Layout { Loop Outer {
+ Segment Bottom { Trace: Stock.Bottom; From: Stock.BottomLeft; To: Stock.BottomRight }
+ Segment Right { Trace: Stock.Right; From: Stock.BottomRight; To: Stock.TopRight }
+ Segment Top { Trace: Stock.Top; From: Stock.TopRight; To: Stock.TopLeft }
+ Segment Left { Trace: Stock.Left; From: Stock.TopLeft; To: Stock.BottomLeft }
+ } }
+ Profile BossProfile Using Layout { Loop Outer {
+ Segment Bottom { Trace: BossPad.Bottom; From: BossPad.BottomLeft; To: BossPad.BottomRight }
+ Segment Right { Trace: BossPad.Right; From: BossPad.BottomRight; To: BossPad.TopRight }
+ Segment Top { Trace: BossPad.Top; From: BossPad.TopRight; To: BossPad.TopLeft }
+ Segment Left { Trace: BossPad.Left; From: BossPad.TopLeft; To: BossPad.BottomLeft }
+ } }
+ Profile PocketProfile Using Layout { Loop Outer {
+ Segment Bottom { Trace: Recess.Bottom; From: Recess.BottomLeft; To: Recess.BottomRight }
+ Segment Right { Trace: Recess.Right; From: Recess.BottomRight; To: Recess.TopRight }
+ Segment Top { Trace: Recess.Top; From: Recess.TopRight; To: Recess.TopLeft }
+ Segment Left { Trace: Recess.Left; From: Recess.TopLeft; To: Recess.BottomLeft }
+ } }
+
+ Struct MountingBlock {
+ Compose Body {
+ Base Stock { Profile: BaseProfile; From: 0mm; To: 12mm; Role: Stock }
+ Boss ConnectorBoss { On: Top; Profile: BossProfile; Height: 6mm }
+ Pocket ElectronicsRecess { On: Top; Profile: PocketProfile; Depth: 4mm; MinimumFloorThickness: 3mm }
+ Hole<Shaft> ConnectorBore { On: +Z; Center: [-16mm, 0mm]; Diameter: 6mm; End: ThroughAll; Role: Connector }
+ Hole<Counterbore> MountNorth {
+ On: +Z
+ Center: [26mm, 13mm]
+ Diameter: 6mm
+ CounterboreDiameter: 11mm
+ CounterboreDepth: 3mm
+ End: ThroughAll
+ Role: MountingHole
+ }
+ Hole<Counterbore> MountSouth {
+ On: +Z
+ Center: [26mm, -13mm]
+ Diameter: 6mm
+ CounterboreDiameter: 11mm
+ CounterboreDepth: 3mm
+ End: ThroughAll
+ Role: MountingHole
+ }
+ }
+ }
+
+ Modify Body {
+ EdgeFinish PerimeterBreak {
+ Target: BaseProfile.Outer
+ On: Top
+ Kind: Chamfer
+ Distance: 1mm
+ }
+ }
+
+ Pmi {
+ Datum A { Target: face(+Z) }
+ HoleDiameter ConnectorDiameter {
+ Target: ConnectorBore
+ Value: 6mm
+ Tolerance: PlusMinus(0.05mm, 0.02mm)
+ DatumRefs: [A]
+ }
+ HoleDiameter MountNorthDiameter {
+ Target: MountNorth
+ Value: 6mm
+ Tolerance: PlusMinus(0.10mm, 0.00mm)
+ DatumRefs: [A]
+ }
+ }
+}
diff --git a/samples/forge-interop-x1/README.md b/samples/forge-interop-x1/README.md
index 6d0b2756..402fcac9 100644
--- a/samples/forge-interop-x1/README.md
+++ b/samples/forge-interop-x1/README.md
@@ -1,13 +1,13 @@
# Forge interop X1 dogfood
-These are intentionally tiny process clients for Forge Host Protocol v1. Build `Aetheris.Forge.Host` in Release, then pass the resulting host executable, the shared request, and a distinct output directory to a client:
+These are intentionally tiny process clients for Forge Host Protocol v1. In the release ZIP, run from the extracted `Aetheris-win-x64` directory and pass the shipped host executable, the shared request, and a distinct output directory to a client:
```powershell
-python python/client.py <host-executable> request.json out/python
-go run go/main.go <host-executable> request.json out/go
-rustc rust/client.rs -o out/rust-client.exe
-out/rust-client.exe <host-executable> request.json out/rust
-node typescript/client.ts <host-executable> request.json out/typescript
+python samples/forge-interop-x1/python/client.py forge-host/Aetheris.Forge.Host.exe samples/forge-interop-x1/request.json out/python
+go run samples/forge-interop-x1/go/main.go forge-host/Aetheris.Forge.Host.exe samples/forge-interop-x1/request.json out/go
+rustc samples/forge-interop-x1/rust/client.rs -o out/rust-client.exe
+out/rust-client.exe forge-host/Aetheris.Forge.Host.exe samples/forge-interop-x1/request.json out/rust
+node samples/forge-interop-x1/typescript/client.ts forge-host/Aetheris.Forge.Host.exe samples/forge-interop-x1/request.json out/typescript
```
-[`scripts/test-forge-interop-x1.ps1`](../../scripts/test-forge-interop-x1.ps1) builds the host, runs all four, validates every STEP with Aetheris.CLI, and rejects any cross-language artifact hash difference.
+The clients require only their language runtime and the extracted release bundle. Each checks the structured response and emitted files; equivalent requests produce byte-identical artifacts.
diff --git a/scripts/package-release.ps1 b/scripts/package-release.ps1
index 9c134a47..c92c1c9c 100644
--- a/scripts/package-release.ps1
+++ b/scripts/package-release.ps1
@@ -85,6 +85,18 @@ function Normalize-PeTimestamps([string]$Path) {
[IO.File]::WriteAllBytes($Path, $bytes)
}
+
+function Get-ReleaseRelativePath([string]$Root, [string]$Path) {
+ $canonicalRoot = [IO.Path]::GetFullPath($Root).TrimEnd([IO.Path]::DirectorySeparatorChar, [IO.Path]::AltDirectorySeparatorChar)
+ $canonicalPath = [IO.Path]::GetFullPath($Path)
+ $rootPrefix = $canonicalRoot + [IO.Path]::DirectorySeparatorChar
+ if (-not $canonicalPath.StartsWith($rootPrefix, [StringComparison]::OrdinalIgnoreCase)) {
+ throw "Release file is outside the staging root: $canonicalPath"
+ }
+
+ return $canonicalPath.Substring($rootPrefix.Length)
+}
+
Remove-Item -LiteralPath $output -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $stage, (Join-Path $output 'packages') | Out-Null
@@ -102,6 +114,11 @@ try {
}
finally { Pop-Location }
+# Release binaries must not inherit compiler state from an earlier publish with
+# different properties (notably PublishAot). Start the managed release graph
+# from a clean configuration so identical inputs produce identical archives.
+dotnet clean (Join-Path $repoRoot 'Aetheris.slnx') -c Release
+
dotnet publish (Join-Path $repoRoot 'Aetheris.CLI/Aetheris.CLI.csproj') -c Release -r win-x64 --self-contained true -t:Rebuild -p:Version=$Version -p:DebugType=None -p:DebugSymbols=false -o (Join-Path $stage 'Aetheris-win-x64')
dotnet publish (Join-Path $repoRoot 'Aetheris.Forge.Host/Aetheris.Forge.Host.csproj') -c Release -r win-x64 --self-contained true -t:Rebuild -p:PublishAot=true -p:Version=$Version -p:DebugType=None -p:DebugSymbols=false -o (Join-Path $stage 'Aetheris-win-x64/forge-host')
Normalize-PeTimestamps (Join-Path $stage 'Aetheris-win-x64/forge-host/Aetheris.Forge.Host.exe')
@@ -112,6 +129,40 @@ if (Test-Path -LiteralPath $endpoints) {
'"Last-Modified","Value":"[^"]+"', '"Last-Modified","Value":"Mon, 01 Jan 2024 00:00:00 GMT"')
[IO.File]::WriteAllText($endpoints, $canonicalEndpoints, [Text.UTF8Encoding]::new($false))
}
+
+$bundleRoot = Join-Path $stage 'Aetheris-win-x64'
+New-Item -ItemType Directory -Force -Path (Join-Path $bundleRoot 'docs'), (Join-Path $bundleRoot 'samples') | Out-Null
+Copy-Item -LiteralPath (Join-Path $repoRoot 'docs/public') -Destination (Join-Path $bundleRoot 'docs/public') -Recurse
+Copy-Item -LiteralPath (Join-Path $repoRoot 'docs/public/release-bundle.md') -Destination (Join-Path $bundleRoot 'README.md')
+Copy-Item -LiteralPath (Join-Path $repoRoot 'LICENSE') -Destination (Join-Path $bundleRoot 'LICENSE')
+Copy-Item -LiteralPath (Join-Path $repoRoot 'THIRD_PARTY_NOTICES.md') -Destination (Join-Path $bundleRoot 'THIRD_PARTY_NOTICES.md')
+Copy-Item -LiteralPath (Join-Path $repoRoot 'samples/forge-interop-x1') -Destination (Join-Path $bundleRoot 'samples/forge-interop-x1') -Recurse
+$publicExamples = @(
+ 'fixtures/FirmamentV2/Canonical/valid/a4-machined-mounting-block.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/boss-pocket-mounting-block.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/box-hole-pmi.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/box-holes-pmi-chamfer.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/profile-compose-l-bracket-counterbore-pmi.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/record-array-pattern-holes.firmament',
+ 'fixtures/FirmamentV2/Canonical/valid/table-template-concept-path-compose.firmament',
+ 'fixtures/FirmamentV2/FEA/inline-step-through-hole.firmament',
+ 'fixtures/FirmamentV2/InlineStep/testdata/canonical-through-hole.step',
+ 'fixtures/FirmamentV2/Materials/catalog-material-coupon.firmament',
+ 'fixtures/FirmamentV2/Primitive/valid/a3-pointed-cone-step-qualified.firmament',
+ 'fixtures/FirmamentV2/Primitive/valid/a3-sphere-step-qualified.firmament',
+ 'fixtures/FirmamentV2/Primitive/valid/a3-torus-step-qualified.firmament',
+ 'fixtures/FirmamentV2/PublicDogfood/ai-fea-a36-cantilever.firmament',
+ 'fixtures/FirmamentV2/PublicDogfood/ai-model.firmament',
+ 'fixtures/FirmamentV2/PublicDogfood/ai-sheet-metal.firmament',
+ 'fixtures/FirmamentV2/SheetMetal/m5-four-wall-tray-template.firmament',
+ 'fixtures/FirmamentV2/SheetMetal/preview3-l-bracket-hole.firmament'
+)
+foreach ($relativeExample in $publicExamples) {
+ $sourceExample = Join-Path $repoRoot $relativeExample
+ $destinationExample = Join-Path $bundleRoot $relativeExample
+ New-Item -ItemType Directory -Force -Path (Split-Path -Parent $destinationExample) | Out-Null
+ Copy-Item -LiteralPath $sourceExample -Destination $destinationExample
+}
# Build the framework-dependent tool payload explicitly. Reusing the preceding
# RID-specific publish output can package stale non-RID bytes with a new filename.
dotnet pack (Join-Path $repoRoot 'Aetheris.CLI/Aetheris.CLI.csproj') -c Release -t:Rebuild -p:Version=$Version -p:DebugType=None -p:DebugSymbols=false -o (Join-Path $output 'packages')
@@ -138,7 +189,7 @@ $sourceRoot = Join-Path $stage 'Aetheris-win-x64'
$archive = [System.IO.Compression.ZipFile]::Open($zip, [System.IO.Compression.ZipArchiveMode]::Create)
try {
Get-ChildItem -LiteralPath $sourceRoot -Recurse -File | Sort-Object FullName | ForEach-Object {
- $relative = [System.IO.Path]::GetRelativePath($sourceRoot, $_.FullName).Replace('\', '/')
+ $relative = (Get-ReleaseRelativePath $sourceRoot $_.FullName).Replace('\', '/')
$entry = $archive.CreateEntry("Aetheris-win-x64/$relative", [System.IO.Compression.CompressionLevel]::Optimal)
$entry.LastWriteTime = [DateTimeOffset]::new(1980, 1, 1, 0, 0, 0, [TimeSpan]::Zero)
$input = $_.OpenRead()
@@ -148,4 +199,4 @@ try {
}
finally { $archive.Dispose() }
$releaseFiles = @($zip, $extensionArtifact) + (Get-ChildItem -LiteralPath (Join-Path $output 'packages') -Filter '*.nupkg' -File | Select-Object -ExpandProperty FullName)
-$releaseFiles | Get-FileHash -Algorithm SHA256 | ForEach-Object { "{0} {1}" -f $_.Hash.ToLowerInvariant(), $_.Path.Substring($output.Length + 1) } | Set-Content (Join-Path $output 'SHA256SUMS.txt')
+$releaseFiles | ForEach-Object { Get-FileHash -LiteralPath $_ -Algorithm SHA256 } | ForEach-Object { "{0} {1}" -f $_.Hash.ToLowerInvariant(), $_.Path.Substring($output.Length + 1) } | Set-Content (Join-Path $output 'SHA256SUMS.txt')
diff --git a/tests/PublicPackageSmoke/Program.cs b/tests/PublicPackageSmoke/Program.cs
index ac26353d..2c2a03b7 100644
--- a/tests/PublicPackageSmoke/Program.cs
+++ b/tests/PublicPackageSmoke/Program.cs
@@ -1,5 +1,7 @@
using System.Reflection;
+using System.Text.Json;
using Aetheris.Forge.Host;
+using Aetheris.Kernel.Core.Step242;
using Aetheris.Kernel.StandardLibrary.Materials;
string[] packageAssemblies =
@@ -34,3 +36,36 @@ var host = new ForgeProtocolHost();
if (host.GetHostInfo().ProtocolVersion != ForgeHostProtocol.Version || host.ListTemplates().Templates.Count == 0)
throw new InvalidOperationException("Packaged Forge Host did not expose Protocol v1 templates.");
Console.WriteLine($"Forge Host Protocol v{ForgeHostProtocol.Version}: {host.ListTemplates().Templates.Count} templates.");
+
+var arguments = new Dictionary<string, JsonElement>(StringComparer.Ordinal)
+{
+ ["width"] = JsonSerializer.SerializeToElement("120 mm"),
+ ["height"] = JsonSerializer.SerializeToElement("40 mm"),
+ ["depth"] = JsonSerializer.SerializeToElement("80 mm"),
+ ["thickness"] = JsonSerializer.SerializeToElement("1.5 mm"),
+ ["lidLipHeight"] = JsonSerializer.SerializeToElement("8 mm"),
+ ["insideRadius"] = JsonSerializer.SerializeToElement("2 mm"),
+ ["kFactor"] = JsonSerializer.SerializeToElement(0.42),
+ ["reliefPolicy"] = JsonSerializer.SerializeToElement("Rectangular")
+};
+var forgeOutput = Path.Combine(Path.GetTempPath(), "aetheris-public-package-forge-" + Guid.NewGuid().ToString("N"));
+try
+{
+ var invocation = host.InvokeTemplate(
+ "Standard.SheetMetal.ElectronicsEnclosure",
+ new ForgeTemplateInvocationRequest(ForgeHostProtocol.Version, arguments, [ForgeArtifactKind.StepAp242]),
+ forgeOutput);
+ if (!invocation.Success)
+ throw new InvalidOperationException(string.Join("; ", invocation.Diagnostics.Select(item => item.Code + ": " + item.Message)));
+ var step = Path.Combine(forgeOutput, AssertSingle(invocation.Artifacts).Path);
+ if (!File.Exists(step) || !Step242Importer.ImportBody(File.ReadAllText(step)).IsSuccess)
+ throw new InvalidOperationException("Direct packaged Forge invocation did not produce reimportable STEP AP242.");
+ Console.WriteLine("Direct packaged Forge API invocation produced reimportable STEP AP242.");
+}
+finally
+{
+ if (Directory.Exists(forgeOutput)) Directory.Delete(forgeOutput, recursive: true);
+}
+
+static ForgeArtifact AssertSingle(IReadOnlyList<ForgeArtifact> artifacts) =>
+ artifacts.Count == 1 ? artifacts[0] : throw new InvalidOperationException($"Expected one Forge artifact, found {artifacts.Count}.");
diff --git a/tests/PublicPackageSmoke/PublicPackageSmoke.csproj b/tests/PublicPackageSmoke/PublicPackageSmoke.csproj
index d4c698e7..c87a01ba 100644
--- a/tests/PublicPackageSmoke/PublicPackageSmoke.csproj
+++ b/tests/PublicPackageSmoke/PublicPackageSmoke.csproj
@@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="Aetheris.Kernel.Core" Version="2.0.0-preview.3" />
<PackageReference Include="Aetheris.Kernel.Firmament" Version="2.0.0-preview.3" />
+ <PackageReference Include="Aetheris.Kernel.StandardLibrary" Version="2.0.0-preview.3" />
<PackageReference Include="Aetheris.Forge.Host" Version="2.0.0-preview.3" />
<PackageReference Include="Aetheris.Forge.KernelSDK" Version="2.0.0-preview.3" />
</ItemGroup>