Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Admit disjoint fillet and hole compositions

Yuechen Li9cf7b4af714d
diff --git a/Aetheris.CLI.Tests/FirmamentFrontendX0CliTests.cs b/Aetheris.CLI.Tests/FirmamentFrontendX0CliTests.cs
index 41df238c..b00be0da 100644
--- a/Aetheris.CLI.Tests/FirmamentFrontendX0CliTests.cs
+++ b/Aetheris.CLI.Tests/FirmamentFrontendX0CliTests.cs
@@ -12,7 +12,7 @@ public sealed class FirmamentFrontendX0CliTests
[InlineData("unknown-compose-statement")]
[InlineData("unknown-boundary-field")]
[InlineData("unsupported-xz-layout")]
- [InlineData("combined-fillet-hole")]
+ [InlineData("combined-fillet-hole-intersection")]
[InlineData("unresolved-semantic-source")]
[InlineData("edgefinish-generic-variant")]
public void ValidateAndBuild_RejectSameSource_WithStructuredDiagnostics(string fixture)
@@ -46,6 +46,26 @@ public sealed class FirmamentFrontendX0CliTests
Assert.Contains("ParsedNotBuilt", stdout.ToString(), StringComparison.Ordinal);
}
+ [Fact]
+ public void DisjointFilletAndHole_ValidateAndBuildBothAdmitTheOriginalSource()
+ {
+ var path = Fixture("combined-fillet-hole");
+ var directory = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory,
+ "../../../../artifacts/local/fillet-hole-cli-tests", Guid.NewGuid().ToString("N")));
+ Directory.CreateDirectory(directory);
+ var output = Path.Combine(directory, "combined.step");
+ var validation = new StringWriter();
+ var build = new StringWriter();
+ Assert.Equal(0, CliRunner.Run(["validate", path, "--json"], validation, new StringWriter()));
+ Assert.Equal(0, CliRunner.Run(["build", path, "--output", output, "--json"], build, new StringWriter()));
+ using var v = JsonDocument.Parse(validation.ToString());
+ using var b = JsonDocument.Parse(build.ToString());
+ Assert.Equal("valid", v.RootElement.GetProperty("firmamentV2Validation").GetProperty("status").GetString());
+ Assert.Equal("Built", v.RootElement.GetProperty("firmamentV2Validation").GetProperty("validationLevel").GetString());
+ Assert.True(b.RootElement.GetProperty("success").GetBoolean());
+ Assert.True(File.Exists(output));
+ }
+
[Fact]
public void TextBuildSummary_IdentifiesDocumentOwner()
{
diff --git a/Aetheris.Kernel.Core.Tests/Brep/Features/TopBoundaryFilletThroughHoleTests.cs b/Aetheris.Kernel.Core.Tests/Brep/Features/TopBoundaryFilletThroughHoleTests.cs
new file mode 100644
index 00000000..931b9aac
--- /dev/null
+++ b/Aetheris.Kernel.Core.Tests/Brep/Features/TopBoundaryFilletThroughHoleTests.cs
@@ -0,0 +1,96 @@
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Brep.Features;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Math;
+using Aetheris.Kernel.Core.Step242;
+
+namespace Aetheris.Kernel.Core.Tests.Brep.Features;
+
+public sealed class TopBoundaryFilletThroughHoleTests
+{
+ [Theory]
+ [InlineData(60d, 40d, 10d, 1d)]
+ [InlineData(18d, 30d, 7d, 2d)]
+ public void FilletBand_HasExactCylinderIntersectionsAndTangentSupportContacts(double w, double d, double h, double r)
+ {
+ var result = CombinedTopBoundaryEdgeFinishThroughHoleBuilder.Build(Plan(w, d, h, r));
+ Assert.True(result.IsSuccess, string.Join("; ", result.Diagnostics.Select(x => x.Message)));
+ Check(result.Value, 10, 4);
+ var body = result.Value;
+ var cylinders = body.Geometry.Surfaces.Select(x => x.Value).Where(s => s.Kind == SurfaceGeometryKind.Cylinder).Select(s => s.Cylinder!.Value).ToArray();
+ foreach (var binding in body.Bindings.EdgeBindings)
+ {
+ var curve = body.Geometry.GetCurve(binding.CurveGeometryId);
+ if (curve.Kind != CurveGeometryKind.Ellipse3) continue;
+ var ellipse = curve.Ellipse3!.Value;
+ var edge = body.Topology.GetEdge(binding.EdgeId);
+ Assert.True(body.TryGetVertexPoint(edge.StartVertexId, out var start));
+ Assert.True(body.TryGetVertexPoint(edge.EndVertexId, out var end));
+ Assert.InRange((ellipse.Evaluate(0) - start).Length, 0, 1e-9);
+ Assert.InRange((ellipse.Evaluate(System.Math.PI / 2) - end).Length, 0, 1e-9);
+ foreach (var t in new[] { 0d, .2, .7, System.Math.PI / 2 })
+ {
+ var p = ellipse.Evaluate(t);
+ Assert.Equal(2, cylinders.Count(c => System.Math.Abs(Radial(p - c.Origin, c.Axis.ToVector()).Length - r) < 1e-9));
+ }
+ }
+ // Each cylinder is tangent to its vertical support at the shoulder and
+ // to +Z at the top. The junction between cylinders is a sharp ellipse.
+ foreach (var c in cylinders)
+ {
+ Assert.Equal(h - r, c.Origin.Z, 9);
+ Assert.InRange(System.Math.Abs(c.XAxis.Z), 0, 1e-9);
+ Assert.InRange(System.Math.Abs(c.Axis.Z), 0, 1e-9);
+ }
+ var step = Step242Exporter.ExportBody(body, new Step242ExportOptions { BrepExportPreflightMode = BrepExportPreflightMode.Enforce });
+ Assert.True(step.IsSuccess, string.Join("; ", step.Diagnostics.Select(x => x.Message)));
+ var imported = Step242Importer.ImportBody(step.Value!);
+ Assert.True(imported.IsSuccess);
+ Check(imported.Value, 10, 4);
+ }
+
+ [Fact]
+ public void AnalyticVolume_AgreesWithIndependentSectionIntegrationAndHoleRemoval()
+ {
+ var plan = Plan(60, 40, 10, 2) with { Holes = [new("shaft", -10, 0, 2), new("counterbore", 10, 0, 2, 4, 3)] };
+ const int n = 100_000;
+ var dz = plan.FinishSize / n;
+ var volume = plan.Width * plan.Depth * (plan.ZMax - plan.FinishSize);
+ for (var i = 0; i <= n; i++)
+ {
+ var t = i * dz;
+ var inset = plan.FinishSize - System.Math.Sqrt(System.Math.Max(0, plan.FinishSize * plan.FinishSize - t * t));
+ volume += (plan.Width - 2 * inset) * (plan.Depth - 2 * inset) * dz * (i is 0 or n ? .5 : 1);
+ }
+ volume -= System.Math.PI * (4 * 10 + 4 * 10 + 12 * 3);
+ Assert.InRange(System.Math.Abs(plan.AnalyticVolume - volume), 0, 1e-4);
+ var body = CombinedTopBoundaryEdgeFinishThroughHoleBuilder.Build(plan);
+ Assert.True(body.IsSuccess);
+ Check(body.Value, 14, 7);
+ }
+
+ [Theory]
+ [InlineData(0d, 0d, 0d)]
+ [InlineData(0d, 0d, 10d)]
+ [InlineData(0d, 0d, double.NaN)]
+ [InlineData(25d, 0d, 2d)] // tangent to the inset top face
+ [InlineData(26d, 0d, 2d)] // crosses the fillet band
+ public void InvalidOrInteractingIntent_CannotProduceABody(double x, double y, double radius)
+ {
+ var plan = Plan(60, 40, 10, radius) with { Holes = [new("bore", x, y, 3)] };
+ Assert.False(CombinedTopBoundaryEdgeFinishThroughHoleBuilder.Build(plan).IsSuccess);
+ }
+
+ private static void Check(BrepBody body, int faces, int cylinders)
+ {
+ Assert.Equal(faces, body.Topology.Faces.Count());
+ Assert.Equal(cylinders, body.Geometry.Surfaces.Count(x => x.Value.Kind == SurfaceGeometryKind.Cylinder));
+ Assert.Equal(4, body.Geometry.Curves.Count(x => x.Value.Kind == CurveGeometryKind.Ellipse3));
+ var preflight = BrepExportPreflight.Validate(body);
+ Assert.True(preflight.IsValid, string.Join("; ", preflight.Diagnostics.Select(x => x.Message)));
+ }
+
+ private static Vector3D Radial(Vector3D delta, Vector3D axis) => delta - axis * delta.Dot(axis);
+ private static CombinedTopBoundaryEdgeFinishThroughHolePlan Plan(double w, double d, double h, double r) =>
+ new("finish-plan", "host-plan", ["EdgeFinish"], w, d, 0, h, r, [], TopBoundaryEdgeFinishKind.Fillet);
+}
diff --git a/Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryChamferThroughHoleBuilder.cs b/Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryEdgeFinishThroughHoleBuilder.cs
similarity index 72%
rename from Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryChamferThroughHoleBuilder.cs
rename to Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryEdgeFinishThroughHoleBuilder.cs
index 409669a8..4ae9010f 100644
--- a/Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryChamferThroughHoleBuilder.cs
+++ b/Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryEdgeFinishThroughHoleBuilder.cs
@@ -9,11 +9,11 @@ namespace Aetheris.Kernel.Core.Brep.Features;
/// <summary>
/// Bounded materializer for the composition of the existing rectangular top-boundary
-/// chamfer family and disjoint, world-Z through-hole cylinders. It is deliberately
+/// chamfer or constant-radius fillet family and disjoint, world-Z through-hole cylinders. It is deliberately
/// a final-plan consumer: callers must have already admitted the host, hole, and
/// semantic finish selections. It performs no topology search or feature recovery.
/// </summary>
-public sealed record CombinedTopBoundaryChamferThroughHole(
+public sealed record CombinedTopBoundaryEdgeFinishThroughHole(
string FeatureId,
double CenterX,
double CenterY,
@@ -25,7 +25,9 @@ public sealed record CombinedTopBoundaryChamferThroughHole(
public double EntryRadius => CounterboreRadius ?? Radius;
}
-public sealed record CombinedTopBoundaryChamferThroughHolePlan(
+public enum TopBoundaryEdgeFinishKind { Chamfer, Fillet }
+
+public sealed record CombinedTopBoundaryEdgeFinishThroughHolePlan(
string PlanId,
string? ParentHostPlanId,
IReadOnlyList<string> AppliedFeatureIds,
@@ -33,32 +35,43 @@ public sealed record CombinedTopBoundaryChamferThroughHolePlan(
double Depth,
double ZMin,
double ZMax,
- double ChamferDistance,
- IReadOnlyList<CombinedTopBoundaryChamferThroughHole> Holes)
+ double FinishSize,
+ IReadOnlyList<CombinedTopBoundaryEdgeFinishThroughHole> Holes,
+ TopBoundaryEdgeFinishKind FinishKind = TopBoundaryEdgeFinishKind.Chamfer)
{
public double AnalyticVolume
{
get
{
var height = ZMax - ZMin;
- var lowerHeight = height - ChamferDistance;
+ var lowerHeight = height - FinishSize;
var bottomArea = Width * Depth;
- var topArea = (Width - (2d * ChamferDistance)) * (Depth - (2d * ChamferDistance));
- var chamferedHost = (bottomArea * lowerHeight) + (ChamferDistance / 3d * (bottomArea + topArea + System.Math.Sqrt(bottomArea * topArea)));
+ var topArea = (Width - (2d * FinishSize)) * (Depth - (2d * FinishSize));
+ var finishedHost = (bottomArea * lowerHeight) + (FinishSize / 3d * (bottomArea + topArea + System.Math.Sqrt(bottomArea * topArea)));
+ if (FinishKind == TopBoundaryEdgeFinishKind.Fillet)
+ {
+ // Integrate the retained rectangle (W-2s)(D-2s), where
+ // s(z)=r-sqrt(r*r-z*z) over the top r of the stock.
+ // The four equal-radius cylinder junctions use exact ellipse seams.
+ var r = FinishSize;
+ var section = r * r * (1d - System.Math.PI / 4d);
+ var overlap = r * r * r * (5d / 3d - System.Math.PI / 2d);
+ finishedHost = bottomArea * height - 2d * (Width + Depth) * section + 4d * overlap;
+ }
var removed = Holes.Sum(h => System.Math.PI * h.Radius * h.Radius * height
+ (h.CounterboreRadius is { } reliefRadius && h.CounterboreDepth is { } reliefDepth
? System.Math.PI * (reliefRadius * reliefRadius - h.Radius * h.Radius) * reliefDepth
: 0d));
- return chamferedHost - removed;
+ return finishedHost - removed;
}
}
}
-public static class CombinedTopBoundaryChamferThroughHoleBuilder
+public static class CombinedTopBoundaryEdgeFinishThroughHoleBuilder
{
private const double Tol = 1e-9;
- public static KernelResult<BrepBody> Build(CombinedTopBoundaryChamferThroughHolePlan plan)
+ public static KernelResult<BrepBody> Build(CombinedTopBoundaryEdgeFinishThroughHolePlan plan)
{
ArgumentNullException.ThrowIfNull(plan);
var validation = Validate(plan);
@@ -68,13 +81,13 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
}
var z0 = plan.ZMin;
- var z1 = plan.ZMax - plan.ChamferDistance;
+ var z1 = plan.ZMax - plan.FinishSize;
var z2 = plan.ZMax;
var x0 = -plan.Width / 2d;
var x1 = plan.Width / 2d;
var y0 = -plan.Depth / 2d;
var y1 = plan.Depth / 2d;
- var d = plan.ChamferDistance;
+ var d = plan.FinishSize;
var bottom = new[] { new Point3D(x0, y0, z0), new Point3D(x1, y0, z0), new Point3D(x1, y1, z0), new Point3D(x0, y1, z0) };
var shoulder = new[] { new Point3D(x0, y0, z1), new Point3D(x1, y0, z1), new Point3D(x1, y1, z1), new Point3D(x0, y1, z1) };
var top = new[] { new Point3D(x0 + d, y0 + d, z2), new Point3D(x1 - d, y0 + d, z2), new Point3D(x1 - d, y1 - d, z2), new Point3D(x0 + d, y1 - d, z2) };
@@ -82,7 +95,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
}
private static KernelResult<BrepBody> BuildWithHoleTopology(
- CombinedTopBoundaryChamferThroughHolePlan plan,
+ CombinedTopBoundaryEdgeFinishThroughHolePlan plan,
Point3D[] bottom,
Point3D[] shoulder,
Point3D[] top)
@@ -93,7 +106,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
var shoulderEdges = Ring(b, vertices, 4);
var topEdges = Ring(b, vertices, 8);
var lowerEdges = Enumerable.Range(0, 4).Select(i => b.AddEdge(vertices[i], vertices[4 + i])).ToArray();
- var chamferEdges = Enumerable.Range(0, 4).Select(i => b.AddEdge(vertices[4 + i], vertices[8 + i])).ToArray();
+ var finishEdges = Enumerable.Range(0, 4).Select(i => b.AddEdge(vertices[4 + i], vertices[8 + i])).ToArray();
var holes = plan.Holes.Select(h =>
{
// The periodic circle and its longitudinal seam share endpoint identities.
@@ -120,12 +133,12 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
var bottomFace = b.AddFace(bottomLoops);
var topFace = b.AddFace(topLoops);
var lowerFaces = new FaceId[4];
- var chamferFaces = new FaceId[4];
+ var finishFaces = new FaceId[4];
for (var i = 0; i < 4; i++)
{
var next = (i + 1) % 4;
lowerFaces[i] = b.AddFace([AddLoop(b, [Forward(bottomEdges[i]), Forward(lowerEdges[next]), Reversed(shoulderEdges[i]), Reversed(lowerEdges[i])])]);
- chamferFaces[i] = b.AddFace([AddLoop(b, [Forward(shoulderEdges[i]), Forward(chamferEdges[next]), Reversed(topEdges[i]), Reversed(chamferEdges[i])])]);
+ finishFaces[i] = b.AddFace([AddLoop(b, [Forward(shoulderEdges[i]), Forward(finishEdges[next]), Reversed(topEdges[i]), Reversed(finishEdges[i])])]);
}
var holeFaces = new List<(HoleTopology Hole, FaceId Face, double Radius, double ZMin, double ZMax)>();
var shoulderFaces = new List<(HoleTopology Hole, FaceId Face)>();
@@ -145,7 +158,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
shoulderFaces.Add((hole,shoulderFace));
holeFaces.Add((hole,shaftFace,hole.Hole.Radius,plan.ZMin,shoulderZ));
}
- var shell = b.AddShell([bottomFace, topFace, .. lowerFaces, .. chamferFaces, .. holeFaces.Select(x=>x.Face), .. shoulderFaces.Select(x=>x.Face)]);
+ var shell = b.AddShell([bottomFace, topFace, .. lowerFaces, .. finishFaces, .. holeFaces.Select(x=>x.Face), .. shoulderFaces.Select(x=>x.Face)]);
b.AddBody([shell]);
var geometry = new BrepGeometryStore();
@@ -153,14 +166,30 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
var points = bottom.Concat(shoulder).Concat(top).ToArray();
var vertexPoints = vertices.Select((id, index) => new KeyValuePair<VertexId, Point3D>(id, points[index])).ToDictionary(x => x.Key, x => x.Value);
var edgeCurve = 1;
- foreach (var edge in bottomEdges.Concat(shoulderEdges).Concat(topEdges).Concat(lowerEdges).Concat(chamferEdges))
+ foreach (var edge in bottomEdges.Concat(shoulderEdges).Concat(topEdges).Concat(lowerEdges).Concat(finishEdges))
{
- var start = vertexPoints[edge == default ? vertices[0] : b.Model.Edges.Single(e => e.Id == edge).StartVertexId];
+ var start = vertexPoints[b.Model.Edges.Single(e => e.Id == edge).StartVertexId];
var end = vertexPoints[b.Model.Edges.Single(e => e.Id == edge).EndVertexId];
var vector = end - start;
var id = new CurveGeometryId(edgeCurve++);
- geometry.AddCurve(id, CurveGeometry.FromLine(new Line3Curve(start, Direction3D.Create(vector))));
- bindings.AddEdgeBinding(new EdgeGeometryBinding(edge, id, new ParameterInterval(0d, vector.Length)));
+ var corner = Array.IndexOf(finishEdges, edge);
+ if (plan.FinishKind == TopBoundaryEdgeFinishKind.Fillet && corner >= 0)
+ {
+ var r = plan.FinishSize;
+ var sx = System.Math.Sign(shoulder[corner].X);
+ var sy = System.Math.Sign(shoulder[corner].Y);
+ var center = new Point3D(top[corner].X, top[corner].Y, shoulder[corner].Z);
+ var diagonal = Direction3D.Create(new Vector3D(sx, sy, 0));
+ // normal x diagonal = +Z, so [0,pi/2] runs shoulder -> top.
+ var normal = Direction3D.Create(new Vector3D(sy, -sx, 0));
+ geometry.AddCurve(id, CurveGeometry.FromEllipse(new Ellipse3Curve(center, normal, r * System.Math.Sqrt(2d), r, diagonal)));
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(edge, id, new ParameterInterval(0d, System.Math.PI / 2d)));
+ }
+ else
+ {
+ geometry.AddCurve(id, CurveGeometry.FromLine(new Line3Curve(start, Direction3D.Create(vector))));
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(edge, id, new ParameterInterval(0d, vector.Length)));
+ }
}
var zAxis = Direction3D.Create(new Vector3D(0d, 0d, 1d));
@@ -172,7 +201,17 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
{
var next = (i + 1) % 4;
BindPlane(lowerFaces[i], bottom[i], bottom[next] - bottom[i], shoulder[i] - bottom[i]);
- BindPlane(chamferFaces[i], shoulder[i], shoulder[next] - shoulder[i], top[i] - shoulder[i]);
+ if (plan.FinishKind == TopBoundaryEdgeFinishKind.Chamfer)
+ BindPlane(finishFaces[i], shoulder[i], shoulder[next] - shoulder[i], top[i] - shoulder[i]);
+ else
+ {
+ var tangent = Direction3D.Create(shoulder[next] - shoulder[i]);
+ var outward = Direction3D.Create(tangent.ToVector().Cross(new Vector3D(0, 0, 1)));
+ var center = new Point3D(top[i].X, top[i].Y, shoulder[i].Z);
+ var id = new SurfaceGeometryId(surface++);
+ geometry.AddSurface(id, SurfaceGeometry.FromCylinder(new CylinderSurface(center, tangent, plan.FinishSize, outward)));
+ bindings.AddFaceBinding(new FaceGeometryBinding(finishFaces[i], id));
+ }
}
foreach (var hole in holes)
{
@@ -185,7 +224,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
geometry.AddCurve(seamCurve, CurveGeometry.FromLine(new Line3Curve(new Point3D(hole.Hole.CenterX + hole.Hole.EntryRadius, hole.Hole.CenterY, upperZMin), zAxis)));
bindings.AddEdgeBinding(new EdgeGeometryBinding(hole.TopCircle, topCurve, new ParameterInterval(0d, 2d * System.Math.PI)));
bindings.AddEdgeBinding(new EdgeGeometryBinding(hole.BottomCircle, bottomCurve, new ParameterInterval(0d, 2d * System.Math.PI)));
- bindings.AddEdgeBinding(new EdgeGeometryBinding(hole.UpperSeam, seamCurve, new ParameterInterval(0d, plan.ZMax - upperZMin)));
+ bindings.AddEdgeBinding(new EdgeGeometryBinding(hole.UpperSeam, seamCurve, new ParameterInterval(0d, plan.ZMax - upperZMin), OrientedEdgeSense: false));
vertexPoints[hole.SeamTopVertex] = new Point3D(hole.Hole.CenterX + hole.Hole.EntryRadius, hole.Hole.CenterY, plan.ZMax);
vertexPoints[hole.SeamBottomVertex] = new Point3D(hole.Hole.CenterX + hole.Hole.Radius, hole.Hole.CenterY, plan.ZMin);
if (hole.Hole.IsCounterbore)
@@ -197,7 +236,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
geometry.AddCurve(lowerSeamCurve,CurveGeometry.FromLine(new Line3Curve(new(hole.Hole.CenterX+hole.Hole.Radius,hole.Hole.CenterY,plan.ZMin),zAxis)));
bindings.AddEdgeBinding(new(hole.ShoulderOuterCircle!.Value,outerCurve,new(0,2d*System.Math.PI)));
bindings.AddEdgeBinding(new(hole.ShoulderInnerCircle!.Value,innerCurve,new(0,2d*System.Math.PI)));
- bindings.AddEdgeBinding(new(hole.LowerSeam!.Value,lowerSeamCurve,new(0,shoulderZ-plan.ZMin)));
+ bindings.AddEdgeBinding(new(hole.LowerSeam!.Value,lowerSeamCurve,new(0,shoulderZ-plan.ZMin), OrientedEdgeSense: false));
vertexPoints[hole.ShoulderOuterVertex!.Value]=new(hole.Hole.CenterX+hole.Hole.CounterboreRadius.Value,hole.Hole.CenterY,shoulderZ);
vertexPoints[hole.ShoulderInnerVertex!.Value]=new(hole.Hole.CenterX+hole.Hole.Radius,hole.Hole.CenterY,shoulderZ);
}
@@ -222,20 +261,23 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
}
}
- private static KernelResult<bool> Validate(CombinedTopBoundaryChamferThroughHolePlan plan)
+ private static KernelResult<bool> Validate(CombinedTopBoundaryEdgeFinishThroughHolePlan plan)
{
- if (!double.IsFinite(plan.Width) || !double.IsFinite(plan.Depth) || !double.IsFinite(plan.ZMin) || !double.IsFinite(plan.ZMax) || !double.IsFinite(plan.ChamferDistance)
- || plan.Width <= Tol || plan.Depth <= Tol || plan.ZMax - plan.ZMin <= Tol || plan.ChamferDistance <= Tol
- || 2d * plan.ChamferDistance >= plan.Width - Tol || 2d * plan.ChamferDistance >= plan.Depth - Tol || plan.ChamferDistance >= plan.ZMax - plan.ZMin - Tol)
- return Failure("CombinedFeaturePlanChainInvalid: bounded top-boundary chamfer dimensions are invalid.");
+ if (!Enum.IsDefined(plan.FinishKind)) return Failure("CombinedFeaturePlanChainInvalid: unknown top-boundary finish kind.");
+ if (!double.IsFinite(plan.Width) || !double.IsFinite(plan.Depth) || !double.IsFinite(plan.ZMin) || !double.IsFinite(plan.ZMax) || !double.IsFinite(plan.FinishSize)
+ || plan.Width <= Tol || plan.Depth <= Tol || plan.ZMax - plan.ZMin <= Tol || plan.FinishSize <= Tol
+ || 2d * plan.FinishSize >= plan.Width - Tol || 2d * plan.FinishSize >= plan.Depth - Tol || plan.FinishSize >= plan.ZMax - plan.ZMin - Tol)
+ return Failure("CombinedFeaturePlanChainInvalid: bounded top-boundary finish size must be positive, smaller than the stock height and smaller than half its width and depth.");
foreach (var hole in plan.Holes)
{
+ if ((hole.CounterboreRadius is null) != (hole.CounterboreDepth is null))
+ return Failure($"CombinedFeaturePlanChainInvalid: counterbore '{hole.FeatureId}' requires both radius and depth.");
if (!double.IsFinite(hole.CenterX) || !double.IsFinite(hole.CenterY) || !double.IsFinite(hole.Radius) || hole.Radius <= Tol)
return Failure($"CombinedFeaturePlanChainInvalid: hole '{hole.FeatureId}' has invalid cylinder data.");
- if (hole.IsCounterbore && (hole.CounterboreRadius <= hole.Radius + Tol || hole.CounterboreDepth <= Tol || hole.CounterboreDepth >= plan.ZMax-plan.ZMin-Tol))
+ if (hole.IsCounterbore && (hole.CounterboreRadius is not { } cr || !double.IsFinite(cr) || hole.CounterboreDepth is not { } cd || !double.IsFinite(cd) || cr <= hole.Radius + Tol || cd <= Tol || hole.CounterboreDepth >= plan.ZMax-plan.ZMin-Tol))
return Failure($"CombinedFeaturePlanChainInvalid: counterbore '{hole.FeatureId}' has invalid relief dimensions.");
- if (System.Math.Abs(hole.CenterX) + hole.EntryRadius >= plan.Width / 2d - plan.ChamferDistance - Tol || System.Math.Abs(hole.CenterY) + hole.EntryRadius >= plan.Depth / 2d - plan.ChamferDistance - Tol)
- return Failure($"CombinedFeatureInteractionUnsupported: hole '{hole.FeatureId}' intersects or splits the selected outer top-boundary chamfer chain.");
+ if (System.Math.Abs(hole.CenterX) + hole.EntryRadius >= plan.Width / 2d - plan.FinishSize - Tol || System.Math.Abs(hole.CenterY) + hole.EntryRadius >= plan.Depth / 2d - plan.FinishSize - Tol)
+ return Failure($"CombinedFeatureInteractionUnsupported: hole '{hole.FeatureId}' intersects or splits the selected outer top-boundary finish band; move the hole inward or reduce its entry radius or the finish size.");
}
for (var i = 0; i < plan.Holes.Count; i++)
for (var j = i + 1; j < plan.Holes.Count; j++)
@@ -246,7 +288,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
}
return KernelResult<bool>.Success(true);
- static KernelResult<bool> Failure(string message) => KernelResult<bool>.Failure([new Aetheris.Kernel.Core.Diagnostics.KernelDiagnostic(Aetheris.Kernel.Core.Diagnostics.KernelDiagnosticCode.ValidationFailed, Aetheris.Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error, message, "CombinedTopBoundaryChamferThroughHole")]);
+ static KernelResult<bool> Failure(string message) => KernelResult<bool>.Failure([new Aetheris.Kernel.Core.Diagnostics.KernelDiagnostic(Aetheris.Kernel.Core.Diagnostics.KernelDiagnosticCode.ValidationFailed, Aetheris.Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error, message, "CombinedTopBoundaryEdgeFinishThroughHole")]);
}
private static EdgeId[] Ring(TopologyBuilder builder, VertexId[] vertices, int offset) => Enumerable.Range(0, 4).Select(i => builder.AddEdge(vertices[offset + i], vertices[offset + ((i + 1) % 4)])).ToArray();
@@ -260,7 +302,7 @@ public static class CombinedTopBoundaryChamferThroughHoleBuilder
private static Use Forward(EdgeId edge) => new(edge, false);
private static Use Reversed(EdgeId edge) => new(edge, true);
private readonly record struct Use(EdgeId Edge, bool Reversed);
- private sealed record HoleTopology(CombinedTopBoundaryChamferThroughHole Hole, VertexId SeamTopVertex, VertexId SeamBottomVertex,
+ private sealed record HoleTopology(CombinedTopBoundaryEdgeFinishThroughHole Hole, VertexId SeamTopVertex, VertexId SeamBottomVertex,
VertexId? ShoulderOuterVertex,VertexId? ShoulderInnerVertex,EdgeId TopCircle,EdgeId BottomCircle,
EdgeId? ShoulderOuterCircle,EdgeId? ShoulderInnerCircle,EdgeId UpperSeam,EdgeId? LowerSeam);
}
diff --git a/Aetheris.Kernel.Core/Diagnostics/KernelDiagnostic.cs b/Aetheris.Kernel.Core/Diagnostics/KernelDiagnostic.cs
index 55cb0cb1..3e23feb7 100644
--- a/Aetheris.Kernel.Core/Diagnostics/KernelDiagnostic.cs
+++ b/Aetheris.Kernel.Core/Diagnostics/KernelDiagnostic.cs
@@ -4,4 +4,11 @@ public sealed record KernelDiagnostic(
KernelDiagnosticCode Code,
KernelDiagnosticSeverity Severity,
string Message,
- string? Source = null);
+ string? Source = null)
+{
+ /// <summary>Offsets in the producing stage's source. Presentation must map
+ /// expanded source to the authored document before displaying a location.</summary>
+ public KernelDiagnosticSourceSpan? SourceSpan { get; init; }
+}
+
+public sealed record KernelDiagnosticSourceSpan(int Start, int Length);
diff --git a/Aetheris.Kernel.Firmament.Tests/CombinedFilletHoleTests.cs b/Aetheris.Kernel.Firmament.Tests/CombinedFilletHoleTests.cs
new file mode 100644
index 00000000..35a4e0c4
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/CombinedFilletHoleTests.cs
@@ -0,0 +1,136 @@
+using Aetheris.Kernel.Core.Brep;
+using Aetheris.Kernel.Core.Brep.Verification;
+using Aetheris.Kernel.Core.Geometry;
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.FirmamentV2;
+using Aetheris.Kernel.Firmament.Materializer;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class CombinedFilletHoleTests
+{
+ [Theory]
+ [InlineData("Regression/FrontendX4/cases/d05-fillet-with-hole.firmament", 11, 5, 4d, 0d)]
+ [InlineData("Regression/Fillet/top-boundary-with-counterbore.firmament", 14, 7, 3d, 2d)]
+ public void AuthoredFilletAndHoles_AdmitTogetherAndSurviveStep(string file, int faces, int cylinders, double shaftA, double shaftB)
+ {
+ var source = Source(file);
+ var result = AdmitAndBuild(source, true);
+ var combined = Assert.IsType<FirmamentCombinedFeaturePlanReport>(result.Combined);
+ Assert.Equal("Disjoint", combined.Interaction);
+ Assert.Equal(4, combined.EdgeFinishDescendantCount);
+ Assert.Equal(FirmamentV2Parser.Parse(source).Document!.ModelName, result.ExportedFeatureId);
+ var correspondence = Assert.IsType<SemanticTopologyCorrespondence>(result.RuntimeCorrespondence);
+ var body = Assert.IsType<BrepBody>(result.RuntimeBody);
+ foreach (var replacement in correspondence.Descendants.Where(d => d.Role == SemanticTopologyRole.EdgeFinishReplacementFace))
+ {
+ var binding = body.Bindings.FaceBindings.Single(b => b.FaceId == replacement.Face);
+ Assert.Equal(SurfaceGeometryKind.Cylinder, body.Geometry.GetSurface(binding.SurfaceGeometryId).Kind);
+ }
+ var walls = correspondence.Descendants.Where(d => d.Role == SemanticTopologyRole.HoleWallFace).ToArray();
+ var shaftRadii = new List<double>();
+ foreach (var wall in walls)
+ {
+ var binding = body.Bindings.FaceBindings.Single(b => b.FaceId == wall.Face);
+ var radius = body.Geometry.GetSurface(binding.SurfaceGeometryId).Cylinder!.Value.Radius;
+ if (wall.StableId.Contains("counterbore-wall")) Assert.Equal(4d, radius, 9);
+ else shaftRadii.Add(radius);
+ }
+ Assert.Equal((shaftB > 0 ? new[] { shaftA, shaftB } : new[] { shaftA }).Order(), shaftRadii.Order());
+ var expectedHost = 24000 - 200 * (1 - Math.PI / 4) + 4 * (5d / 3 - Math.PI / 2);
+ var expectedRemoved = Math.PI * (shaftA * shaftA + shaftB * shaftB) * 10;
+ if (shaftB > 0) expectedRemoved += Math.PI * (16 - shaftB * shaftB) * 3;
+ Assert.Equal(expectedHost - expectedRemoved, combined.FinalAnalyticVolume, 8);
+ var imported = Step242Importer.ImportBody(result.StepText);
+ Assert.True(imported.IsSuccess, string.Join("; ", imported.Diagnostics.Select(d => d.Message)));
+ Assert.Equal(faces, imported.Value.Topology.Faces.Count());
+ Assert.Equal(cylinders, imported.Value.Geometry.Surfaces.Count(s => s.Value.Kind == SurfaceGeometryKind.Cylinder));
+ Assert.Equal(4, imported.Value.Geometry.Curves.Count(c => c.Value.Kind == CurveGeometryKind.Ellipse3));
+ Assert.True(BrepMassProperties.Evaluate(imported.Value).IsEnclosed);
+ Assert.True(BrepExportPreflight.Validate(imported.Value).IsValid);
+ var repeated = FirmamentBuildAndExport.CompileSource(source);
+ Assert.Equal(result.StepText, repeated.Value.StepText);
+ }
+
+ [Theory]
+ [InlineData("Center: Point2(0mm, 0mm)", "Center: Point2(24mm, 0mm)", "Radius: 1mm", "Radius: 1mm", true)]
+ [InlineData("Center: Point2(0mm, 0mm)", "Center: Point2(24mm, 0mm)", "Radius: 1mm", "Radius: 2mm", false)]
+ [InlineData("Center: Point2(0mm, 0mm)", "Center: Point2(25mm, 0mm)", "Radius: 1mm", "Radius: 2mm", false)]
+ [InlineData("Center: Point2(0mm, 0mm)", "Center: Point2(0mm, 0mm)", "Radius: 1mm", "Radius: 10mm", false)]
+ public void InteractionAndRadiusBoundaries_AgreeBetweenValidateAndBuild(string oldCenter, string center, string oldRadius, string radius, bool accepted)
+ {
+ var source = Source("Regression/FrontendX4/cases/d05-fillet-with-hole.firmament").Replace(oldCenter, center).Replace(oldRadius, radius);
+ AdmitAndBuild(source, accepted);
+ if (accepted) return;
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ var presented = build.Diagnostics.Select(d => FirmamentBuildAdmissionValidation.Present(d, "test.firmament", source)).ToArray();
+ Assert.Contains(presented, d => d.Line == 6 && d.Message.Length > d.Code.Length);
+ }
+
+ [Fact]
+ public void RemovingTheHole_PreservesTheExactFilletSurfaceFamilyAndStockFrame()
+ {
+ var source = Source("Regression/FrontendX4/cases/d05-fillet-with-hole.firmament");
+ var withoutHole = string.Join('\n', source.Split('\n').Where(line => !line.Contains("Hole<Shaft>")));
+ var result = AdmitAndBuild(withoutHole, true);
+ Assert.Equal("TopBoundaryFillet", result.ExportedFeatureKind);
+ var body = result.RuntimeBody!;
+ Assert.Equal(10, body.Topology.Faces.Count());
+ Assert.Equal(4, body.Geometry.Surfaces.Count(s => s.Value.Kind == SurfaceGeometryKind.Cylinder));
+ Assert.Equal(0, body.Topology.Vertices.Select(v => { Assert.True(body.TryGetVertexPoint(v.Id, out var p)); return p.Z; }).Min(), 9);
+ Assert.Equal(10, body.Topology.Vertices.Select(v => { Assert.True(body.TryGetVertexPoint(v.Id, out var p)); return p.Z; }).Max(), 9);
+ }
+
+ [Fact]
+ public void FilletAndHoles_PreserveExplicitAp242Pmi()
+ {
+ var source = Source("Canonical/PMI/multiple-hole-dimensions-with-chamfer.firmament")
+ .Replace("Kind: Chamfer Distance: 1mm", "Kind: Fillet Radius: 1mm");
+ var result = AdmitAndBuild(source, true);
+ var pmi = Step242SemanticPmiInspector.Inspect(result.StepText);
+ Assert.True(pmi.Success, string.Join("; ", pmi.Diagnostics));
+ Assert.Equal(1, pmi.DatumCount);
+ Assert.Equal(2, pmi.DimensionCount);
+ Assert.Equal(2, result.DimensionInspection!.Count);
+ }
+
+ [Theory]
+ [InlineData("shaft-tangent", "CombinedFeaturePlanChainInvalid", 5)]
+ [InlineData("unsupported-selector", "CombinedFeatureSelectionLost", 6)]
+ [InlineData("overlapping-holes", "CombinedFeatureInteractionUnsupported", 7)]
+ public void UnadmittedCombinations_KeepActionableLocatedDiagnostics(string variant, string code, int line)
+ {
+ var source = Source("Regression/FrontendX4/cases/d05-fillet-with-hole.firmament");
+ source = variant switch
+ {
+ "shaft-tangent" => source.Replace("Point2(0mm, 0mm)", "Point2(26mm, 0mm)"),
+ "unsupported-selector" => source.Replace("Face: +Z", "Face: +X"),
+ _ => source.Replace(" EdgeFinish", " Hole<Shaft> Other { on: +Z; center: [1mm,0mm]; diameter: 4mm; end: ThroughAll }\n EdgeFinish")
+ };
+ AdmitAndBuild(source, false);
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ var diagnostics = build.Diagnostics.Select(d => FirmamentBuildAdmissionValidation.Present(d, "test.firmament", source)).ToArray();
+ Assert.Contains(diagnostics, d => d.Code == code && d.Line == line && d.SourceSpan is not null);
+ }
+
+ [Fact]
+ public void CounterboreEntryRadius_DeterminesFinishClearance()
+ {
+ var source = Source("Regression/Fillet/top-boundary-with-counterbore.firmament")
+ .Replace("[12mm, 0mm]", "[25mm, 0mm]");
+ AdmitAndBuild(source, false);
+ var result = FirmamentBuildAndExport.CompileSource(source);
+ Assert.Contains(result.Diagnostics, d => d.Message.Contains("finish band", StringComparison.Ordinal));
+ }
+
+ private static FirmamentStepExportResult AdmitAndBuild(string source, bool accepted)
+ {
+ var report = FirmamentBuildAdmissionValidation.Admit(FirmamentV2ValidationReportBuilder.Build(FirmamentV2Parser.Parse(source)), source);
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ Assert.True(accepted == build.IsSuccess, string.Join("; ", build.Diagnostics.Select(d => d.Message)));
+ Assert.Equal(accepted ? "valid" : "invalid", report.Status);
+ return accepted ? build.Value : null!;
+ }
+
+ private static string Source(string file) => FirmamentCorpusHarness.ReadFixtureText("fixtures/" + file);
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/ConceptPathAuthoringTests.cs b/Aetheris.Kernel.Firmament.Tests/ConceptPathAuthoringTests.cs
index f9cb7124..5b1ca4b0 100644
--- a/Aetheris.Kernel.Firmament.Tests/ConceptPathAuthoringTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/ConceptPathAuthoringTests.cs
@@ -106,7 +106,8 @@ public sealed class ConceptPathAuthoringTests
Assert.Null(parsed.Feature);
Assert.Contains("profile-path-missing:Plate:MissingOutline", parsed.Diagnostics);
- Assert.Contains("ConceptPathProfileNotAdmittedByCompose:Stock:Plate", parsed.Diagnostics);
+ Assert.Contains("profile-path-missing:Plate:MissingOutline", parsed.Diagnostics);
+ Assert.DoesNotContain(parsed.Diagnostics, diagnostic => diagnostic.StartsWith("ConceptPathProfileNotAdmittedByCompose", StringComparison.Ordinal));
}
[Fact]
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX0Tests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX0Tests.cs
index 9364b881..413e2885 100644
--- a/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX0Tests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX0Tests.cs
@@ -29,7 +29,7 @@ public sealed class FirmamentFrontendX0Tests
}
[Theory]
- [InlineData("combined-fillet-hole")]
+ [InlineData("combined-fillet-hole-intersection")]
[InlineData("unresolved-semantic-source")]
[InlineData("edgefinish-generic-variant")]
public void BuildAdmission_RejectsParsedButUnbuildablePrograms(string fixture)
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX4Tests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX4Tests.cs
new file mode 100644
index 00000000..44f4fbe1
--- /dev/null
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX4Tests.cs
@@ -0,0 +1,88 @@
+using Aetheris.Kernel.Core.Step242;
+using Aetheris.Kernel.Firmament.FirmamentV2;
+
+namespace Aetheris.Kernel.Firmament.Tests;
+
+public sealed class FirmamentFrontendX4Tests
+{
+ public static IEnumerable<object[]> CorpusCases()
+ {
+ using var manifest = System.Text.Json.JsonDocument.Parse(File.ReadAllText(Path.Combine(Corpus, "expected.json")));
+ foreach (var item in manifest.RootElement.GetProperty("cases").EnumerateArray())
+ yield return [item.GetProperty("file").GetString()!, item.GetProperty("expect").GetString() == "valid"];
+ }
+
+ [Theory]
+ [MemberData(nameof(CorpusCases))]
+ public void Retest_UsesTheSameAdmissionAndPreservesRecordedTopology(string file, bool accepted)
+ {
+ var source = File.ReadAllText(Path.Combine(Corpus, file));
+ var parse = FirmamentV2Parser.Parse(source);
+ var report = FirmamentBuildAdmissionValidation.Admit(FirmamentV2ValidationReportBuilder.Build(parse, file), source);
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ Assert.Equal(accepted, build.IsSuccess);
+ Assert.Equal(accepted ? "valid" : "invalid", report.Status);
+ if (!accepted) return;
+ Assert.Equal("Built", report.ValidationLevel);
+ using var manifest = System.Text.Json.JsonDocument.Parse(File.ReadAllText(Path.Combine(Corpus, "expected.json")));
+ var geometry = manifest.RootElement.GetProperty("cases").EnumerateArray().Single(c => c.GetProperty("file").GetString() == file).GetProperty("geometry");
+ // This is newly compiled output, so a separate import is the test subject.
+ var imported = Step242Importer.ImportBody(build.Value.StepText);
+ Assert.True(imported.IsSuccess);
+ Assert.Equal(geometry.GetProperty("faces").GetInt32(), imported.Value.Topology.Faces.Count());
+ Assert.Equal(geometry.GetProperty("edges").GetInt32(), imported.Value.Topology.Edges.Count());
+ Assert.Equal(geometry.GetProperty("vertices").GetInt32(), imported.Value.Topology.Vertices.Count());
+ }
+
+ [Theory]
+ [InlineData("cases/f03-segment-inline-coordinates.firmament", "ProfileSegmentEndpointMustReferenceNamedPoint", 5)]
+ public void RejectedIntent_PreservesItsOriginalConstruct(string file, string code, int line)
+ {
+ var source = File.ReadAllText(Path.Combine(Corpus, file));
+ var build = FirmamentBuildAndExport.CompileSource(source);
+ Assert.False(build.IsSuccess);
+ var presented = build.Diagnostics.Select(d => FirmamentBuildAdmissionValidation.Present(d, file, source)).ToArray();
+ Assert.Contains(presented, d => d.Code == code && d.Line == line && d.SourceSpan is not null);
+ Assert.DoesNotContain(presented, d => d.Code == "ConceptPathProfileNotAdmittedByCompose");
+ }
+
+ [Theory]
+ [InlineData("Polygon2 outline { points: [[0mm,0mm],[20mm,0mm],[0mm,10mm]]; heigth: 5mm }")]
+ [InlineData("Polygon2 outline { points: [[0mm,0mm],[20mm,0mm],[0mm,10mm]]; rotation: 15deg }")]
+ [InlineData("Modify Body { Hole<Shaft> bore { on: Other.Top; center: [0mm,0mm]; diameter: 2mm; end: ThroughAll } }")]
+ [InlineData("Modify Body { EdgeFinish<Chamfer> edge { face: +Z; target: Boundary; kind: Fillet; distance: 1mm } }")]
+ [InlineData("Static sites: Set<Point2> { bad => [2mm, 1deg] }")]
+ [InlineData("Static sites: Set<Point2> { bad => Point3(2mm, 1mm) }")]
+ [InlineData("Modify Body { Hole<Shaft> bore { on: +Z; center: Point3(0mm,0mm); diameter: 2mm; end: ThroughAll } }")]
+ public void NewlyAdmittedForms_DoNotHideUnknownOrConflictingIntent(string intent)
+ {
+ var source = "Model Test { units: mm Box Body { size: [40mm,30mm,5mm] } " + intent + " }";
+ Assert.False(FirmamentBuildAndExport.CompileSource(source).IsSuccess);
+ var report = FirmamentBuildAdmissionValidation.Admit(FirmamentV2ValidationReportBuilder.Build(FirmamentV2Parser.Parse(source)), source);
+ Assert.Equal("invalid", report.Status);
+ }
+
+ [Fact]
+ public void GenericProfileFinish_RejectsAnUnknownFieldBeforeEmittingPlausibleGeometry()
+ {
+ var source = File.ReadAllText(Path.Combine(Corpus, "cases/d01-edgefinish-generic-variant.firmament"));
+ source = source.Replace("Distance: 1mm", "Distance: 1mm; distnce: 2mm", StringComparison.Ordinal);
+ var built = FirmamentBuildAndExport.CompileSource(source);
+ Assert.False(built.IsSuccess);
+ Assert.Contains(built.Diagnostics, d => d.Message.Contains("distnce", StringComparison.Ordinal));
+ }
+
+ [Fact]
+ public void StandaloneConstruction_ProjectsStaticValuesWithoutDependingOnASyntheticWrapperSpan()
+ {
+ var wrapped = File.ReadAllText(Path.Combine(Corpus, "cases/a05-static-in-compose-interval.firmament"));
+ var standalone = wrapped[(wrapped.IndexOf('{') + 1)..wrapped.LastIndexOf('}')];
+ var expected = FirmamentBuildAndExport.CompileSource(wrapped);
+ var actual = FirmamentBuildAndExport.CompileSource(standalone);
+ Assert.True(expected.IsSuccess);
+ Assert.True(actual.IsSuccess, string.Join("; ", actual.Diagnostics.Select(d => d.Message)));
+ Assert.Equal(expected.Value.StepText, actual.Value.StepText);
+ }
+
+ private static string Corpus => Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../fixtures/Regression/FrontendX4"));
+}
diff --git a/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs b/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs
index a8ecaeb1..c4e6bb5c 100644
--- a/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs
+++ b/Aetheris.Kernel.Firmament.Tests/FirmamentV2CanonicalGrammarTests.cs
@@ -161,13 +161,16 @@ public sealed class FirmamentV2CanonicalGrammarTests
}
[Fact]
- public void CanonicalPoint2_RejectsTheLegacyBracketLiteralWithASpecificDiagnostic()
+ public void CanonicalPoint2_AdmitsBracketLiteralWithIdenticalEngineeringGeometry()
{
- var source = File.ReadAllText(Fixture("through-hole.firmament")).Replace("Point2(0mm, 0mm)", "[0mm, 0mm]", StringComparison.Ordinal);
- var parsed = FirmamentV2Parser.Parse(source);
-
- Assert.False(parsed.IsSuccess);
- Assert.Contains(FirmamentV2Parser.CanonicalPoint2Invalid, parsed.Diagnostics);
+ var original = File.ReadAllText(Fixture("through-hole.firmament"));
+ var source = original.Replace("Point2(0mm, 0mm)", "[0mm, 0mm]", StringComparison.Ordinal);
+ Assert.True(FirmamentV2Parser.Parse(source).IsSuccess);
+ var before = FirmamentBuildAndExport.CompileSource(original);
+ var after = FirmamentBuildAndExport.CompileSource(source);
+ Assert.True(before.IsSuccess);
+ Assert.True(after.IsSuccess);
+ Assert.Equal(before.Value.StepText, after.Value.StepText);
}
private static string Fixture(string name)
diff --git a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
index 5c3e709f..2c040f3a 100644
--- a/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs
@@ -1382,9 +1382,10 @@ public static class FirmamentBuildAndExport
}
var finish = finishes[0];
- if (!string.Equals(finish.FaceAxis, "+Z", StringComparison.Ordinal) || !string.Equals(finish.Target, "Boundary", StringComparison.Ordinal) || !string.Equals(finish.Kind, "Chamfer", StringComparison.Ordinal))
+ if (!string.Equals(finish.FaceAxis, "+Z", StringComparison.Ordinal) || !string.Equals(finish.Target, "Boundary", StringComparison.Ordinal)
+ || finish.Kind is not ("Chamfer" or "Fillet"))
{
- return CombinedFailure($"CombinedFeatureSelectionLost: EdgeFinish '{finish.Name}' must select the +Z outer Boundary with Kind Chamfer.");
+ return CombinedFailure($"CombinedFeatureSelectionLost: EdgeFinish '{finish.Name}' must select the +Z outer Boundary with Kind Chamfer or Fillet. Other combined selectors are not admitted.", sourceSpan: finish.SourceSpan);
}
var holes = FirmamentV2SemanticHoleLowering.LowerSemanticHoles(document);
@@ -1398,12 +1399,15 @@ public static class FirmamentBuildAndExport
// its same source intent alongside the admitted outer-boundary finish.
var host = FirmamentStockFrame.ForBox(box.Size[0], box.Size[1], box.Size[2]).CreateHoleHost();
var holeStages = holes.Select(h => AirHoleSimpleShaftMaterializer.Execute(h, host)).ToArray();
- if (holeStages.Any(stage => !stage.Succeeded || stage.Plan is null))
+ for (var i = 0; i < holeStages.Length; i++)
{
- return CombinedFailure("CombinedFeatureMaterializerDiverged: admitted semantic Hole stage did not materialize its authoritative plan.", holeStages.SelectMany(stage => stage.Diagnostics));
+ var stage = holeStages[i];
+ if (!stage.Succeeded || stage.Plan is null)
+ return CombinedFailure($"CombinedFeaturePlanChainInvalid: Hole '{holes[i].FeatureId}' could not materialize its semantic plan.",
+ stage.Diagnostics, holesDeclared[i].SourceSpan);
}
- var combinedHoles = new List<CombinedTopBoundaryChamferThroughHole>(holes.Count);
+ var combinedHoles = new List<CombinedTopBoundaryEdgeFinishThroughHole>(holes.Count);
foreach (var (hole, stage) in holes.Zip(holeStages))
{
if (hole.EndCondition is not AirHoleEndCondition.ThroughAll || hole.Stack.Kind is not (AirHoleStackKind.SimpleShaft or AirHoleStackKind.Counterbore) || hole.Placement is not AirFaceLocalHolePlacement placement || hole.Axis.Direction.Z < 1d - 1e-9)
@@ -1411,34 +1415,41 @@ public static class FirmamentBuildAndExport
return CombinedFailure($"CombinedFeaturePlanChainInvalid: Hole '{hole.FeatureId}' is outside the shared combined route; only top/+Z shaft or counterbore ThroughAll holes are admitted.");
}
var counterbore=hole.Stack.Components.OfType<AirHoleCounterboreComponent>().SingleOrDefault();
- combinedHoles.Add(new CombinedTopBoundaryChamferThroughHole(hole.FeatureId, placement.U, placement.V, hole.Shaft.Radius,counterbore?.Radius,counterbore?.Depth));
+ combinedHoles.Add(new CombinedTopBoundaryEdgeFinishThroughHole(hole.FeatureId, placement.U, placement.V, hole.Shaft.Radius,counterbore?.Radius,counterbore?.Depth));
}
- // Resolve and admit the exact EdgeFinish family after the Hole stage. X1's
- // interaction classification is geometric-plan evidence, not a raw BRep ID or
- // coordinate search: the selected descendant is the known outer boundary role.
- var compiledFinish = AirTopFaceBoundaryChamferCompiler.Compile(new(
- solid.Name, $"{solid.Name}.{finish.Name}", finish.Name,
- box.Size[0], box.Size[1], box.Size[2], finish.FaceAxis, finish.Target, finish.Kind, finish.Distance,
- new AirSourceSpan(finish.SourceSpan.Start, finish.SourceSpan.Length, document.ModelName)));
- if (!compiledFinish.Succeeded || compiledFinish.BRepPlan?.RealizationPlan is null)
+ // Preserve the existing chamfer admission and realization unchanged. Fillet
+ // admission is owned by the same bounded final plan that realizes its cylinders.
+ if (finish.Kind == "Chamfer")
{
- return CombinedFailure("CombinedFeatureSelectionLost: post-Hole outer boundary selection did not admit the exact chamfer planner.", compiledFinish.Diagnostics);
+ var compiledFinish = AirTopFaceBoundaryChamferCompiler.Compile(new(
+ solid.Name, $"{solid.Name}.{finish.Name}", finish.Name,
+ box.Size[0], box.Size[1], box.Size[2], finish.FaceAxis, finish.Target, finish.Kind, finish.Distance,
+ new AirSourceSpan(finish.SourceSpan.Start, finish.SourceSpan.Length, document.ModelName)));
+ if (!compiledFinish.Succeeded || compiledFinish.BRepPlan?.RealizationPlan is null)
+ return CombinedFailure("CombinedFeatureSelectionLost: post-Hole outer boundary selection did not admit the exact chamfer planner.", compiledFinish.Diagnostics, finish.SourceSpan);
}
var parentHolePlan = string.Join(",", holeStages.Select(s => s.Plan!.HoleBRepPlan?.StableId ?? s.Plan!.SemanticFeatureId));
- var finalPlan = new CombinedTopBoundaryChamferThroughHolePlan(
+ var finalPlan = new CombinedTopBoundaryEdgeFinishThroughHolePlan(
$"brep-plan:combined-hole-edgefinish:{solid.Name}:{finish.Name}",
$"brep-plan:host:{solid.Name}->[{parentHolePlan}]",
["HostBRepPlan", "HoleChangedBRepPlan", "EdgeFinishChangedBRepPlan"],
- box.Size[0], box.Size[1], host.ZMin, host.ZMax, finish.Distance, combinedHoles);
- var materialized = CombinedTopBoundaryChamferThroughHoleBuilder.Build(finalPlan);
+ box.Size[0], box.Size[1], host.ZMin, host.ZMax, finish.Distance, combinedHoles,
+ finish.Kind == "Fillet" ? TopBoundaryEdgeFinishKind.Fillet : TopBoundaryEdgeFinishKind.Chamfer);
+ var materialized = CombinedTopBoundaryEdgeFinishThroughHoleBuilder.Build(finalPlan);
if (!materialized.IsSuccess || materialized.Value is null)
{
- return CombinedFailure("CombinedFeatureInteractionUnsupported: Hole descendants and EdgeFinish target are not Disjoint in X1.", materialized.Diagnostics.Select(d => d.Message));
+ return CombinedFailure("CombinedFeatureInteractionUnsupported: the combined Hole and EdgeFinish plan was rejected.", materialized.Diagnostics.Select(d => d.Message), finish.SourceSpan);
}
var body = materialized.Value;
+ if (finish.Kind == "Fillet")
+ {
+ var preflight = BrepExportPreflight.Validate(body);
+ if (!preflight.IsValid)
+ return CombinedFailure("CombinedFeatureMaterializerDiverged: fillet boundary failed analytic export preflight.", preflight.Diagnostics.Select(d => d.Message), finish.SourceSpan);
+ }
if (!FirmamentManifoldChecker.IsManifold(body))
{
return CombinedFailure("CombinedFeaturePlanChainInvalid: final combined plan did not produce one enclosed manifold body.");
@@ -1463,17 +1474,23 @@ public static class FirmamentBuildAndExport
var descendants = new List<SemanticTopologyDescendant>();
var finalTop = body.Topology.Faces.Single(f => f.Id.Value == 2);
var finalBottom = body.Topology.Faces.Single(f => f.Id.Value == 1);
+ // The builder emits the counterbore wall and shoulder before the shaft.
var wallFaceId=11;
for (var i = 0; i < holes.Count; i++)
{
var source = $"hole:{holes[i].FeatureId}";
descendants.Add(new($"combined:{source}:mouth-loop", "Loop", SemanticTopologyRole.HoleEntryLoop, source, Loop: finalTop.LoopIds[i + 1], ParentStableId: holes[i].FeatureId));
descendants.Add(new($"combined:{source}:exit-loop", "Loop", SemanticTopologyRole.HoleExitLoop, source, Loop: finalBottom.LoopIds[i + 1], ParentStableId: holes[i].FeatureId));
- descendants.Add(new($"combined:{source}:shaft-wall", "Face", SemanticTopologyRole.HoleWallFace, source, Face: new FaceId(wallFaceId++), ParentStableId: holes[i].FeatureId));
- if(combinedHoles[i].IsCounterbore)
+ if (combinedHoles[i].IsCounterbore)
+ {
descendants.Add(new($"combined:{source}:counterbore-wall", "Face", SemanticTopologyRole.HoleWallFace, source, Face: new FaceId(wallFaceId++), ParentStableId: holes[i].FeatureId));
+ wallFaceId++; // annular shoulder, not a shaft wall
+ }
+ descendants.Add(new($"combined:{source}:shaft-wall", "Face", SemanticTopologyRole.HoleWallFace, source, Face: new FaceId(wallFaceId++), ParentStableId: holes[i].FeatureId));
}
- descendants.Add(new($"combined:edgefinish:{finish.Name}:replacement", "Face", SemanticTopologyRole.EdgeFinishReplacementFace, $"edgefinish:{finish.Name}", Face: new FaceId(7), ParentStableId: finish.Name));
+ for (var side = 0; side < 4; side++)
+ descendants.Add(new($"combined:edgefinish:{finish.Name}:replacement:{side}", "Face", SemanticTopologyRole.EdgeFinishReplacementFace,
+ $"edgefinish:{finish.Name}", Face: new FaceId(4 + 2 * side), ParentStableId: finish.Name));
var correspondence = new SemanticTopologyCorrespondence(solid.Name, descendants, ["HostBRepPlan", "HoleChangedBRepPlan", "EdgeFinishChangedBRepPlan", "AuthoritativeBRepPlan"]);
if (correspondence.Descendants.Count(d => d.Role == SemanticTopologyRole.HoleEntryLoop) != holes.Count || correspondence.Descendants.Count(d => d.Role == SemanticTopologyRole.HoleExitLoop) != holes.Count)
{
@@ -1484,14 +1501,15 @@ public static class FirmamentBuildAndExport
+(h.CounterboreRadius is { } reliefRadius&&h.CounterboreDepth is { } reliefDepth?System.Math.PI*(reliefRadius*reliefRadius-h.Radius*h.Radius)*reliefDepth:0d));
var report = new FirmamentCombinedFeaturePlanReport(
"CombinedHoleEdgeFinish", "Succeeded", finalPlan.ParentHostPlanId!, finalPlan.AppliedFeatureIds, finalPlan.PlanId, "Disjoint",
- descendants.Count(d => d.SourceStableId.StartsWith("hole:", StringComparison.Ordinal)), 1,
+ descendants.Count(d => d.SourceStableId.StartsWith("hole:", StringComparison.Ordinal)),
+ descendants.Count(d => d.Role == SemanticTopologyRole.EdgeFinishReplacementFace),
box.Size[0] * box.Size[1] * (host.ZMax - host.ZMin), holeRemoved, finalPlan.AnalyticVolume,
Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(step.Value))), body.Topology.Vertices.Count(), body.Topology.Edges.Count(), body.Topology.Faces.Count(),
body.Geometry.Surfaces.Count(s => s.Value.Kind == SurfaceGeometryKind.Plane), body.Geometry.Surfaces.Count(s => s.Value.Kind == SurfaceGeometryKind.Cylinder), true, true);
var featureReports = holes.Select(h => new FirmamentHoleFeatureReport(h.Name, "Hole", h.FeatureId, h.Shaft.Diameter, h.Placement.U, h.Placement.V, null, null, null, null, "top", null, nameof(AirHoleSimpleShaftMaterializer), "HoleChangedBRepPlan", h.Stack.Kind.ToString(), "CombinedHoleEdgeFinish", h.Stack.Kind==AirHoleStackKind.Counterbore?2:1, 0, h.Stack.Kind==AirHoleStackKind.Counterbore?1:0, report.StepSha256, true)).ToArray();
return KernelResult<FirmamentStepExportResult>.Success(new FirmamentStepExportResult(
step.Value,
- finish.Name,
+ document.ModelName,
0,
"combined-hole-edgefinish",
"CombinedHoleEdgeFinish",
@@ -1499,15 +1517,44 @@ public static class FirmamentBuildAndExport
DimensionInspection: document.Pmi?.Where(p => p.Kind == FirmamentV2PmiKind.HoleDiameter).Select(p => new FirmamentPmiInspectionDimension("Diameter", p.Target, null, p.Value ?? 0d, "explicit-v2-semantic-pmi", p.Name)).ToArray() ?? [],
ConceptIr: document.ConceptIr,
Features: featureReports,
- Combined: report));
+ Combined: report) { RuntimeBody = body, RuntimeCorrespondence = correspondence });
}
- private static KernelResult<FirmamentStepExportResult> CombinedFailure(string message, IEnumerable<string>? details = null) =>
+ private static KernelResult<FirmamentStepExportResult> ExportV2TopBoundaryFillet(
+ FirmamentV2Document document, FirmamentV2SolidBinding solid, FirmamentV2EdgeFinishDecl finish, FirmamentV2BoxRecord box)
+ {
+ var frame = FirmamentStockFrame.ForBox(box.Size[0], box.Size[1], box.Size[2]);
+ var host = frame.CreateHoleHost();
+ var plan = new CombinedTopBoundaryEdgeFinishThroughHolePlan(
+ $"brep-plan:top-boundary-fillet:{solid.Name}:{finish.Name}", $"brep-plan:host:{solid.Name}",
+ ["HostBRepPlan", "EdgeFinishChangedBRepPlan"], box.Size[0], box.Size[1], host.ZMin, host.ZMax,
+ finish.Distance, [], TopBoundaryEdgeFinishKind.Fillet);
+ var built = CombinedTopBoundaryEdgeFinishThroughHoleBuilder.Build(plan);
+ if (!built.IsSuccess || built.Value is null)
+ return CombinedFailure("CombinedFeaturePlanChainInvalid: top-boundary fillet plan was rejected.", built.Diagnostics.Select(d => d.Message), finish.SourceSpan);
+ if (!FirmamentManifoldChecker.IsManifold(built.Value))
+ return CombinedFailure("CombinedFeaturePlanChainInvalid: top-boundary fillet is not manifold.", sourceSpan: finish.SourceSpan);
+ var preflight = BrepExportPreflight.Validate(built.Value);
+ if (!preflight.IsValid)
+ return CombinedFailure("CombinedFeatureMaterializerDiverged: fillet boundary failed analytic export preflight.", preflight.Diagnostics.Select(d => d.Message), finish.SourceSpan);
+ var pmiSupport = ValidateV2PmiExportSupport(document);
+ if (!pmiSupport.IsSuccess) return KernelResult<FirmamentStepExportResult>.Failure(pmiSupport.Diagnostics);
+ var step = Step242Exporter.ExportBody(built.Value, BuildV2SemanticPmi(document, [], solid.Name));
+ if (!step.IsSuccess || step.Value is null) return KernelResult<FirmamentStepExportResult>.Failure(step.Diagnostics);
+ var imported = Step242Importer.ImportBody(step.Value);
+ if (!imported.IsSuccess || imported.Value is null || !FirmamentManifoldChecker.IsManifold(imported.Value))
+ return CombinedFailure("CombinedFeatureMaterializerDiverged: top-boundary fillet STEP round trip failed.", imported.Diagnostics.Select(d => d.Message), finish.SourceSpan);
+ return KernelResult<FirmamentStepExportResult>.Success(new FirmamentStepExportResult(
+ step.Value, document.ModelName, 0, "top-boundary-fillet", "TopBoundaryFillet") { RuntimeBody = built.Value });
+ }
+
+ private static KernelResult<FirmamentStepExportResult> CombinedFailure(string message, IEnumerable<string>? details = null, FirmamentV2SourceSpan? sourceSpan = null) =>
KernelResult<FirmamentStepExportResult>.Failure((new[] { message }).Concat(details ?? []).Distinct().Select(detail => new Kernel.Core.Diagnostics.KernelDiagnostic(
Kernel.Core.Diagnostics.KernelDiagnosticCode.ValidationFailed,
Kernel.Core.Diagnostics.KernelDiagnosticSeverity.Error,
detail,
- "FirmamentV2.CombinedHoleEdgeFinish")).ToArray());
+ "FirmamentV2.CombinedHoleEdgeFinish")
+ { SourceSpan = sourceSpan is null ? null : new(sourceSpan.Start, sourceSpan.Length) }).ToArray());
private static KernelResult<FirmamentStepExportResult>? TryExportV2AirChamferBody(FirmamentV2Document document)
{
@@ -1562,7 +1609,11 @@ public static class FirmamentBuildAndExport
// AIR-FILLET-LOCALIZED-M1: semantic support-face selection only; emitted BRep IDs never enter Firmament.
if (string.Equals(finish.Kind, "Fillet", StringComparison.Ordinal))
+ {
+ if (finish.FaceAxis == "+Z" && finish.Target == "Boundary")
+ return ExportV2TopBoundaryFillet(document, solid, finish, box);
return ExportV2LocalizedTangentBlendSingleEdgeFillet(document, solid, finish, box);
+ }
// AIR-CHAMFER-LOCALIZED-PLAN-A1: a semantic face-pair selector, never an emitted edge id.
if (string.Equals(finish.FaceAxis, "+X", StringComparison.Ordinal)
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
index a27ca1c5..df0ddc63 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/CanonicalStaticAuthoring.cs
@@ -250,7 +250,7 @@ internal static class CanonicalStaticAuthoring
if (close < 0) { diagnostics.Add(Prefix + "set-malformed:" + name); continue; }
if (!IsSupportedSetElementType(type, recordByName)) { diagnostics.Add(Prefix + "set-element-type-unsupported:" + name + ":" + type); continue; }
if (!names.Add(name)) { diagnostics.Add(FirmamentV2Parser.DuplicateName + ":Static:" + name); continue; }
- var entries = ParseSetEntries(source, open + 1, close, name, type, recordByName, diagnostics);
+ var entries = ParseSetEntries(source, open + 1, close, name, type, recordByName, diagnostics, scalars);
sets.Add(new(name, type, entries, new(header.Index, close - header.Index + 1)));
changes.Add((header.Index, close - header.Index + 1, string.Empty));
}
@@ -355,7 +355,15 @@ internal static class CanonicalStaticAuthoring
{ diagnostics.Add(Prefix + "pattern-source-invalid:" + patternName); continue; }
if (setByName.TryGetValue(sourceName, out var set))
{
- ExpandSetPattern(pattern, set, templateByName, changes, patterns, diagnostics);
+ var parent = FirmamentSyntaxTraversal.Declarations(patternSyntax.Document).FirstOrDefault(d => d.Body?.Statements.Contains(pattern) == true);
+ string? target = null;
+ if (parent?.Type.Name.Text is "Model" or "Struct")
+ {
+ var bodies = parent.Body!.Statements.OfType<DeclarationSyntax>().Where(d => FirmamentV2Parser.IsPrimitiveDeclaration(d) || d.Type.Name.Text is "Compose" or "Extrude").ToArray();
+ if (bodies.Length != 1) { diagnostics.Add(Prefix + "pattern-target-ambiguous:" + patternName + ":Model-scope features require exactly one material body; use Modify target"); continue; }
+ target = bodies[0].Name?.Text;
+ }
+ ExpandSetPattern(pattern, set, templateByName, changes, patterns, diagnostics, target);
continue;
}
if (!arrayByName.TryGetValue(sourceName, out var array))
@@ -462,7 +470,7 @@ internal static class CanonicalStaticAuthoring
}
private static IReadOnlyList<FirmamentV2StaticSetEntry> ParseSetEntries(string source, int start, int end, string setName, string elementType,
- IReadOnlyDictionary<string, FirmamentV2RecordTypeDecl> recordTypes, List<string> diagnostics)
+ IReadOnlyDictionary<string, FirmamentV2RecordTypeDecl> recordTypes, List<string> diagnostics, FirmamentCompileTimeValues? scalars = null)
{
var parsed = FirmamentSyntaxParser.Parse(source[start..end]);
var result = new List<FirmamentV2StaticSetEntry>();
@@ -483,7 +491,18 @@ internal static class CanonicalStaticAuthoring
"__SetValue_" + setName + "_" + entryName, diagnostics);
if (fields is null) continue;
}
- else if (!ValueMatchesType(value, elementType))
+ else
+ {
+ var expression = FirmamentSyntaxParser.ParseExpression(value).Expression;
+ if (expression is not null && scalars is not null) expression = scalars.NominalExpression(expression);
+ if (elementType is "Point2" or "Point3" or "Vector2"
+ && (expression is SequenceSyntax { Kind: SequenceKind.List } || expression is CallSyntax { Target: ReferenceSyntax constructor } && constructor.Name.Text == elementType)
+ && FirmamentSyntaxValues.Vector(expression, elementType == "Vector2" ? "" : "mm", out var coordinates)
+ && coordinates.Length == (elementType == "Point3" ? 3 : 2))
+ value = elementType + "(" + string.Join(", ", coordinates.Select(n => n.ToString("R", CultureInfo.InvariantCulture) + (elementType == "Vector2" ? "" : "mm"))) + ")";
+ else if (expression is not null) value = FirmamentSyntaxWriter.Expression(expression);
+ }
+ if (fields is null && !ValueMatchesType(value, elementType))
{ diagnostics.Add(Prefix + "set-entry-type-mismatch:" + setName + ":" + entryName + ":expected-" + elementType); continue; }
result.Add(new(entryName, value, result.Count, span, fields));
}
@@ -505,7 +524,7 @@ internal static class CanonicalStaticAuthoring
private static void ExpandSetPattern(DeclarationSyntax pattern, FirmamentV2StaticSetDecl set,
IReadOnlyDictionary<string, Template> templates, List<(int Start, int Length, string Text)> changes,
- List<FirmamentV2CanonicalPatternDecl> patterns, List<string> diagnostics)
+ List<FirmamentV2CanonicalPatternDecl> patterns, List<string> diagnostics, string? target = null)
{
var patternName = pattern.Name!.Text;
if (set.Entries.Count > MaxPatternExpansion) { diagnostics.Add(Prefix + "pattern-expansion-limit:" + patternName + ":" + set.Entries.Count); return; }
@@ -542,7 +561,8 @@ internal static class CanonicalStaticAuthoring
}
patterns.Add(new(patternName, set.Name, invocation ?? (mapping.Value as DeclarationSyntax)?.Type.Name.Text ?? "mapping",
generated.Count, generated, pattern.Span, associations));
- changes.Add((pattern.Span.Start, pattern.Span.Length, string.Join(Environment.NewLine, output)));
+ var emitted = string.Join(Environment.NewLine, output);
+ changes.Add((pattern.Span.Start, pattern.Span.Length, target is null ? emitted : "Modify " + target + " {\n" + emitted + "\n}"));
}
private static bool IsSupportedSetElementType(string type, IReadOnlyDictionary<string, FirmamentV2RecordTypeDecl> records) =>
@@ -551,11 +571,15 @@ internal static class CanonicalStaticAuthoring
private static bool ValueMatchesType(string value, string type)
{
value = value.Trim();
+ if (type is "Point2" or "Point3" or "Vector2")
+ {
+ var expression = FirmamentSyntaxParser.ParseExpression(value).Expression;
+ return (expression is SequenceSyntax { Kind: SequenceKind.List } || expression is CallSyntax { Target: ReferenceSyntax constructor } && constructor.Name.Text == type)
+ && FirmamentSyntaxValues.Vector(expression, type == "Vector2" ? "" : "mm", out var components)
+ && components.Length == (type == "Point3" ? 3 : 2);
+ }
return type switch
{
- "Point2" => Regex.IsMatch(value, @"^Point2\s*\(\s*[-+]?\d+(?:\.\d+)?mm\s*,\s*[-+]?\d+(?:\.\d+)?mm\s*\)$", RegexOptions.CultureInvariant),
- "Point3" => Regex.IsMatch(value, @"^Point3\s*\(\s*[-+]?\d+(?:\.\d+)?mm\s*,\s*[-+]?\d+(?:\.\d+)?mm\s*,\s*[-+]?\d+(?:\.\d+)?mm\s*\)$", RegexOptions.CultureInvariant),
- "Vector2" => Regex.IsMatch(value, @"^Vector2\s*\(\s*[-+]?\d+(?:\.\d+)?\s*,\s*[-+]?\d+(?:\.\d+)?\s*\)$", RegexOptions.CultureInvariant),
"Length" => Regex.IsMatch(value, @"^[-+]?\d+(?:\.\d+)?mm$", RegexOptions.CultureInvariant),
"Angle" => Regex.IsMatch(value, @"^[-+]?\d+(?:\.\d+)?deg$", RegexOptions.CultureInvariant),
"Int" => Regex.IsMatch(value, @"^[-+]?\d+$", RegexOptions.CultureInvariant),
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
index b61be78b..3f61fe85 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ClosedBoundary2Authoring.cs
@@ -26,7 +26,7 @@ internal static class ClosedBoundary2Authoring
private sealed record Shape(FirmamentV2ClosedBoundary2Decl Declaration, string? LoweredSource,
IReadOnlyDictionary<string, string> MemberMap, string TraceExpression, int Start, int Length);
- public static Result? Expand(string source, List<string> diagnostics)
+ public static Result? Expand(string source, List<string> diagnostics, FirmamentCompileTimeValues? scalars = null)
{
// Template bodies have local names and unbound dimensions. Their selected
// specializations pass through this lowering after ordinary template binding.
@@ -55,7 +55,11 @@ internal static class ClosedBoundary2Authoring
// static geometry expander; it does not request a material operation.
fields.Word("Role");
var beforeBinding = diagnostics.Count;
- var shape = Bind(source, declaration, fields, diagnostics);
+ var boundDeclaration = scalars is null ? declaration : (DeclarationSyntax)new BoundaryValues(scalars).Statement(declaration);
+ var boundFields = scalars is null ? fields : new FirmamentSyntaxFields(boundDeclaration, diagnostics);
+ if (scalars is not null) boundFields.Word("Role");
+ var shape = Bind(source, boundDeclaration, boundFields, diagnostics);
+ fields = boundFields;
// Unbound template/record expressions remain with their specialization
// owner. Successful shape binding must consume every authored field.
if (shape is not null) { fields.Complete(); shapes.Add(shape); }
@@ -65,7 +69,15 @@ internal static class ClosedBoundary2Authoring
var changes = new List<(int Start, int Length, string Text)>();
foreach (var shape in shapes)
{
- if (shape.LoweredSource is not null) changes.Add((shape.Start, shape.Length, shape.LoweredSource));
+ if (shape.LoweredSource is not null)
+ {
+ var directConsumer = FirmamentSyntaxTraversal.Declarations(syntax.Document).Any(d => d.Type.Name.Text == "Revolve"
+ && d.Body?.Statements.OfType<FieldSyntax>().Any(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Profile")
+ && FirmamentSyntaxValues.Reference(f.Value) == shape.Declaration.Name) == true);
+ var lowered = shape.LoweredSource;
+ if (directConsumer) lowered += "\nProfile " + shape.Declaration.Name + " { Loop Outer { " + shape.TraceExpression + " } }\n";
+ changes.Add((shape.Start, shape.Length, lowered));
+ }
// Preserve a closed boundary value for immutable Profile derivation
// before the primitive declaration is erased to its ordinary guides.
var seedUses = Regex.Matches(source,
@@ -104,6 +116,11 @@ internal static class ClosedBoundary2Authoring
};
}
+ private sealed class BoundaryValues(FirmamentCompileTimeValues values) : FirmamentSyntaxRewriter
+ {
+ internal override ExpressionSyntax Expression(ExpressionSyntax expression) => values.NominalExpression(expression);
+ }
+
private static IEnumerable<DeclarationSyntax> BoundaryDeclarations(DocumentSyntax syntax) =>
FirmamentSyntaxTraversal.Declarations(syntax)
.Where(d => d.Name is not null && d.Body is not null && d.Modifiers.All(m => m.Name.Text == "Concept")
@@ -143,7 +160,7 @@ internal static class ClosedBoundary2Authoring
"Slot2" => Slot(name, body, rotation, span, diagnostics),
"SmoothRoundedRect2" => SmoothRoundedRect(name, body, rotation, span, diagnostics),
"RoundedRect2" => RoundedRect(name, body, rotation, span, diagnostics),
- "Polygon2" => Polygon(source, name, variant!, body, rotation, span, diagnostics),
+ "Polygon2" => Polygon(source, name, variant ?? "Explicit", body, rotation, span, diagnostics),
_ => RegularPolygon(name, variant!, body, rotation, span, diagnostics)
};
}
@@ -316,8 +333,32 @@ internal static class ClosedBoundary2Authoring
if (!Point(body, "Center", out c) || !Length(body, "BottomWidth", out var bw) || !Length(body, "TopWidth", out var tw) || !Length(body, "Height", out var th) || !Positive(bw, tw, th)) return Invalid(name, "invalid-dimensions", diagnostics);
vertices = new (double X, double Y)[] { (-bw / 2, -th / 2), (bw / 2, -th / 2), (tw / 2, th / 2), (-tw / 2, th / 2) }.Select(p => Rotate((p.X + c.X, p.Y + c.Y), c, rotation)).ToArray(); pointNames = ["BottomLeft", "BottomRight", "TopRight", "TopLeft"]; dimensions["BottomWidth"] = bw; dimensions["TopWidth"] = tw; dimensions["Height"] = th; break;
case "Explicit":
+ var inline = body.Take("Points");
var setName = Identifier(body, "Vertices");
- if (setName is null || !PointSet(source, setName, out pointNames, out vertices) || vertices.Count < 3) return Invalid(name, "explicit-too-few-vertices", diagnostics);
+ if (inline is not null)
+ {
+ if (setName is not null) return Invalid(name, "explicit-points-and-vertices-conflict", diagnostics);
+ if (Math.Abs(rotation) > Tol) return Invalid(name, "rotation-unsupported: Explicit boundaries use authored coordinates", diagnostics);
+ if (inline is not SequenceSyntax { Kind: SequenceKind.List } list) return Invalid(name, "invalid-points-list", diagnostics);
+ var coordinates = new List<(double X, double Y)>();
+ foreach (var item in list.Items)
+ {
+ if (item.Name is not null || item.Default is not null) return Invalid(name, "invalid-point", diagnostics);
+ if (item.Value is not (SequenceSyntax { Kind: SequenceKind.List } or CallSyntax { Target: ReferenceSyntax { Name.Text: "Point2" } })
+ || !FirmamentSyntaxValues.Vector(item.Value, "mm", out var point) || point.Length != 2)
+ {
+ // Scalar binding precedes the second boundary pass.
+ if (FirmamentSyntaxTraversal.Expressions(item.Value).Any(x => x is ReferenceSyntax or MemberSyntax)) return null;
+ return Invalid(name, "invalid-point", diagnostics);
+ }
+ coordinates.Add((point[0], point[1]));
+ }
+ vertices = coordinates;
+ pointNames = Enumerable.Range(0, vertices.Count).Select(i => "Vertex" + i).ToArray();
+ }
+ else if (setName is not null && PointSet(source, setName, out pointNames, out vertices)) { }
+ else return Invalid(name, "explicit-too-few-vertices", diagnostics);
+ if (vertices.Count < 3) return Invalid(name, "explicit-too-few-vertices", diagnostics);
if (HasDuplicate(vertices)) return Invalid(name, "explicit-duplicate-vertex", diagnostics); if (SelfIntersects(vertices)) return Invalid(name, "explicit-self-intersection", diagnostics); if (Math.Abs(SignedArea(vertices)) <= Tol) return Invalid(name, "explicit-degenerate-area", diagnostics);
c = PolygonCentroid(vertices); rotation = 0; break;
default: diagnostics.Add("firmament-polygon2-variant-unsupported:" + name + ":" + variant); return null;
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs
index b79ff72f..df76983e 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ConceptIr.cs
@@ -280,6 +280,8 @@ internal static class ConceptIrResolver
{
size = FirmamentSyntaxValues.Vector(sizeExpression, "mm", out var values) && values.Length == 3 && values.All(v => v > 0) ? values : null;
boundsProvenance = $"{materialized.Groups["name"].Value}.{box.Groups["name"].Value}.Size";
+ if (size is not null) resolvedBounds = new("materialized:" + boundsProvenance,
+ new(-size[0] / 2, -size[1] / 2, 0), new(size[0] / 2, size[1] / 2, size[2]), boundsProvenance);
}
if (size is null || box.Groups["name"].Value != modify.Groups["target"].Value)
@@ -441,7 +443,7 @@ internal static class ConceptIrResolver
}
var faceAxis = on switch
{
- "face(+Z)" => "+Z",
+ "face(+Z)" or "Top" or "+Z" => "+Z",
_ when string.Equals(on, boxName + ".Top", StringComparison.Ordinal) => "+Z",
_ => ResolvePlaneAxis(on, instances, diagnostics)
};
@@ -533,14 +535,17 @@ internal static class ConceptIrResolver
IReadOnlyList<FirmamentV2SemanticHoleDecl> holes,
List<string> diagnostics)
{
- var expose = Regex.Match(body, @"\bExpose\s*\{(?<body>.*?)\}", RegexOptions.Singleline | RegexOptions.CultureInvariant);
- if (!expose.Success) return [];
+ var expose = FirmamentSyntaxParser.Parse(body).Document.Statements.OfType<DeclarationSyntax>()
+ .FirstOrDefault(d => d.Type.Name.Text == "Expose");
+ if (expose?.Body is null) return [];
var result = new List<ConceptIrSemanticMember>();
var names = new HashSet<string>(StringComparer.Ordinal);
- var fields = Regex.Matches(expose.Groups["body"].Value, @"(?m)^\s*(?<name>[A-Za-z_][A-Za-z0-9_]*)\s*:\s*(?<value>[^\r\n}]+?)\s*$", RegexOptions.CultureInvariant).Cast<Match>().ToArray();
- var fieldNames = fields.Select(f => f.Groups["name"].Value).ToHashSet(StringComparer.Ordinal);
+ var fields = expose.Body.Statements.OfType<FieldSyntax>().ToArray();
+ foreach (var statement in expose.Body.Statements.Where(s => s is not FieldSyntax))
+ diagnostics.Add($"{FirmamentV2Parser.CanonicalDeclarationUnknown}:Expose:{(statement as DeclarationSyntax)?.Type.Name.Text ?? "expression"}");
+ var fieldNames = fields.Select(f => f.Name.Text).ToHashSet(StringComparer.Ordinal);
var dependencies = new Dictionary<string, string>(StringComparer.Ordinal);
- foreach (var field in fields) dependencies.TryAdd(field.Groups["name"].Value, field.Groups["value"].Value.Trim());
+ foreach (var field in fields) dependencies.TryAdd(field.Name.Text, FirmamentSyntaxWriter.Expression(field.Value));
var cycleMembers = new HashSet<string>(StringComparer.Ordinal);
foreach (var start in dependencies.Keys)
{
@@ -550,10 +555,10 @@ internal static class ConceptIrResolver
}
foreach (var field in fields)
{
- var name = field.Groups["name"].Value; var reference = field.Groups["value"].Value.Trim();
+ var name = field.Name.Text; var reference = FirmamentSyntaxWriter.Expression(field.Value);
if (!names.Add(name)) { diagnostics.Add($"{DuplicateExposedMember}:{name}"); continue; }
if (cycleMembers.Contains(name)) { diagnostics.Add($"{CircularExposureDependency}:{name}->{reference}"); continue; }
- var span = new FirmamentV2SourceSpan(bodyOffset + expose.Groups["body"].Index + field.Index, field.Length);
+ var span = new FirmamentV2SourceSpan(bodyOffset + field.Span.Start, field.Span.Length);
ConceptIrValue? value = null; string? semanticReference = null; ConceptIrSemanticPhase phase; ConceptIrMaterializationCategory category;
var dotted = Regex.Match(reference, @"^(?<instance>[A-Za-z_][A-Za-z0-9_]*)\.(?<member>[A-Za-z_][A-Za-z0-9_]*)$", RegexOptions.CultureInvariant);
if (dotted.Success && instances.TryGetValue(dotted.Groups["instance"].Value, out var instance) && instance.Members.TryGetValue(dotted.Groups["member"].Value, out value))
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs
index c39f85ca..90bafb5f 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentBuildAdmissionValidation.cs
@@ -36,8 +36,19 @@ public static class FirmamentBuildAdmissionValidation
? diagnostic.Message : diagnostic.Code.ToString();
if (source is not null)
{
- var original = FirmamentV2Parser.Parse(source).SyntaxDiagnostics.FirstOrDefault(d => d.Code == code || d.Code.StartsWith(code + ":", StringComparison.Ordinal));
+ var parsed = FirmamentV2Parser.Parse(source);
+ var original = parsed.SyntaxDiagnostics.FirstOrDefault(d => d.Code == code || d.Code.StartsWith(code + ":", StringComparison.Ordinal));
if (original is not null) return Locate(original, source, sourceFile);
+ if (diagnostic.SourceSpan is { } produced && FirmamentV2Parser.Parse(source.ReplaceLineEndings("\n")).DiagnosticSource is { } input)
+ {
+ var origins = new Syntax.FirmamentSyntaxOrigins(Syntax.FirmamentSyntaxParser.Parse(FirmamentSourceSpelling.Normalize(source)).Document,
+ Syntax.FirmamentSyntaxParser.Parse(input).Document);
+ var anchor = origins.Find(new(produced.Start, produced.Length));
+ if (anchor is not null) return Locate(new(code, diagnostic.Severity == KernelDiagnosticSeverity.Error ? "fatal" : "warning", diagnostic.Message)
+ { SourceSpan = anchor, Source = diagnostic.Source, Stage = diagnostic.Source }, source, sourceFile);
+ }
+ if (ProfileAuthoringParser.LocateDiagnostic(source, diagnostic.Message) is { } profileDiagnostic)
+ return Locate(profileDiagnostic, source, sourceFile);
}
if (source is not null && code.StartsWith("firmament-syntax-", StringComparison.Ordinal))
{
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentCompileTimeValues.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentCompileTimeValues.cs
index 03f2a1e2..de1093a8 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentCompileTimeValues.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentCompileTimeValues.cs
@@ -377,6 +377,15 @@ internal sealed class FirmamentCompileTimeValues(string source)
internal string NominalExpression(string expression) => values.TryGetValue(expression.Trim(), out var value) ? Nominal(value)
: recordValues.TryGetValue(expression.Trim(), out var record) ? record.AuthoredName ?? record.Name : expression;
+ internal ExpressionSyntax NominalExpression(ExpressionSyntax expression)
+ {
+ var replacements = FirmamentSyntaxTraversal.Expressions(expression)
+ .Select(FirmamentSyntaxValues.Reference).OfType<string>().Distinct(StringComparer.Ordinal)
+ .Where(values.ContainsKey).ToDictionary(name => name,
+ name => FirmamentSyntaxParser.ParseExpression(NominalExpression(name)).Expression!, StringComparer.Ordinal);
+ return new FirmamentSyntaxSubstitution(replacements).Expression(expression);
+ }
+
private static bool IsLiteral(string expression) => FirmamentSyntaxParser.ParseExpression(expression).Expression is
LiteralSyntax or QuantitySyntax or UnarySyntax { Operand: LiteralSyntax or QuantitySyntax };
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs
index c26041ae..c19a6235 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2MechanicalBinding.cs
@@ -51,20 +51,27 @@ public static partial class FirmamentV2Parser
var materialConstruction = constructions.Length > 0;
// Concept-valued stock retains its existing semantic resolver. Its actual
// declarations do not change the grammar of neighbouring nodes.
- var semanticStock = declarations.Any(d => d.Type.Name.Text == "Modify" && d.Body?.Statements.OfType<DeclarationSyntax>().Any(f => f.Type.Name.Text == "Pattern") == true)
+ var semanticStock = declarations.Any(d => d.Type.Name.Text == "Pattern" || d.Type.Name.Text == "Modify" && d.Body?.Statements.OfType<DeclarationSyntax>().Any(f => f.Type.Name.Text == "Pattern") == true)
|| declarations.Any(d => d.Type.Name.Text == "Struct" && d.Annotation is not null)
|| declarations.Where(d => d.Type.Name.Text == "Modify").SelectMany(d => d.Body?.Statements.OfType<DeclarationSyntax>() ?? [])
- .Any(d => d.Type.Name.Text == "Hole" && d.Body?.Statements.OfType<FieldSyntax>().Any(f => f.Name.Text == "From" || f.Name.Text == "On" && FirmamentSyntaxValues.Reference(f.Value) is not ("+X" or "-X" or "+Y" or "-Y" or "+Z" or "-Z")) == true);
+ .Any(d => d.Type.Name.Text == "Hole" && d.Body?.Statements.OfType<FieldSyntax>().Any(f => FirmamentSyntaxFields.SameField(f.Name.Text, "From")
+ || FirmamentSyntaxFields.SameField(f.Name.Text, "Center") && f.Value is IndexSyntax) == true);
var constructionConsumer = materialConstruction || semanticStock || primitives.Any(d => d.Body?.Statements.OfType<FieldSyntax>().Any(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Bounds")) == true);
- if (staticValues.Values.Count > 0 && constructionConsumer)
- return CanonicalFailure(diagnostics,
- "firmament-v2-static-scalar-consumer-unsupported: Model Static scalars currently bind direct primitive and Modify fields; parameterize construction recipes with Template instead.");
if (constructions.Length > 1 && constructions.All(d => d.Type.Name.Text == "Extrude") && primitives.Length == 0)
return BindMechanicalExtrusionStack(model, constructions, source, diagnostics);
if (constructions.Length > 1 || materialConstruction && primitives.Length > 0)
return CanonicalFailure(diagnostics, "firmament-v2-mechanical-material-owners-unsupported: Use one material body per mechanical document; use Assembly for separate parts.");
if (constructionConsumer)
- return BindMechanicalConstruction(source, model, diagnostics, templateInstantiations);
+ {
+ // The construction adapter consumes serialized bound AST fields. An
+ // unused Static is data, never a reason to reject a material owner.
+ var construction = BindMechanicalConstruction(source, model, diagnostics, templateInstantiations);
+ return construction.Document is null ? construction : construction with
+ {
+ Document = construction.Document with { Lets = staticValues.Declarations, BoundLets = staticValues.Values },
+ SyntaxDiagnostics = construction.SyntaxDiagnostics.Concat(staticValues.Diagnostics).ToArray()
+ };
+ }
var units = model.Body.Statements.OfType<FieldSyntax>().Where(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Units")).ToArray();
if (units.Length == 0 && model.Type.Name.Text != "Struct" || units.Any(f => FirmamentSyntaxValues.Reference(f.Value) != "mm")) return CanonicalFailure(diagnostics, CanonicalUnitsInvalid);
@@ -112,7 +119,7 @@ public static partial class FirmamentV2Parser
switch (feature.Type.Name.Text)
{
case "Hole":
- if (BindMechanicalHole(fields, diagnostics) is { } hole) holes.Add(hole);
+ if (BindMechanicalHole(fields, diagnostics, ownerName: solid.Name) is { } hole) holes.Add(hole);
break;
case "EdgeFinish":
if (BindMechanicalFinish(fields, diagnostics) is { } finish) finishes.Add(finish);
@@ -280,14 +287,14 @@ public static partial class FirmamentV2Parser
return result;
}
- private static FirmamentV2SemanticHoleDecl? BindMechanicalHole(FirmamentSyntaxFields f, List<string> diagnostics, FirmamentV2SolidBinding? compatibilityStock = null)
+ private static FirmamentV2SemanticHoleDecl? BindMechanicalHole(FirmamentSyntaxFields f, List<string> diagnostics, FirmamentV2SolidBinding? compatibilityStock = null, string? ownerName = null)
{
var d = f.Declaration;
if (d.Modifiers.Count > 0 || d.Type.Arguments.Any(a => a.Name is not null || a.Default is not null))
{ diagnostics.Add(HoleVariantUnknown); return null; }
var variantName = d.Type.Arguments.Count == 1 ? FirmamentSyntaxValues.Reference(d.Type.Arguments[0].Value) : null;
if (!Enum.TryParse<FirmamentV2SemanticHoleVariant>(variantName, compatibilityStock is not null, out var variant)) { diagnostics.Add(HoleVariantUnknown); return null; }
- var on = f.Take("On"); var axis = FirmamentSyntaxValues.Reference(on);
+ var on = f.Take("On"); var axis = MechanicalFaceAxis(on, compatibilityStock?.Name ?? ownerName);
FirmamentV2FaceTarget? face = null;
if (compatibilityStock is not null)
{
@@ -319,7 +326,8 @@ public static partial class FirmamentV2Parser
if (variant == FirmamentV2SemanticHoleVariant.Countersink) { csDiameter = Diameter("CountersinkDiameter", "Countersink");
var angle = f.Take("CountersinkAngle");
csAngle = FirmamentSyntaxValues.TryMeasure(angle, "deg", out var degrees, compatibilityStock is null ? null : "deg") ? degrees : double.NaN; }
- if (compatibilityStock is null && point is not CallSyntax { Target: ReferenceSyntax { Name.Text: "Point2" } } || !FirmamentSyntaxValues.Vector(point, "mm", out var center, compatibilityStock is null ? null : "mm") || center.Length != 2) { diagnostics.Add(CanonicalPoint2Invalid); return null; }
+ if (compatibilityStock is null && point is not (SequenceSyntax { Kind: SequenceKind.List } or CallSyntax { Target: ReferenceSyntax { Name.Text: "Point2" } })
+ || !FirmamentSyntaxValues.Vector(point, "mm", out var center, compatibilityStock is null ? null : "mm") || center.Length != 2) { diagnostics.Add(CanonicalPoint2Invalid); return null; }
if (axis is not ("+X" or "-X" or "+Y" or "-Y" or "+Z" or "-Z") || termination is null || d.Name is null) { diagnostics.Add(CanonicalModifyMalformed); return null; }
if (!(diameter > 0)) { diagnostics.Add(HoleDiameterInvalid); return null; }
if (cbDiameter is not null && (!(cbDiameter > diameter) || !(cbDepth > 0))) { diagnostics.Add(HoleCounterboreInvalid); return null; }
@@ -329,10 +337,82 @@ public static partial class FirmamentV2Parser
cbDiameter, cbDepth, csDiameter, csAngle, SourceSpan: d.Span, AuthoredFields: f.AuthoredFields);
}
+ private static string? MechanicalFinishKind(FirmamentSyntaxFields fields, List<string> diagnostics)
+ {
+ var arguments = fields.Declaration.Type.Arguments;
+ var generic = arguments.Count == 1 && arguments[0].Name is null && arguments[0].Default is null
+ ? FirmamentSyntaxValues.Reference(arguments[0].Value) : null;
+ var alias = fields.Word("Kind");
+ if (arguments.Count > 0 && generic is not ("Chamfer" or "Fillet") || generic is not null && alias is not null && generic != alias)
+ { diagnostics.Add("firmament-v2-edgefinish-variant-conflict: Use EdgeFinish<Chamfer> or EdgeFinish<Fillet>; Kind, if supplied, must agree."); return null; }
+ return generic ?? alias;
+ }
+
+ // Transport only bound value/header edits to the existing domain adapters.
+ // Reprinting an entire document would unnecessarily change legacy productions
+ // such as ProfileDelta anchors and Concept descriptor fields.
+ private static string MechanicalConstructionSource(string source, DeclarationSyntax bound, List<string> diagnostics)
+ {
+ var original = FirmamentSyntaxParser.Parse(source).Document;
+ var originalFields = FirmamentSyntaxTraversal.Statements(original).OfType<FieldSyntax>()
+ .ToDictionary(f => f.Span);
+ var changes = new List<(FirmamentV2SourceSpan Span, string Text)>();
+ void Project(DeclarationSyntax declaration)
+ {
+ if (declaration.Type.Name.Text == "Static")
+ { changes.Add((declaration.Span, "")); return; }
+ if (declaration.Type.Name.Text is "Pmi" or "Concept" or "Feature" or "Template" || declaration.Modifiers.Count > 0) return;
+ if (declaration.Type.Name.Text == "EdgeFinish" && declaration.Type.Arguments.Count > 0)
+ {
+ var fields = new FirmamentSyntaxFields(declaration, diagnostics);
+ var kind = MechanicalFinishKind(fields, diagnostics);
+ if (kind is not null && declaration.Body is not null)
+ {
+ changes.Add((declaration.Type.Span, "EdgeFinish"));
+ if (!declaration.Body.Statements.OfType<FieldSyntax>().Any(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Kind")))
+ changes.Add((new(declaration.Body.Span.Start + 1, 0), " Kind: " + kind + "; "));
+ }
+ }
+ foreach (var statement in declaration.Body?.Statements ?? [])
+ {
+ if (statement is DeclarationSyntax child) Project(child);
+ if (statement is FieldSyntax field && originalFields.TryGetValue(field.Span, out var authored)
+ && FirmamentSyntaxWriter.Expression(authored.Value) != FirmamentSyntaxWriter.Expression(field.Value))
+ changes.Add((authored.Value.Span, FirmamentSyntaxWriter.Expression(field.Value)));
+ }
+ }
+ Project(bound);
+ var patterns = bound.Body!.Statements.OfType<DeclarationSyntax>().Where(d => d.Type.Name.Text == "Pattern").ToArray();
+ if (patterns.Length > 0)
+ {
+ var bodies = bound.Body.Statements.OfType<DeclarationSyntax>().Where(IsPrimitiveDeclaration).ToArray();
+ if (bodies.Length != 1) diagnostics.Add("firmament-pattern-target-ambiguous: Model Pattern requires one material body; use Modify target.");
+ else foreach (var pattern in patterns)
+ {
+ changes.Add((new(pattern.Span.Start, 0), "Modify " + bodies[0].Name!.Text + " {\n"));
+ changes.Add((new(pattern.Span.Start + pattern.Span.Length, 0), "\n}"));
+ }
+ }
+ foreach (var (span, text) in changes.OrderByDescending(c => c.Span.Start))
+ source = source.Remove(span.Start, span.Length).Insert(span.Start, text);
+ return source;
+ }
+
+ internal static string? MechanicalFaceAxis(ExpressionSyntax? expression, string? ownerName)
+ {
+ if (expression is CallSyntax { Target: ReferenceSyntax { Name.Text: "face" or "Face" }, Arguments.Count: 1 } call
+ && call.Arguments[0].Name is null && call.Arguments[0].Default is null)
+ expression = call.Arguments[0].Value;
+ var reference = FirmamentSyntaxValues.Reference(expression);
+ if (reference is "+X" or "-X" or "+Y" or "-Y" or "+Z" or "-Z") return reference;
+ if (reference == "Top" || ownerName is not null && reference == ownerName + ".Top") return "+Z";
+ return null;
+ }
+
private static FirmamentV2EdgeFinishDecl? BindMechanicalFinish(FirmamentSyntaxFields f, List<string> diagnostics)
{
- if (f.Declaration.Type.Arguments.Count != 0) { diagnostics.Add(CanonicalModifyMalformed); return null; }
- var axis = f.Word("Face"); var target = f.Word("Target"); var kind = f.Word("Kind");
+ var kind = MechanicalFinishKind(f, diagnostics);
+ var axis = f.Word("Face"); var target = f.Word("Target");
var distance = f.Take("Distance"); var radius = f.Take("Radius");
if ((distance is not null && radius is not null) || f.Declaration.Name is null || axis is null || target is null || kind is null
|| !FirmamentSyntaxValues.TryMeasure(distance ?? radius, "mm", out var value))
@@ -412,7 +492,7 @@ public static partial class FirmamentV2Parser
case "Box" or "Cylinder" or "Cone" or "Sphere" or "Torus" or "RoundedBox" or "Frustum" or "StandardPart" or "ExactCoaxialPart":
case "Plane" or "Axis" or "Axis2" or "Point2" or "Line2" or "CubicBezier2" or "Rect2" or "Square2" or "Triangle2" or "Polygon2" or "RegularPolygon2" or "Circle2" or "Ellipse2" or "Ellipse2Guide" or "Slot2" or "RoundedRect2" or "SmoothRoundedRect2" or "Path":
case "Plateau" or "Concept" or "Struct" or "Profile" or "Span" or "Compose" or "Boss" or "Pocket" or "AddOffset" or "RemoveOffset" or "EdgeFinish" or "Extrude":
- case "Enum" or "Expose" or "Record" or "Template" or "template" or "Feature" or "ProfileDelta" or "Selection" or "InlineStep" or "Recognize" or "Replace" or "Pmi" or "Modify" or "Match" or "Require" or "Assert" or "Thread":
+ case "Enum" or "Expose" or "Record" or "Template" or "template" or "Feature" or "Pattern" or "ProfileDelta" or "Selection" or "InlineStep" or "Recognize" or "Replace" or "Pmi" or "Modify" or "Match" or "Require" or "Assert" or "Thread":
break;
case "Solid": diagnostics.Add(CanonicalConstructNotYetSupported + ":Solid"); break;
default: diagnostics.Add(CanonicalDeclarationUnrecognized); diagnostics.Add($"{CanonicalDeclarationUnknown}:{declaration.Type.Name.Text}"); break;
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
index 4949e92e..62817c1c 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/FirmamentV2Parser.cs
@@ -467,7 +467,7 @@ public static partial class FirmamentV2Parser
- var specializedBoundaries = ClosedBoundary2Authoring.Expand(source, diagnostics);
+ var specializedBoundaries = ClosedBoundary2Authoring.Expand(source, diagnostics, compileTime);
if (specializedBoundaries is null)
{
diagnostics.Add("firmament-v2-parse-failed");
@@ -1090,6 +1090,15 @@ public static partial class FirmamentV2Parser
/// </summary>
private static FirmamentV2ParseResult BindMechanicalConstruction(string source, DeclarationSyntax model, List<string> diagnostics, IReadOnlyList<ConceptIrTemplateInstantiation>? templateInstantiations)
{
+ source = MechanicalConstructionSource(source, model, diagnostics);
+ if (diagnostics.Any(IsFatalDiagnosticCode)) return CanonicalFailure(diagnostics, CanonicalDocumentMalformed);
+ // Re-index the existing AST after local source transport; semantic binding
+ // is already complete and is not delegated to another parser route.
+ var projectedSyntax = FirmamentSyntaxParser.Parse(source).Document;
+ model = model.Body!.Delimited
+ ? FirmamentSyntaxTraversal.Declarations(projectedSyntax)
+ .First(d => d.Span.Start == model.Span.Start && d.Type.Name.Text == model.Type.Name.Text && d.Name?.Text == model.Name?.Text)
+ : model with { Span = projectedSyntax.Span, Body = model.Body with { Statements = projectedSyntax.Statements, Span = projectedSyntax.Span } };
var bodySpan = model.Body!.ContentSpan;
var body = source.Substring(bodySpan.Start, bodySpan.Length);
var units = model.Body.Statements.OfType<FieldSyntax>().Where(f => FirmamentSyntaxFields.SameField(f.Name.Text, "Units")).ToArray();
diff --git a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
index 83e0191c..980eb53e 100644
--- a/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentV2/ProfileAuthoringParser.cs
@@ -38,6 +38,17 @@ public static class ProfileAuthoringParser
}
/// <summary>Resolves one named Profile without requiring an Extrude consumer.</summary>
+ internal static FirmamentV2ValidationDiagnostic? LocateDiagnostic(string source, string diagnostic)
+ {
+ var parts = diagnostic.Split(':');
+ if (parts.Length < 3 || parts[0] != SegmentEndpointMustReferenceNamedPoint) return null;
+ var syntax = FirmamentSyntaxParser.Parse(FirmamentSourceSpelling.Normalize(source)).Document;
+ var segments = FirmamentSyntaxTraversal.Declarations(syntax).Where(d => d.Type.Name.Text == "Segment" && d.Name?.Text == parts[1]).ToArray();
+ if (segments.Length != 1) return null;
+ return new(parts[0], "fatal", $"Segment '{parts[1]}' endpoint '{parts[2]}' must reference a named Point2; declare the point and use its name.")
+ { SourceSpan = segments[0].Span, Target = parts[1], Stage = "Profile binding", IsOriginalSource = true };
+ }
+
public static ResolvedProfile2D? ResolveNamedProfile(string source, string profileName, out IReadOnlyList<string> reportedDiagnostics)
=> ResolveNamedProfileCore(source, profileName, new(StringComparer.Ordinal), out reportedDiagnostics);
diff --git a/Aetheris.Kernel.Firmament/Materializer/PrismaticProfileComposition.cs b/Aetheris.Kernel.Firmament/Materializer/PrismaticProfileComposition.cs
index c1ee681f..98347168 100644
--- a/Aetheris.Kernel.Firmament/Materializer/PrismaticProfileComposition.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/PrismaticProfileComposition.cs
@@ -293,6 +293,16 @@ public static class PrismaticProfileCompositionParser
}
var syntax = FirmamentSyntaxParser.Parse(source);
+ // Low-level Profiles are ordinary operands too. Preserve their owner's
+ // endpoint/frame errors rather than replacing them with a missing-profile error.
+ foreach (var declaration in FirmamentSyntaxTraversal.Declarations(syntax.Document).Where(d => d.Type.Name.Text == "Profile" && d.Name is not null))
+ {
+ if (profiles.ContainsKey(declaration.Name!.Text)) continue;
+ var resolved = ProfileAuthoringParser.ResolveNamedProfile(source, declaration.Name.Text, out var reported);
+ diagnostics.AddRange(reported);
+ if (resolved is not null && reported.Count == 0) profiles.Add(declaration.Name.Text, resolved);
+ }
+ if (diagnostics.Count > 0) return new(null, profiles, diagnostics.Distinct(StringComparer.Ordinal).ToArray());
var compose = FirmamentSyntaxTraversal.Declarations(syntax.Document).FirstOrDefault(d => d.Type.Name.Text == "Compose");
if (compose?.Body is null || compose.Name is null) return new(null, profiles, diagnostics.Append("compose-source-missing-compose").ToArray());
if (compose.Clauses.Count > 0 || compose.Type.Arguments.Count > 0)
@@ -391,14 +401,19 @@ public static class PrismaticProfileCompositionParser
{
var name = declaration.Name?.Text ?? "";
var fields = new FirmamentSyntaxFields(declaration, diagnostics);
- var profileName = fields.Word("Profile"); var face = fields.Word("On"); var depth = fields.Number("Depth", "mm");
- fields.Take("MinimumFloorThickness");
+ var profileName = fields.Word("Profile"); var face = fields.Word("On"); var depthExpression = fields.Take("Depth");
+ var depth = FirmamentSyntaxValues.TryMeasure(depthExpression, "mm", out var measuredDepth) ? measuredDepth : double.NaN;
+ var end = fields.Word("End");
+ var minimumFloorExpression = fields.Take("MinimumFloorThickness");
+ var through = end == "ThroughAll";
+ if (end is not null && !through || through && (depthExpression is not null || minimumFloorExpression is not null))
+ { diagnostics.Add($"firmament-pocket-termination-conflict:{name}: Use End: ThroughAll alone, or Depth with a remaining floor."); continue; }
fields.Complete();
- if (profileName is null || face is null || !double.IsFinite(depth)) { diagnostics.Add($"firmament-pocket-missing-required-field:{name}:required=On,Profile,Depth"); continue; }
+ if (profileName is null || face is null || !through && !double.IsFinite(depth)) { diagnostics.Add($"firmament-pocket-missing-required-field:{name}:required=On,Profile,Depth-or-End-ThroughAll"); continue; }
var body = composeBody.Substring(declaration.Body!.Span.Start + 1, declaration.Body.Span.Length - 2);
if (!names.Add(name)) { diagnostics.Add($"compose-duplicate-operation:{name}"); continue; }
if (!profiles.TryGetValue(profileName, out var pocketProfile)) { diagnostics.Add($"firmament-pocket-invalid-profile:{name}:profile={profileName}"); continue; }
- if (!double.IsFinite(depth) || depth <= 0d) { diagnostics.Add($"firmament-pocket-depth-must-be-positive:{name}:depth={depth:R}mm"); continue; }
+ if (!through && (!double.IsFinite(depth) || depth <= 0d)) { diagnostics.Add($"firmament-pocket-depth-must-be-positive:{name}:depth={depth:R}mm"); continue; }
surfaceSpans.TryGetValue(face, out var supportSpan);
if (supportSpan is null && !IsTopSelector(face)) { diagnostics.Add($"firmament-pocket-invalid-target:{name}:On={face}:supported=Top-or-<feature>.Top-or-Span<Plane>"); continue; }
if (supportSpan is not null && !IsProfileFootprintInsideSpan(supportSpan, pocketProfile, profiles))
@@ -409,6 +424,11 @@ public static class PrismaticProfileCompositionParser
if (candidates.Count == 0) { diagnostics.Add($"feature-support-not-found:{name}:{face}:profile={profileName}:footprint-must-be-enclosed-by-support"); continue; }
if (candidates.Count > 1) { diagnostics.Add($"feature-support-ambiguous:Top:feature={name}:candidates={string.Join(",", candidates.Select(x => x.Name).Order(StringComparer.Ordinal))}"); continue; }
var selectedSupport = candidates[0];
+ if (through)
+ {
+ operations.Add(new(name, PrismaticProfileIntent.Remove, profileName, stock.From, selectedSupport.To, "ThroughCut", $"offset:{declaration.Span.Start}"));
+ continue;
+ }
var hostThickness = selectedSupport.To - selectedSupport.From; var remaining = hostThickness - depth;
var (minimumFloor, policySource) = ResolveMinimumFloor(source, body);
if (!double.IsFinite(minimumFloor) || minimumFloor <= 0d)
@@ -570,7 +590,11 @@ public static class PrismaticProfileCompositionParser
var diagnosticName = patternIdentityMatch.Success ? patternIdentityMatch.Groups["id"].Value : name;
var center = ReadFeatureField(fields, composeBody, HoleCenter, "Center"); if (!center.Success) center = ReadFeatureField(fields, composeBody, HolePoint2Center, "Center");
var diameter = ReadFeatureField(fields, composeBody, HoleDiameter, "Diameter"); var end = ReadFeatureField(fields, composeBody, HoleEnd, "End"); var role = ReadFeatureField(fields, composeBody, HoleRole, "Role");
- var counterboreDiameter = ReadFeatureField(fields, composeBody, HoleCounterboreDiameter, "CounterboreDiameter"); var counterboreDepth = ReadFeatureField(fields, composeBody, HoleCounterboreDepth, "CounterboreDepth"); var on = ReadFeatureField(fields, composeBody, HoleOn, "On");
+ var counterboreDiameter = ReadFeatureField(fields, composeBody, HoleCounterboreDiameter, "CounterboreDiameter"); var counterboreDepth = ReadFeatureField(fields, composeBody, HoleCounterboreDepth, "CounterboreDepth"); var onExpression = fields.Take("On");
+ var onName = FirmamentV2Parser.MechanicalFaceAxis(onExpression, compose.Name.Text) ?? FirmamentSyntaxValues.Reference(onExpression);
+ var on = HoleOn.Match("On: " + onName);
+ if (onExpression is not null && (!on.Success || on.Groups["face"].Value != onName))
+ diagnostics.Add($"compose-hole-support-invalid:{name}: Use a host face or an admitted Span<Plane>.");
var from = ReadFeatureField(fields, composeBody, HoleFrom, "From"); var depthEnd = ReadFeatureField(fields, composeBody, HoleDepthEnd, "End"); var termination = ReadFeatureField(fields, composeBody, HoleTermination, "Termination");
fields.Complete();
if (from.Success)
diff --git a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
index a7d0359f..f9353de8 100644
--- a/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
+++ b/Aetheris.Kernel.Firmament/Materializer/ProfileBoundaryChamfer.cs
@@ -1,3 +1,5 @@
+using Aetheris.Kernel.Firmament.FirmamentV2;
+using Aetheris.Kernel.Firmament.FirmamentV2.Syntax;
using System.Globalization;
using System.Text.RegularExpressions;
using Aetheris.Kernel.Core.Brep;
@@ -85,15 +87,17 @@ public static class ProfileBoundaryChamferSourceBinder
target = null; radius = 0d; endClearance = 0d; diagnostic = null;
var finish = EdgeFinishHeader.Matches(source).Cast<Match>().Select(match => (Match: match, Body: Block(source, match.Index + match.Length - 1))).FirstOrDefault(x => x.Body is not null && On.IsMatch(x.Body) && string.Equals(Kind.Match(x.Body).Groups["value"].Value, "Fillet", StringComparison.Ordinal));
if (finish.Body is null) { diagnostic = "ProfileBoundaryFilletBoundaryRequired"; return false; }
- var profileMode = Regex.Match(finish.Body, @"\bProfile\s*:\s*(?<mode>[^\s;}]+)", RegexOptions.CultureInvariant);
+ var fields = new FinishFields(source, finish.Match.Index, finish.Body);
+ fields.Read("Kind", Kind);
+ var profileMode = fields.Read("Profile", new Regex(@"\bProfile\s*:\s*(?<mode>[^\s;}]+)", RegexOptions.CultureInvariant));
if (profileMode.Success && profileMode.Groups["mode"].Value != "Circular")
{
diagnostic = $"ProfileBoundaryFilletProfileModeUnsupported:{profileMode.Groups["mode"].Value}:polynomial-contact-shell-required";
return false;
}
- var radiusMatch = Radius.Match(finish.Body); var clearanceMatch = EndClearance.Match(finish.Body);
+ var radiusMatch = fields.Read("Radius", Radius); var clearanceMatch = fields.Read("EndClearance", EndClearance);
if (!radiusMatch.Success || !double.TryParse(radiusMatch.Groups["value"].Value, NumberStyles.Float, CultureInfo.InvariantCulture, out radius) || !double.IsFinite(radius) || radius <= 0d) { diagnostic = "ProfileBoundaryFilletRadiusMustBePositive"; return false; }
- var targetMatch = Target.Match(finish.Body); var on = On.Match(finish.Body);
+ var targetMatch = fields.Read("Target", Target); var on = fields.Read("On", On);
if (!targetMatch.Success || !on.Success) { diagnostic = "ProfileBoundaryFilletDeclarationInvalid"; return false; }
var rawTarget = targetMatch.Groups["value"].Value;
string requestedProfile; string requestedLoop; IReadOnlyList<string> requestedSegments;
@@ -140,13 +144,14 @@ public static class ProfileBoundaryChamferSourceBinder
endClearance = clearanceMatch.Success && double.TryParse(clearanceMatch.Groups["value"].Value, NumberStyles.Float, CultureInfo.InvariantCulture, out var explicitClearance) ? explicitClearance : radius;
if (!double.IsFinite(endClearance) || endClearance <= 0d) { diagnostic = "ProfileBoundaryFilletEndClearanceMustBePositive"; return false; }
- var reflexJunctionMatch = ReflexJunction.Match(finish.Body);
+ var reflexJunctionMatch = fields.Read("ReflexJunction", ReflexJunction);
var reflexJunctionStyle = ProfileReflexJunctionStyle.ToroidalRolling;
if (reflexJunctionMatch.Success && !Enum.TryParse(reflexJunctionMatch.Groups["value"].Value, ignoreCase: false, out reflexJunctionStyle))
{
diagnostic = "ProfileBoundaryFilletReflexJunctionStyleUnsupported";
return false;
}
+ if (!fields.Complete(out diagnostic)) return false;
target = new($"edgefinish:{finish.Match.Groups["name"].Value}", hostBodyId, profile.Name, loop.Name,
orderedSegments.Select(segment => segment.Name).ToArray(), Enum.Parse<ProfileBoundaryChamferSide>(on.Groups["value"].Value),
chainKind, $"offset:{finish.Match.Index}", provenance, reflexJunctionStyle);
@@ -159,7 +164,8 @@ public static class ProfileBoundaryChamferSourceBinder
var finish = EdgeFinishHeader.Matches(source).Cast<Match>().Select(match => (Match: match, Body: Block(source, match.Index + match.Length - 1))).FirstOrDefault(x => x.Body is not null && On.IsMatch(x.Body));
if (finish.Body is null) { diagnostic = "ProfileBoundaryChamferBoundaryRequired"; return false; }
var name = finish.Match.Groups["name"].Value;
- var targetMatch = Target.Match(finish.Body); var on = On.Match(finish.Body); var kind = Kind.Match(finish.Body); var amount = Distance.Match(finish.Body);
+ var fields = new FinishFields(source, finish.Match.Index, finish.Body);
+ var targetMatch = fields.Read("Target", Target); var on = fields.Read("On", On); var kind = fields.Read("Kind", Kind); var amount = fields.Read("Distance", Distance);
if (!targetMatch.Success || !on.Success || !kind.Success) { diagnostic = "ProfileBoundaryChamferDeclarationInvalid"; return false; }
if (string.Equals(kind.Groups["value"].Value, "Fillet", StringComparison.Ordinal))
{
@@ -206,11 +212,41 @@ public static class ProfileBoundaryChamferSourceBinder
if (chainKind == ProfileBoundaryChamferChainKind.OpenConnectedChain && closed) { diagnostic = "ProfileBoundaryChamferSelectionMustBeOpen"; return false; }
if (closed) chainKind = ProfileBoundaryChamferChainKind.ClosedLoop;
else if (ordered.Count == 1) chainKind = ProfileBoundaryChamferChainKind.SingleSegment;
+ if (!fields.Complete(out diagnostic)) return false;
target = new($"edgefinish:{name}", hostBodyId, profile.Name, loop, ordered.Select(index => resolvedLoop.Segments[index].Name).ToArray(),
Enum.Parse<ProfileBoundaryChamferSide>(on.Groups["value"].Value), chainKind, $"offset:{finish.Match.Index}", provenance);
return true;
}
+ private sealed class FinishFields
+ {
+ private readonly List<string> diagnostics = [];
+ private readonly FirmamentSyntaxFields? fields;
+ private readonly string body;
+ internal FinishFields(string source, int start, string body)
+ {
+ this.body = body;
+ var declaration = FirmamentSyntaxTraversal.Declarations(FirmamentSyntaxParser.Parse(source).Document)
+ .FirstOrDefault(d => d.Type.Name.Text == "EdgeFinish" && d.Span.Start == start);
+ if (declaration is not null)
+ {
+ fields = new(declaration, diagnostics);
+ fields.Take("PatternIdentity"); // Compiler-owned finite expansion receipt.
+ }
+ }
+ internal Match Read(string name, Regex reader)
+ {
+ fields?.Take(name);
+ return reader.Match(body);
+ }
+ internal bool Complete(out string? diagnostic)
+ {
+ fields?.Complete();
+ diagnostic = fields is null ? "ProfileBoundaryEdgeFinishDeclarationInvalid" : diagnostics.FirstOrDefault();
+ return diagnostic is null;
+ }
+ }
+
private static int IndexOf(ResolvedProfileLoop2D loop, string name) => loop.Segments.Select((segment, index) => (segment, index)).Where(x => x.segment.Name == name).Select(x => x.index).DefaultIfEmpty(-1).Single();
private static IReadOnlyList<int>? NormalizeConnectedOrder(ResolvedProfileLoop2D loop, IReadOnlyList<int> indices, out bool closed)
{
diff --git a/docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md b/docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md
index 36018159..78f37922 100644
--- a/docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md
+++ b/docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md
@@ -1,5 +1,7 @@
# October 2026 Firmament language decision register
+X4 authoring retest amendment (2026-10-15): [repairs and final qualification](../release/FIRMAMENT-FRONTEND-X4.md) close all 32 checks in Claude's current corpus. The decisions at the end of this register supersede only their qualified portions of the historical dispositions below.
+
X2 production binding amendment (2026-10-15):
[current semantic migration report](../release/FIRMAMENT-FRONTEND-X2.md) migrates
Feature definitions/calls, private construction renaming and defaults to lexical
@@ -312,3 +314,38 @@ are deferred to the remaining typed module contract, without implicit capture.
Recommendations 3, 4, 8, 15, 19, 22 and 23 advance. The full X2 domain/value/source-map
migration is still open; no new parser route, geometry engine or runtime module
system is introduced. Qualification is recorded in the Inventory release report.
+
+## FrontendX4 retest decisions (2026-10-15)
+
+- #19 / a01: `Static name = expression` is the Model-local compile-time value spelling, with optional scalar type inference. Model `let` is not a new alias; Feature-local `let` retains its existing meaning. Update the design specimen to `Static thickness = 6mm`; its geometry oracle is unchanged.
+- #20 / f02, f04, g01: admit `Polygon2 Name { points: [[x, y], ...] }` as the inline form of the existing explicit boundary. Coordinates use typed Length expressions; winding, duplicate, intersection and area checks remain owned by the explicit-polygon lowerer. Named `vertices: Set<Point2>` stays supported. No general inline Segment endpoint syntax is added; f03 remains a located rejection.
+
+- #10: planar Hole centers and `Set<Point2>` entries accept `[x, y]` as well as `Point2(x, y)`. Both retain Length checks and the shared numeric evaluator. Spatial Point3/Grid values retain their frame checks.
+- #11: `EdgeFinish<Chamfer>` and `<Fillet>` select the existing variant, with `Kind` retained as a compatibility alias. Conflicting variants reject. Profile finish fields close through the existing AST field-consumption owner; extra misspelled fields cannot disappear.
+- #12 / #15: a Model/Struct-level Pattern targets exactly one material body. Multiple candidate bodies require an explicit Modify. Source/Grid Patterns and Set/Feature Patterns keep their respective finite binders; generated features enter the target's Modify scope.
+- #13: `Pocket { end: ThroughAll }` lowers to the existing Remove/ThroughCut operation, from stock bottom to selected top support. Explicit depth or floor policy conflicts with ThroughAll; an accidentally through-depth Pocket still rejects. No kernel capability is added.
+- #21: `+Z`, `face(+Z)`, `Top`, and the active host's `.Top` share planar support binding; spelling alone cannot select Concept point interpretation.
+- #4 / #24: the combined Fillet + Hole capability remains rejected, with its explanatory message and original EdgeFinish location. Inline Segment endpoints remain rejected at their Segment declarations. Causal profile errors precede and replace derivative missing-operand noise.
+
+The a01 reference and chimera already use `Static`, so only its design specimen
+changes. Other specimens, references and recorded geometry remain unchanged.
+The [X4 qualification report](../release/FIRMAMENT-FRONTEND-X4.md) records the
+measured outcomes; these amendments supersede earlier deferrals only within
+the cases and boundaries qualified there. They do not close every expression,
+expansion-provenance or domain limitation tracked by the original 24 items.
+
+
+## Engineering follow-up: Fillet + Hole (2026-10-15)
+
+The user explicitly authorized the capability after X4. Recommendation #24 is
+**partially implemented in a separate geometry feature**, not a new language
+restriction or another parser milestone. One Box top `Boundary` Fillet can now
+coexist with disjoint top ThroughAll shaft/counterbore holes. The same bounded
+builder handles finish-only top-boundary fillets. Four exact cylindrical blends
+join on elliptical direct-intersection seams; vertical corners remain sharp.
+Original d05 source is retained and becomes a positive capability specimen.
+Intersections, tangencies, other combined selectors, blind holes, countersinks,
+Regions, mixed finishes and general feature chains remain explicit limitations.
+Shell and unrelated geometry work from #24 is still deferred. This supersedes
+the d05 rejection disposition above only for the newly qualified combination.
+See [qualification and upstream reconciliation](../release/FIRMAMENT-FILLET-HOLE.md).
diff --git a/docs/public/firmament/boundaries.md b/docs/public/firmament/boundaries.md
index ebbe7838..e75b0f6e 100644
--- a/docs/public/firmament/boundaries.md
+++ b/docs/public/firmament/boundaries.md
@@ -55,7 +55,7 @@ Polygon2<Rhombus> Diamond { center: [0mm,0mm] diagonals: [50mm,32mm] }
Polygon2<Parallelogram> Leaning { center: [0mm,0mm] base: 40mm height: 24mm shear: 10mm }
Polygon2<Trapezoid> Tapered { center: [0mm,0mm] bottomWidth: 44mm topWidth: 28mm height: 24mm }
Static vertices: Set<Point2> { A => Point2(0mm,0mm) B => Point2(30mm,0mm) C => Point2(20mm,20mm) D => Point2(0mm,15mm) }
-Polygon2<Explicit> Outline { vertices: Vertices }
+Polygon2<Explicit> Outline { vertices: vertices }
RegularPolygon2<6> Hex { center: [0mm,0mm] acrossFlats: 32mm rotation: 30deg }
```
@@ -93,3 +93,11 @@ The fixed corner law is polynomial, inspired by a fourth-power superellipse; it
The existing Profile binder owns the resolved curves, and ordinary extrusion and SectionChain consume them as polynomial B-splines. No guide body is exported. [The SectionChain witness](../../../fixtures/Canonical/SectionChain/smooth-corner-sections.firmament) checks realized surface position, normals, and geometric curvature at every span and section join. Its straight extrusion has G2 side joins; its planar caps meet the sides with sharp edges. General `Continuity: G2` surface construction and plateau-to-body support matching remain separate work.
Use a smooth boundary as the footprint of a [G2 planar plateau](plateaus.md) to blend a raised region into a planar base.
+
+`Polygon2 outline { points: [[0mm, 0mm], [30mm, 0mm], [20mm, 20mm], [0mm, 15mm]] }`
+is the inline explicit form. Both `Point2(x, y)` and `[x, y]` entries use Length
+expressions, including scoped Static arithmetic. Inline vertex identities are
+`Vertex0`, `Vertex1`, and so on; use a named Set when names must survive a reorder.
+The duplicate, area, self-intersection and explicit-rotation checks are shared.
+A Revolve may name this closed polygon directly as its `profile`; it is converted
+to the same closed Profile before the existing revolve binder runs.
diff --git a/docs/public/firmament/geometry.md b/docs/public/firmament/geometry.md
index feed51ad..33d71dbf 100644
--- a/docs/public/firmament/geometry.md
+++ b/docs/public/firmament/geometry.md
@@ -70,7 +70,7 @@ Model BossPlate {
## Pocket
-`Pocket` is the first-class finite profile feature for accessible prismatic removal from the active Compose body's top support. It deliberately leaves a floor:
+`Pocket` removes a profile from the active Compose body's top support. Its `depth` form deliberately leaves a floor:
```firmament
Compose Body {
@@ -86,6 +86,13 @@ Compose Body {
Preview 3 admits only `On: Top` / `+Z`, an enclosed admitted line/arc profile, and a positive finite `Depth`. The compiler derives `hostThickness` from the unique Base interval and calculates `remainingFloor = hostThickness - Depth`. `Depth == hostThickness`, greater depth, and tolerance-close through depth fail as `firmament-pocket-through-depth`; a positive remaining floor below policy fails as `firmament-pocket-minimum-floor-thickness`. Diagnostics include feature, host, requested depth, host thickness, remaining floor, and required floor.
+For a through cut, use `Pocket cable { on: Top; profile: cableProfile; end: ThroughAll }`.
+This lowers to the existing `Remove` operation with `role: ThroughCut` across the
+stock interval to the selected top support. Omit `depth` and
+`minimumFloorThickness`; mixing termination policies is an error. A `depth`
+that accidentally reaches through remains an error and never changes into a
+through cut automatically.
+
Minimum-floor precedence is:
1. `MinimumFloorThickness` on the Pocket;
@@ -93,7 +100,7 @@ Minimum-floor precedence is:
3. the existing template `minimumWallThickness` concept;
4. the documented Preview 3 bounded default of `1mm`.
-Every supplied policy value must be positive and finite. Pocket retains a stable `pocket:<host>.<name>` identity and lowers through the existing section-stack `Remove` operation. It is intentionally not arbitrary solid subtraction and never means through-all. Use semantic `Hole`, `Slot`, or another documented opening feature for through removal.
+Every supplied policy value must be positive and finite. Pocket retains a stable `pocket:<host>.<name>` identity and lowers through the existing section-stack `Remove` operation. A depth-based Pocket must retain its floor; explicit `end: ThroughAll` selects the admitted through-cut operation. This is not arbitrary solid subtraction.
### Complete rectangular Pocket source
@@ -137,6 +144,39 @@ For geometry that already exposes named spans, prefer the finite [Profile pipeli
Sheet Metal has its own `Hole Name` syntax for planar circular openings; countersink and counterbore forms are Model-domain features and deliberately fail in Sheet Metal rather than being ignored.
+## Box top fillet with holes
+
+```firmament
+Model Mount {
+ units: mm
+ Box Body { size: [60mm, 40mm, 10mm] }
+ Modify Body {
+ Hole<Shaft> Bore { on: +Z; center: [0mm, 0mm]; diameter: 8mm; end: ThroughAll }
+ EdgeFinish<Fillet> TopEdge { face: +Z; target: Boundary; radius: 1mm }
+ }
+}
+```
+
+This constructs the four top-edge cylindrical fillets and the through hole in
+one enclosed body. The cylinders meet at exact elliptical corner seams, matching
+the existing direct-intersection two-edge fillet construction. The vertical
+corners stay sharp; this does not request a spherical whole-box corner blend.
+The stock remains centered in XY with its bottom at Z=0.
+
+The same finish works without holes. With holes, the bounded combination admits
+one Box, one Modify, one complete `+Z` `Boundary` finish and top `ThroughAll`
+shaft/counterbore holes. No Region operations participate. For finish size `r`,
+the entry circle must satisfy `abs(x) + entryRadius < width/2 - r` and
+`abs(y) + entryRadius < depth/2 - r`, with kernel tolerance applied. A counterbore
+uses its larger entry radius. Hole entry circles must also be mutually disjoint.
+Touching or overlapping requests fail; neither the hole nor the finish is dropped.
+The radius must be positive, smaller than the height, and smaller than half the
+width and depth. Other combined selectors, blind holes, countersinks, mixed
+finishes and hole/fillet intersections remain outside this qualified combination.
+
+The [shaft/counterbore witness](../../../fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament)
+uses the ordinary authoring and AP242 paths. Explicit supported PMI is retained.
+
## Intentional Boolean boundary
Sphere remains a supported standalone analytic solid. Pocket is a supported finite prismatic profile feature. Subtracting a Sphere from a block, a hemispherical arbitrary cavity, public `Union` / `Subtract` / `Intersect`, and general CSG trees are not Preview 3 Firmament features. A future `SphericalSeat`, `Dish`, or tool-profile feature would require an engineering contract; geometric possibility alone is not one.
diff --git a/docs/public/firmament/syntax.md b/docs/public/firmament/syntax.md
index 879cd3e8..35578f9d 100644
--- a/docs/public/firmament/syntax.md
+++ b/docs/public/firmament/syntax.md
@@ -143,10 +143,12 @@ angles also admit `rad`; this does not make radians a universal alias in every
Angle field. Mixed degree/radian arithmetic requires an explicit owning-domain
conversion rather than silently adding the raw numbers.
-Points and lists overlap without being universal aliases. The direct Hole above
-requires `Point2(...)`; a Rect2's `center` accepts `[x, y]`. A semantic Grid may
-publish Point3 values in its own frame. Use the field owner's documented type
-and spelling rather than replacing all point forms mechanically.
+Planar point fields such as a Hole's or Rect2's `center` accept both
+`Point2(x, y)` and `[x, y]`, with Length coordinates. `Set<Point2>` entries
+accept both forms and typed scalar arithmetic. A semantic Grid publishes
+Point3 values in its own frame; these retain their spatial placement checks.
+For a direct Hole on its host's top plane, `+Z`, `face(+Z)`, `Top` and
+`host.Top` identify the same support. An unrelated body name is not an alias.
Arithmetic is available in admitted value positions, with dimensional checks.
Expression support is not uniform across every field, Template argument and
@@ -422,8 +424,12 @@ a material Profile must satisfy its boundary rules.
Closed boundaries should express their engineering shape. Use Rect2 for a
rectangle, Triangle2 for a triangle, or a named Polygon2 variant. Current Polygon2
variants include `Rhombus`, `Parallelogram`, `Trapezoid` and `Explicit`. Explicit
-references a named point set; it does not introduce inline arbitrary vertex-array
-syntax. `RegularPolygon2<N>` uses a bounded vertex count. These are built-in
+references a named point set with `vertices: points`. The inline equivalent is
+`Polygon2 outline { points: [[0mm, 0mm], [40mm, 0mm], [0mm, 20mm]] }`.
+Each coordinate can use typed Static arithmetic. Both forms check winding,
+duplicate points, self-intersection and nonzero area; neither accepts a nonzero
+`rotation`. Segment endpoints still reference named Point2 declarations.
+`RegularPolygon2<N>` uses a bounded vertex count. These are built-in
shape parameters, not user-extensible generic types.
| 2D construction family | Main fields / meaning |
@@ -481,13 +487,18 @@ or feature combinations.
| Drill a hole | `Hole<Shaft>`, `Hole<Counterbore>`, `Hole<Countersink>` | `on`, `center`, `end: ThroughAll` or a bounded blind end. |
| Add a profile boss | `Boss` in profile-based Compose | Top support, a Profile and positive `height`. |
| Remove a finite-depth recess | `Pocket` in profile-based Compose | Profile and positive `depth`; must leave the admitted floor. |
-| Cut through a profile-based body | Admitted `Remove` with `Role: ThroughCut` | Use the through-cut form rather than a through-depth Pocket. |
+| Cut through a profile-based body | `Pocket` with `end: ThroughAll`, or `Remove` with `role: ThroughCut` | Through-Pocket selects its top support and lowers to the same through-cut operation; omit `depth` and floor policy. |
| Make a capsule slot | `Slot<Capsule>` in its admitted composition | `length`, `width`, `direction`, `extent` and `role`. |
-| Finish selected edges | `EdgeFinish` with `kind: Chamfer` or `kind: Fillet` | Selector and capability depend on the target body. |
-
-For a primitive boundary chamfer, the selector is `face: +Z` plus
-`target: Boundary`; a profile-composed finish names its Profile boundary and
-support instead. `EdgeFinish<Chamfer>` is not the direct primitive spelling.
+| Finish selected edges | `EdgeFinish<Chamfer>` or `EdgeFinish<Fillet>` | `kind: Chamfer` / `kind: Fillet` remains an alias; if both are supplied they must agree. Selector and capability depend on the target body. |
+
+For a Box top-boundary chamfer or fillet, the selector is `face: +Z` plus
+`target: Boundary`. A fillet uses `radius`; a chamfer uses `distance`.
+One such finish can coexist with disjoint top `ThroughAll` shaft or counterbore
+holes in the same Modify. The hole entry circles must stay strictly inside the
+inset top face. Fillets retain sharp vertical stock corners and join their four
+cylindrical blends on exact elliptical seams; this is not a whole-box rounding.
+A profile-composed finish names its Profile boundary and support instead.
+The generic variant has the same capability checks as `kind`.
A bare `Fillet corners { ... }` is not an alternative EdgeFinish declaration.
Read the [feature support and examples](geometry.md) before combining operations.
@@ -571,7 +582,12 @@ Model MountingPlate {
}
```
-The Pattern belongs **inside the target Modify**, not at the root of this file.
+A Pattern may be inside its target `Modify`, or directly inside a Model/Struct
+with exactly one material body. The latter form targets that body; ambiguous
+material ownership requires an explicit `Modify`. Scalar `Static` values may
+be declared in the module or Model scope and used in Compose intervals as well
+as primitive dimensions. Use `Static` for Model-local values; `let` remains a
+Feature-local derivation.
Each Set entry has a unique stable name; equal values are allowed and source
order is authoritative. `mountPoints.left` selects that value. An empty typed
Set yields zero mapped instances. Arrays provide anonymous ordered data; Sets
diff --git a/docs/public/reference/diagnostics.md b/docs/public/reference/diagnostics.md
index 0f0546e3..bbd43465 100644
--- a/docs/public/reference/diagnostics.md
+++ b/docs/public/reference/diagnostics.md
@@ -2,7 +2,7 @@
Generic V2 build/validation errors use structured objects with `code`, `severity`, `message`, `sourceFile`, optional `sourceSpan`, `line`, `column`, and `locationNote`. The existing `fatal` spelling means an error that prevents admission; `warning` remains nonfatal. Parser route metadata is for debugging. An enclosing-declaration span is explicitly labelled when the legacy producer supplied no precise original-source provenance. Monaco consumes the same compiler presentation. Specialized domain commands are not yet all migrated to this representation.
-Unknown canonical statements and Box fields are errors. `profile-layout-placement-unsupported` rejects unsupported Concept Struct layout planes instead of substituting XY. Use a traced Construction Plane for supported oriented profile workflows. `SemanticSourceNotFound` preserves the missing source and the provenance explanation. A through-depth Pocket diagnostic points to `Remove` with `Role: ThroughCut`; X0 does not add through-Pocket or combined Fillet/Hole capabilities.
+Unknown canonical statements and Box fields are errors. `profile-layout-placement-unsupported` rejects unsupported Concept Struct layout planes instead of substituting XY. Use a traced Construction Plane for supported oriented profile workflows. `SemanticSourceNotFound` preserves the missing source and the provenance explanation. An accidental through-depth Pocket fails; explicit `end: ThroughAll` selects the admitted through cut. Box top-boundary Fillet with disjoint ThroughAll shaft/counterbore holes is supported; `CombinedFeatureInteractionUnsupported` identifies a hole touching the finish band or another hole. Unsupported combined selectors retain `CombinedFeatureSelectionLost` at the EdgeFinish declaration.
## Circular Sweep (X0)
diff --git a/docs/public/reference/supported-features.md b/docs/public/reference/supported-features.md
index 7a79caaf..eb79c9f8 100644
--- a/docs/public/reference/supported-features.md
+++ b/docs/public/reference/supported-features.md
@@ -5,6 +5,7 @@
| Area | Status | Preview 3 boundary |
|---|---|---|
| Firmament V2 native primitives/profiles | Bounded | Named Box/Cylinder/Frustum/RoundedBox and admitted line/arc profile construction/composition |
+| Box top-boundary finish with holes | Bounded | One complete +Z Boundary Chamfer or constant-radius Fillet with disjoint ThroughAll shaft/counterbore holes; exact cylindrical fillets and elliptical corner seams. Intersecting holes/finish bands, other combined selectors and general feature chains remain unsupported. See [geometry](../firmament/geometry.md#box-top-fillet-with-holes). |
| Gear Standard Library | Supported / bounded by family | Supported external/internal standard involute spur gears; bounded straight bevel/miter and ratchet/pawl; typed `Interface<Gear>` compatibility and ideal ratios; deterministic manifold AP242. No contact, dynamics, ratings, helical/worm, spiral-bevel, or qualified hub/keyway geometry. See the [gear guide](../firmament/gears.md). |
| Assembly Interface bundles and Subassemblies | Supported / bounded | Compiler-owned `Fixed`, `Axial`, and `Revolute` expansion; explicit `Custom` atomic bundles; compile-time relative `Include`; reusable nested definitions; private-by-default internals; exposed semantic ports that preserve type, including Gear; stable hierarchical paths and dependency hashes. Include aliases are deferred. See [assemblies](../firmament/assemblies.md). |
| Scene spatial composition | Supported / bounded | Metre/mm coordinates; rectangular Room boundaries; Door/Window apertures; independent AssemblyFile and typed Part occurrences; keyed patterns; retained definition reuse; cameras and appearances; USD/GLB. No Scene mechanical relationships, nested Scenes, whole-scene STEP or BIM. See [scenes](../firmament/scenes.md). |
@@ -42,7 +43,7 @@
| Linux/macOS release binaries | Not in Preview 3 | Framework logic tests do not constitute binary qualification |
| Post-Preview-3 feature families | X0 exception | Circular Sweep, WIRE-X0 Formed Wire, and Standard Products Paperclip are bounded X0 additions; other new geometry/PMI/FEA/Forge families remain frozen |
| General smooth/rail/topology-changing loft and freeform surface features | Not in Preview 3 | The bounded two-section lofts, G1 SectionChains, and WireForm `Helix` do not qualify arbitrary smooth loft, guide rails, topology-changing correspondence, arbitrary dumb-solid editing, G2 continuity, or surface networks. |
-| Through profile removal | Bounded semantic operations | Use qualified `Hole`, `Slot`, or another documented opening feature; Pocket never means through-all |
+| Through profile removal | Bounded semantic operations | Use qualified `Hole`, `Slot`, explicit `Pocket { end: ThroughAll }`, or `Remove` with `role: ThroughCut`; depth-based Pocket must leave its admitted floor |
| Arbitrary solid Boolean subtraction / hemispherical cavity | Not in Preview 3 | No public `Union`, `Subtract`, `Intersect`, CSG tree, Sphere-from-Block subtraction, or hemisphere special case |
## Template capability matrix
diff --git a/docs/release/FIRMAMENT-FILLET-HOLE.evidence.json b/docs/release/FIRMAMENT-FILLET-HOLE.evidence.json
new file mode 100644
index 00000000..36c4204a
--- /dev/null
+++ b/docs/release/FIRMAMENT-FILLET-HOLE.evidence.json
@@ -0,0 +1,484 @@
+{
+ "scope": "Box complete +Z Boundary Fillet with disjoint ThroughAll shaft/counterbore holes; finish-only shares the builder",
+ "verdict": "Success within the stated engineering boundary",
+ "date": "2026-10-15 America/Los_Angeles",
+ "upstream": {
+ "before": "7525f37f",
+ "after": "1585f637a381f668b82ea153172c6f3d1249bd80",
+ "originMaster": "1585f637a381f668b82ea153172c6f3d1249bd80",
+ "strategy": "fast-forward",
+ "contentConflicts": 0,
+ "localChangesRetained": true,
+ "committed": false,
+ "pushed": false
+ },
+ "qualification": {
+ "releaseBuild": "Passed",
+ "coreFastPassed": 1076,
+ "focusedFrontendPassed": 92,
+ "focusedCliPassed": 13,
+ "fullSolution": {
+ "assemblies": 20,
+ "totals": {
+ "failed": 0,
+ "passed": 5140,
+ "skipped": 0,
+ "total": 5140
+ }
+ },
+ "authoringCorpus": {
+ "passed": 32,
+ "total": 32,
+ "changedManifestCases": [
+ "d05"
+ ],
+ "d05SourceUnchanged": true,
+ "otherGeometryGoldensUnchanged": true
+ },
+ "sdkLanguageTransport": {
+ "passed": 3,
+ "failed": 0,
+ "liveBrowserExecution": false
+ },
+ "runtimeHostsAfter": [],
+ "diffCheck": "Passed"
+ },
+ "normalCli": {
+ "gitHead": "1585f637a381f668b82ea153172c6f3d1249bd80",
+ "positiveCases": [
+ {
+ "source": "fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament",
+ "sourceSha256": "de61ee6716ff2805f9358a65bb3dd64a9b13c000f4354301d69813682dd36c1f",
+ "stepSha256": "7896bd08f1584d9647c3d914de49797cb988700b7df2d3ddb563b903f88d69dc",
+ "faces": 11,
+ "edges": 23,
+ "vertices": 14,
+ "planes": 6,
+ "cylinders": 5,
+ "ellipses": 4,
+ "bbox": {
+ "min": {
+ "x": -30,
+ "y": -20,
+ "z": 0
+ },
+ "max": {
+ "x": 30,
+ "y": 20,
+ "z": 10
+ }
+ },
+ "analyticVolume": 23454.80828946461,
+ "numericalVolume": 23460.317970712236,
+ "massEvaluationMethod": "DeterministicTrimmedFaceTriangulationBoundaryIntegral",
+ "massStatus": "NumericalWithBound",
+ "massErrorBound": 2746.011024431587,
+ "importQualification": "Qualified",
+ "pcurveMaximumDeviation": 3.6123509517291385e-07
+ },
+ {
+ "source": "fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament",
+ "sourceSha256": "223b8743879c82d624b86a15847d9a80140030d0ab863445a6099382e2e7359b",
+ "stepSha256": "3b12afac6ce78a114bc4074c7694201f2f0dc4dcbc876b27aae8e0d6f6a721ee",
+ "faces": 14,
+ "edges": 29,
+ "vertices": 18,
+ "planes": 7,
+ "cylinders": 7,
+ "ellipses": 4,
+ "bbox": {
+ "min": {
+ "x": -30,
+ "y": -20,
+ "z": 0
+ },
+ "max": {
+ "x": 30,
+ "y": 20,
+ "z": 10
+ }
+ },
+ "analyticVolume": 23435.95873354307,
+ "numericalVolume": 23441.682999464858,
+ "massEvaluationMethod": "DeterministicTrimmedFaceTriangulationBoundaryIntegral",
+ "massStatus": "NumericalWithBound",
+ "massErrorBound": 2793.5626591805394,
+ "importQualification": "Qualified",
+ "pcurveMaximumDeviation": 3.6123509517291385e-07
+ },
+ {
+ "source": "fixtures/Regression/FrontendX0/combined-fillet-hole.firmament",
+ "sourceSha256": "a6a99c8be86b88286b441ce0387867dba42b4d85289e35c7848cb74a6ab0aab4",
+ "stepSha256": "e6e3e88ac0cac14df250b54d6294bffbe551aff4ac676a3413bbc4bd3ba9fd46",
+ "faces": 11,
+ "edges": 23,
+ "vertices": 14,
+ "planes": 6,
+ "cylinders": 5,
+ "ellipses": 4,
+ "bbox": {
+ "min": {
+ "x": -20,
+ "y": -10,
+ "z": 0
+ },
+ "max": {
+ "x": 20,
+ "y": 10,
+ "z": 6
+ }
+ },
+ "analyticVolume": 4699.233037281026,
+ "numericalVolume": 4699.965260845049,
+ "massEvaluationMethod": "DeterministicTrimmedFaceTriangulationBoundaryIntegral",
+ "massStatus": "NumericalWithBound",
+ "massErrorBound": 927.3585646053124,
+ "importQualification": "Qualified",
+ "pcurveMaximumDeviation": 3.612350951705584e-07
+ }
+ ],
+ "negativeCase": {
+ "source": "fixtures/Regression/FrontendX0/combined-fillet-hole-intersection.firmament",
+ "validateExit": 1,
+ "buildExit": 1,
+ "code": "CombinedFeatureInteractionUnsupported",
+ "line": 6,
+ "artifactAbsent": true
+ }
+ },
+ "showcaseGeometryParity": [
+ {
+ "source": "fixtures/Canonical/Symmetry/radial-bolt-circle.firmament",
+ "sourceSha256": "19DAA47DC20CA092A6DDA1CC49AF0B74E7E016F5E4A143AA4C00B7230B81C3CE",
+ "expectedSha256": "4B4F8FD69D10E73BB403F1538C6FC13995F895E4C1C17E0605A3E4A008E5356E",
+ "actualSha256": "4B4F8FD69D10E73BB403F1538C6FC13995F895E4C1C17E0605A3E4A008E5356E",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 829.5063
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/partial-radial-pattern.firmament",
+ "sourceSha256": "258427029AA0882653801833109AD9FE04542C7448DE1D126291215FC016DE7D",
+ "expectedSha256": "7D708B30209B6A03010D9C647F762E453C705BC8F656882BE4F18785B2F08D87",
+ "actualSha256": "7D708B30209B6A03010D9C647F762E453C705BC8F656882BE4F18785B2F08D87",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 857.3559
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-revolve.firmament",
+ "sourceSha256": "B955033028F838A3A3D7D265BD4EB04A9AAD89E83D95D5EA1C640ECB0953FA6C",
+ "expectedSha256": "C44AE2A5B6CFC978AFB24041F0B5C43A4554161FE5880FC6E2D59ADB1B7CAB4A",
+ "actualSha256": "C44AE2A5B6CFC978AFB24041F0B5C43A4554161FE5880FC6E2D59ADB1B7CAB4A",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 543.8599
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-profile.firmament",
+ "sourceSha256": "1F41E7EBE426306205E01226C36410261798418C385E5E284BD0A4216CAF98BF",
+ "expectedSha256": "30D1F927A7295A5B553453BA2D6E936564140839E4497B0C5B46A1682A18F6A1",
+ "actualSha256": "30D1F927A7295A5B553453BA2D6E936564140839E4497B0C5B46A1682A18F6A1",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 477.8405
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-hole.firmament",
+ "sourceSha256": "39B62FB47C0C42BDF7CD3DE7FCA2E78E785BCD693412FC052628F470F3261EB0",
+ "expectedSha256": "4A0DA2E67DA153B38DD7E6389CB329B4BBB6939FEC88541936DF705F49BE62FE",
+ "actualSha256": "4A0DA2E67DA153B38DD7E6389CB329B4BBB6939FEC88541936DF705F49BE62FE",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 648.1466
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-feature-with-override.firmament",
+ "sourceSha256": "DEBDCE6974743DCBCED725B9FF6B8ED833EF64DBE69A4B94256515E6CDF24B4E",
+ "expectedSha256": "052F9FC96919130FA11D2FDE5BEF302BCBE42BA6441A61F7164D43E25EAF8FBB",
+ "actualSha256": "052F9FC96919130FA11D2FDE5BEF302BCBE42BA6441A61F7164D43E25EAF8FBB",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 639.2726
+ },
+ {
+ "source": "fixtures/Regression/FrontendMigration/preferred-profile-links.firmament",
+ "sourceSha256": "41ACDC508CDB714BC0409C864708FD968BB812A83E4FD406B7AA0818670C6C4B",
+ "expectedSha256": "E43449262ECDD3DD05EFB73DB821D2E09226637EC1FB1EAF73E07821CD46AA57",
+ "actualSha256": "E43449262ECDD3DD05EFB73DB821D2E09226637EC1FB1EAF73E07821CD46AA57",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 415.1094
+ },
+ {
+ "source": "fixtures/Canonical/Features/Holes/through-hole.firmament",
+ "sourceSha256": "38E8188DB1BB7C75406570BBCEC9A09DAFA9D4D33A0EDEB746A6C04A973B265C",
+ "expectedSha256": "5999F127E5A1477E5825AFA656DCEB7F89241D8F85312B0E6BCD793639A0F548",
+ "actualSha256": "5999F127E5A1477E5825AFA656DCEB7F89241D8F85312B0E6BCD793639A0F548",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 577.4685
+ },
+ {
+ "source": "fixtures/Canonical/Templates/generic-mounting-plate.firmament",
+ "sourceSha256": "91B69697F5E777438F688FA2D1F0330FEF5C430D064FCA0A7FFF886252567C92",
+ "expectedSha256": "B0FF1D05D82135A3630C5E165C09B6C2C467B3FAF98A0825A9AF86B2E1CE76A3",
+ "actualSha256": "B0FF1D05D82135A3630C5E165C09B6C2C467B3FAF98A0825A9AF86B2E1CE76A3",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 642.4878
+ },
+ {
+ "source": "fixtures/Canonical/Set/pattern-feature-map.firmament",
+ "sourceSha256": "7BF1BA1E508CAE2548EC429724A895F2E50FFDAD057084F17B506C4362A34E40",
+ "expectedSha256": "08D4EA1F1336C06A380E30806C02AEE3F08535CAD1592929470EBD64B9882FC2",
+ "actualSha256": "08D4EA1F1336C06A380E30806C02AEE3F08535CAD1592929470EBD64B9882FC2",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 642.7746
+ },
+ {
+ "source": "fixtures/Canonical/PMI/hole-diameter-and-datum.firmament",
+ "sourceSha256": "B105A5535F53189938CBA6C9E8644FC9D8C6683F8BB97B04167FA48C411ABBFD",
+ "expectedSha256": "9F2F24975267BF425D16A2ECDF863F4A94C0FAD172C932F9868BBB836BD46F5D",
+ "actualSha256": "9F2F24975267BF425D16A2ECDF863F4A94C0FAD172C932F9868BBB836BD46F5D",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 587.0204
+ },
+ {
+ "source": "fixtures/Canonical/PMI/typed-tolerance.firmament",
+ "sourceSha256": "7C928F862D443904E87EAD137DB7D55E4D69E03A12F918F3319ECED947245EC9",
+ "expectedSha256": "098B515124D46220AAB85F6DBE1568E6B5969FEB55B537BA91AD3DDA587509A5",
+ "actualSha256": "098B515124D46220AAB85F6DBE1568E6B5969FEB55B537BA91AD3DDA587509A5",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 618.4675
+ },
+ {
+ "source": "fixtures/Canonical/PMI/record-template-feature-tolerance.firmament",
+ "sourceSha256": "6F88543F7E0D544F460709EE85521620101DCB053CF3C5C7C90F05A96CA63B8D",
+ "expectedSha256": "300023D4A6CC156F9224F4937F990926523372C8BF0AB11D8C15851FA256BB18",
+ "actualSha256": "300023D4A6CC156F9224F4937F990926523372C8BF0AB11D8C15851FA256BB18",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 635.3654
+ },
+ {
+ "source": "fixtures/Canonical/AssemblyInterfaces/executable-machine.firmament",
+ "sourceSha256": "9CEDEDC63C8EEF28A51F58E0E1E0D85E70104C9014C94508C44F1E9320B42F72",
+ "expectedSha256": "912FCCCDF607E0EB9437423BEA0D2E6EB74D9BEDE4D4758D9DF6BF5364C66391",
+ "actualSha256": "912FCCCDF607E0EB9437423BEA0D2E6EB74D9BEDE4D4758D9DF6BF5364C66391",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 665.7939
+ },
+ {
+ "source": "fixtures/Canonical/Assembly/template-block-pair.firmament",
+ "sourceSha256": "3530A14F1156C588EA5747EE65B338162AEC803243FBBB379D7C11D5265EF211",
+ "expectedSha256": "17E1DABEA787334BE13DA18E9771B69927CE46D754CA35783693C2FD76847B24",
+ "actualSha256": "17E1DABEA787334BE13DA18E9771B69927CE46D754CA35783693C2FD76847B24",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 652.6033
+ },
+ {
+ "source": "fixtures/Canonical/Assembly/coil-on-stem.firmament",
+ "sourceSha256": "056E6354C85B0E54AC6B4E1B79C1E9ED5CBE7A97648748F1C55923B76C85E485",
+ "expectedSha256": "9C21BE66AA885DF21DE349169C4E3D14282C2384E661372EC4034E627A5E0A1A",
+ "actualSha256": "9C21BE66AA885DF21DE349169C4E3D14282C2384E661372EC4034E627A5E0A1A",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 6804.7577
+ },
+ {
+ "source": "fixtures/Canonical/AssemblyInterfaces/GuitarX0/guitar.firmasm",
+ "sourceSha256": "10C11DD2FA4361C87D14E22D318348CE18BE0925119496184E846A603B1CA2DB",
+ "expectedSha256": "469E42D07EC1BB3FFDB88D5B0149DA50C21F39631EDC7441C2B3DCF11C41681C",
+ "actualSha256": "469E42D07EC1BB3FFDB88D5B0149DA50C21F39631EDC7441C2B3DCF11C41681C",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 10455.0212
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-branch-variants.firmament",
+ "sourceSha256": "CEFCA8936656C4947A5D434FD75EF6AA23B94D8A3DBB808B340DD376842B9240",
+ "expectedSha256": "DDC7B5C388058035E1B6A5FC8D5AC6701FBA3057508448EF00351312D766EF07",
+ "actualSha256": "DDC7B5C388058035E1B6A5FC8D5AC6701FBA3057508448EF00351312D766EF07",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 650.0488
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-offset-region.firmament",
+ "sourceSha256": "2FB5300A60902B01916B7D2D0C72A83156E365674BA0A5F249BC5D0B7EF00EE7",
+ "expectedSha256": "EB310460850C1153C5C1813F2863DCD16595755359E8545558140BBA5F632F05",
+ "actualSha256": "EB310460850C1153C5C1813F2863DCD16595755359E8545558140BBA5F632F05",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 578.8937
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-preserve-interface.firmament",
+ "sourceSha256": "C2310DAB5E3F591E1260EDA82852F53EE7842B284914D030231C15DA72D50AF4",
+ "expectedSha256": "67D5F7D6316FA53F63CEE95C08F45AFEC71E2AA2B89060A41F7F88D29319AD79",
+ "actualSha256": "67D5F7D6316FA53F63CEE95C08F45AFEC71E2AA2B89060A41F7F88D29319AD79",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 583.3042
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpted-housing.firmament",
+ "sourceSha256": "CD6647031A073A140C93CE7DBC14C08D801B84C24F0C15816D3C446464CF1D48",
+ "expectedSha256": "27136BC65CACE501B84E6EC81BCC186F1F48262ABB2CC9F76D2208951092396F",
+ "actualSha256": "27136BC65CACE501B84E6EC81BCC186F1F48262ABB2CC9F76D2208951092396F",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 578.8487
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x1-freeform-housing.firmament",
+ "sourceSha256": "36CCD4855AC3F8574854AA2499CB7B5BFFE4A892852AE9DDC452714962457B38",
+ "expectedSha256": "F509AA95D3B223F876790A755DF0052900E07598A1CB8266D63EA2408EF2DB07",
+ "actualSha256": "F509AA95D3B223F876790A755DF0052900E07598A1CB8266D63EA2408EF2DB07",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 878.4901
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x1a-trimmed-freeform-housing.firmament",
+ "sourceSha256": "990DC7389DBCB4E330B2A316AF4946297B5CA8F13C5BD9A693497792852ABD46",
+ "expectedSha256": "5717FD937D9FE93EACF3B49190BB967028C574121AE8850F2D82EA8FC7C1B9B4",
+ "actualSha256": "5717FD937D9FE93EACF3B49190BB967028C574121AE8850F2D82EA8FC7C1B9B4",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 973.4191
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-g1-blend.firmament",
+ "sourceSha256": "1BB2EE58823B87D5CF65D227CC7163D36D92E670B43D33B8D6A9DCDB9F6288F9",
+ "expectedSha256": "73C2D486D3CED015EBEFA984C41063C54D86BF81E5A575179CA9098EBE23EF22",
+ "actualSha256": "73C2D486D3CED015EBEFA984C41063C54D86BF81E5A575179CA9098EBE23EF22",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 823.1821
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-judged-housing.firmament",
+ "sourceSha256": "96BEDCA540DD454F27DA530E9B58E3E4C3DA21F4AEE0CA5422E56372D32EDE8C",
+ "expectedSha256": "0BC71E45EE37D7B523063A59E5060610048FBE7DAC227D82CB24B4A8186FDB2A",
+ "actualSha256": "0BC71E45EE37D7B523063A59E5060610048FBE7DAC227D82CB24B4A8186FDB2A",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 1214.0909
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-manual-candidate.firmament",
+ "sourceSha256": "CFBA24141D578B8049C61FA491B5978D40E873DA149373D287F5DB5488F40056",
+ "expectedSha256": "1B32DB8AFF518EAA86ADBEC212047641B48C5CCD9F57736F9C807D897AFA70B2",
+ "actualSha256": "1B32DB8AFF518EAA86ADBEC212047641B48C5CCD9F57736F9C807D897AFA70B2",
+ "exitCode": 0,
+ "byteIdentical": true,
+ "commandMilliseconds": 919.1661
+ }
+ ],
+ "scopedDogfood": [
+ {
+ "source": "fixtures/Regression/FrontendX2/scoped-drill.firmament",
+ "sourceSha256": "E9E7611398FA7A12504F3713A405D2AC931D244659D3C470B4E4A770EF2D23EB",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/pattern-symbol-collision.firmament",
+ "sourceSha256": "526AEB3BA9CC466B1686C484C9B45A310048ABE8F05A57A4025D5F99491FD0E3",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/sibling-feature.invalid.firmament",
+ "sourceSha256": "77F9E13949E472FDDE6F2229C5E55281698DDE69B71C72C5BB7F5F3182D7E26C",
+ "validationExit": 1,
+ "buildExit": 1,
+ "artifactExists": false,
+ "expectedAccepted": false
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/template-shadowing.firmament",
+ "sourceSha256": "4B9BCF681615E0B92CACC2B803885BCF638C0629AEFECF078E582EA5DD033E14",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/sibling-template.invalid.firmament",
+ "sourceSha256": "8C50B7AE867AF1BFAEA76F6ED05FD82752ECF388350F134DF30C6891BB15CA37",
+ "validationExit": 1,
+ "buildExit": 1,
+ "artifactExists": false,
+ "expectedAccepted": false
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/record-shadowing.firmament",
+ "sourceSha256": "F2A221AF5F2AA873758CD2299215F9DA4E40CA2FD578DCC08618A4C36A9B4C9D",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/scoped-record-pmi.firmament",
+ "sourceSha256": "11AF24E14B595F714939CB389E9AD82207EADEE68BE28E4035E4CC12F13FDDA2",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/scoped-table.firmament",
+ "sourceSha256": "099403730BB31221D936BA23842FE5709416791A649B729C9603EB11815852D3",
+ "validationExit": 0,
+ "buildExit": 0,
+ "artifactExists": true,
+ "expectedAccepted": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendX2/sibling-data.invalid.firmament",
+ "sourceSha256": "2584C8449E345361DCBDE8D8DD1BEB1907602E3E3767A9F6B1A2C8B731F0FA0B",
+ "validationExit": 1,
+ "buildExit": 1,
+ "artifactExists": false,
+ "expectedAccepted": false
+ }
+ ],
+ "codeSourceHashes": {
+ "Aetheris.Kernel.Core/Brep/Features/CombinedTopBoundaryEdgeFinishThroughHoleBuilder.cs": "39e1a152138493d05894fbb707d887341c14b0e2d13bbc8c266ba79f09b34847",
+ "Aetheris.Kernel.Firmament/FirmamentBuildAndExport.cs": "bbdb68e4203cbda919e63bc2e733fd1f7740bbf851a9d3ab5bbc457f2e7b57cb",
+ "Aetheris.Kernel.Core.Tests/Brep/Features/TopBoundaryFilletThroughHoleTests.cs": "a1ca7a970c34aec7dd57349ea4fec5ed80375fcf7a5055665a1becd0b806ee94",
+ "Aetheris.Kernel.Firmament.Tests/CombinedFilletHoleTests.cs": "bca99ea19311a2f28d07eefde0302c860573b12fcc9ee33c06b2ae0f3112ddf2",
+ "Aetheris.CLI.Tests/FirmamentFrontendX0CliTests.cs": "fba280aac280391c558fb290d6187ce882ff628db5908b4649111a90d40eabe7",
+ "Aetheris.Kernel.Firmament.Tests/FirmamentFrontendX0Tests.cs": "632cf2966c6f8fd517ac796097a230410a1cb8d1940bd4cb7395d8977f927855",
+ "fixtures/Regression/FrontendX4/expected.json": "cfd253a7ec0b0df1052f96983bafd3549824726e5fb7f8748e0b905d0b8015dd",
+ "fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament": "de61ee6716ff2805f9358a65bb3dd64a9b13c000f4354301d69813682dd36c1f",
+ "fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament": "223b8743879c82d624b86a15847d9a80140030d0ab863445a6099382e2e7359b",
+ "fixtures/Regression/FrontendX0/combined-fillet-hole-intersection.firmament": "25a08b5ca7730a1b960fc16b55c442b706be79dc45e6d0494fe22200ecc3c206"
+ },
+ "assemblyHashes": {
+ "Aetheris.Kernel.Core/bin/Release/net10.0/Aetheris.Kernel.Core.dll": "b1e90ceece4381c85a4dfd56959e89996564376e977825ea4ec88d07aff56720",
+ "Aetheris.Kernel.Firmament/bin/Release/net10.0/Aetheris.Kernel.Firmament.dll": "d5caf018ab940432face6167c3591c46ea1a1a255d59e2923b35d6dbc8f42c0b",
+ "Aetheris.CLI/bin/Release/net10.0/aetheris.dll": "b518925eade047b11ee04d5e9e96df9f2f7fe14838e0f18d49b17a5721b87cca"
+ },
+ "limits": [
+ "Other combined selectors",
+ "Blind holes and countersinks in this combination",
+ "Regions and mixed finishes",
+ "Intersecting or tangent hole/finish footprints",
+ "General feature-history composition"
+ ],
+ "volumeEvidencePolicy": "Analytic plan volume is checked by independent section integration and exact surface/curve support tests. Existing verify triangulation is only a numerical regression fingerprint; it is not promoted to exact volume authority."
+}
diff --git a/docs/release/FIRMAMENT-FILLET-HOLE.md b/docs/release/FIRMAMENT-FILLET-HOLE.md
new file mode 100644
index 00000000..0ea372ba
--- /dev/null
+++ b/docs/release/FIRMAMENT-FILLET-HOLE.md
@@ -0,0 +1,151 @@
+# Firmament Box top-boundary Fillet + Hole qualification
+
+Author: Codex. Date: 2026-10-15 (America/Los_Angeles).
+
+## Request and scope
+
+After the FrontendX4 closeout, the user explicitly authorized fixing the rejected
+Fillet + Hole combination. This supersedes the earlier diagnostic-only boundary
+for that case. The original Claude source
+`fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament` is unchanged.
+
+The qualified construction is one Box, one Modify, one complete +Z Boundary
+Chamfer or constant-radius Fillet, and mutually disjoint top ThroughAll shaft or
+counterbore holes. Finish-only top-boundary Fillet uses the same materializer.
+Other combined selectors, blind holes, countersinks, Region operations, mixed
+finishes and intersecting/tangent hole/finish footprints remain explicit limits.
+This is a bounded engineering capability, not general feature-history composition.
+
+## Root cause and repair
+
+The prior combined route admitted only Chamfer and consumed a chamfer-specific
+final plan. Removing its admission check would not have constructed a fillet.
+
+The existing combined owner is now
+`CombinedTopBoundaryEdgeFinishThroughHoleBuilder`, with an explicit finish kind.
+Its hole and counterbore topology is shared. Chamfer realization retains its
+existing surfaces and entity ordering. Fillet realization emits four exact
+cylindrical strips and four elliptical intersection edges. This extends the
+direct cylinder-intersection construction already used by the two-edge fillet
+compiler; it does not substitute a chamfer or invent spherical corner patches.
+The four vertical stock corners remain sharp. No parser dispatch, source rewrite,
+new spelling or general Boolean engine was added.
+
+For a blend radius `r`, in the upper stock band the inset is
+`s(t) = r - sqrt(r*r - t*t)`, `0 <= t <= r`. The retained cross section is
+`(width - 2*s) * (depth - 2*s)`. The plan integrates this section analytically,
+including corner overlap, then subtracts shaft and counterbore volumes.
+Tests independently integrate these sections and sample each seam on both of its
+incident cylinder supports. Binding preflight and AP242 round trip check the
+real emitted body. This is more than a success-code test.
+
+Analytic preflight exposed reversed orientation flags on the existing longitudinal
+hole seam bindings. Those bindings now reflect their stored curve direction.
+The STEP exporter already normalizes line direction against topology; emitted
+geometry compatibility is qualified separately below.
+
+The combined correspondence now identifies all four finish replacement faces.
+Counterbore wall, annular shoulder and shaft face ordering is accounted for;
+the shoulder is no longer mislabeled as a shaft wall. Exact runtime body and
+correspondence accompany the export. Model summaries identify the document owner.
+
+## Admission and diagnostics
+
+Validate and build retain their shared AST admission/build path. A hole entry
+circle must lie strictly inside the inset top face and remain disjoint from
+other entry circles. The larger counterbore radius determines entry clearance.
+The finish radius must be positive, smaller than the stock height and smaller
+than half the width and depth. Invalid requests cannot emit a partial body.
+
+Unsupported combined selectors retain `CombinedFeatureSelectionLost`. Interacting
+footprints report `CombinedFeatureInteractionUnsupported` and explain how to
+restore clearance. Invalid plan dimensions retain `CombinedFeaturePlanChainInvalid`
+detail. Finish failures retain the EdgeFinish source span; a hole materializer
+failure retains that Hole's span. The corpus and focused tests check acceptance,
+failure codes/lines, body topology, exact surface families, deterministic STEP,
+semantic descendant identities, stock placement and explicit AP242 PMI.
+
+## Corpus and compatibility decisions
+
+Only d05's manifest disposition changes from invalid to valid. Its newly admitted
+geometry baseline has 11 faces, 23 edges, 14 vertices, six planes, five cylinders
+and four elliptical curves, with bounds `[-30,-20,0]` to `[30,20,10]` mm.
+Other FrontendX4 geometry baselines and source specimens are unchanged by this
+follow-up. The recorded numerical verification volume is a deterministic
+regression fingerprint, not exact mass authority. The analytic plan volume and
+sampled surface evidence have separate tests. Interacting requests replace the
+old blanket rejection as negative capability witnesses.
+
+For d05 the analytic volume is `23454.80828946461 mm³`. The existing coarse
+`verify` triangulation reports `23460.317970712236 mm³` as `NumericalWithBound`;
+that estimate is not promoted to an exact geometry claim. No mass evaluator or
+tessellation tolerances were changed to obtain acceptance.
+
+The first full regression run identified two X0 assertions that required the
+now-supported original `combined-fillet-hole` witness to fail. Those assertions
+now use the new `combined-fillet-hole-intersection` negative witness; the
+original remains unchanged and has an explicit normal-CLI acceptance test.
+
+The new readable multi-hole witness is
+`fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament`.
+The public syntax, geometry, support matrix and diagnostic guides describe the
+qualified combination and its remaining limits. The language decision register
+preserves the historical #24 deferral and records this bounded superseding result.
+
+## Upstream reconciliation
+
+Fetched `origin/master` and fast-forwarded local master from `7525f37f` to
+`1585f637` (`Language outline: declaration graph for visual editors (G0)`).
+The upstream change had no overlapping files and merged without content conflicts.
+All pre-existing uncommitted frontend changes were retained. No local commit or
+remote push was created. An empty stale Git index lock was preserved under
+ignored local evidence after verifying its age and the absence of Git workers.
+
+The merged solution build, full .NET lane and upstream SDK language transport
+tests are part of qualification; this is not an untested post-qualification merge.
+
+## Qualification
+
+Final qualification ran after the upstream fast-forward and the X0 expectation
+updates. Generated logs and exported bodies live under ignored
+`artifacts/local/fillet-hole/`. Durable hashes and results are in the
+[evidence manifest](FIRMAMENT-FILLET-HOLE.evidence.json).
+
+| Check | Measured result |
+| --- | --- |
+| Serial Release solution build | Passed, zero errors; existing warnings remain |
+| Core fast lane (`Category!=SlowCorpus`) | 1,076 passed |
+| Focused frontend/semantic/outline qualification | 92 passed |
+| CLI X0 honesty tests | 13 passed |
+| Complete serial .NET solution regression | **5,140 passed, 0 failed, 0 skipped**, 20 executing assemblies |
+| Claude FrontendX4 authoring corpus | **32/32 passed**, including unchanged chimera/reference geometry |
+| Frozen showcase AP242 artifacts | **26/26 byte-identical**, source hashes checked against the existing X1 baseline |
+| Existing scoped X2 positive/negative dogfood replay | 9/9 retain their intended outcome |
+| Upstream SDK language transport tests | 3/3 passed; includes outline transport; these are client contract tests, not browser execution |
+| Final independent normal-CLI witnesses | Original d05, shaft/counterbore and original X0 models validate/build/import/verify; intersecting witness rejects with code and line preserved |
+| Runtime host cleanup | Zero dotnet, testhost, MSBuild, VBCSCompiler or aetheris processes remain |
+| Whitespace check | `git diff --check` passed |
+
+The FrictionLab project has no discoverable tests; it is not included as an
+executing test assembly. No full-suite evidence is inferred from the fast lane.
+The first full-run failures and the final passing run are kept separately in
+local evidence.
+
+## Code-quality review and verdict
+
+Reviewed the modified admission, construction and diagnostic code for new parser
+routes, source rewrites, fatal-code allowlists, duplicate field schemas, mutable
+global state and geometry changes outside the qualified family. None were added.
+The finish-kind dispatch is deterministic; no strategy-scoring framework is
+needed. The same bounded builder admits and realizes finish-only and combined
+top-boundary fillets, and the existing AST binders still own fields and spelling.
+The plan/type rename reflects the two admitted finish families, with repository
+callers migrated together. Source failures retain their causal messages and
+the appropriate enclosing feature span.
+
+**Success within the stated engineering boundary.** The original source now
+constructs both the requested fillet and hole. Validate/build agree, exact
+supports survive AP242, supported explicit PMI survives, the full merged
+regression passes, and the frozen showcase geometry stays byte-identical.
+General feature-chain composition and interacting hole/fillet trimming are
+still separate work; they are not hidden behind successful partial geometry.
diff --git a/docs/release/FIRMAMENT-FRONTEND-X4.evidence.json b/docs/release/FIRMAMENT-FRONTEND-X4.evidence.json
new file mode 100644
index 00000000..56de6c7f
--- /dev/null
+++ b/docs/release/FIRMAMENT-FRONTEND-X4.evidence.json
@@ -0,0 +1,622 @@
+{
+ "schemaVersion": 1,
+ "date": "2026-10-15",
+ "verdict": "Accepted for the FrontendX4 authoring corpus and exercised compatibility set",
+ "implementationBase": "7525f37fc6ec68ce9475dbceec7b946c2188e5c2",
+ "qualificationUsesUncommittedImplementation": true,
+ "before": {
+ "authoringPassed": 13,
+ "authoringTotal": 32
+ },
+ "after": {
+ "authoringPassed": 32,
+ "authoringTotal": 32,
+ "normalValidateAndBuild": true,
+ "geometryReferenceRelativeTolerance": 1e-09,
+ "recordUsed": false,
+ "changedDesignSpecimens": [
+ "cases/a01-let-in-model.firmament"
+ ]
+ },
+ "chimera": {
+ "faces": 98,
+ "edges": 240,
+ "vertices": 144,
+ "bbox": [
+ [
+ -35,
+ -30,
+ 0
+ ],
+ [
+ 35,
+ 30,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 22,
+ "cylinder": 76
+ },
+ "volume": 20769.234952815874
+ },
+ "tests": {
+ "solutionBuild": "passed",
+ "fastCore": {
+ "passed": 1068,
+ "failed": 0
+ },
+ "focused": {
+ "passed": 93,
+ "failed": 0
+ },
+ "full": {
+ "executingAssemblies": 20,
+ "passed": 5112,
+ "failed": 0,
+ "skipped": 0,
+ "emptyTestProjects": [
+ "Aetheris.FrictionLab.Tests"
+ ]
+ },
+ "newFrontendX4Cases": 42
+ },
+ "corpus": {
+ "schemaVersion": 1,
+ "sourceCount": 1375,
+ "canonicalSourceCount": 368,
+ "canonicalStructurallyParsed": 368,
+ "structurallyParsed": 1011,
+ "standaloneProductionAccepted": 571,
+ "inventorySha256": "D24300E1FD53E7D00E2995B02CFF2255749A65AFC8C700595F52084E28EAD3B2",
+ "unresolvedMismatchCount": 0,
+ "universalSemanticParityQualified": false,
+ "classifications": {
+ "Admitted": 554,
+ "AdmittedGeometryWithDfmFindings": 1,
+ "AdmittedInConsumerContext": 72,
+ "DeclarationModuleRequiresConsumer": 5,
+ "ExpectedNegativeRejection": 286,
+ "ExperimentalAdmitted": 9,
+ "ExperimentalRejected": 31,
+ "LegacySerializationAdmitted": 5,
+ "LegacySerializationRejected": 324,
+ "MalformedOrUnsupportedSourceRejected": 6,
+ "MisfiledPositiveFixture": 1,
+ "RejectedAtSolveStage": 1,
+ "SourceAdmissionRejected": 80
+ },
+ "canonicalClassifications": {
+ "Admitted": 290,
+ "AdmittedInConsumerContext": 69,
+ "SourceAdmissionRejected": 9
+ }
+ },
+ "existingCorpusComparison": {
+ "unchangedSourceHashes": 1326,
+ "acceptedSourceRegressions": [],
+ "intentionalNewAdmissions": 5
+ },
+ "additionalAdmissions": [
+ {
+ "source": "Regression/LanguageBurnIn/boss-hole-unique/boss-hole-unique.firmament",
+ "before": "SourceAdmissionRejected",
+ "after": "Admitted",
+ "beforeExit": 1,
+ "afterExit": 0,
+ "sameSource": true,
+ "reason": "Structural parse and domain production owner both succeed at the recorded production level.",
+ "sourceSha256": "59644E39E4DBC32D48887E7751762E1B79263DE512E5269D1494E9EC5C0A3528",
+ "geometry": {
+ "faces": 19,
+ "edges": 44,
+ "vertices": 28,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 17
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 11,
+ "cylinder": 8
+ },
+ "volume": 30986.524186192815
+ },
+ "analyticVolume": 30986.371699555893,
+ "analyticRelativeTolerance": 1e-05,
+ "analyticRelativeError": 4.921087192793441e-06,
+ "referenceGeometryMatches": true,
+ "stepByteIdentical": true,
+ "disposition": "Newly admitted Top alias; geometry agrees with +Z and analytic through-hole volume"
+ },
+ {
+ "source": "Regression/LanguageBurnIn/boss-hole/boss-hole.firmament",
+ "before": "SourceAdmissionRejected",
+ "after": "Admitted",
+ "beforeExit": 1,
+ "afterExit": 0,
+ "sameSource": true,
+ "reason": "Structural parse and domain production owner both succeed at the recorded production level.",
+ "sourceSha256": "007ED873F1FBBB289B7B56A8E190300B14F27B347FE9C040D03519101861B67F",
+ "geometry": {
+ "faces": 19,
+ "edges": 44,
+ "vertices": 28,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 17
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 11,
+ "cylinder": 8
+ },
+ "volume": 30986.524186192815
+ },
+ "analyticVolume": 30986.371699555893,
+ "analyticRelativeTolerance": 1e-05,
+ "analyticRelativeError": 4.921087192793441e-06,
+ "referenceGeometryMatches": true,
+ "stepByteIdentical": true,
+ "disposition": "Newly admitted Top alias; geometry agrees with +Z and analytic through-hole volume"
+ },
+ {
+ "source": "Regression/LanguageBurnIn/boss-stack-hole-unique/boss-stack-hole-unique.firmament",
+ "before": "SourceAdmissionRejected",
+ "after": "Admitted",
+ "beforeExit": 1,
+ "afterExit": 0,
+ "sameSource": true,
+ "reason": "Structural parse and domain production owner both succeed at the recorded production level.",
+ "sourceSha256": "1228B9246170227D4A3CB0DB7DD45037A8EF3B1BD7C3419AF3BCA185A3D615FE",
+ "geometry": {
+ "faces": 28,
+ "edges": 64,
+ "vertices": 40,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 21
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 16,
+ "cylinder": 12
+ },
+ "volume": 31416.29458294407
+ },
+ "analyticVolume": 31416.10621709846,
+ "analyticRelativeTolerance": 1e-05,
+ "analyticRelativeError": 5.995836794931368e-06,
+ "referenceGeometryMatches": true,
+ "stepByteIdentical": true,
+ "disposition": "Newly admitted Top alias; geometry agrees with +Z and analytic through-hole volume"
+ },
+ {
+ "source": "Regression/LanguageBurnIn/boss-stack-hole/boss-stack-hole.firmament",
+ "before": "SourceAdmissionRejected",
+ "after": "Admitted",
+ "beforeExit": 1,
+ "afterExit": 0,
+ "sameSource": true,
+ "reason": "Structural parse and domain production owner both succeed at the recorded production level.",
+ "sourceSha256": "67522759BC02D9B9E125C6F840895260C72C36C92513CD5E3240BEF3BB008FEC",
+ "geometry": {
+ "faces": 28,
+ "edges": 64,
+ "vertices": 40,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 21
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 16,
+ "cylinder": 12
+ },
+ "volume": 31416.29458294407
+ },
+ "analyticVolume": 31416.10621709846,
+ "analyticRelativeTolerance": 1e-05,
+ "analyticRelativeError": 5.995836794931368e-06,
+ "referenceGeometryMatches": true,
+ "stepByteIdentical": true,
+ "disposition": "Newly admitted Top alias; geometry agrees with +Z and analytic through-hole volume"
+ },
+ {
+ "source": "Regression/LanguageBurnIn/pocket-hole/pocket-hole.firmament",
+ "before": "SourceAdmissionRejected",
+ "after": "Admitted",
+ "beforeExit": 1,
+ "afterExit": 0,
+ "sameSource": true,
+ "reason": "Structural parse and domain production owner both succeed at the recorded production level.",
+ "sourceSha256": "C9C059BC216CBB9800BCA9E593D8E70528F42A15E67498262293EAAECBA1D2D5",
+ "geometry": {
+ "faces": 19,
+ "edges": 44,
+ "vertices": 28,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 12
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 15,
+ "cylinder": 4
+ },
+ "volume": 27931.540793502496
+ },
+ "analyticVolume": 27931.469035085127,
+ "analyticRelativeTolerance": 1e-05,
+ "analyticRelativeError": 2.5690885530884937e-06,
+ "referenceGeometryMatches": true,
+ "stepByteIdentical": true,
+ "disposition": "Newly admitted Top alias; geometry agrees with +Z and analytic through-hole volume"
+ }
+ ],
+ "stepParity": [
+ {
+ "source": "fixtures/Canonical/Symmetry/radial-bolt-circle.firmament",
+ "sourceSha256": "19DAA47DC20CA092A6DDA1CC49AF0B74E7E016F5E4A143AA4C00B7230B81C3CE",
+ "expectedSha256": "4B4F8FD69D10E73BB403F1538C6FC13995F895E4C1C17E0605A3E4A008E5356E",
+ "actualSha256": "4B4F8FD69D10E73BB403F1538C6FC13995F895E4C1C17E0605A3E4A008E5356E",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/partial-radial-pattern.firmament",
+ "sourceSha256": "258427029AA0882653801833109AD9FE04542C7448DE1D126291215FC016DE7D",
+ "expectedSha256": "7D708B30209B6A03010D9C647F762E453C705BC8F656882BE4F18785B2F08D87",
+ "actualSha256": "7D708B30209B6A03010D9C647F762E453C705BC8F656882BE4F18785B2F08D87",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-revolve.firmament",
+ "sourceSha256": "B955033028F838A3A3D7D265BD4EB04A9AAD89E83D95D5EA1C640ECB0953FA6C",
+ "expectedSha256": "C44AE2A5B6CFC978AFB24041F0B5C43A4554161FE5880FC6E2D59ADB1B7CAB4A",
+ "actualSha256": "C44AE2A5B6CFC978AFB24041F0B5C43A4554161FE5880FC6E2D59ADB1B7CAB4A",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-profile.firmament",
+ "sourceSha256": "1F41E7EBE426306205E01226C36410261798418C385E5E284BD0A4216CAF98BF",
+ "expectedSha256": "30D1F927A7295A5B553453BA2D6E936564140839E4497B0C5B46A1682A18F6A1",
+ "actualSha256": "30D1F927A7295A5B553453BA2D6E936564140839E4497B0C5B46A1682A18F6A1",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-hole.firmament",
+ "sourceSha256": "39B62FB47C0C42BDF7CD3DE7FCA2E78E785BCD693412FC052628F470F3261EB0",
+ "expectedSha256": "4A0DA2E67DA153B38DD7E6389CB329B4BBB6939FEC88541936DF705F49BE62FE",
+ "actualSha256": "4A0DA2E67DA153B38DD7E6389CB329B4BBB6939FEC88541936DF705F49BE62FE",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Symmetry/mirrored-feature-with-override.firmament",
+ "sourceSha256": "DEBDCE6974743DCBCED725B9FF6B8ED833EF64DBE69A4B94256515E6CDF24B4E",
+ "expectedSha256": "052F9FC96919130FA11D2FDE5BEF302BCBE42BA6441A61F7164D43E25EAF8FBB",
+ "actualSha256": "052F9FC96919130FA11D2FDE5BEF302BCBE42BA6441A61F7164D43E25EAF8FBB",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Regression/FrontendMigration/preferred-profile-links.firmament",
+ "sourceSha256": "41ACDC508CDB714BC0409C864708FD968BB812A83E4FD406B7AA0818670C6C4B",
+ "expectedSha256": "E43449262ECDD3DD05EFB73DB821D2E09226637EC1FB1EAF73E07821CD46AA57",
+ "actualSha256": "E43449262ECDD3DD05EFB73DB821D2E09226637EC1FB1EAF73E07821CD46AA57",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Features/Holes/through-hole.firmament",
+ "sourceSha256": "38E8188DB1BB7C75406570BBCEC9A09DAFA9D4D33A0EDEB746A6C04A973B265C",
+ "expectedSha256": "5999F127E5A1477E5825AFA656DCEB7F89241D8F85312B0E6BCD793639A0F548",
+ "actualSha256": "5999F127E5A1477E5825AFA656DCEB7F89241D8F85312B0E6BCD793639A0F548",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Templates/generic-mounting-plate.firmament",
+ "sourceSha256": "91B69697F5E777438F688FA2D1F0330FEF5C430D064FCA0A7FFF886252567C92",
+ "expectedSha256": "B0FF1D05D82135A3630C5E165C09B6C2C467B3FAF98A0825A9AF86B2E1CE76A3",
+ "actualSha256": "B0FF1D05D82135A3630C5E165C09B6C2C467B3FAF98A0825A9AF86B2E1CE76A3",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Set/pattern-feature-map.firmament",
+ "sourceSha256": "7BF1BA1E508CAE2548EC429724A895F2E50FFDAD057084F17B506C4362A34E40",
+ "expectedSha256": "08D4EA1F1336C06A380E30806C02AEE3F08535CAD1592929470EBD64B9882FC2",
+ "actualSha256": "08D4EA1F1336C06A380E30806C02AEE3F08535CAD1592929470EBD64B9882FC2",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/PMI/hole-diameter-and-datum.firmament",
+ "sourceSha256": "B105A5535F53189938CBA6C9E8644FC9D8C6683F8BB97B04167FA48C411ABBFD",
+ "expectedSha256": "9F2F24975267BF425D16A2ECDF863F4A94C0FAD172C932F9868BBB836BD46F5D",
+ "actualSha256": "9F2F24975267BF425D16A2ECDF863F4A94C0FAD172C932F9868BBB836BD46F5D",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/PMI/typed-tolerance.firmament",
+ "sourceSha256": "7C928F862D443904E87EAD137DB7D55E4D69E03A12F918F3319ECED947245EC9",
+ "expectedSha256": "098B515124D46220AAB85F6DBE1568E6B5969FEB55B537BA91AD3DDA587509A5",
+ "actualSha256": "098B515124D46220AAB85F6DBE1568E6B5969FEB55B537BA91AD3DDA587509A5",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/PMI/record-template-feature-tolerance.firmament",
+ "sourceSha256": "6F88543F7E0D544F460709EE85521620101DCB053CF3C5C7C90F05A96CA63B8D",
+ "expectedSha256": "300023D4A6CC156F9224F4937F990926523372C8BF0AB11D8C15851FA256BB18",
+ "actualSha256": "300023D4A6CC156F9224F4937F990926523372C8BF0AB11D8C15851FA256BB18",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/AssemblyInterfaces/executable-machine.firmament",
+ "sourceSha256": "9CEDEDC63C8EEF28A51F58E0E1E0D85E70104C9014C94508C44F1E9320B42F72",
+ "expectedSha256": "912FCCCDF607E0EB9437423BEA0D2E6EB74D9BEDE4D4758D9DF6BF5364C66391",
+ "actualSha256": "912FCCCDF607E0EB9437423BEA0D2E6EB74D9BEDE4D4758D9DF6BF5364C66391",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Assembly/template-block-pair.firmament",
+ "sourceSha256": "3530A14F1156C588EA5747EE65B338162AEC803243FBBB379D7C11D5265EF211",
+ "expectedSha256": "17E1DABEA787334BE13DA18E9771B69927CE46D754CA35783693C2FD76847B24",
+ "actualSha256": "17E1DABEA787334BE13DA18E9771B69927CE46D754CA35783693C2FD76847B24",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Assembly/coil-on-stem.firmament",
+ "sourceSha256": "056E6354C85B0E54AC6B4E1B79C1E9ED5CBE7A97648748F1C55923B76C85E485",
+ "expectedSha256": "9C21BE66AA885DF21DE349169C4E3D14282C2384E661372EC4034E627A5E0A1A",
+ "actualSha256": "9C21BE66AA885DF21DE349169C4E3D14282C2384E661372EC4034E627A5E0A1A",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/AssemblyInterfaces/GuitarX0/guitar.firmasm",
+ "sourceSha256": "10C11DD2FA4361C87D14E22D318348CE18BE0925119496184E846A603B1CA2DB",
+ "expectedSha256": "469E42D07EC1BB3FFDB88D5B0149DA50C21F39631EDC7441C2B3DCF11C41681C",
+ "actualSha256": "469E42D07EC1BB3FFDB88D5B0149DA50C21F39631EDC7441C2B3DCF11C41681C",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-branch-variants.firmament",
+ "sourceSha256": "CEFCA8936656C4947A5D434FD75EF6AA23B94D8A3DBB808B340DD376842B9240",
+ "expectedSha256": "DDC7B5C388058035E1B6A5FC8D5AC6701FBA3057508448EF00351312D766EF07",
+ "actualSha256": "DDC7B5C388058035E1B6A5FC8D5AC6701FBA3057508448EF00351312D766EF07",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-offset-region.firmament",
+ "sourceSha256": "2FB5300A60902B01916B7D2D0C72A83156E365674BA0A5F249BC5D0B7EF00EE7",
+ "expectedSha256": "EB310460850C1153C5C1813F2863DCD16595755359E8545558140BBA5F632F05",
+ "actualSha256": "EB310460850C1153C5C1813F2863DCD16595755359E8545558140BBA5F632F05",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpt-preserve-interface.firmament",
+ "sourceSha256": "C2310DAB5E3F591E1260EDA82852F53EE7842B284914D030231C15DA72D50AF4",
+ "expectedSha256": "67D5F7D6316FA53F63CEE95C08F45AFEC71E2AA2B89060A41F7F88D29319AD79",
+ "actualSha256": "67D5F7D6316FA53F63CEE95C08F45AFEC71E2AA2B89060A41F7F88D29319AD79",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/sculpted-housing.firmament",
+ "sourceSha256": "CD6647031A073A140C93CE7DBC14C08D801B84C24F0C15816D3C446464CF1D48",
+ "expectedSha256": "27136BC65CACE501B84E6EC81BCC186F1F48262ABB2CC9F76D2208951092396F",
+ "actualSha256": "27136BC65CACE501B84E6EC81BCC186F1F48262ABB2CC9F76D2208951092396F",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x1-freeform-housing.firmament",
+ "sourceSha256": "36CCD4855AC3F8574854AA2499CB7B5BFFE4A892852AE9DDC452714962457B38",
+ "expectedSha256": "F509AA95D3B223F876790A755DF0052900E07598A1CB8266D63EA2408EF2DB07",
+ "actualSha256": "F509AA95D3B223F876790A755DF0052900E07598A1CB8266D63EA2408EF2DB07",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x1a-trimmed-freeform-housing.firmament",
+ "sourceSha256": "990DC7389DBCB4E330B2A316AF4946297B5CA8F13C5BD9A693497792852ABD46",
+ "expectedSha256": "5717FD937D9FE93EACF3B49190BB967028C574121AE8850F2D82EA8FC7C1B9B4",
+ "actualSha256": "5717FD937D9FE93EACF3B49190BB967028C574121AE8850F2D82EA8FC7C1B9B4",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-g1-blend.firmament",
+ "sourceSha256": "1BB2EE58823B87D5CF65D227CC7163D36D92E670B43D33B8D6A9DCDB9F6288F9",
+ "expectedSha256": "73C2D486D3CED015EBEFA984C41063C54D86BF81E5A575179CA9098EBE23EF22",
+ "actualSha256": "73C2D486D3CED015EBEFA984C41063C54D86BF81E5A575179CA9098EBE23EF22",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-judged-housing.firmament",
+ "sourceSha256": "96BEDCA540DD454F27DA530E9B58E3E4C3DA21F4AEE0CA5422E56372D32EDE8C",
+ "expectedSha256": "0BC71E45EE37D7B523063A59E5060610048FBE7DAC227D82CB24B4A8186FDB2A",
+ "actualSha256": "0BC71E45EE37D7B523063A59E5060610048FBE7DAC227D82CB24B4A8186FDB2A",
+ "byteIdentical": true
+ },
+ {
+ "source": "fixtures/Canonical/Sculpting/surf-x2-manual-candidate.firmament",
+ "sourceSha256": "CFBA24141D578B8049C61FA491B5978D40E873DA149373D287F5DB5488F40056",
+ "expectedSha256": "1B32DB8AFF518EAA86ADBEC212047641B48C5CCD9F57736F9C807D897AFA70B2",
+ "actualSha256": "1B32DB8AFF518EAA86ADBEC212047641B48C5CCD9F57736F9C807D897AFA70B2",
+ "byteIdentical": true
+ }
+ ],
+ "downstreamDispositions": {
+ "Invalid/FEA/ExperimentalShell/singular-map.firmament": {
+ "classification": "RejectedAtSolveStage",
+ "reason": "Analysis compilation succeeds at the explicitly reported AnalysisCompiledNotSolved level. The ordinary fea execution rejects the inconsistent cylindrical map with thinwall-map-singular. This is a solve/map negative, not a syntax failure.",
+ "exitCode": 1,
+ "diagnostics": [
+ {
+ "code": "thinwall-map-singular",
+ "severity": "Error",
+ "message": "Cylindrical master S span must equal radius times angle (0.15707963267948966 m); got 0.16 m."
+ }
+ ],
+ "sourceSha256": "A1C922DC74CB102CE47F7696A8F52AB82B2DA6973CD61E52F2EF298C8325F2EB",
+ "witnessPassed": true,
+ "requalifiedOn": "2026-10-15",
+ "evidenceRoot": "artifacts/local/frontend-x4"
+ },
+ "Invalid/Pipeline/traceloop-non-loop.firmament": {
+ "classification": "MisfiledPositiveFixture",
+ "reason": "Despite the historical filename, the actual source traces a closed Rect2 into an outer loop and extrudes it. Real build and STEP reimport confirm a valid enclosed six-face solid with the requested bounds. Rejecting it would reject legitimate geometry.",
+ "exitCodes": [
+ 0,
+ 0
+ ],
+ "bodyCount": 1,
+ "faceCount": 6,
+ "boundsMm": {
+ "min": {
+ "x": -5,
+ "y": -2,
+ "z": 0
+ },
+ "max": {
+ "x": 5,
+ "y": 2,
+ "z": 1
+ }
+ },
+ "structuralAssessment": "enclosed-manifold",
+ "stepSha256": "CC536B201711D265AB53ECB6BC50262F5FF577FD9FC2745B6B53ACB8FC1672E2",
+ "sourceSha256": "1BC08FBE89A39A14A46E13AC25D2FDC5C75962F2759E8FB0951213C69526C169",
+ "witnessPassed": true,
+ "requalifiedOn": "2026-10-15",
+ "evidenceRoot": "artifacts/local/frontend-x4"
+ },
+ "Invalid/SheetMetal/tray-dfm-violation.firmament": {
+ "classification": "AdmittedGeometryWithDfmFindings",
+ "reason": "The fixture explicitly requests geometry that compiles and a DFM repair finding. sheetmetal inspect succeeds and reports Warning with insufficient corner relief; a manufacturing warning does not make the frontend source invalid.",
+ "exitCode": 0,
+ "dfmOverall": "Warning",
+ "findings": [
+ {
+ "ruleId": "sheetmetal-dfm-corner-resolution",
+ "status": "Warning",
+ "message": "'corner-Front-Right' has insufficient or missing relief geometry.",
+ "subjectId": "corner-Front-Right",
+ "measured": 1,
+ "required": 2.7,
+ "suggestedFix": "Increase relief-Front-Right width to at least 1.2 mm and depth to at least 2.7 mm."
+ }
+ ],
+ "sourceSha256": "035B7CDA274FF49DC23E3223F8EFE44F100E26A4CF208327D74759312AB11EB8",
+ "witnessPassed": true,
+ "requalifiedOn": "2026-10-15",
+ "evidenceRoot": "artifacts/local/frontend-x4"
+ }
+ },
+ "compilerAssemblies": {
+ "Aetheris.CLI/bin/Release/net10.0/aetheris.dll": "2375025B5D546C7E9728A79E93C51AF997FD80D26A6461E64000262290D87FD5",
+ "Aetheris.Kernel.Firmament/bin/Release/net10.0/Aetheris.Kernel.Firmament.dll": "A52623D687A762B00D74AA111C5BF1C4C768A7D5414EE177A19A9223861EA8F4",
+ "Aetheris.Kernel.Core/bin/Release/net10.0/Aetheris.Kernel.Core.dll": "A8AF785620B0809C5838A7B6EA1A92DFDC22CF184B21F8A98EA93E5D999954C8"
+ },
+ "corpusSourceHashes": {
+ "cases/a01-let-in-model.firmament": "F8230868CDC93F31980E834AAB15DD3E407AF88F1EA81D2246D3281B628AB507",
+ "cases/a02-static-in-model.firmament": "BEBF407605E13C6DEE10B46E2C81D9E0A7278AE1FF738E2B4AE842AE3F08FD98",
+ "cases/a03-set-entry-arithmetic.firmament": "56EE1516723D6A218177EF48E1EB18FEF7BBEA510117B0AA731A33F3045DDB3A",
+ "cases/a04-box-size-arithmetic.firmament": "16683EFE8A95F7F704BD26EB5189209557F75DFF83DAA577B3E7BC5674941C10",
+ "cases/a05-static-in-compose-interval.firmament": "852A24933726111F5B4760B4AF88A32A99DF5C15F42F5FB95015355C9A78A060",
+ "cases/a06-unused-static-with-compose.firmament": "D9ADA72B7E7E1F51D8EB17DA31FF2F90623A5724B330AB3AE7A73F695D4F3DFF",
+ "cases/b01-pattern-model-scope.firmament": "3F4C89C7536574460A6B7DB4D6028F76CF9B6C728A0699E56C35C0CB3CF63C1E",
+ "cases/b02-pattern-in-modify.firmament": "185CCE0669616299582E33644F39F2B1C0B8AAD6E1AB3A606AD05CC3E0B585B1",
+ "cases/b03-pattern-in-modify-struct-root.firmament": "A34587E52C0B5B952E99D2657320158302F4C3BBE35C2ED7B618A93E2A03CDEB",
+ "cases/b04-pattern-model-scope-with-modify.firmament": "4680C895DFF9A9C908EA44B0A21150C528D7598516D1AF1423615A74165DC977",
+ "cases/c01-hole-on-plusz-struct-root.firmament": "F5DB592071F80E5B4EE0AA3B2EB0DA6B38C462549CD4418F14939B3B184DE8EC",
+ "cases/c02-hole-on-plusz-model-root.firmament": "90E60225962974572C65FC017FC19E52407C0D28C35CD67AA97FD02F6DCE14EE",
+ "cases/c03-face-reference-spellings.firmament": "0D226D1DF461FDF2B3C068C6FEFBD365EF70A477DC896B79F44C3E9CFAB803EF",
+ "cases/c04-point-literal-spellings.firmament": "47CE255531BEE6549969DF2138AD327CB6EDA8EA2896BA60518632672713BBFB",
+ "cases/c05-feature-hole-on-top.firmament": "470076AF44458847D547905B6D13D5143B393CDF74676B24F560F6CCBC64DA0D",
+ "cases/c06-set-array-literal-entries.firmament": "16F1F221F0906F147BD127A143571E04152A68A279C740370303EBAED7F43A44",
+ "cases/d01-edgefinish-generic-variant.firmament": "C23AA9B7FC78881662233F0C84B0110DC1FA730C41735045AE406A18E4610AB4",
+ "cases/d02-edgefinish-kind-field.firmament": "F429B4A5C1D3D975A7C65ACCFE7D1286904DE3730C8074993E943117F2698CE3",
+ "cases/d03-edgefinish-primitive-selector.firmament": "6CEFC0AD46DF1B8B07DB8083F1E915F00AB6814F3717F44533FF86D85A7A3731",
+ "cases/d04-edgefinish-lowercase-fields.firmament": "5700985F38726A21BD497ABAE3F2AEA9B2BC7C3440C6273FD3796306027BC071",
+ "cases/d05-fillet-with-hole.firmament": "DE61EE6716FF2805F9358A65BB3DD64A9B13C000F4354301D69813682DD36C1F",
+ "cases/e01-pocket-through.firmament": "05190253316BF3A04C75100463E38810EF0DE79335E03EA696443CD31621BA47",
+ "cases/e02-cut-in-modify.firmament": "E3F0CE299AEB627F7C6B38FF080AC292E9186AB09BE2F2586EE0E39DC2ED9189",
+ "cases/f01-xz-layout.firmament": "FD9011AA6EC8CBF07BA2B63200268D7B9AA47B9D63084CA088A67A008B1DC775",
+ "cases/f02-inline-polygon.firmament": "EE8653D39AFBE84F7BBDC1EE1C2393628530A0B429F97871824BFCB612D115F3",
+ "cases/f03-segment-inline-coordinates.firmament": "B3DCCA0F208A1BBBD4846B39C16CD20B0FB3413B66FE0265C12C872FFBA4D570",
+ "cases/f04-inline-polygon-arithmetic.firmament": "F8986AF5294A0E516EAD6A7D53CE60258E94BE987882874D0371A1A9C14864C6",
+ "cases/g01-revolve-point-list.firmament": "52D9FEBA91E908F8E4DA19E25F1380034D6A5C2CCBF7656FF6023A0062625FAE",
+ "cases/h00-concept-grid-struct-root.firmament": "56A68D0B11D82C2C3A5613C2DE5F398601CCC6B98C8B9CB4C5240237902484D5",
+ "cases/h01-concept-grid-model-root.firmament": "FA4AE6A99FF908830D321389832738AD91E70359285A075122EACCEBC7C4CE6C",
+ "cases/h02-documented-feature-pattern.firmament": "D9D7E0795F74AD83A47E11683F42228A079A3CCFFB00B10579666FE7D639E06F",
+ "cases/reference/a01-let-in-model.firmament": "C3CCAC2AAE567A78A93C837281F9C546AD6F6C3228D816E8079CDD25B7111629",
+ "cases/reference/a03-set-entry-arithmetic.firmament": "235C5D6C89FC2B3C64E34813654915E261C1FA1B71A4551DEDB2685C785B3F09",
+ "cases/reference/a05-static-in-compose-interval.firmament": "1EB26AFA2E625361542E65DB045377B7FA4FD1F7A0014C8B08569E8A4B29EE16",
+ "cases/reference/a06-unused-static-with-compose.firmament": "181FB119B836EDDBC27E2F8D516DD8DF17B42334B30805B69BB13FFD664726FE",
+ "cases/reference/b01-pattern-model-scope.firmament": "185CCE0669616299582E33644F39F2B1C0B8AAD6E1AB3A606AD05CC3E0B585B1",
+ "cases/reference/b04-pattern-model-scope-with-modify.firmament": "55EBD6A23C97B190491B28DB1E1D3B6CF43820BC1D0A9A04B607969BAD5F02DE",
+ "cases/reference/c03-face-reference-spellings.firmament": "9009A12C2E33DBC5C5225065508E96235496E97D513A751A00E7769E4EC92096",
+ "cases/reference/c04-point-literal-spellings.firmament": "DAABA37C16F0876B29E12CD5ED8C72D4F0B9084C3C982C802690BCA7F2F7FFBA",
+ "cases/reference/c05-feature-hole-on-top.firmament": "F1043C16CFC25A0CB7C81B95A5B360AD7B6FB7C0EDEC9B8E6A9C4469514A3BC0",
+ "cases/reference/c06-set-array-literal-entries.firmament": "7A6BA9F32AD7A097A49DB971375125F277AA9A7D1DD37DFC90B16C49CA915BA8",
+ "cases/reference/d01-edgefinish-generic-variant.firmament": "F429B4A5C1D3D975A7C65ACCFE7D1286904DE3730C8074993E943117F2698CE3",
+ "cases/reference/e01-pocket-through.firmament": "61776648D57105BA92ADA716F63024E32AC08E7BC4452AD06E7F72157DD5B762",
+ "cases/reference/f02-inline-polygon.firmament": "9AF07581C3DF6E54B290C08189A33A1285473C1DFCC93216BBD5B350280B4AB4",
+ "cases/reference/f04-inline-polygon-arithmetic.firmament": "D73E3156A724C9B8A4C12882CCB5E3F2D248C6215CEB51F6A9BF422673413DEC",
+ "cases/reference/g01-revolve-point-list.firmament": "C4873ED6F0952CF78DED0108A35E7B1B9D255D4D82E83E0CBC0657058BBB88D5",
+ "cases/reference/h02-documented-feature-pattern.firmament": "FA4AE6A99FF908830D321389832738AD91E70359285A075122EACCEBC7C4CE6C",
+ "chimera.baseline.firmament": "88F08FB7D6D458753311DDBC916F12AB1B256401E0CE455EF15D583D79E75C8B",
+ "chimera.firmament": "AB4CB3069B9320B7CE41A66B8207103B6CA4EAAC7169EF2EE264AADB532670BF"
+ },
+ "recordedGeometryManifestSha256": "925211843505411F12525AD55A8861BFB99D6291D451F89E6A05F792D8CA0765",
+ "resourceCleanup": {
+ "finalSnapshotHostsRemaining": [],
+ "checkedProcessNames": [
+ "dotnet",
+ "testhost",
+ "MSBuild",
+ "VBCSCompiler",
+ "aetheris"
+ ]
+ },
+ "limits": [
+ "Not universal semantic parity across all language domains or source expansions.",
+ "Fillet plus Hole remains a rejected geometry capability.",
+ "Chamfer wall splitting is unchanged.",
+ "The additional analytic-volume checks use 1e-5 relative tolerance for the existing numerical mass integrator; all reference geometry checks retain 1e-9 and all five aliases are STEP byte-identical."
+ ]
+}
diff --git a/docs/release/FIRMAMENT-FRONTEND-X4.md b/docs/release/FIRMAMENT-FRONTEND-X4.md
new file mode 100644
index 00000000..1c880e7b
--- /dev/null
+++ b/docs/release/FIRMAMENT-FRONTEND-X4.md
@@ -0,0 +1,143 @@
+# Firmament Frontend X4 — Claude authoring retest repairs
+
+Subsequent authorized engineering work now admits the unchanged d05 Fillet + Hole
+source. Its earlier rejection disposition below is historical; see the
+[Fillet + Hole qualification](FIRMAMENT-FILLET-HOLE.md). Other X4 geometry
+baselines remain unchanged, and this report's original evidence is preserved.
+
+Implementation base: `7525f37f` (Claude's corpus commit), 2026-10-15.
+Scope: the 32 checks in `fixtures/Regression/FrontendX4`, with existing geometry
+and legitimate compatibility retained. This is production frontend repair, not a
+shadow admission milestone. **Accepted for the X4 authoring corpus and exercised
+compatibility set:** all 32 checks pass through the real validate/build paths,
+with the original geometry comparisons and diagnostic lines retained.
+
+## Reproduction and repairs
+
+The unchanged corpus initially reproduced **13/32 passes**: eleven geometry
+guards and two diagnostics. No finding was dismissed as speculative without
+running its source. The corpus README and original recorded geometry remain the
+historical evidence.
+
+| Cases | Observed cause | Repair / disposition |
+| --- | --- | --- |
+| a01 | Model `let` was unknown | Choose existing `Static`, including inferred scalar type. This is the sole changed design specimen; its reference and the chimera already use Static. |
+| a03, c06 | Set coordinate checks used literal regexes and rejected expressions/arrays | Bind scalar references with the shared compile-time environment, evaluate typed coordinates through the existing AST numeric owner, and retain keyed Set identity. |
+| a05, a06 | A blanket construction-consumer guard rejected any Static, including unused values | Transport bound AST value edits into Compose lowering; erase compile-time declarations after binding and retain their value metadata. |
+| b01, b04 | Set Pattern expansion placed Hole declarations directly in Model scope | Resolve the unique material target and emit into its Modify scope; reject ambiguous ownership. |
+| c03, c05 | Face spelling selected Concept-point interpretation | Bind planar aliases to the active host face. Spatial point references still use their existing owner and frame checks. |
+| c04 | Direct mechanical Hole required a constructor despite an equivalent typed array | Use the existing typed AST vector binder for either form. |
+| d01 | Generic EdgeFinish never reached the existing Kind consumer | Bind generic/Kind variants once, reject conflicts, and project the header/alias at AST spans. Close profile finish fields through their actual reads so extras cannot disappear. |
+| d05 | Capability failure discarded its source span | Carry a typed kernel diagnostic span and map LF/expanded offsets back to the retained original declaration. Fillet + Hole remains rejected. |
+| e01 | Pocket only bound Depth | Explicit ThroughAll lowers to existing Remove/ThroughCut; conflicting depth/floor policies reject. e02 remains an accidental through-depth error. |
+| f01, f03 | Derivative missing-operand noise obscured profile errors; Segment location lost | Preserve causal profile diagnostics and locate rejected inline endpoints at original Segment declarations. Inline Segment endpoints remain unsupported. |
+| f02, f04 | Explicit polygons required a separately named Set | Admit inline typed points through the existing explicit boundary checks and guide generation. No new polygon kernel. |
+| g01 | A closed polygon guide had no Profile value for Revolve | Adapt that directly consumed closed polygon to its existing closed Profile before ordinary Revolve binding. |
+| h02 | Model-level Source Pattern had no Modify target; sized Box had no Concept projection bounds | Wrap the Pattern for the sole body and derive projection bounds from the same established Box dimensions. |
+| chimera | Combined occurrences of the issues above | Compile through the normal CLI and compare with its unchanged reference and recorded measurements. |
+| all eleven guards | Existing admitted spellings | Retain their source and geometry oracles unchanged. |
+
+The full-suite iteration exposed legacy readers sensitive to reprinted syntax.
+The final transport changes only AST-owned value/header/wrapper spans, preserving
+unrelated ProfileDelta anchors and Concept descriptors. The Expose reader now
+uses existing AST field nodes, so semicolons cannot become part of a reference.
+Two obsolete test expectations were reconciled with the deliberate new behavior:
+bracket points are admitted, and missing paths report the causal binding error
+rather than a derivative Compose operand error.
+
+## Decisions and boundaries
+
+The [language decision register](../development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md)
+records these decisions before the allowed design specimen change. `Static`
+remains the Model-local value keyword; Feature-local `let` is unchanged.
+`Polygon2 { points: [...] }` is the inline explicit form. Named vertices remain
+available for stable identities under reordering. Generic finish variants retain
+Kind aliases, and explicit ThroughAll retains finite-depth Pocket diagnostics.
+Public syntax, boundary and geometry documentation is updated in place.
+
+There is no new whole-document dispatch route, fatality allowlist, independent
+field schema, macro system, or geometry operation. The new span transport uses
+existing AST ownership; generated nodes without a matching original declaration
+still receive a disclosed enclosing location rather than a fabricated precise
+span. This does not claim universal expression consolidation or complete expansion
+source maps.
+
+The chamfer's existing wall splitting (98 faces / 22 cylindrical surfaces) is
+unchanged and remains a separate topology optimization. No motion work is included.
+
+## Reproduction
+
+```powershell
+$env:MSBUILDDISABLENODEREUSE = '1'
+dotnet build Aetheris.slnx -c Release -m:1 -nr:false -p:UseSharedCompilation=false
+python fixtures/Regression/FrontendX4/run.py
+dotnet test Aetheris.Kernel.Core.Tests -c Release --no-build --filter "Category!=SlowCorpus"
+dotnet test Aetheris.slnx -c Release --no-build -m:1 -nr:false -- RunConfiguration.MaxCpuCount=1
+```
+
+`--record` was not used. `expected.json`, the reference sources and the chimera
+are unchanged. Raw logs and per-run artifacts belong under ignored
+`artifacts/local/`; the [compact evidence](FIRMAMENT-FRONTEND-X4.evidence.json)
+retains final counts, source hashes and geometry comparison results.
+
+## Final qualification
+
+| Gate | Final result |
+| --- | --- |
+| Release solution build | Passed; existing compiler/analyzer/WASM warnings remain. |
+| Claude corpus | **32/32**, including all eleven unchanged guards and all four diagnostic cases. |
+| Chimera | **98 faces, 240 edges, 144 vertices**, bounds `[-35,-30,0]` to `[35,30,6]`, volume approximately **20769.235 mm³**; surface families and volume match its unchanged baseline and recorded geometry. |
+| Focused final tests | **93 passed**, including the corpus, rejection boundaries and repaired legacy consumers. |
+| Core fast lane | **1,068 passed**; the final full lane also includes its slow corpus. |
+| Full regression | **5,112 passed, zero failed, zero skipped**, across 20 executing test assemblies. FrictionLab's existing empty test project has no tests to execute. |
+| Complete fixture inventory | **1,375 sources** classified, **368/368 canonical sources structurally represented**, **zero unresolved mismatches**. Standalone production admits 571; other rows retain their negative, capability, compatibility or consumer-required dispositions. |
+| Existing corpus comparison | All **1,326 pre-existing source hashes** unchanged; no previously admitted standalone source regressed. Five former rejections now admit the repaired Top alias. |
+| Frozen showcase STEP comparison | **26/26 byte-identical** to the X1 closeout evidence, with original source hashes checked first. Includes assembly, threaded, PMI, profile and sculpting examples. |
+| Additional Top aliases | All five boss/pocket/hole sources produce **byte-identical STEP** to equivalent `+Z` sources and equal topology, bounds, surface families and numerical volume. |
+| Runtime cleanup | No dotnet, testhost, MSBuild, VBCSCompiler or aetheris hosts remained in the final snapshot. |
+
+The five additional admissions are `boss-hole`, `boss-hole-unique`,
+`boss-stack-hole`, `boss-stack-hole-unique` and `pocket-hole` under
+`Regression/LanguageBurnIn`. Their ordinary through-hole volumes also agree with
+analytic stock/addition/removal calculations within 0.001%, a separately stated
+check for the existing numerical mass integrator. This does **not** relax the
+1e-9 reference comparisons or alter the corpus runner's geometry tolerances.
+
+Three unusual negative-folder sources were rechecked against the final binary:
+the singular FEA map rejects at solve with `thinwall-map-singular`, the misfiled
+Rect2/TraceLoop source builds the correct six-face solid, and the tray source
+admits geometry while reporting its intended DFM warning. Their dispositions
+are explicit rather than inferred from directory names.
+
+For complete corpus replay, collect production outcomes with
+`frontend-shadow --corpus fixtures --production --output-dir artifacts/local/frontend-x4/corpus`
+(the historical command name is developer instrumentation, not a separate
+admission parser). Pass the report to `scripts/classify-firmament-frontend-x1.py`.
+The evidence JSON's `downstreamDispositions` object supplies the three reviewed
+source-hash-bound exceptions; their expected observations are recorded above. Recheck them with:
+
+```powershell
+dotnet Aetheris.CLI/bin/Release/net10.0/aetheris.dll fea fixtures/Invalid/FEA/ExperimentalShell/singular-map.firmament --out-dir artifacts/local/frontend-x4/singular-map --json
+dotnet Aetheris.CLI/bin/Release/net10.0/aetheris.dll build fixtures/Invalid/Pipeline/traceloop-non-loop.firmament --output artifacts/local/frontend-x4/misfiled-positive.step --json
+dotnet Aetheris.CLI/bin/Release/net10.0/aetheris.dll sheetmetal inspect fixtures/Invalid/SheetMetal/tray-dfm-violation.firmament --json
+```
+
+Extract `downstreamDispositions` from the evidence JSON into an ignored JSON file
+and pass that path as the classifier's `--downstream-evidence` argument after
+rechecking the observations.
+
+## Code-quality review and remaining scope
+
+The review checked field ownership, severity, source spans, source transport,
+parser dispatch, shared validation/build admission and process lifetime. The
+coordinate literal regex checks and Expose field regex were removed. The only
+added regex construction wraps an existing unchanged Profile-mode lookup so its
+read participates in AST field consumption. No fatal-code allowlist, global
+mutable state, new document dispatcher or product-specific validator was added.
+
+The compiler still has domain adapters and bounded source serialization between
+AST binding and established lowerers. This pass does not claim universal semantic
+parity, general inline Segment endpoints, every cross-domain expression form, or
+complete generated-source provenance. Those remain tracked in the original
+language register. None of the reported X4 cases remains blocked, and this pass
+requires no further language decision from the user.
diff --git a/fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament b/fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament
new file mode 100644
index 00000000..76d12703
--- /dev/null
+++ b/fixtures/Regression/Fillet/top-boundary-with-counterbore.firmament
@@ -0,0 +1,16 @@
+Model RoundedMount {
+ units: mm
+ Box Body { size: [60mm, 40mm, 10mm] }
+ Modify Body {
+ Hole<Shaft> Pilot { on: +Z; center: [-12mm, 0mm]; diameter: 6mm; end: ThroughAll }
+ Hole<Counterbore> Fastener {
+ on: +Z
+ center: [12mm, 0mm]
+ diameter: 4mm
+ end: ThroughAll
+ counterboreDiameter: 8mm
+ counterboreDepth: 3mm
+ }
+ EdgeFinish<Fillet> TopEdge { face: +Z; target: Boundary; radius: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX0/README.md b/fixtures/Regression/FrontendX0/README.md
index 967330e8..009e2f79 100644
--- a/fixtures/Regression/FrontendX0/README.md
+++ b/fixtures/Regression/FrontendX0/README.md
@@ -17,15 +17,16 @@ records belong under ignored `artifacts/local/frontend-x0/`.
| unknown-modify-statement | Modify-level unknown Fillet statement |
| unknown-box-field | Unknown dimension field must not disappear |
| unsupported-xz-layout | Asymmetric six-edge L outline, 60 x 30 x 3 mm; XY must not substitute for XZ |
-| combined-fillet-hole | Parsed features rejected at the actual capability boundary |
+| combined-fillet-hole | Original source now admitted by the 2026-10-15 bounded Fillet + Hole capability follow-up |
+| combined-fillet-hole-intersection | Parsed features rejected because the hole crosses the requested fillet band |
| unresolved-semantic-source | Selection binding must preserve AbsentEdge and its explanation |
-| edgefinish-generic-variant | Unsupported generic spelling must not validate as build-admitted |
+| edgefinish-generic-variant | Generic spelling is recognized; this semantic-selection consumer still requires its admitted materialization path |
| through-pocket | Finite Pocket reaching through the stock must suggest the through-cut vocabulary |
-| unknown-compose-statement | **Open defect:** advanced Compose ignores nested Fillet |
-| unknown-boundary-field | **Open defect:** boundary lowering discards heigth before Compose admission |
+| unknown-compose-statement | Former ignored nested Fillet: now rejected as unknown intent |
+| unknown-boundary-field | Former discarded heigth: now rejected before Compose admission |
-The last two remain reproduction evidence, not accepted language forms. Do not
-turn their current successful compilation into a compatibility requirement.
+The last two remain negative reproduction evidence; their historical silent
+acceptance is not a compatibility requirement. See the X4 closeout for their repair.
## Twelve-part audit coverage map
diff --git a/fixtures/Regression/FrontendX0/combined-fillet-hole-intersection.firmament b/fixtures/Regression/FrontendX0/combined-fillet-hole-intersection.firmament
new file mode 100644
index 00000000..8440a34c
--- /dev/null
+++ b/fixtures/Regression/FrontendX0/combined-fillet-hole-intersection.firmament
@@ -0,0 +1,8 @@
+Model IntersectingFilletHole {
+ units: mm
+ Box Body { size: [40mm, 20mm, 6mm] }
+ Modify Body {
+ Hole<Shaft> Mount { on: +Z; center: Point2(17mm, 0mm); diameter: 4mm; end: ThroughAll }
+ EdgeFinish TopRound { face: +Z; target: Boundary; kind: Fillet; radius: 2mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/README.md b/fixtures/Regression/FrontendX4/README.md
index ae63a552..66873b13 100644
--- a/fixtures/Regression/FrontendX4/README.md
+++ b/fixtures/Regression/FrontendX4/README.md
@@ -36,8 +36,11 @@ Each case goes through both `validate --json` and `build`.
of the same constructs.
3. **`--record` rewrites the recorded geometry.** Use it only when a geometry change is intended
and explained in the commit, as the M4 report did for its hash changes.
-4. **No new kernel capability is in scope.** Fillet plus Hole stays rejected (#24). Only its
- diagnostic moves.
+4. **Original X4 scope was diagnostic-only for kernel gaps.** The explicitly authorized
+ 2026-10-15 follow-up now admits d05 (disjoint Box top-boundary Fillet + ThroughAll Hole).
+ Its original source is unchanged; only that manifest expectation gains a geometry baseline.
+ Touching/intersecting holes and unsupported selectors remain rejection tests. See the
+ [capability report](../../../docs/release/FIRMAMENT-FILLET-HOLE.md).
## The chimera
@@ -82,7 +85,7 @@ removes about 31 mm³.
| c05 | fix | X2 #21 | F19 | "only +Z" for `On: Top` | `Top` in a Feature hole |
| c06 | fix | X3 #10 | F23 | `static-set-entry-type-mismatch` | `[x, y]` entries in `Set<Point2>` |
| d01 | fix | X3 #11 | F22 | `SemanticSourceNotFound` at (1,1), no message | `EdgeFinish<Chamfer>`, keeping `Kind:` as an alias |
-| d05 | diagnostic | #24 | F5 | `CombinedFeatureSelectionLost` at (1,1) | Same code, at the EdgeFinish line (6) |
+| d05 | capability follow-up | #24 | F5 | Originally `CombinedFeatureSelectionLost` at (1,1) | Now builds the original source: 11 faces, 23 edges, 14 vertices; 4 fillet cylinders plus the hole wall |
| e01 | fix | X3 #13 | F21 | `pocket-missing-required-field` | `Pocket … End: ThroughAll` = `Remove … Role: ThroughCut` |
| e02 | diagnostic | X3 #13 | F21 | correct at (6,5) | Keep it |
| f01 | diagnostic | X0 #5 | F9 | correct code at line 9, after `ConceptPathProfileNotAdmittedByCompose` noise | Keep it; drop the noise |
@@ -108,3 +111,23 @@ removes about 31 mm³.
heavier than it needs to be. This is not part of acceptance.
- **Binding-level diagnostics still default to (1,1) or the Model header** (a05, a06, c03, c04,
d01, d05, e01, f02). Syntax-level ones already carry exact spans.
+
+## Repair qualification (2026-10-15)
+
+See [the repair and qualification report](../../../docs/release/FIRMAMENT-FRONTEND-X4.md).
+The `Today` column above preserves Claude's original observations. The a01
+design specimen now uses the decided `Static` spelling, as its reference and
+the chimera already did. Other specimens and geometry goldens are unchanged.
+The runner's checks and tolerances are unchanged; generated STEP and verify
+evidence now default to ignored `artifacts/local/frontend-x4/` rather than the
+system temporary directory. `--record` was not used for the repair.
+
+
+## Fillet + Hole capability follow-up (2026-10-15)
+
+The user authorized the engineering capability after X4 qualification. `d05` now
+expects acceptance, with unchanged source. Every other recorded geometry value
+remains unchanged. The numerical `verify` volume is a deterministic regression
+fingerprint, not analytic volume authority. The combined plan's analytic volume
+is checked independently against section integration and its emitted cylinder /
+ellipse supports are checked through AP242 preflight and round trip.
diff --git a/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament b/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament
index 7d85859d..091651a2 100644
--- a/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament
+++ b/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament
@@ -1,5 +1,5 @@
Model LetPlate {
Units: mm
- let thickness = 6mm
+ Static thickness = 6mm
Box Body { Size: [60mm, 40mm, thickness] }
}
diff --git a/fixtures/Regression/FrontendX4/expected.json b/fixtures/Regression/FrontendX4/expected.json
index 21858ece..3d4da2de 100644
--- a/fixtures/Regression/FrontendX4/expected.json
+++ b/fixtures/Regression/FrontendX4/expected.json
@@ -694,14 +694,35 @@
{
"id": "d05",
"file": "cases/d05-fillet-with-hole.firmament",
- "kind": "diagnostic",
+ "kind": "capability",
"register": "#24",
"findings": "F5",
- "expect": "invalid",
+ "expect": "valid",
"observedAt0a72e6f": "CombinedFeatureSelectionLost at (1,1)",
- "note": "Capability gap, stays rejected. The diagnostic must point at the EdgeFinish line.",
- "code": "CombinedFeatureSelectionLost",
- "line": 6
+ "note": "2026-10-15: explicitly authorized kernel follow-up admits disjoint top Boundary Fillet plus ThroughAll shaft/counterbore holes. Original source unchanged. Four exact cylindrical blends meet on elliptical seams. Interacting holes remain diagnostic regressions in CombinedFilletHoleTests.",
+ "geometry": {
+ "faces": 11,
+ "edges": 23,
+ "vertices": 14,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 5
+ },
+ "volume": 23460.317970712236
+ }
},
{
"id": "e01",
diff --git a/fixtures/Regression/FrontendX4/run.py b/fixtures/Regression/FrontendX4/run.py
index bd10d240..9f205208 100644
--- a/fixtures/Regression/FrontendX4/run.py
+++ b/fixtures/Regression/FrontendX4/run.py
@@ -31,6 +31,12 @@ from pathlib import Path
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[2]
VOLUME_REL = 1e-9
+ARTIFACTS = ROOT / "artifacts" / "local" / "frontend-x4"
+
+
+def scratch(prefix: str) -> Path:
+ ARTIFACTS.mkdir(parents=True, exist_ok=True)
+ return Path(tempfile.mkdtemp(prefix=prefix, dir=ARTIFACTS))
def default_cli() -> Path:
@@ -58,7 +64,7 @@ def build(cli: Path, source: Path, out: Path) -> tuple[bool, str]:
def geometry(cli: Path, step: Path) -> dict:
s = json.loads(run(cli, "inspect", str(step), "--json").stdout)["summary"]
- evidence = Path(tempfile.mkdtemp(prefix="x4-verify-"))
+ evidence = scratch("verify-")
v = json.loads(run(cli, "verify", str(step), "--json", "--evidence-dir", str(evidence)).stdout)
bb = s["boundingBox"]
return {
@@ -137,7 +143,7 @@ def main() -> int:
manifest_path = HERE / "expected.json"
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
only = {x.strip() for x in args.only.split(",") if x.strip()}
- tmp = Path(tempfile.mkdtemp(prefix="x4-"))
+ tmp = scratch("run-")
failures = 0
rows = []
for case in manifest["cases"]: