Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Add AIR-X9 parser-backed box Feature AIR trace

Yuechen Lidc352f6c1f3b
diff --git a/Aetheris.CLI.Tests/AirTraceCommandTests.cs b/Aetheris.CLI.Tests/AirTraceCommandTests.cs
index 8ba671c2..de76e4dc 100644
--- a/Aetheris.CLI.Tests/AirTraceCommandTests.cs
+++ b/Aetheris.CLI.Tests/AirTraceCommandTests.cs
@@ -107,19 +107,20 @@ public sealed class AirTraceCommandTests
[Fact]
- public void TraceParserBackedFixture_ValidBox_DefaultsToText()
+ public void TraceParserBackedBoxFixture_ReachesFeatureAir_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: parsed", output); Assert.Contains("Actual stage: parsed", output);
+ Assert.Contains("Expected stage: feature-air", output); Assert.Contains("Actual stage: feature-air", output);
+ Assert.Contains("Feature AIR", output); Assert.Contains("Source op: box", output); Assert.Contains("Node: CreateBox", output);
Assert.Contains("Expectation satisfied: true", output);
}
[Fact]
- public void TraceParserBackedFixture_ValidBox_JsonParses()
+ public void TraceParserBackedBoxFixture_ReachesFeatureAir_Json()
{
var (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");
Assert.Equal(0, exitCode);
@@ -130,25 +131,65 @@ public sealed class AirTraceCommandTests
Assert.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("parsed", root.GetProperty("frontend").GetProperty("frontendStageReached").GetString());
- Assert.Contains("air-x8-firmament-parse-succeeded", output);
+ Assert.Equal("feature-air", root.GetProperty("frontend").GetProperty("frontendStageReached").GetString());
+ Assert.Equal("feature-air", root.GetProperty("actualStageReached").GetString());
+ Assert.Equal("box", root.GetProperty("featureAir").GetProperty("sourceOpKind").GetString());
+ Assert.Equal("CreateBox", root.GetProperty("featureAir").GetProperty("nodeKind").GetString());
+ Assert.Contains("air-x9-firmament-parse-succeeded", output);
+ }
+
+
+ [Fact]
+ public void TraceParserBackedBoxFixture_DimensionsAreReported()
+ {
+ var (exitCode, output, _) = Run("trace", "--fixture", PrimitiveFixture("valid/box.valid.firmfixture"), "--json");
+ Assert.Equal(0, exitCode);
+ using var doc = JsonDocument.Parse(output);
+ var dimensions = doc.RootElement.GetProperty("featureAir").GetProperty("dimensions");
+ Assert.Equal(10, dimensions.GetProperty("width").GetDouble());
+ Assert.Equal(8, dimensions.GetProperty("depth").GetDouble());
+ Assert.Equal(6, dimensions.GetProperty("height").GetDouble());
+ Assert.Contains("air-x9-source-dimensions-extracted", output);
}
[Fact]
- public void TraceParserBackedFixture_ExpectationFailure_ReturnsNonZero()
+ public void TraceParserBackedBoxFixture_DoesNotPretendBRepPlanOrCIR()
{
+ var (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("feature-air", root.GetProperty("actualStageReached").GetString());
+ Assert.Equal("none", root.GetProperty("brepPlan").GetProperty("planKind").GetString());
+ Assert.Equal("not-requested", root.GetProperty("cirMirror").GetProperty("status").GetString());
+ Assert.False(root.TryGetProperty("constructiveAir", out var constructive) && constructive.ValueKind != JsonValueKind.Null);
+ }
+
+ [Fact]
+ public void MetadataDrivenChamferFixtures_StillWork()
+ {
+ Assert.Equal(0, Run("trace", "--fixture", Fixture("valid/top-face-loop-chamfer.valid.firmfixture"), "--json").ExitCode);
+ Assert.Equal(0, Run("trace", "--fixture", Fixture("invalid/arbitrary-graph-chamfer.invalid.firmfixture"), "--json").ExitCode);
+ Assert.Equal(0, Run("trace", "--fixture", Fixture("invalid/non-uniform-loop-chamfer.invalid.firmfixture"), "--json").ExitCode);
+ Assert.Equal(0, Run("trace", "--fixture", Fixture("invalid/loop-fillet-deferred.invalid.firmfixture"), "--json").ExitCode);
+ }
+
+ [Fact]
+ public void ParserBackedBoxExpectationFailure_ReturnsNonZeroWithReport()
+ {
+ var source = File.ReadAllText(PrimitiveFixture("valid/box.valid.firmfixture")).Replace("// expected-stage: feature-air", "// expected-stage: cir-mirror", StringComparison.Ordinal);
var path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N") + ".valid.firmfixture");
- File.WriteAllText(path, "// case: box\n// expected: valid\n// expected-stage: parsed\n// parser-backed: true\n\nnot valid firmament");
+ File.WriteAllText(path, source);
var (exitCode, output, error) = Run("trace", "--fixture", path, "--json");
Assert.NotEqual(0, exitCode); Assert.Contains("expectation", error, StringComparison.OrdinalIgnoreCase);
using var doc = JsonDocument.Parse(output); var root = doc.RootElement;
Assert.False(root.GetProperty("fixture").GetProperty("expectationSatisfied").GetBoolean());
- Assert.False(root.GetProperty("frontend").GetProperty("parseSucceeded").GetBoolean());
- Assert.Contains("air-x8-firmament-parse-failed", output);
+ Assert.True(root.GetProperty("frontend").GetProperty("parseSucceeded").GetBoolean());
+ Assert.Equal("feature-air", root.GetProperty("actualStageReached").GetString());
+ Assert.Contains("air-x9-firmament-parse-succeeded", output);
}
[Fact]
- public void TraceParserBackedFixture_JsonOutput_IsDeterministic()
+ public void ParserBackedBoxJsonDeterministic()
{
var valid = PrimitiveFixture("valid/box.valid.firmfixture");
Assert.Equal(Run("trace", "--fixture", valid, "--json").Stdout, Run("trace", "--fixture", valid, "--json").Stdout);
diff --git a/Aetheris.CLI/AirTrace.cs b/Aetheris.CLI/AirTrace.cs
index 2b5eee16..1c131c15 100644
--- a/Aetheris.CLI/AirTrace.cs
+++ b/Aetheris.CLI/AirTrace.cs
@@ -36,10 +36,15 @@ internal sealed record AirTraceReport(
string? ExpectedReason = null,
bool? ExpectationSatisfied = null,
IReadOnlyList<string>? FixtureDiagnostics = null,
- AirTraceFrontendSummary? Frontend = null);
+ AirTraceFrontendSummary? Frontend = null,
+ AirTraceFeatureAirSummary? FeatureAir = null,
+ AirTraceConstructiveAirSummary? ConstructiveAir = 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 StageReached, 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);
internal sealed record AirTraceBRepPlanSummary(string PlanKind, int Vertices, int Curves, int Edges, int Faces, int Loops, int Coedges, int Surfaces, int CapFaces, int TransitionFaces, int ChamferFaces, int SideFaces, string SplitPolicy, string Bounds, string? RouteSelectionMode, IReadOnlyList<string> Diagnostics);
@@ -108,19 +113,35 @@ internal static class AirTraceReportBuilder
: !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();
- return new("AIR-X8", "trace", "lowering", "firmfixture", fixture.CaseName, expectationSatisfied, frontend.FrontendSummary,
- new("FirmamentPrimitive", "none", "none", "none", "parser-backed-source-fixture", fixture.CaseName, fixture.CaseName, "AIR-X8"),
- new("none", null, false, "AIR lowering is not wired for parser-backed trace fixtures in AIR-X8.", "none", "none", []),
+ var featureAir = frontend.FeatureAir is null
+ ? null
+ : new AirTraceFeatureAirSummary(
+ frontend.FeatureAir.ParserBacked,
+ frontend.FeatureAir.SourceOpKind,
+ frontend.FeatureAir.FeatureAirNodeKind,
+ frontend.FeatureAir.SourceDimensions is null ? null : new AirTraceDimensionsSummary(frontend.FeatureAir.SourceDimensions.Width, frontend.FeatureAir.SourceDimensions.Depth, frontend.FeatureAir.SourceDimensions.Height),
+ frontend.FeatureAir.ConstructionIntent,
+ frontend.FeatureAir.StageReached,
+ frontend.FeatureAir.Diagnostics,
+ frontend.FeatureAir.Guarantees);
+ var constructiveAir = frontend.ConstructiveAir is null
+ ? null
+ : new AirTraceConstructiveAirSummary(frontend.ConstructiveAir.NodeKind, frontend.ConstructiveAir.CanonicalForm, frontend.ConstructiveAir.StageReached, frontend.ConstructiveAir.Diagnostics);
+
+ return new("AIR-X9", "trace", "lowering", "firmfixture", fixture.CaseName, expectationSatisfied, frontend.FrontendSummary,
+ new(featureAir?.NodeKind ?? "FirmamentPrimitive", "none", "none", "none", "parser-backed-source-fixture", fixture.CaseName, fixture.CaseName, "AIR-X9"),
+ new("none", null, false, "Constructive AIR and route selection are deferred for parser-backed box fixtures in AIR-X9.", "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 truthful frontend boundary"),
new(false, false, false, false, []),
new("not-requested", "none", "none", "FirmamentPrimitive", "none", "none", "none", [], [], [], []),
- [], ["AIR lowering not wired for parser-backed fixture"], fxDiagnostics,
- ["real Firmament parser invoked", "parser-backed fixture stops at truthful frontend boundary", "no production grammar expansion", "no new geometry"],
+ [], ["Constructive AIR lowering not wired for parser-backed box fixture"], fxDiagnostics,
+ ["real Firmament parser invoked", "parser-backed fixture reaches Feature AIR summary", "Constructive AIR deferred", "no production grammar expansion", "no production route replacement", "no new geometry"],
["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));
+ new(true, frontend.ParserName, frontend.ParseSucceeded, frontend.Diagnostics, actualStage, frontend.FrontendSummary),
+ featureAir, constructiveAir);
}
public static string FixtureFileStem(FirmFixture fixture) => $"air-x7-{fixture.CaseName}-firmfixture-trace";
@@ -200,6 +221,16 @@ internal static class AirTraceTextRenderer
{
b.AppendLine("Frontend"); b.AppendLine($" Parser-backed: {r.Frontend.ParserBacked.ToString().ToLowerInvariant()}"); b.AppendLine($" Parser name: {r.Frontend.ParserName}"); b.AppendLine($" Parse succeeded: {r.Frontend.ParseSucceeded?.ToString().ToLowerInvariant()}"); b.AppendLine($" Frontend stage reached: {r.Frontend.FrontendStageReached}"); b.AppendLine(" Diagnostics:"); foreach (var d in r.Frontend.ParseDiagnostics) b.AppendLine($" - {d}"); b.AppendLine();
}
+ if (r.FeatureAir is not null)
+ {
+ b.AppendLine("Feature AIR"); b.AppendLine($" Source op: {r.FeatureAir.SourceOpKind}"); b.AppendLine($" Node: {r.FeatureAir.NodeKind}");
+ if (r.FeatureAir.Dimensions is not null) b.AppendLine($" Dimensions: width={r.FeatureAir.Dimensions.Width:g}, depth={r.FeatureAir.Dimensions.Depth:g}, height={r.FeatureAir.Dimensions.Height:g}");
+ b.AppendLine($" Construction intent: {r.FeatureAir.ConstructionIntent}"); b.AppendLine($" Stage reached: {r.FeatureAir.StageReached}"); b.AppendLine(" Diagnostics:"); foreach (var d in r.FeatureAir.Diagnostics) b.AppendLine($" - {d}"); b.AppendLine();
+ }
+ if (r.ConstructiveAir is not null)
+ {
+ b.AppendLine("Constructive AIR"); b.AppendLine($" Node: {r.ConstructiveAir.NodeKind}"); b.AppendLine($" Canonical form: {r.ConstructiveAir.CanonicalForm}"); b.AppendLine($" Stage reached: {r.ConstructiveAir.StageReached}"); 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/FirmamentFrontendTraceProbe.cs b/Aetheris.Kernel.Firmament/FirmamentFrontendTraceProbe.cs
index abf2fba6..b2a971a1 100644
--- a/Aetheris.Kernel.Firmament/FirmamentFrontendTraceProbe.cs
+++ b/Aetheris.Kernel.Firmament/FirmamentFrontendTraceProbe.cs
@@ -1,3 +1,6 @@
+using System.Globalization;
+using System.Text.RegularExpressions;
+using Aetheris.Kernel.Firmament.ParsedModel;
using Aetheris.Kernel.Firmament.Parsing;
namespace Aetheris.Kernel.Firmament;
@@ -7,8 +10,28 @@ public sealed record FirmamentFrontendTraceProbeResult(
bool ParseSucceeded,
string FrontendStageReached,
string FrontendSummary,
+ IReadOnlyList<string> Diagnostics,
+ FirmamentPrimitiveAirTraceSummary? FeatureAir = null,
+ FirmamentConstructiveAirTraceSummary? ConstructiveAir = null);
+
+public sealed record FirmamentPrimitiveAirTraceSummary(
+ bool ParserBacked,
+ string SourceOpKind,
+ string FeatureAirNodeKind,
+ FirmamentTraceDimensions? SourceDimensions,
+ string ConstructionIntent,
+ string StageReached,
+ IReadOnlyList<string> Diagnostics,
+ IReadOnlyList<string> Guarantees);
+
+public sealed record FirmamentConstructiveAirTraceSummary(
+ string NodeKind,
+ string CanonicalForm,
+ string StageReached,
IReadOnlyList<string> Diagnostics);
+public sealed record FirmamentTraceDimensions(double Width, double Depth, double Height);
+
public static class FirmamentFrontendTraceProbe
{
public static FirmamentFrontendTraceProbeResult ParseOnly(string sourceText)
@@ -19,18 +42,65 @@ public static class FirmamentFrontendTraceProbe
if (parseResult.IsSuccess)
{
var opCount = parseResult.Value.Ops.Entries.Count;
+ var boxOp = parseResult.Value.Ops.Entries.FirstOrDefault(op => op.KnownKind == FirmamentKnownOpKind.Box);
+ if (boxOp is not null)
+ {
+ var dimensions = TryExtractBoxDimensions(boxOp) ?? TryExtractBoxDimensionsFromSource(sourceText);
+ var dimensionDiagnostics = dimensions is null
+ ? new[] { "air-x9-box-dimensions-missing" }
+ : new[] { "air-x9-source-dimensions-extracted" };
+ var featureAirDiagnostics = new[]
+ {
+ "air-x9-parser-backed-fixture-loaded",
+ "air-x9-firmament-parser-invoked",
+ "air-x9-firmament-parse-succeeded",
+ "air-x9-firmament-box-op-recognized",
+ "air-x9-feature-air-summary-created",
+ "air-x9-feature-air-box-created",
+ "air-x9-actual-stage-feature-air",
+ "air-x9-box-constructive-air-lowering-not-wired",
+ "air-x9-constructive-air-deferred",
+ "air-x9-no-production-grammar-change",
+ "air-x9-no-production-route-replacement"
+ }.Concat(dimensionDiagnostics).Order(StringComparer.Ordinal).ToArray();
+
+ var featureAir = new FirmamentPrimitiveAirTraceSummary(
+ ParserBacked: true,
+ SourceOpKind: boxOp.OpName,
+ FeatureAirNodeKind: "CreateBox",
+ SourceDimensions: dimensions,
+ ConstructionIntent: "box / rectangular prism",
+ StageReached: "feature-air",
+ Diagnostics: featureAirDiagnostics,
+ Guarantees:
+ [
+ "parser-backed Firmament source form",
+ "Feature AIR summary only",
+ "Constructive AIR deferred",
+ "no production grammar expansion",
+ "no production route replacement",
+ "no geometry emitted"
+ ]);
+
+ return new(
+ "FirmamentTopLevelParser",
+ true,
+ "feature-air",
+ $"Parsed Firmament document with {opCount} op(s). Recognized box op and created Feature AIR CreateBox summary; Constructive AIR is deferred.",
+ featureAirDiagnostics,
+ featureAir);
+ }
+
return new(
"FirmamentTopLevelParser",
true,
"parsed",
- $"Parsed Firmament document with {opCount} op(s). AIR lowering is not wired for parser-backed trace fixtures in AIR-X8.",
+ $"Parsed Firmament document with {opCount} op(s). No AIR-X9 supported primitive op was recognized.",
[
- "air-x8-firmament-parser-invoked",
- "air-x8-firmament-parse-succeeded",
- "air-x8-frontend-stage-recorded",
- "air-x8-air-lowering-not-wired-for-parser-backed-fixture",
- "air-x8-parser-backed-lowering-boundary-reached",
- "air-x8-parser-backed-fixture-does-not-change-production-grammar"
+ "air-x9-firmament-parser-invoked",
+ "air-x9-firmament-parse-succeeded",
+ "air-x9-firmament-box-op-not-recognized",
+ "air-x9-no-production-grammar-change"
]);
}
@@ -40,11 +110,46 @@ public static class FirmamentFrontendTraceProbe
"parsed",
"Firmament parser rejected the fixture source body.",
[
- "air-x8-firmament-parser-invoked",
- "air-x8-firmament-parse-failed",
- "air-x8-frontend-stage-recorded",
+ "air-x9-firmament-parser-invoked",
+ "air-x9-firmament-parse-failed",
.. parseResult.Diagnostics.Select(d => d.Code.ToString()).Order(StringComparer.Ordinal),
- "air-x8-parser-backed-fixture-does-not-change-production-grammar"
+ "air-x9-no-production-grammar-change"
]);
}
+
+ private static FirmamentTraceDimensions? TryExtractBoxDimensions(FirmamentParsedOpEntry boxOp)
+ {
+ return boxOp.RawFields.TryGetValue("size[3]", out var rawSize) || boxOp.RawFields.TryGetValue("size[3]:", out rawSize)
+ ? TryParseDimensions(rawSize)
+ : null;
+ }
+
+ private static FirmamentTraceDimensions? TryExtractBoxDimensionsFromSource(string sourceText)
+ {
+ var match = Regex.Match(sourceText, @"(?m)^\s*size\[3\]:\s*\r?\n\s*(?<w>[+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\r?\n\s*(?<d>[+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\r?\n\s*(?<h>[+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*$", RegexOptions.CultureInvariant);
+ return match.Success
+ ? TryParseDimensions($"{match.Groups["w"].Value}\n{match.Groups["d"].Value}\n{match.Groups["h"].Value}")
+ : null;
+ }
+
+ private static FirmamentTraceDimensions? TryParseDimensions(string rawSize)
+ {
+ var values = rawSize
+ .Split(['\r', '\n', ',', '[', ']'], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
+ .Where(value => !string.IsNullOrWhiteSpace(value))
+ .ToArray();
+ if (values.Length != 3)
+ {
+ return null;
+ }
+
+ return double.TryParse(values[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var width)
+ && double.TryParse(values[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var depth)
+ && double.TryParse(values[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var height)
+ && width > 0
+ && depth > 0
+ && height > 0
+ ? new FirmamentTraceDimensions(width, depth, height)
+ : null;
+ }
}
diff --git a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md b/docs/air-a0-aetheris-v2-compiler-ir-constitution.md
index f448df29..49c64f36 100644
--- a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md
+++ b/docs/air-a0-aetheris-v2-compiler-ir-constitution.md
@@ -769,3 +769,7 @@ Firmament `.valid.firmfixture` and `.invalid.firmfixture` files are source/lower
## AIR-X8 parser-backed fixture anchor
AIR-X8 anchors the Firmament fixture corpus to the real Firmament frontend for one minimal primitive source form. The primitive box `.valid.firmfixture` is parser-backed, reaches the truthful `parsed` frontend stage, and deliberately does not claim AIR/BRepPlan/CIR/STEP lowering until that bridge is explicitly wired. Metadata-driven AIR-X7 Chamfer fixtures remain valid lowering contracts.
+
+## AIR-X9 parser-backed frontend boundary note
+
+AIR-X9 creates the first parser-backed Firmament-to-AIR boundary for the existing TOON-style primitive box fixture. The path is `Firmament source -> FirmamentTopLevelParser -> parsed box op -> Feature AIR CreateBox trace summary`. This validates the constitutional distinction between Firmament source and Feature AIR without expanding grammar, replacing production routes, or claiming Constructive AIR/BRepPlan/CIR stages that are not wired.
diff --git a/docs/air-x6-aetheris-trace-lowering-report-cli.md b/docs/air-x6-aetheris-trace-lowering-report-cli.md
index cefcbcce..3cd9c5f9 100644
--- a/docs/air-x6-aetheris-trace-lowering-report-cli.md
+++ b/docs/air-x6-aetheris-trace-lowering-report-cli.md
@@ -146,3 +146,7 @@ AIR-X7 extends `aetheris trace` with `--fixture <path>` while keeping AIR-X6 bui
## AIR-X8 parser-backed fixture frontend section
For `.firmfixture` inputs with `// parser-backed: true`, `aetheris trace --fixture` now includes a `Frontend` section in text output and a `frontend` object in JSON. The fields record whether parser-backed mode was requested, the parser/frontend name, parse success, deterministic parse diagnostics, and the truthful frontend stage reached. The first parser-backed primitive box fixture stops at `parsed` because Firmament-to-AIR fixture lowering is not wired in AIR-X8.
+
+## AIR-X9 Feature AIR section for parser-backed fixtures
+
+For the parser-backed box fixture, `aetheris trace --fixture` now includes a `Feature AIR` text section and a `featureAir` JSON object. The section reports source op `box`, node `CreateBox`, dimensions when extracted, construction intent, deterministic diagnostics, and the truthful stage `feature-air`. Constructive AIR, BRepPlan, BRep/STEP, and CIR mirror sections remain unavailable/not-requested for this fixture unless a later milestone wires those boundaries.
diff --git a/docs/air-x7-firmament-fixture-trace-corpus.md b/docs/air-x7-firmament-fixture-trace-corpus.md
index 0e65f3a8..45ded893 100644
--- a/docs/air-x7-firmament-fixture-trace-corpus.md
+++ b/docs/air-x7-firmament-fixture-trace-corpus.md
@@ -105,3 +105,7 @@ Recommended AIR-X8: **Firmament parser-backed trace fixture for one real source
AIR-X8 adds opt-in parser-backed fixture mode with `// parser-backed: true`. Metadata-driven AIR-X7 fixtures remain the default. Parser-backed fixtures extract the non-metadata body, invoke the existing Firmament frontend, report parse success/failure and `frontendStageReached`, and satisfy the fixture expectation from the truthful frontend stage reached.
The first parser-backed fixture is `fixtures/Firmament/Primitive/valid/box.valid.firmfixture`. It reaches `parsed` and records the explicit AIR-X8 boundary diagnostic that AIR lowering is not wired for parser-backed fixtures yet.
+
+## AIR-X9 parser-backed primitive stage
+
+The parser-backed primitive fixture `fixtures/Firmament/Primitive/valid/box.valid.firmfixture` now reaches `feature-air` through the real Firmament parser and a narrow trace summary adapter. The AIR-X7 Chamfer fixtures remain metadata-driven and continue to use their existing route-selection/lowering trace mappings.
diff --git a/docs/air-x8-parser-backed-firmament-fixture.md b/docs/air-x8-parser-backed-firmament-fixture.md
index e3222ad5..33bde69e 100644
--- a/docs/air-x8-parser-backed-firmament-fixture.md
+++ b/docs/air-x8-parser-backed-firmament-fixture.md
@@ -94,3 +94,7 @@ AIR-X8 validation used CLI help, parser-backed text/JSON trace, existing metadat
## Recommended next milestone
Recommended AIR-X9: **Firmament-to-AIR frontend boundary for parsed box primitive**. AIR-X8 proves parser invocation and isolates the next blocker: parsed primitive source is not yet wired into AIR trace lowering.
+
+## AIR-X9 advancement
+
+AIR-X9 advances the same parser-backed box fixture from `parsed` to `feature-air`. The syntax remains the existing TOON-style `op: box` with `size[3]`; the parser is still the real Firmament parser; and the new trace-only boundary creates a Feature AIR `CreateBox` summary with width/depth/height dimensions. Constructive AIR remains deferred and is not reported as reached.
diff --git a/docs/air-x9-firmament-to-air-box-boundary.md b/docs/air-x9-firmament-to-air-box-boundary.md
new file mode 100644
index 00000000..f7634bc3
--- /dev/null
+++ b/docs/air-x9-firmament-to-air-box-boundary.md
@@ -0,0 +1,86 @@
+# AIR-X9 — Firmament-to-AIR box boundary
+
+## Purpose and scope
+
+AIR-X9 connects the first parser-backed `.firmfixture` source form to an AIR-facing summary. It is a frontend boundary milestone, not a geometry milestone: one parsed Firmament primitive box operation becomes one deterministic Feature AIR summary in `aetheris trace`.
+
+## Relationship to AIR-X8
+
+AIR-X8 proved that `fixtures/Firmament/Primitive/valid/box.valid.firmfixture` could load as a parser-backed fixture, invoke `FirmamentTopLevelParser`, and truthfully stop at `parsed`. AIR-X9 advances that same fixture from `parsed` to `feature-air` by recognizing the parsed box op and creating a trace-only Feature AIR summary.
+
+## Existing Firmament syntax used
+
+AIR-X9 uses the existing TOON-style Firmament primitive syntax; it does not add grammar:
+
+```text
+ops[1]:
+ -
+ op: box
+ id: base
+ size[3]:
+ 10
+ 8
+ 6
+```
+
+## Parser-backed fixture path
+
+```text
+fixtures/Firmament/Primitive/valid/box.valid.firmfixture
+```
+
+The fixture metadata now expects `feature-air` and `expected-feature-air: CreateBox`.
+
+## Frontend path
+
+```text
+box.valid.firmfixture
+ -> fixture metadata/source-body split
+ -> FirmamentTopLevelParser
+ -> parsed Firmament op: box
+ -> Feature AIR trace summary: CreateBox
+```
+
+Constructive AIR is deliberately deferred in AIR-X9. The trace does not claim BRepPlan, BRep emission, STEP smoke, CIR mirror success, or production route selection for the parser-backed box fixture.
+
+## Stage reached and why
+
+The actual stage reached is `feature-air`. This is the furthest stable truthful boundary because the parser exposes a recognized box op and the fixture source provides deterministic `width=10`, `depth=8`, and `height=6`, but there is no narrow dependency-clean production lowering from this parsed source fixture to an existing Constructive AIR node in this milestone.
+
+## Feature AIR summary fields
+
+Text output includes a `Feature AIR` section with:
+
+- source op kind: `box`;
+- node kind: `CreateBox`;
+- dimensions: `width=10`, `depth=8`, `height=6`;
+- construction intent: `box / rectangular prism`;
+- stage reached: `feature-air`;
+- deterministic AIR-X9 diagnostics.
+
+JSON output includes stable `featureAir` fields: `parserBacked`, `sourceOpKind`, `nodeKind`, `dimensions`, `constructionIntent`, `stageReached`, `diagnostics`, and `guarantees`.
+
+## Dimension extraction status
+
+Dimensions are reported for the AIR-X8/X9 box fixture. The adapter first checks parsed raw fields and then uses a narrow trace-only source-body extraction for the existing `size[3]` box form. This keeps parser behavior unchanged while making the trace summary deterministic.
+
+## What remains metadata-driven
+
+The AIR-X7 Chamfer fixtures remain metadata-driven and continue to exercise the existing AIR-X2/AIR-X6 trace paths. AIR-X9 does not convert them to parser-backed Firmament syntax.
+
+## Non-goals
+
+- no Firmament grammar expansion;
+- no full Firmament-to-AIR migration;
+- no production route replacement;
+- no geometry changes;
+- no BRepPlan, BRep, STEP, or CIR requirement for the parser-backed fixture;
+- no route-selection or JudgmentUtility behavior changes.
+
+## Tests run
+
+The implementation was validated with the AIR-X9 parser-backed box trace commands, the metadata-driven Chamfer fixture compatibility checks, focused CLI tests, and the required filtered .NET build/test commands recorded in the PR summary.
+
+## Recommended next milestone
+
+Recommended next milestone: **AIR-X10 — Box Feature AIR to Constructive AIR/ProfileExtrude trace**. AIR-X9 found the Feature AIR boundary clean and dimension-bearing; the next narrow step is to decide whether a parser-backed box `CreateBox` can canonicalize to an `AirProfileExtrude` rectangle summary without creating dependency cycles or replacing production routes.
diff --git a/fixtures/Firmament/Primitive/valid/box.valid.firmfixture b/fixtures/Firmament/Primitive/valid/box.valid.firmfixture
index 5f1ad7c5..08d814d2 100644
--- a/fixtures/Firmament/Primitive/valid/box.valid.firmfixture
+++ b/fixtures/Firmament/Primitive/valid/box.valid.firmfixture
@@ -1,8 +1,9 @@
// case: box
// expected: valid
-// expected-stage: parsed
+// expected-stage: feature-air
+// expected-feature-air: CreateBox
// parser-backed: true
-// description: Minimal parser-backed Firmament primitive fixture.
+// description: Minimal parser-backed Firmament primitive fixture reaching Feature AIR.
firmament:
version: 1