Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Advance parser-backed box trace to profile emission
Yuechen Li2901a7b5be3e
diff --git a/Aetheris.CLI.Tests/AirTraceCommandTests.cs b/Aetheris.CLI.Tests/AirTraceCommandTests.csindex 650a6f02..a78d924b 100644--- a/Aetheris.CLI.Tests/AirTraceCommandTests.cs+++ b/Aetheris.CLI.Tests/AirTraceCommandTests.cs@@ -107,22 +107,24 @@ public sealed class AirTraceCommandTests[Fact]- public void TraceParserBackedBoxFixture_ReachesConstructiveAir_DefaultText()+ public void TraceParserBackedBoxFixture_ReachesProfileEmission_DefaultText(){var (exitCode, output, error) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"));Assert.Equal(0, exitCode); Assert.True(string.IsNullOrWhiteSpace(error));Assert.False(output.TrimStart().StartsWith("{", StringComparison.Ordinal));Assert.Contains("Fixture", output); Assert.Contains("Frontend", output);Assert.Contains("Parser-backed: true", output); Assert.Contains("Parse succeeded: true", output);- Assert.Contains("Expected stage: constructive-air", output); Assert.Contains("Actual stage: constructive-air", output);+ Assert.Contains("Expected stage: emitted-brep", output); Assert.Contains("Actual stage: emitted-brep", output);Assert.Contains("Feature AIR", output); Assert.Contains("Source op: box", output); Assert.Contains("Node: CreateBox", output);Assert.Contains("Constructive AIR", output); Assert.Contains("Node: AirProfileExtrude", output); Assert.Contains("Canonical form: rectangle-profile-extrude", output);Assert.Contains("Profile: Rectangle(width=10, depth=8)", output); Assert.Contains("Extrusion: height=6", output);+ Assert.Contains("Profile extrusion emission", output); Assert.Contains("Wrapper invoked: true", output);+ Assert.Contains("Emitter: LineArcProfileExtrudeEmitter", output); Assert.Contains("Succeeded: true", output);Assert.Contains("Expectation satisfied: true", output);}[Fact]- public void TraceParserBackedBoxFixture_ReachesConstructiveAir_Json()+ public void TraceParserBackedBoxFixture_ReachesProfileEmission_Json(){var (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");Assert.Equal(0, exitCode);@@ -133,18 +135,22 @@ public sealed class AirTraceCommandTestsAssert.True(root.GetProperty("fixture").GetProperty("expectationSatisfied").GetBoolean());Assert.True(root.GetProperty("frontend").GetProperty("parserBacked").GetBoolean());Assert.True(root.GetProperty("frontend").GetProperty("parseSucceeded").GetBoolean());- Assert.Equal("constructive-air", root.GetProperty("frontend").GetProperty("frontendStageReached").GetString());- Assert.Equal("constructive-air", root.GetProperty("actualStageReached").GetString());+ Assert.Equal("emitted-brep", root.GetProperty("frontend").GetProperty("frontendStageReached").GetString());+ Assert.Equal("emitted-brep", root.GetProperty("actualStageReached").GetString());Assert.Equal("box", root.GetProperty("featureAir").GetProperty("sourceOpKind").GetString());Assert.Equal("CreateBox", root.GetProperty("featureAir").GetProperty("nodeKind").GetString());Assert.Equal("AirProfileExtrude", root.GetProperty("constructiveAir").GetProperty("nodeKind").GetString());Assert.Equal("rectangle-profile-extrude", root.GetProperty("constructiveAir").GetProperty("canonicalForm").GetString());- Assert.Contains("air-x10-firmament-parse-succeeded", output);+ Assert.True(root.TryGetProperty("profileEmission", out var profileEmission));+ Assert.True(profileEmission.GetProperty("wrapperInvoked").GetBoolean());+ Assert.Equal("LineArcProfileExtrudeEmitter", profileEmission.GetProperty("emitterName").GetString());+ Assert.True(profileEmission.GetProperty("succeeded").GetBoolean());+ Assert.Contains("air-x11-profile-extrude-wrapper-invoked", output);}[Fact]- public void TraceParserBackedBoxFixture_DimensionsMappedToProfileExtrude()+ public void TraceParserBackedBoxFixture_ProfileEmissionUsesConstructiveDimensions(){var (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");Assert.Equal(0, exitCode);@@ -158,7 +164,11 @@ public sealed class AirTraceCommandTestsAssert.Equal(8, constructive.GetProperty("depth").GetDouble());Assert.Equal(6, constructive.GetProperty("height").GetDouble());Assert.Equal("Rectangle", constructive.GetProperty("profileKind").GetString());- Assert.Contains("air-x10-box-dimensions-extracted", output);+ var emission = doc.RootElement.GetProperty("profileEmission");+ Assert.Equal(10, emission.GetProperty("width").GetDouble());+ Assert.Equal(8, emission.GetProperty("depth").GetDouble());+ Assert.Equal(6, emission.GetProperty("height").GetDouble());+ Assert.Contains("air-x11-profile-emission-summary-created", output);}[Fact]@@ -167,12 +177,24 @@ public sealed class AirTraceCommandTestsvar (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");Assert.Equal(0, exitCode);using var doc = JsonDocument.Parse(output); var root = doc.RootElement;- Assert.Equal("constructive-air", root.GetProperty("actualStageReached").GetString());+ Assert.Equal("emitted-brep", root.GetProperty("actualStageReached").GetString());Assert.Equal("none", root.GetProperty("brepPlan").GetProperty("planKind").GetString());Assert.Equal("not-requested", root.GetProperty("cirMirror").GetProperty("status").GetString());Assert.Equal("AirProfileExtrude", root.GetProperty("constructiveAir").GetProperty("nodeKind").GetString());- Assert.Contains("air-x10-brepplan-deferred", output);- Assert.Contains("air-x10-cir-mirror-deferred", output);+ Assert.Contains("air-x11-brepplan-deferred", output);+ Assert.Contains("air-x11-cir-mirror-deferred", output);+ }++ [Fact]+ public void TraceParserBackedBoxFixture_StepSmokeTruthful()+ {+ var (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");+ Assert.Equal(0, exitCode);+ using var doc = JsonDocument.Parse(output);+ var stepSmoke = doc.RootElement.GetProperty("profileEmission").GetProperty("stepSmoke");+ Assert.False(stepSmoke.GetProperty("wasChecked").GetBoolean());+ Assert.False(stepSmoke.GetProperty("succeeded").GetBoolean());+ Assert.Contains("air-x11-step-smoke-unavailable", output);}[Fact]@@ -187,7 +209,7 @@ public sealed class AirTraceCommandTests[Fact]public void ParserBackedBoxExpectationFailure_ReturnsNonZeroWithReport(){- var source = File.ReadAllText(PrimitiveFixture("valid/box.valid.firmfixture")).Replace("// expected-stage: constructive-air", "// expected-stage: cir-mirror", StringComparison.Ordinal);+ var source = File.ReadAllText(PrimitiveFixture("valid/box.valid.firmfixture")).Replace("// expected-stage: emitted-brep", "// expected-stage: cir-mirror", StringComparison.Ordinal);var path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N") + ".valid.firmfixture");File.WriteAllText(path, source);var (exitCode, output, error) = Run("trace", "--fixture", path, "--json");@@ -195,7 +217,7 @@ public sealed class AirTraceCommandTestsusing var doc = JsonDocument.Parse(output); var root = doc.RootElement;Assert.False(root.GetProperty("fixture").GetProperty("expectationSatisfied").GetBoolean());Assert.True(root.GetProperty("frontend").GetProperty("parseSucceeded").GetBoolean());- Assert.Equal("constructive-air", root.GetProperty("actualStageReached").GetString());+ Assert.Equal("emitted-brep", root.GetProperty("actualStageReached").GetString());Assert.Contains("air-x10-firmament-parse-succeeded", output);}diff --git a/Aetheris.CLI/AirTrace.cs b/Aetheris.CLI/AirTrace.csindex 74067e6a..31614433 100644--- a/Aetheris.CLI/AirTrace.cs+++ b/Aetheris.CLI/AirTrace.cs@@ -38,12 +38,16 @@ internal sealed record AirTraceReport(IReadOnlyList<string>? FixtureDiagnostics = null,AirTraceFrontendSummary? Frontend = null,AirTraceFeatureAirSummary? FeatureAir = null,- AirTraceConstructiveAirSummary? ConstructiveAir = null);+ AirTraceConstructiveAirSummary? ConstructiveAir = null,+ AirTraceProfileEmissionSummary? ProfileEmission = null);internal sealed record AirTraceFixtureSummary(string Path, string Expectation, string CaseName, string? ExpectedStage, string ActualStageReached, string? ExpectedRoute, string? ExpectedReason, bool ExpectationSatisfied, bool ParserBacked, IReadOnlyList<string> Diagnostics);internal sealed record AirTraceFrontendSummary(bool ParserBacked, string? ParserName, bool? ParseSucceeded, IReadOnlyList<string> ParseDiagnostics, string? FrontendStageReached, string? FrontendSummary);internal sealed record AirTraceFeatureAirSummary(bool ParserBacked, string SourceOpKind, string NodeKind, AirTraceDimensionsSummary? Dimensions, string ConstructionIntent, string StageReached, IReadOnlyList<string> Diagnostics, IReadOnlyList<string> Guarantees);internal sealed record AirTraceConstructiveAirSummary(string NodeKind, string CanonicalForm, string SourceFeatureAirNodeKind, string ProfileKind, double Width, double Depth, double Height, string ExtrusionAxis, string ConstructionIntent, string RouteKind, string StageReached, IReadOnlyList<string> Diagnostics, IReadOnlyList<string> Guarantees);+internal sealed record AirTraceProfileEmissionSummary(bool WrapperInvoked, string EmitterName, bool Succeeded, double Width, double Depth, double Height, string StageReached, AirTraceProfileEmissionTopologySummary? TopologySummary, AirTraceProfileEmissionStepSmokeSummary StepSmoke, IReadOnlyList<string> Diagnostics, IReadOnlyList<string> Guarantees);+internal sealed record AirTraceProfileEmissionTopologySummary(int Vertices, int Edges, int Faces, int PlanarFaces, int CylindricalFaces, int Loops, int Coedges, int? CapFaces, int? SideFaces, string? Bounds);+internal sealed record AirTraceProfileEmissionStepSmokeSummary(bool WasChecked, bool Succeeded, bool RequiredMarkersPresent, bool ForbiddenMarkersAbsent, IReadOnlyList<string> Diagnostics);internal sealed record AirTraceDimensionsSummary(double Width, double Depth, double Height);internal sealed record AirTraceAirSummary(string Node, string Route, string SelectionClass, string Rule, string ConstructionHistory, string FeatureName, string FeatureId, string ProvenanceMilestone);internal sealed record AirTraceRouteDecisionSummary(string Mode, string? SelectedRoute, bool Succeeded, string Recommendation, string SelectionClass, string Rule, IReadOnlyList<string> Diagnostics);@@ -106,12 +110,13 @@ internal static class AirTraceReportBuilderprivate static AirTraceReport BuildParserBackedFixture(FirmFixture fixture){var frontend = FirmamentFrontendTraceProbe.ParseOnly(fixture.SourceBody);- var actualStage = frontend.FrontendStageReached;+ var profileEmissionProbe = frontend.ConstructiveAir is null ? null : BoxConstructiveAirToProfileEmissionTraceProbe.Invoke(frontend.ConstructiveAir);+ var actualStage = profileEmissionProbe?.StageReached ?? frontend.FrontendStageReached;var expectedStageSatisfied = string.IsNullOrWhiteSpace(fixture.ExpectedStage) || string.Equals(actualStage, fixture.ExpectedStage, StringComparison.Ordinal);var expectationSatisfied = fixture.Expectation == "valid"- ? frontend.ParseSucceeded && expectedStageSatisfied+ ? frontend.ParseSucceeded && expectedStageSatisfied && (profileEmissionProbe?.Succeeded ?? true): !frontend.ParseSucceeded && expectedStageSatisfied;- var fxDiagnostics = Stable([.. fixture.Diagnostics, .. frontend.Diagnostics, "air-x8-parser-backed-fixture-trace-created", expectationSatisfied ? "air-x8-parser-backed-expectation-satisfied" : "air-x8-parser-backed-expectation-not-satisfied"]).ToArray();+ var fxDiagnostics = Stable([.. fixture.Diagnostics, .. frontend.Diagnostics, .. profileEmissionProbe?.Diagnostics ?? [], "air-x8-parser-backed-fixture-trace-created", "air-x11-parser-backed-fixture-loaded", "air-x11-firmament-parser-invoked", frontend.ParseSucceeded ? "air-x11-firmament-parse-succeeded" : "air-x11-firmament-parse-failed", expectationSatisfied ? "air-x11-parser-backed-expectation-satisfied" : "air-x11-profile-emission-expectation-not-satisfied"]).ToArray();var featureAir = frontend.FeatureAir is null? null@@ -128,20 +133,33 @@ internal static class AirTraceReportBuilder? null: new AirTraceConstructiveAirSummary(frontend.ConstructiveAir.NodeKind, frontend.ConstructiveAir.CanonicalForm, frontend.ConstructiveAir.SourceFeatureAirNodeKind, frontend.ConstructiveAir.ProfileKind, frontend.ConstructiveAir.Dimensions.Width, frontend.ConstructiveAir.Dimensions.Depth, frontend.ConstructiveAir.Dimensions.Height, frontend.ConstructiveAir.ExtrusionAxis, frontend.ConstructiveAir.ConstructionIntent, frontend.ConstructiveAir.RouteKind, frontend.ConstructiveAir.StageReached, frontend.ConstructiveAir.Diagnostics, frontend.ConstructiveAir.Guarantees);- return new("AIR-X10", "trace", "lowering", "firmfixture", fixture.CaseName, expectationSatisfied, frontend.FrontendSummary,- new(constructiveAir?.NodeKind ?? featureAir?.NodeKind ?? "FirmamentPrimitive", constructiveAir?.RouteKind ?? "none", "none", "none", "parser-backed-source-fixture", fixture.CaseName, fixture.CaseName, "AIR-X10"),- new("none", null, false, "Route selection, BRepPlan, emission, STEP, and CIR are deferred for parser-backed box fixtures in AIR-X10.", "none", "none", []),+ var profileEmission = profileEmissionProbe is null ? null : new AirTraceProfileEmissionSummary(+ profileEmissionProbe.WrapperInvoked,+ profileEmissionProbe.EmitterName,+ profileEmissionProbe.Succeeded,+ profileEmissionProbe.Width,+ profileEmissionProbe.Depth,+ profileEmissionProbe.Height,+ profileEmissionProbe.StageReached,+ profileEmissionProbe.TopologySummary is null ? null : new AirTraceProfileEmissionTopologySummary(profileEmissionProbe.TopologySummary.Vertices, profileEmissionProbe.TopologySummary.Edges, profileEmissionProbe.TopologySummary.Faces, profileEmissionProbe.TopologySummary.PlanarFaces, profileEmissionProbe.TopologySummary.CylindricalFaces, profileEmissionProbe.TopologySummary.Loops, profileEmissionProbe.TopologySummary.Coedges, profileEmissionProbe.TopologySummary.CapFaces, profileEmissionProbe.TopologySummary.SideFaces, profileEmissionProbe.TopologySummary.Bounds),+ new AirTraceProfileEmissionStepSmokeSummary(profileEmissionProbe.StepSmoke.WasChecked, profileEmissionProbe.StepSmoke.Succeeded, profileEmissionProbe.StepSmoke.RequiredMarkersPresent, profileEmissionProbe.StepSmoke.ForbiddenMarkersAbsent, profileEmissionProbe.StepSmoke.Diagnostics),+ profileEmissionProbe.Diagnostics,+ profileEmissionProbe.Guarantees);++ return new("AIR-X11", "trace", "lowering", "firmfixture", fixture.CaseName, expectationSatisfied, frontend.FrontendSummary,+ new(constructiveAir?.NodeKind ?? featureAir?.NodeKind ?? "FirmamentPrimitive", constructiveAir?.RouteKind ?? "none", "none", "none", "parser-backed-source-fixture", fixture.CaseName, fixture.CaseName, "AIR-X11"),+ new("none", null, false, "Route selection and BRepPlan are deferred for parser-backed box fixtures in AIR-X11; profile emission is reported separately.", "none", "none", []),new("none", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "none", "none", null, []),- new("none", false, "parser-backed fixture stops at Constructive AIR summary; BRepPlan, emission, STEP, and CIR are deferred"),- new(false, false, false, false, []),+ new(profileEmission?.EmitterName ?? "none", profileEmission?.Succeeded ?? false, profileEmission is null ? "parser-backed fixture stops before profile emission" : "parser-backed fixture invoked existing profile extrusion wrapper/emitter summary"),+ new(profileEmission?.StepSmoke.WasChecked ?? false, profileEmission?.StepSmoke.Succeeded ?? false, profileEmission?.StepSmoke.RequiredMarkersPresent ?? false, profileEmission?.StepSmoke.ForbiddenMarkersAbsent ?? false, profileEmission?.StepSmoke.Diagnostics ?? []),new("not-requested", "none", "none", "FirmamentPrimitive", "none", "none", "none", [], [], [], []),- [], ["BRepPlan/emission/CIR deferred for parser-backed box fixture"], fxDiagnostics,- ["real Firmament parser invoked", "parser-backed fixture reaches Feature AIR summary", "parser-backed fixture reaches Constructive AIR summary", "ProfileExtrude wrapper not invoked", "no production grammar expansion", "no production route replacement", "no new geometry"],+ [], ["BRepPlan/CIR deferred for parser-backed box fixture", "STEP smoke unavailable for parser-backed box fixture"], fxDiagnostics,+ ["real Firmament parser invoked", "parser-backed fixture reaches Feature AIR summary", "parser-backed fixture reaches Constructive AIR summary", "ProfileExtrude wrapper invoked", "no production grammar expansion", "no production route replacement", "no new geometry", "no profile emitter rewrite"],["no production Firmament grammar expansion", "no production route replacement", "no production analyzer behavior change", "no STEP exporter/importer change", "no BRep topology behavior change", "no route-selection/JudgmentUtility behavior change", "no CIR evaluator/tape behavior change", "no Boolean behavior change", "no AirEdgeSweep behavior change", "no BrepBoundedChamfer/BrepBoundedFillet behavior change", "no chamfer/fillet/shell geometry change", "no new geometry"],new(fixture.Path, fixture.Expectation, fixture.CaseName, fixture.ExpectedStage, actualStage, fixture.ExpectedRoute, fixture.ExpectedReason, expectationSatisfied, true, fxDiagnostics),fixture.Path, fixture.Expectation, fixture.CaseName, fixture.ExpectedStage, actualStage, fixture.ExpectedRoute, fixture.ExpectedReason, expectationSatisfied, fxDiagnostics,new(true, frontend.ParserName, frontend.ParseSucceeded, frontend.Diagnostics, actualStage, frontend.FrontendSummary),- featureAir, constructiveAir);+ featureAir, constructiveAir, profileEmission);}public static string FixtureFileStem(FirmFixture fixture) => $"air-x7-{fixture.CaseName}-firmfixture-trace";@@ -231,6 +249,12 @@ internal static class AirTraceTextRenderer{b.AppendLine("Constructive AIR"); b.AppendLine($" Node: {r.ConstructiveAir.NodeKind}"); b.AppendLine($" Canonical form: {r.ConstructiveAir.CanonicalForm}"); b.AppendLine($" Profile: {r.ConstructiveAir.ProfileKind}(width={r.ConstructiveAir.Width:g}, depth={r.ConstructiveAir.Depth:g})"); b.AppendLine($" Extrusion: height={r.ConstructiveAir.Height:g}"); b.AppendLine($" Extrusion axis: {r.ConstructiveAir.ExtrusionAxis}"); b.AppendLine($" Intent: {r.ConstructiveAir.ConstructionIntent}"); b.AppendLine($" Route kind: {r.ConstructiveAir.RouteKind}"); b.AppendLine($" Stage reached: {r.ConstructiveAir.StageReached}"); b.AppendLine(" Diagnostics:"); foreach (var d in r.ConstructiveAir.Diagnostics) b.AppendLine($" - {d}"); b.AppendLine();}+ if (r.ProfileEmission is not null)+ {+ b.AppendLine("Profile extrusion emission"); b.AppendLine($" Wrapper invoked: {r.ProfileEmission.WrapperInvoked.ToString().ToLowerInvariant()}"); b.AppendLine($" Emitter: {r.ProfileEmission.EmitterName}"); b.AppendLine($" Succeeded: {r.ProfileEmission.Succeeded.ToString().ToLowerInvariant()}"); b.AppendLine($" Dimensions: width={r.ProfileEmission.Width:g}, depth={r.ProfileEmission.Depth:g}, height={r.ProfileEmission.Height:g}"); b.AppendLine($" Stage reached: {r.ProfileEmission.StageReached}");+ if (r.ProfileEmission.TopologySummary is not null) b.AppendLine($" Topology: vertices={r.ProfileEmission.TopologySummary.Vertices}, edges={r.ProfileEmission.TopologySummary.Edges}, faces={r.ProfileEmission.TopologySummary.Faces}, planarFaces={r.ProfileEmission.TopologySummary.PlanarFaces}, cylindricalFaces={r.ProfileEmission.TopologySummary.CylindricalFaces}, bounds={r.ProfileEmission.TopologySummary.Bounds}");+ b.AppendLine($" STEP smoke: {(r.ProfileEmission.StepSmoke.Succeeded ? "succeeded" : r.ProfileEmission.StepSmoke.WasChecked ? "failed" : "unavailable")}"); b.AppendLine(" Diagnostics:"); foreach (var d in r.ProfileEmission.Diagnostics) b.AppendLine($" - {d}"); b.AppendLine();+ }b.AppendLine("AIR"); b.AppendLine($" Node: {r.Air.Node}"); b.AppendLine($" Route: {r.Air.Route}"); b.AppendLine($" Selection class: {r.Air.SelectionClass}"); b.AppendLine($" Rule: {r.Air.Rule}"); b.AppendLine($" Construction history: {r.Air.ConstructionHistory}"); b.AppendLine();b.AppendLine("Route decision"); b.AppendLine($" Mode: {r.RouteDecision.Mode}"); b.AppendLine($" Selected route: {r.RouteDecision.SelectedRoute}"); b.AppendLine($" Succeeded: {r.RouteDecision.Succeeded.ToString().ToLowerInvariant()}"); b.AppendLine();b.AppendLine("BRepPlan"); b.AppendLine($" Plan kind: {r.BRepPlan.PlanKind}"); b.AppendLine($" Vertices: {r.BRepPlan.Vertices}"); b.AppendLine($" Edges: {r.BRepPlan.Edges}"); b.AppendLine($" Faces: {r.BRepPlan.Faces}"); b.AppendLine($" Loops: {r.BRepPlan.Loops}"); b.AppendLine($" Coedges: {r.BRepPlan.Coedges}"); b.AppendLine($" Cap faces: {r.BRepPlan.CapFaces}"); b.AppendLine($" Transition faces: {r.BRepPlan.TransitionFaces}"); b.AppendLine($" Chamfer faces: {r.BRepPlan.ChamferFaces}"); b.AppendLine($" Split policy: {r.BRepPlan.SplitPolicy}"); b.AppendLine($" Bounds: {r.BRepPlan.Bounds}"); b.AppendLine();diff --git a/Aetheris.Kernel.Firmament/Air/AirProfileExtrudeWrapper.cs b/Aetheris.Kernel.Firmament/Air/AirProfileExtrudeWrapper.csindex 2b903f8d..ddc13945 100644--- a/Aetheris.Kernel.Firmament/Air/AirProfileExtrudeWrapper.cs+++ b/Aetheris.Kernel.Firmament/Air/AirProfileExtrudeWrapper.cs@@ -7,7 +7,9 @@ namespace Aetheris.Kernel.Firmament.Air;internal static class AirProfileExtrudeWrapper{- public static AirLoweringSummary LowerCanonicalRectangleExtrude()+ public static AirLoweringSummary LowerCanonicalRectangleExtrude() => LowerRectangleExtrude(10, 8, 6);++ internal static AirLoweringSummary LowerRectangleExtrude(double width, double depth, double height){var diagnostics = new List<AirDiagnostic>{@@ -17,12 +19,12 @@ internal static class AirProfileExtrudeWrappervar result = LineArcProfileExtrudeEmitter.TryEmit(new LineArcProfileExtrudeRequest([new LineArcProfileLoop2D([- new LineArcLineSegment2D((-5, -4), (5, -4)),- new LineArcLineSegment2D((5, -4), (5, 4)),- new LineArcLineSegment2D((5, 4), (-5, 4)),- new LineArcLineSegment2D((-5, 4), (-5, -4)),+ new LineArcLineSegment2D((-width / 2d, -depth / 2d), (width / 2d, -depth / 2d)),+ new LineArcLineSegment2D((width / 2d, -depth / 2d), (width / 2d, depth / 2d)),+ new LineArcLineSegment2D((width / 2d, depth / 2d), (-width / 2d, depth / 2d)),+ new LineArcLineSegment2D((-width / 2d, depth / 2d), (-width / 2d, -depth / 2d)),], IsHole: false)],- Height: 6));+ Height: height));diagnostics.Add(D("air-x1-profile-extrude-summary-created"));diagnostics.Add(D("air-x1-no-production-route-replacement"));@@ -35,13 +37,13 @@ internal static class AirProfileExtrudeWrappersucceeded,succeeded ? "profile-extrude-air-wrapper-ready-for-envelope-validation" : "profile-extrude-air-wrapper-needs-emitter-investigation",new AirProvenance("AIR-X1", "Constructive AIR wrapper", "canonical-rectangle-profile-extrude", "air-x1-profile-extrude-canonical", nameof(LineArcProfileExtrudeEmitter), AirSelectionClass.None, AirRuleKind.None, "generated/constructive", true, ["Uses existing profile extrusion emitter; AIR wrapper is not a production route replacement."]),- result.Body is null ? new AirTopologySummary(0, 0, 0, 0, 0, 0, 0) : Summarize(result.Body),+ result.Body is null ? new AirTopologySummary(0, 0, 0, 0, 0, 0, 0) : Summarize(result.Body, width, depth, height),AirStepSmokeSummary.NotChecked,diagnostics.GroupBy(x => x.Code).Select(g => g.First()).OrderBy(x => x.Code, StringComparer.Ordinal).ToArray(),["no production route replacement"]);}- private static AirTopologySummary Summarize(Aetheris.Kernel.Core.Brep.BrepBody body) => new(+ private static AirTopologySummary Summarize(Aetheris.Kernel.Core.Brep.BrepBody body, double width, double depth, double height) => new(body.Topology.Vertices.Count(),body.Topology.Edges.Count(),body.Topology.Faces.Count(),@@ -51,7 +53,7 @@ internal static class AirProfileExtrudeWrapperbody.Topology.Coedges.Count(),CapFaceCount: 2,SideFaceCount: body.Topology.Faces.Count() - 2,- Bounds: "[-5,-4,-3]..[5,4,3]");+ Bounds: FormattableString.Invariant($"[{-width / 2d:g},{-depth / 2d:g},{-height / 2d:g}]..[{width / 2d:g},{depth / 2d:g},{height / 2d:g}]"));private static AirDiagnostic D(string code) => new(code, AirDiagnosticSeverity.Info, code);}diff --git a/Aetheris.Kernel.Firmament/BoxConstructiveAirToProfileEmissionTraceProbe.cs b/Aetheris.Kernel.Firmament/BoxConstructiveAirToProfileEmissionTraceProbe.csnew file mode 100644index 00000000..ea7e3d2b--- /dev/null+++ b/Aetheris.Kernel.Firmament/BoxConstructiveAirToProfileEmissionTraceProbe.cs@@ -0,0 +1,99 @@+using Aetheris.Kernel.Firmament.Air;++namespace Aetheris.Kernel.Firmament;++public sealed record FirmamentProfileEmissionTopologySummary(+ int Vertices,+ int Edges,+ int Faces,+ int PlanarFaces,+ int CylindricalFaces,+ int Loops,+ int Coedges,+ int? CapFaces,+ int? SideFaces,+ string? Bounds);++public sealed record FirmamentProfileEmissionStepSmokeSummary(+ bool WasChecked,+ bool Succeeded,+ bool RequiredMarkersPresent,+ bool ForbiddenMarkersAbsent,+ IReadOnlyList<string> Diagnostics);++public sealed record ParserBackedBoxProfileExtrudeTraceResult(+ bool WrapperInvoked,+ string EmitterName,+ bool Succeeded,+ double Width,+ double Depth,+ double Height,+ string StageReached,+ FirmamentProfileEmissionTopologySummary? TopologySummary,+ FirmamentProfileEmissionStepSmokeSummary StepSmoke,+ IReadOnlyList<string> Diagnostics,+ IReadOnlyList<string> Guarantees);++public static class BoxConstructiveAirToProfileEmissionTraceProbe+{+ public static ParserBackedBoxProfileExtrudeTraceResult Invoke(FirmamentConstructiveAirTraceSummary constructiveAir)+ {+ ArgumentNullException.ThrowIfNull(constructiveAir);++ if (!string.Equals(constructiveAir.NodeKind, "AirProfileExtrude", StringComparison.Ordinal)+ || !string.Equals(constructiveAir.CanonicalForm, "rectangle-profile-extrude", StringComparison.Ordinal))+ {+ return Deferred(constructiveAir, "air-x11-box-profile-canonicalization-missing");+ }++ var dimensions = constructiveAir.Dimensions;+ var summary = AirProfileExtrudeWrapper.LowerRectangleExtrude(dimensions.Width, dimensions.Depth, dimensions.Height);+ var topology = summary.TopologySummary;+ var succeeded = summary.Succeeded;+ var stage = succeeded && topology.FaceCount > 0 ? "emitted-brep" : "profile-emission";+ var diagnosticList = new List<string>+ {+ "air-x11-profile-extrude-wrapper-invoked",+ "air-x11-profile-extrude-wrapper-summary-created",+ "air-x11-line-arc-profile-extrude-emitter-invoked",+ "air-x11-profile-emission-summary-created",+ succeeded && topology.FaceCount > 0 ? "air-x11-emitted-brep-summary-created" : "air-x11-actual-stage-profile-emission",+ succeeded && topology.FaceCount > 0 ? "air-x11-actual-stage-emitted-brep" : "air-x11-profile-extrude-wrapper-failed",+ "air-x11-step-smoke-unavailable",+ "air-x11-brepplan-deferred",+ "air-x11-cir-mirror-deferred",+ "air-x11-no-production-grammar-change",+ "air-x11-no-production-route-replacement",+ "air-x11-no-new-geometry-implementation",+ "air-x11-no-profile-emitter-rewrite"+ };+ diagnosticList.AddRange(summary.Diagnostics.Select(d => d.Code));+ var diagnostics = diagnosticList.Distinct(StringComparer.Ordinal).Order(StringComparer.Ordinal).ToArray();++ return new(+ true,+ summary.Provenance.RouteName,+ succeeded,+ dimensions.Width,+ dimensions.Depth,+ dimensions.Height,+ stage,+ new(topology.VertexCount, topology.EdgeCount, topology.FaceCount, topology.PlanarFaceCount, topology.CylindricalFaceCount, topology.LoopCount, topology.CoedgeCount, topology.CapFaceCount, topology.SideFaceCount, topology.Bounds),+ new(summary.StepSmokeSummary.WasChecked, summary.StepSmokeSummary.Succeeded, summary.StepSmokeSummary.RequiredMarkersPresent, summary.StepSmokeSummary.ForbiddenMarkersAbsent, summary.StepSmokeSummary.Diagnostics.Select(d => d.Code).Order(StringComparer.Ordinal).ToArray()),+ diagnostics,+ [.. summary.Guarantees, "parser-backed Constructive AIR dimensions propagated to profile emission", "BRepPlan deferred", "CIR mirror deferred", "STEP smoke unavailable"]);+ }++ private static ParserBackedBoxProfileExtrudeTraceResult Deferred(FirmamentConstructiveAirTraceSummary constructiveAir, string reason) => new(+ false,+ "none",+ false,+ constructiveAir.Dimensions.Width,+ constructiveAir.Dimensions.Depth,+ constructiveAir.Dimensions.Height,+ constructiveAir.StageReached,+ null,+ new(false, false, false, false, []),+ ["air-x11-profile-extrude-wrapper-not-invoked", "air-x11-profile-emission-deferred", reason],+ ["no production grammar expansion", "no production route replacement", "no new geometry"]);+}diff --git a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md b/docs/air-a0-aetheris-v2-compiler-ir-constitution.mdindex 3707cbd1..a5dd4e0a 100644--- a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md+++ b/docs/air-a0-aetheris-v2-compiler-ir-constitution.md@@ -777,3 +777,8 @@ AIR-X9 creates the first parser-backed Firmament-to-AIR boundary for the existin## AIR-X10 parser-backed boundary noteAIR-X10 creates the first parser-backed Feature AIR to Constructive AIR boundary: the existing Firmament `op: box` / `size[3]` fixture now traces from parsed source to Feature AIR `CreateBox` and then to a Constructive AIR `AirProfileExtrude` rectangle-profile-extrude summary. This is still a trace-only frontend-to-MIR proof; it does not change production grammar, route selection, BRepPlan, BRep, STEP, CIR, Boolean, or geometry behavior.+++## AIR-X11 parser-backed emission boundary note++AIR-X11 establishes the first parser-backed Constructive AIR to existing emission-evidence boundary: a Firmament `box` fixture reaches `AirProfileExtrude` and then the existing profile extrusion wrapper/emitter summary. The boundary is trace-only and does not alter grammar, production routes, geometry implementation, BRepPlan semantics, CIR behavior, STEP export/import, route selection, or topology behavior.diff --git a/docs/air-x10-box-feature-air-to-constructive-air.md b/docs/air-x10-box-feature-air-to-constructive-air.mdindex 41356c4e..aa99b07e 100644--- a/docs/air-x10-box-feature-air-to-constructive-air.md+++ b/docs/air-x10-box-feature-air-to-constructive-air.md@@ -98,3 +98,7 @@ Implementation validation includes the focused CLI build/help/trace commands and## Recommended next milestoneRecommended next milestone: **AIR-X11 — Box Constructive AIR to existing profile extrusion wrapper/emission trace**. AIR-X10 found the parser-backed source-to-Constructive-AIR bridge clean, while wrapper/emitter invocation remains deliberately deferred to avoid overstating BRepPlan, STEP, or CIR success.++## AIR-X11 advancement note++AIR-X11 now consumes this Constructive AIR `AirProfileExtrude` summary through a narrow parser-backed box profile emission trace probe. The box fixture advances from `constructive-air` to `emitted-brep` only because the existing AIR-X1 profile extrusion wrapper invokes `LineArcProfileExtrudeEmitter` and returns deterministic BRep topology evidence; BRepPlan and CIR remain deferred.diff --git a/docs/air-x11-box-constructive-air-to-profile-emission-trace.md b/docs/air-x11-box-constructive-air-to-profile-emission-trace.mdnew file mode 100644index 00000000..8f53318e--- /dev/null+++ b/docs/air-x11-box-constructive-air-to-profile-emission-trace.md@@ -0,0 +1,107 @@+# AIR-X11 — Box Constructive AIR to profile emission trace++## Purpose and scope++AIR-X11 advances the parser-backed box fixture from AIR-X10 Constructive AIR evidence to existing profile extrusion wrapper/emitter evidence. This is a trace integration milestone, not a geometry milestone: it reuses the already-existing AIR-X1 `AirProfileExtrudeWrapper` and `LineArcProfileExtrudeEmitter` path and reports only what that path truthfully exposes.++## Relationship to AIR-X10++AIR-X10 proved `fixtures/Firmament/Primitive/valid/box.valid.firmfixture` can be loaded, parsed by `FirmamentTopLevelParser`, recognized as `op: box`, surfaced as Feature AIR `CreateBox`, and canonicalized as Constructive AIR `AirProfileExtrude` with canonical form `rectangle-profile-extrude`. AIR-X11 starts from that same Constructive AIR summary and invokes a narrow trace probe for profile emission evidence.++## Existing Firmament syntax used++The fixture continues to use the existing TOON-style Firmament syntax:++```text+ops[1]:+ -+ op: box+ id: base+ size[3]:+ 10+ 8+ 6+```++No grammar production or source syntax changes were introduced.++## Parser-backed fixture path++```text+fixtures/Firmament/Primitive/valid/box.valid.firmfixture+```++The fixture now expects `emitted-brep` because the reused profile extrusion emitter returns a nonzero BRep topology summary.++## Pipeline++```text+fixture+ -> FirmFixtureLoader+ -> FirmamentTopLevelParser+ -> Feature AIR CreateBox summary+ -> Constructive AIR AirProfileExtrude summary+ -> BoxConstructiveAirToProfileEmissionTraceProbe+ -> AirProfileExtrudeWrapper+ -> LineArcProfileExtrudeEmitter+ -> emitted BRep topology summary+```++STEP smoke remains unavailable for this lane because the wrapper exposes `AirStepSmokeSummary.NotChecked`.++## Dimension propagation++The trace keeps the AIR-X10 convention:++- `size[0]` maps to rectangle width;+- `size[1]` maps to rectangle depth;+- `size[2]` maps to extrusion height.++For the committed fixture, Feature AIR, Constructive AIR, and profile emission all report `width=10`, `depth=8`, and `height=6`. The existing emitter convention centers the extrusion about `Z=0`, producing bounds `[-5,-4,-3]..[5,4,3]` for the fixture.++## Emission summary fields++The trace report adds `profileEmission` with stable fields:++- `wrapperInvoked`;+- `emitterName`;+- `succeeded`;+- `width`, `depth`, `height`;+- `stageReached`;+- `topologySummary` when available;+- `stepSmoke`;+- `diagnostics`;+- `guarantees`.++## Stage reached and why++The actual stage is `emitted-brep`. The existing wrapper invokes `LineArcProfileExtrudeEmitter`, the emitter succeeds, and the wrapper returns a deterministic nonzero topology summary for the rectangular prism. AIR-X11 does not claim `step-smoke` because no STEP smoke check is performed by this wrapper path.++## BRepPlan and CIR status++BRepPlan remains deferred for parser-backed profile extrusion in this milestone; no BRepPlan semantics were added or changed. CIR mirror remains `not-requested`; no CIR evaluator, tape, or mirror behavior changed.++## What remains metadata-driven++The AIR-X7 chamfer fixtures remain metadata-driven and continue through their established AIR-X2/AIR-X6 trace paths. AIR-X11 changes only the parser-backed box lane.++## Non-goals++- no Firmament grammar expansion;+- no full Firmament-to-AIR migration;+- no production route replacement;+- no geometry changes;+- no profile emitter rewrite;+- no BRepPlan/CIR requirement;+- no STEP exporter/importer changes;+- no BRep topology behavior changes;+- no route-selection/JudgmentUtility behavior changes;+- no arbitrary graph, import/recovery, triangle migration, or NURBS/freeform expansion.++## Tests run++Validation included CLI build/help/trace commands, parser-backed box text and JSON traces, metadata-driven chamfer fixture trace, and focused filtered test suites. See the PR summary for exact commands and results.++## Recommended next milestone++Recommended next milestone: **AIR-X12 — ProfileExtrude BRepPlan for parser-backed box**. AIR-X11 shows the existing emitter can produce BRep evidence from parser-backed Constructive AIR, while BRepPlan remains the next explicitly deferred topology-planning boundary.diff --git a/docs/air-x6-aetheris-trace-lowering-report-cli.md b/docs/air-x6-aetheris-trace-lowering-report-cli.mdindex 99da507c..622b91d9 100644--- a/docs/air-x6-aetheris-trace-lowering-report-cli.md+++ b/docs/air-x6-aetheris-trace-lowering-report-cli.md@@ -154,3 +154,8 @@ For the parser-backed box fixture, `aetheris trace --fixture` now includes a `Fe## AIR-X10 Constructive AIR fixture sectionFor parser-backed Firmament primitive fixtures, `aetheris trace --fixture` can now include both `Feature AIR` and `Constructive AIR` sections. The AIR-X10 box fixture reports source op `box`, Feature AIR `CreateBox`, Constructive AIR `AirProfileExtrude`, canonical form `rectangle-profile-extrude`, rectangle width/depth, extrusion height, and truthful deferred BRepPlan/emission/STEP/CIR status.+++## AIR-X11 profile emission section++For parser-backed Firmament box fixtures, `aetheris trace --fixture` may include a `Profile extrusion emission` text section and a `profileEmission` JSON object. These fields report wrapper invocation, emitter name, propagated dimensions, topology summary when exposed by the existing wrapper, STEP smoke availability, diagnostics, and guarantees. BRepPlan and CIR are still reported separately and remain deferred/not-requested unless actually wired for the lane.diff --git a/docs/air-x7-firmament-fixture-trace-corpus.md b/docs/air-x7-firmament-fixture-trace-corpus.mdindex ca1ddc47..4f60c13a 100644--- a/docs/air-x7-firmament-fixture-trace-corpus.md+++ b/docs/air-x7-firmament-fixture-trace-corpus.md@@ -113,3 +113,8 @@ The parser-backed primitive fixture `fixtures/Firmament/Primitive/valid/box.vali## AIR-X10 parser-backed fixture advancementThe primitive parser-backed fixture `fixtures/Firmament/Primitive/valid/box.valid.firmfixture` now expects and reaches `constructive-air`. It remains parser-backed while the Chamfer corpus remains metadata-driven. The box trace reports Feature AIR `CreateBox`, Constructive AIR `AirProfileExtrude`, canonical form `rectangle-profile-extrude`, and deferred BRepPlan/emission/CIR status.+++## AIR-X11 corpus note++The parser-backed primitive box fixture advances to existing profile extrusion emission evidence with expected stage `emitted-brep`. The AIR-X7 chamfer fixtures remain metadata-driven and continue to validate their previous valid/deferred/rejected paths.diff --git a/docs/air-x8-parser-backed-firmament-fixture.md b/docs/air-x8-parser-backed-firmament-fixture.mdindex bc669d7d..04301e60 100644--- a/docs/air-x8-parser-backed-firmament-fixture.md+++ b/docs/air-x8-parser-backed-firmament-fixture.md@@ -102,3 +102,8 @@ AIR-X9 advances the same parser-backed box fixture from `parsed` to `feature-air## AIR-X10 stage updateThe parser-backed box fixture no longer stops at `parsed` or `feature-air`: AIR-X10 traces it through Feature AIR `CreateBox` into Constructive AIR `AirProfileExtrude` as a rectangle-profile extrusion summary. The syntax remains the same existing TOON-style `op: box` / `size[3]` form.+++## AIR-X11 advancement note++The parser-backed primitive box fixture now has an `emitted-brep` expected stage. This is not a parser or grammar change: it is a trace-only bridge from the AIR-X10 Constructive AIR summary to the existing profile extrusion wrapper/emitter summary.diff --git a/docs/air-x9-firmament-to-air-box-boundary.md b/docs/air-x9-firmament-to-air-box-boundary.mdindex 39ce3f76..285bbeae 100644--- a/docs/air-x9-firmament-to-air-box-boundary.md+++ b/docs/air-x9-firmament-to-air-box-boundary.md@@ -88,3 +88,8 @@ Recommended next milestone: **AIR-X10 — Box Feature AIR to Constructive AIR/Pr## AIR-X10 advancementAIR-X10 advances the same parser-backed box fixture from `feature-air` to `constructive-air`. The trace now canonicalizes Feature AIR `CreateBox` to Constructive AIR `AirProfileExtrude` with canonical form `rectangle-profile-extrude`, using `size[0]` as width, `size[1]` as depth, and `size[2]` as height. The profile wrapper/emitter remains deferred, and BRepPlan/emission/STEP/CIR sections remain truthful non-success placeholders.+++## AIR-X11 advancement note++The parser-backed box boundary now reaches existing profile extrusion emission evidence after Feature AIR and Constructive AIR. The source syntax and parser boundary are unchanged; the trace bridge reuses the existing profile extrusion wrapper and does not expand production Firmament behavior.diff --git a/fixtures/Firmament/Primitive/valid/box.valid.firmfixture b/fixtures/Firmament/Primitive/valid/box.valid.firmfixtureindex d1c51f09..bc4e24d0 100644--- a/fixtures/Firmament/Primitive/valid/box.valid.firmfixture+++ b/fixtures/Firmament/Primitive/valid/box.valid.firmfixture@@ -1,10 +1,11 @@// case: box// expected: valid-// expected-stage: constructive-air+// expected-stage: emitted-brep// expected-feature-air: CreateBox// expected-constructive-air: AirProfileExtrude+// expected-emitter: LineArcProfileExtrudeEmitter// parser-backed: true-// description: Minimal parser-backed Firmament primitive fixture reaching Constructive AIR.+// description: Parser-backed Firmament box fixture reaching existing profile extrusion emission evidence.firmament:version: 1