Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add AIR-X3 prismatic BRepPlan proof
Yuechen Li76d4a1cfae62
diff --git a/Aetheris.Kernel.Core.Tests/Air/AirBRepPlanTests.cs b/Aetheris.Kernel.Core.Tests/Air/AirBRepPlanTests.csnew file mode 100644index 00000000..8887524a--- /dev/null+++ b/Aetheris.Kernel.Core.Tests/Air/AirBRepPlanTests.cs@@ -0,0 +1,102 @@+using Aetheris.Kernel.Core.Air.BRepPlan;+using Aetheris.Kernel.Core.Brep.Prismatic;++namespace Aetheris.Kernel.Core.Tests.Air;++public sealed class AirBRepPlanTests+{+ [Fact]+ public void AirPrismaticSectionTransitionBRepPlanner_CanonicalStack_ProducesExpectedPlan()+ {+ var result = AirPrismaticSectionTransitionBRepPlanner.Plan(CanonicalRequest());+ Assert.True(result.Succeeded);+ var plan = Assert.IsType<AirBRepPlan>(result.Plan);+ Assert.Equal(AirBRepPlanKind.PrismaticSectionTransition, plan.PlanKind);+ Assert.Equal(12, plan.Summary.VertexCount);+ Assert.Equal(20, plan.Summary.EdgeCount);+ Assert.Equal(20, plan.Summary.CurveCount);+ Assert.Equal(10, plan.Summary.FaceCount);+ Assert.Equal(10, plan.Summary.SurfaceCount);+ Assert.Equal(10, plan.Summary.LoopCount);+ Assert.Equal(40, plan.Summary.CoedgeCount);+ Assert.Equal(2, plan.Summary.CapFaceCount);+ Assert.Equal(4, plan.Summary.SideFaceCount);+ Assert.Equal(4, plan.Summary.TransitionFaceCount);+ Assert.Equal(0, plan.Summary.ChamferFaceCount);+ Assert.Equal(1, plan.Summary.ShellCount);+ Assert.Equal(1, plan.Summary.BodyCount);+ Assert.Equal("[-5,-4,0]..[5,4,6]", plan.Summary.Bounds);+ Assert.Equal(AirPrismaticSectionTransitionBRepPlanner.PreserveSectionSplits, plan.Summary.SplitPolicy);+ foreach (var code in new[] { "air-x3-prismatic-plan-created", "air-x3-stable-planned-ids-created", "air-x3-section-vertices-planned", "air-x3-section-edges-planned", "air-x3-transition-edges-planned", "air-x3-cap-faces-planned", "air-x3-transition-faces-planned", "air-x3-shell-planned", "air-x3-body-planned", "air-x3-split-preserving-plan" })+ Assert.Contains(plan.Diagnostics, d => d.Code == code);+ }++ [Fact]+ public void AirPrismaticSectionTransitionBRepPlanner_StableIds_AreDeterministic()+ {+ var a = AirPrismaticSectionTransitionBRepPlanner.Plan(CanonicalRequest()).Plan!;+ var b = AirPrismaticSectionTransitionBRepPlanner.Plan(CanonicalRequest()).Plan!;+ Assert.Equal(a.Elements.Select(e => e.Id.Value), b.Elements.Select(e => e.Id.Value));+ Assert.Equal(a.Elements.Select(e => (e.Kind, e.Role)), b.Elements.Select(e => (e.Kind, e.Role)));+ Assert.Equal(a.Summary with { Diagnostics = [], Guarantees = [] }, b.Summary with { Diagnostics = [], Guarantees = [] });+ Assert.Equal(a.Summary.Diagnostics.Select(d => d.Code), b.Summary.Diagnostics.Select(d => d.Code));+ Assert.Equal(a.Summary.Guarantees, b.Summary.Guarantees);+ Assert.Equal(a.Diagnostics.Select(d => d.Code), b.Diagnostics.Select(d => d.Code));+ }++ [Fact]+ public void AirPrismaticSectionTransitionBRepPlanner_PlanMatchesExistingEmitterSummary()+ {+ var request = CanonicalRequest(runStepSmoke: true);+ var plan = AirPrismaticSectionTransitionBRepPlanner.Plan(request).Plan!;+ var emitted = PrismaticSectionTransitionEmitter.Emit(request);+ Assert.True(emitted.Succeeded);+ Assert.Equal(emitted.Topology.VertexCount, plan.Summary.VertexCount);+ Assert.Equal(emitted.Topology.EdgeCount, plan.Summary.EdgeCount);+ Assert.Equal(emitted.Topology.FaceCount, plan.Summary.FaceCount);+ Assert.Equal(emitted.Topology.PlanarFaceCount, plan.Summary.SurfaceCount);+ Assert.Equal(emitted.Topology.LoopCount, plan.Summary.LoopCount);+ Assert.Equal(emitted.Topology.CoedgeCount, plan.Summary.CoedgeCount);+ Assert.Equal(emitted.Topology.CapFaceCount, plan.Summary.CapFaceCount);+ Assert.Equal(emitted.Topology.StableIntervalFaceCount, plan.Summary.SideFaceCount);+ Assert.Equal(emitted.Topology.ChangedIntervalFaceCount, plan.Summary.TransitionFaceCount);+ Assert.Equal(emitted.Topology.Bounds, plan.Summary.Bounds);+ Assert.Equal(AirPrismaticSectionTransitionBRepPlanner.PreserveSectionSplits, plan.Summary.SplitPolicy);+ Assert.Contains(plan.Guarantees, g => g == "no production route replacement");+ Assert.Contains(plan.Guarantees, g => g == "no emitter rewrite");+ Assert.True(emitted.Step.Exported);+ Assert.Empty(emitted.Step.MissingRequiredMarkers);+ Assert.Empty(emitted.Step.UnexpectedPresentMarkers);+ }++ [Theory]+ [MemberData(nameof(InvalidRequests))]+ public void AirPrismaticSectionTransitionBRepPlanner_InvalidCases_AreRejectedOrDeferred(object requestObject, string expectedCode)+ {+ var request = Assert.IsType<PrismaticSectionTransitionRequest>(requestObject);+ var result = AirPrismaticSectionTransitionBRepPlanner.Plan(request);+ Assert.False(result.Succeeded);+ Assert.Null(result.Plan);+ Assert.Contains(result.Validation.Diagnostics, d => d.Code == expectedCode);+ Assert.Equal(AirBRepPlanKind.Unsupported, result.Validation.ExpectedTopologySummary.PlanKind);+ }++ public static IEnumerable<object[]> InvalidRequests()+ {+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)])], PrismaticCorrespondenceMap.Identity(3)), "air-x3-invalid-section-count-rejected"];+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(1, [(-1d, -1d), (1d, -1d), (1d, 1d), (-1d, 1d)]), new(2, [(-1d, -1d), (1d, -1d), (1d, 1d)])], PrismaticCorrespondenceMap.Identity(3)), "air-x3-mismatched-vertex-count-rejected"];+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(2, [(-1d, -1d), (1d, -1d), (1d, 1d)])], PrismaticCorrespondenceMap.Identity(3)), "air-x3-non-increasing-sections-rejected"];+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(1, [(double.NaN, -1d), (1d, -1d), (1d, 1d)]), new(2, [(-1d, -1d), (1d, -1d), (1d, 1d)])], PrismaticCorrespondenceMap.Identity(3)), "air-x3-non-finite-coordinate-rejected"];+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)], HasHoles: true), new(1, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(2, [(-1d, -1d), (1d, -1d), (1d, 1d)])], PrismaticCorrespondenceMap.Identity(3)), "air-x3-holes-deferred"];+ yield return [new PrismaticSectionTransitionRequest([new(0, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(1, [(-1d, -1d), (1d, -1d), (1d, 1d)]), new(2, [(-1d, -1d), (1d, -1d), (1d, 1d)])], new PrismaticCorrespondenceMap([1, 2, 0])), "air-x3-non-identity-correspondence-deferred"];+ }++ private static PrismaticSectionTransitionRequest CanonicalRequest(bool runStepSmoke = false) => new(+ [+ new(0, [(-5, -4), (5, -4), (5, 4), (-5, 4)]),+ new(5, [(-5, -4), (5, -4), (5, 4), (-5, 4)]),+ new(6, [(-4, -3), (4, -3), (4, 3), (-4, 3)]),+ ],+ PrismaticCorrespondenceMap.Identity(4),+ new PrismaticSectionTransitionOptions(RunStepSmoke: runStepSmoke, TraceLabel: "air-x3-brep-plan-test"));+}diff --git a/Aetheris.Kernel.Core/Air/AirBRepPlan.cs b/Aetheris.Kernel.Core/Air/AirBRepPlan.csnew file mode 100644index 00000000..ab2a894b--- /dev/null+++ b/Aetheris.Kernel.Core/Air/AirBRepPlan.cs@@ -0,0 +1,176 @@+using Aetheris.Kernel.Core.Brep.Prismatic;++namespace Aetheris.Kernel.Core.Air.BRepPlan;++internal enum AirBRepPlanKind { PrismaticSectionTransition, Unsupported }+internal enum AirBRepPlanElementKind { Vertex, Curve, Edge, Coedge, Loop, Surface, Face, Shell, Body }+internal enum AirBRepPlanRole { Unknown, SectionVertex, SectionEdge, VerticalTransitionEdge, SectionLoop, CapFace, SideFace, TransitionFace, PrismaticTransitionFace, ChamferFace, BodyShell, Body }++internal readonly record struct AirBRepPlanId(string Value)+{+ public override string ToString() => Value;+}++internal sealed record AirBRepPlanElement(+ AirBRepPlanId Id,+ AirBRepPlanElementKind Kind,+ AirBRepPlanRole Role,+ string SourceAirNodeId,+ AirProvenance Provenance,+ int? SectionIndex = null,+ int? ProfileVertexIndex = null,+ int? IntervalIndex = null,+ int? EdgeIndex = null,+ string? FaceRole = null,+ IReadOnlyList<AirDiagnostic>? Diagnostics = null);++internal sealed record AirBRepPlanSummary(+ AirBRepPlanKind PlanKind,+ string SourceAirNodeId,+ int VertexCount,+ int CurveCount,+ int EdgeCount,+ int CoedgeCount,+ int LoopCount,+ int SurfaceCount,+ int FaceCount,+ int ShellCount,+ int BodyCount,+ int CapFaceCount,+ int SideFaceCount,+ int TransitionFaceCount,+ int ChamferFaceCount,+ string Bounds,+ string SplitPolicy,+ IReadOnlyList<AirDiagnostic> Diagnostics,+ IReadOnlyList<string> Guarantees);++internal sealed record AirBRepPlanValidationResult(+ bool Succeeded,+ IReadOnlyList<AirDiagnostic> Diagnostics,+ IReadOnlyList<AirDiagnostic> Errors,+ IReadOnlyList<AirDiagnostic> Warnings,+ AirBRepPlanSummary ExpectedTopologySummary,+ AirTopologySummary? ActualTopologySummary = null);++internal sealed record AirBRepPlan(+ string PlanId,+ AirBRepPlanKind PlanKind,+ string SourceAirNodeId,+ AirProvenance Provenance,+ IReadOnlyList<AirBRepPlanElement> Elements,+ AirBRepPlanSummary Summary,+ IReadOnlyList<AirDiagnostic> Diagnostics,+ IReadOnlyList<string> Guarantees);++internal sealed record AirBRepPlanResult(AirBRepPlan? Plan, AirBRepPlanValidationResult Validation)+{+ public bool Succeeded => Plan is not null && Validation.Succeeded;+}++internal static class AirPrismaticSectionTransitionBRepPlanner+{+ private const double Tol = 1e-9;+ public const string PreserveSectionSplits = "preserve-section-splits";++ private static readonly IReadOnlyList<string> RouteGuarantees =+ [+ "no production route replacement",+ "no emitter rewrite",+ "no STEP exporter change",+ "no BRep topology behavior change",+ "no coplanar merge",+ "no AirEdgeSweep",+ "no Boolean",+ "no topology graft",+ ];++ public static AirBRepPlanResult Plan(+ PrismaticSectionTransitionRequest request,+ string sourceAirNodeId = "air-x3-prismatic-canonical",+ AirProvenance? provenance = null)+ {+ provenance ??= Provenance(sourceAirNodeId);+ var diagnostics = new List<AirDiagnostic> { D("air-x3-brep-plan-created") };+ var rejected = Validate(request, sourceAirNodeId, diagnostics);+ if (rejected is not null)+ {+ return new AirBRepPlanResult(null, Validation(false, sourceAirNodeId, diagnostics, rejected));+ }++ var elements = BuildElements(request, sourceAirNodeId, provenance, diagnostics);+ var summary = Summary(request, sourceAirNodeId, diagnostics, RouteGuarantees);+ diagnostics.Add(D("air-x3-prismatic-plan-created"));+ diagnostics.Add(D("air-x3-prismatic-plan-validated"));+ diagnostics.AddRange(RouteGuarantees.Select(g => D("air-x3-" + g.Replace(" ", "-").Replace("STEP", "step").Replace("BRep", "brep").Replace("AirEdgeSweep", "air-edge-sweep").Replace("Boolean", "boolean"))));+ diagnostics = Stable(diagnostics).ToList();+ summary = summary with { Diagnostics = diagnostics };+ var plan = new AirBRepPlan("brep-plan:prismatic-section-transition:" + sourceAirNodeId, AirBRepPlanKind.PrismaticSectionTransition, sourceAirNodeId, provenance, elements, summary, diagnostics, RouteGuarantees);+ return new AirBRepPlanResult(plan, new AirBRepPlanValidationResult(true, diagnostics, [], [], summary));+ }++ private static AirDiagnostic? Validate(PrismaticSectionTransitionRequest request, string sourceAirNodeId, List<AirDiagnostic> diagnostics)+ {+ if (request.Sections.Count < 2) return D("air-x3-invalid-section-count-rejected", AirDiagnosticSeverity.Error);+ if (request.Sections.Count != 3) return D("air-x3-invalid-section-count-rejected", AirDiagnosticSeverity.Error);+ foreach (var section in request.Sections)+ {+ if (section.HasHoles) return D("air-x3-holes-deferred", AirDiagnosticSeverity.Warning);+ if (section.HasArcs) return D("air-x3-arcs-deferred", AirDiagnosticSeverity.Warning);+ if (section.OuterLoopCount != 1) return D("air-x3-multiple-loops-deferred", AirDiagnosticSeverity.Warning);+ if (section.OuterLoop.Count < 3) return D("air-x3-invalid-section-count-rejected", AirDiagnosticSeverity.Error);+ if (!double.IsFinite(section.Z) || section.OuterLoop.Any(p => !double.IsFinite(p.X) || !double.IsFinite(p.Y))) return D("air-x3-non-finite-coordinate-rejected", AirDiagnosticSeverity.Error);+ }+ for (var i = 1; i < request.Sections.Count; i++)+ if (request.Sections[i].Z <= request.Sections[i - 1].Z + Tol) return D("air-x3-non-increasing-sections-rejected", AirDiagnosticSeverity.Error);+ var n = request.Sections[0].OuterLoop.Count;+ if (request.Sections.Any(s => s.OuterLoop.Count != n)) return D("air-x3-mismatched-vertex-count-rejected", AirDiagnosticSeverity.Error);+ if (request.Correspondence is null || request.Correspondence.VertexMap.Count != n || !request.Correspondence.VertexMap.SequenceEqual(Enumerable.Range(0, n))) return D("air-x3-non-identity-correspondence-deferred", AirDiagnosticSeverity.Warning);+ diagnostics.Add(D("air-x3-split-preserving-plan"));+ return null;+ }++ private static IReadOnlyList<AirBRepPlanElement> BuildElements(PrismaticSectionTransitionRequest request, string sourceAirNodeId, AirProvenance provenance, List<AirDiagnostic> diagnostics)+ {+ var e = new List<AirBRepPlanElement>();+ var n = request.Sections[0].OuterLoop.Count;+ for (var s = 0; s < request.Sections.Count; s++) for (var i = 0; i < n; i++) e.Add(E($"v:s{s}:{i}", AirBRepPlanElementKind.Vertex, AirBRepPlanRole.SectionVertex, s, i));+ diagnostics.Add(D("air-x3-section-vertices-planned"));+ for (var s = 0; s < request.Sections.Count; s++) for (var i = 0; i < n; i++) { e.Add(E($"c:section:{s}:{i}", AirBRepPlanElementKind.Curve, AirBRepPlanRole.SectionEdge, s, null, null, i)); e.Add(E($"e:section:{s}:{i}", AirBRepPlanElementKind.Edge, AirBRepPlanRole.SectionEdge, s, null, null, i)); }+ diagnostics.Add(D("air-x3-section-edges-planned"));+ for (var s = 0; s < request.Sections.Count - 1; s++) for (var i = 0; i < n; i++) { e.Add(E($"c:transition:{s}:{i}", AirBRepPlanElementKind.Curve, AirBRepPlanRole.VerticalTransitionEdge, null, null, s, i)); e.Add(E($"e:transition:{s}:{i}", AirBRepPlanElementKind.Edge, AirBRepPlanRole.VerticalTransitionEdge, null, null, s, i)); }+ diagnostics.Add(D("air-x3-transition-edges-planned"));+ e.Add(E("surf:cap:bottom", AirBRepPlanElementKind.Surface, AirBRepPlanRole.CapFace)); e.Add(E("loop:face:cap:bottom", AirBRepPlanElementKind.Loop, AirBRepPlanRole.SectionLoop)); e.Add(E("f:cap:bottom", AirBRepPlanElementKind.Face, AirBRepPlanRole.CapFace, faceRole: "bottom-cap"));+ e.Add(E("surf:cap:top", AirBRepPlanElementKind.Surface, AirBRepPlanRole.CapFace)); e.Add(E("loop:face:cap:top", AirBRepPlanElementKind.Loop, AirBRepPlanRole.SectionLoop)); e.Add(E("f:cap:top", AirBRepPlanElementKind.Face, AirBRepPlanRole.CapFace, faceRole: "top-cap"));+ diagnostics.Add(D("air-x3-cap-faces-planned"));+ for (var s = 0; s < request.Sections.Count - 1; s++) for (var i = 0; i < n; i++) { var role = s == 0 ? AirBRepPlanRole.SideFace : AirBRepPlanRole.TransitionFace; var label = s == 0 ? "side" : "transition"; e.Add(E($"surf:{label}:interval{s}:edge{i}", AirBRepPlanElementKind.Surface, role, null, null, s, i)); e.Add(E($"loop:face:{label}:interval{s}:edge{i}", AirBRepPlanElementKind.Loop, role, null, null, s, i)); e.Add(E($"f:{label}:interval{s}:edge{i}", AirBRepPlanElementKind.Face, role, null, null, s, i, label)); }+ diagnostics.Add(D("air-x3-transition-faces-planned"));+ for (var i = 0; i < 40; i++) e.Add(E($"coedge:{i:00}", AirBRepPlanElementKind.Coedge, AirBRepPlanRole.Unknown));+ e.Add(E("shell:body:0", AirBRepPlanElementKind.Shell, AirBRepPlanRole.BodyShell)); diagnostics.Add(D("air-x3-shell-planned"));+ e.Add(E("body:0", AirBRepPlanElementKind.Body, AirBRepPlanRole.Body)); diagnostics.Add(D("air-x3-body-planned"));+ diagnostics.Add(D("air-x3-stable-planned-ids-created"));+ return e;+ AirBRepPlanElement E(string id, AirBRepPlanElementKind kind, AirBRepPlanRole role, int? section = null, int? vertex = null, int? interval = null, int? edge = null, string? faceRole = null) => new(new AirBRepPlanId(id), kind, role, sourceAirNodeId, provenance, section, vertex, interval, edge, faceRole, []);+ }++ private static AirBRepPlanSummary Summary(PrismaticSectionTransitionRequest request, string sourceAirNodeId, IReadOnlyList<AirDiagnostic> diagnostics, IReadOnlyList<string> guarantees)+ {+ var n = request.Sections[0].OuterLoop.Count; var intervals = request.Sections.Count - 1; var faces = 2 + intervals * n;+ var allX = request.Sections.SelectMany(s => s.OuterLoop.Select(p => p.X)); var allY = request.Sections.SelectMany(s => s.OuterLoop.Select(p => p.Y));+ var bounds = FormattableString.Invariant($"[{allX.Min():0.###},{allY.Min():0.###},{request.Sections.Min(s => s.Z):0.###}]..[{allX.Max():0.###},{allY.Max():0.###},{request.Sections.Max(s => s.Z):0.###}]");+ return new(AirBRepPlanKind.PrismaticSectionTransition, sourceAirNodeId, request.Sections.Count * n, request.Sections.Count * n + intervals * n, request.Sections.Count * n + intervals * n, (2 * n) + (4 * intervals * n), faces, faces, faces, 1, 1, 2, n, n, 0, bounds, PreserveSectionSplits, diagnostics, guarantees);+ }++ private static AirBRepPlanValidationResult Validation(bool succeeded, string sourceAirNodeId, List<AirDiagnostic> diagnostics, AirDiagnostic error)+ {+ diagnostics.Add(error); diagnostics = Stable(diagnostics).ToList();+ var empty = new AirBRepPlanSummary(AirBRepPlanKind.Unsupported, sourceAirNodeId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "none", PreserveSectionSplits, diagnostics, RouteGuarantees);+ var errors = error.Severity == AirDiagnosticSeverity.Error ? new[] { error } : [];+ var warnings = error.Severity == AirDiagnosticSeverity.Warning ? new[] { error } : [];+ return new(succeeded, diagnostics, errors, warnings, empty);+ }++ private static AirProvenance Provenance(string sourceAirNodeId) => new("AIR-X3", "Constructive AIR BRepPlan", "canonical-rectangle-inset-section-transition", sourceAirNodeId, nameof(PrismaticSectionTransitionEmitter), AirSelectionClass.None, AirRuleKind.None, "generated/constructive; split policy: preserve section splits", false, ["BRepPlan is non-production and does not materialize BRep."]);+ private static AirDiagnostic D(string code, AirDiagnosticSeverity severity = AirDiagnosticSeverity.Info) => new(code, severity, code);+ private static IReadOnlyList<AirDiagnostic> Stable(IEnumerable<AirDiagnostic> d) => d.GroupBy(x => x.Code).Select(g => g.First()).OrderBy(x => x.Code, StringComparer.Ordinal).ToArray();+}diff --git a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md b/docs/air-a0-aetheris-v2-compiler-ir-constitution.mdindex 613b7d61..d7732b9b 100644--- a/docs/air-a0-aetheris-v2-compiler-ir-constitution.md+++ b/docs/air-a0-aetheris-v2-compiler-ir-constitution.md@@ -744,3 +744,7 @@ AIR-X1 adds a minimal internal AIR envelope and thin wrappers for the existing p## AIR-X2 status noteAIR-X2 adds an internal route-selection/admissibility layer ahead of AIR-X1 wrappers. It preserves the AIR-A0 authority split: Firmament remains source intent, AIR remains constructive MIR, BRep remains topology authority, CIR remains a mirror side-channel, and STEP remains serialization. AIR-X2 does not implement BRepPlan and does not replace production routes.++## AIR-X3 status note++AIR-X3 adds the first minimal internal BRepPlan proof for `AirPrismaticSectionTransition`. The plan sits between Constructive AIR and the existing prismatic BRep emitter, records deterministic planned IDs, topology roles, expected counts, split policy, provenance, diagnostics, and guarantees, and does not change production routes, BRep topology behavior, CIR authority, Firmament lowering, or STEP/export authority.diff --git a/docs/air-x1-minimal-air-wrappers-for-proven-lanes.md b/docs/air-x1-minimal-air-wrappers-for-proven-lanes.mdindex 152f30a1..567fd45d 100644--- a/docs/air-x1-minimal-air-wrappers-for-proven-lanes.md+++ b/docs/air-x1-minimal-air-wrappers-for-proven-lanes.md@@ -75,3 +75,7 @@ AIR-X2 should introduce route-selection/admissibility metadata only after more w## AIR-X2 route-selection noteAIR-X2 now records deterministic route decisions for the AIR-X1 wrapper lanes. Profile extrusion and prismatic section transition use direct selection; top-face loop chamfer uses switch/match classification. These decisions are internal/test-visible and do not replace production routes.++## AIR-X3 BRepPlan note++AIR-X1 wrappers remain thin envelopes around proven lanes. AIR-X3 adds a non-production, internal/test-visible BRepPlan for the canonical prismatic section transition lane, but it does not replace the AIR-X1 wrapper or the existing emitter path.diff --git a/docs/air-x2-route-selection-and-admissibility.md b/docs/air-x2-route-selection-and-admissibility.mdindex ce29de42..7714c996 100644--- a/docs/air-x2-route-selection-and-admissibility.md+++ b/docs/air-x2-route-selection-and-admissibility.md@@ -64,3 +64,7 @@ Focused AIR route-selection tests were added under `Aetheris.Kernel.Core.Tests`.## Recommended next milestoneRecommended next milestone: AIR-X3 JudgmentUtility integration for one contested edge-finish route. AIR-X2 found direct and switch/match selection clean enough that the remaining new evidence is in scored competing-route policy rather than another deterministic selector.++## AIR-X3 direct-route BRepPlan proof++AIR-X3 proves that the direct `AirPrismaticSectionTransition` route can produce a planned topology summary before invoking the existing emitter. Route selection behavior is unchanged: direct selection remains appropriate for this named constructive route, and JudgmentUtility remains deferred.diff --git a/docs/air-x3-brep-plan-prismatic-section-transition.md b/docs/air-x3-brep-plan-prismatic-section-transition.mdnew file mode 100644index 00000000..f75c26a3--- /dev/null+++ b/docs/air-x3-brep-plan-prismatic-section-transition.md@@ -0,0 +1,90 @@+# AIR-X3 — BRepPlan for PrismaticSectionTransition++## Purpose and scope++AIR-X3 introduces the first minimal BRepPlan layer for one already-proven Constructive AIR lane:++`AirPrismaticSectionTransition -> BRepPlan -> existing PrismaticSectionTransitionEmitter/BRep`++The milestone proves that Aetheris can represent planned explicit topology before materializing BRep while preserving AIR provenance, topology roles, expected counts, split policy, diagnostics, and test summaries.++## Relationship to AIR-A0, AIR-X1, and AIR-X2++AIR-A0 defines Aetheris as a compiler for BRep: Firmament is source intent, AIR is constructive geometry MIR, BRepPlan is the backend topology emission plan, BRep is the explicit topology backend and STEP/export authority, CIR is an evaluation side-channel, and STEP is serialization.++AIR-X1 added thin AIR wrappers around proven lanes without replacing production routes and without implementing BRepPlan.++AIR-X2 made route selection explicit and admissibility-driven. AIR-X3 does not alter that behavior: `AirPrismaticSectionTransition` still uses direct selection because the AIR node already names its constructive route. JudgmentUtility remains deferred.++## BRepPlan definition++BRepPlan is lower-level than AIR and richer than raw BRep. It carries deterministic planned IDs, element kinds, topology roles, source AIR node IDs, provenance, expected topology counts, bounds, split policy, diagnostics, and route-exclusion guarantees.++The minimal AIR-X3 model is internal/test-visible and prismatic-focused. It defines plan kinds, element kinds, roles, stable IDs, elements, summaries, validation results, and plans.++## BRepPlan is not AIR and not BRep++BRepPlan is not source/authoring intent and is not a replacement for Constructive AIR. It is also not materialized explicit topology and does not own STEP/export authority. The existing `PrismaticSectionTransitionEmitter` remains the BRep materialization path.++## Why prismatic section transition is first++The prismatic section transition lane already has a constrained, proven emitter and canonical artifact corpus. Its topology formula is deterministic for a three-section, four-vertex, split-preserving stack, making it suitable for the first planned-topology proof without rewriting geometry.++## Planner model++The planner uses `AirBRepPlanKind.PrismaticSectionTransition`, element kinds for vertex/curve/edge/coedge/loop/surface/face/shell/body, and roles including section vertices/edges, vertical transition edges, cap faces, side faces, transition faces, body shell, and body.++Stable IDs are deterministic strings such as `v:s0:0`, `e:section:0:1`, `e:transition:1:2`, `f:cap:bottom`, `f:transition:interval1:edge2`, `shell:body:0`, and `body:0`.++The summary records counts, bounds, split policy (`preserve-section-splits`), diagnostics, and guarantees. The validation result reports success/failure, diagnostics, errors, warnings, expected summary, and optional actual emitted topology summary.++## Canonical stack and expected planned topology++The canonical stack uses width `10`, depth `8`, height `6`, inset `1`, sections at `z=0`, `z=5`, and `z=6`, with a full rectangle on the first two sections and an inset rectangle on the top section.++Expected planned topology:++- vertices: `12`+- section edges: `12`+- transition edges: `8`+- total edges: `20`+- curves: `20`+- faces: `10`+- cap faces: `2`+- lower side interval faces: `4`+- upper transition interval faces: `4`+- chamfer faces: `0` for pure prismatic transition+- loops: `10`+- coedges: `40`+- planar surfaces: `10`+- cylindrical faces: `0`+- shell: `1`+- body: `1`+- bounds: `[-5,-4,0]..[5,4,6]`+- split policy: `preserve-section-splits`++## Comparison against existing emitter++AIR-X3 compares the BRepPlan summary against the existing emitter result for the canonical case. Counts and bounds match the emitted BRep topology summary, and STEP smoke remains produced by the existing emitter path, not by BRepPlan.++## Validation, rejection, and deferred cases++The planner validates three line-only sections, equal vertex counts, at least three vertices per section, identity correspondence, increasing Z coordinates, finite coordinates, no holes, no arcs, one outer loop, and split-preserving topology.++Deterministic diagnostics cover rejected/deferred cases including invalid section count, mismatched vertex count, non-increasing sections, non-finite coordinate, holes, arcs, multiple loops, and non-identity correspondence.++## Route-exclusion guarantees++AIR-X3 records guarantees that it performs no production route replacement, no emitter rewrite, no STEP exporter change, no BRep topology behavior change, no coplanar merge, no AirEdgeSweep, no Boolean, and no topology graft.++## Non-goals++AIR-X3 does not replace production routes, rewrite emitters, change STEP exporter/importer behavior, change BRep topology behavior, change route selection or JudgmentUtility, change CIR mirror behavior, change Firmament lowering, implement new geometry, change Boolean/chamfer/fillet/shell behavior, add arbitrary graph support, add import/recovery, retry triangle migration, or expand NURBS/freeform support.++## Tests run++Focused AIR-X3 tests validate canonical plan counts and diagnostics, deterministic IDs, comparison against the existing emitter summary, and invalid/deferred diagnostics. The broader required gate list was also run for this implementation.++## Recommended next milestone++Recommended next milestone: **AIR-X4 — BRepPlan roles/provenance for top-face loop chamfer**. AIR-X3 showed that the pure prismatic transition can preserve structural roles and match emitted topology without production changes; the next useful increment is preserving Class B `FaceBoundaryLoop` / `UniformChamfer` provenance and marking the four upper transition faces as `ChamferFace` in a similarly non-production plan.diff --git a/docs/edge-prismatic-v1-section-transition-emitter.md b/docs/edge-prismatic-v1-section-transition-emitter.mdindex 8048538b..2c68d815 100644--- a/docs/edge-prismatic-v1-section-transition-emitter.md+++ b/docs/edge-prismatic-v1-section-transition-emitter.md@@ -188,3 +188,7 @@ Recommended next steps are either:## 11. EDGE-PRISMATIC-X5 corpus evidence noteEDGE-PRISMATIC-X5 records artifact-corpus evidence for the internal `PrismaticSectionTransitionEmitter` seam. The experimental CLI corpus route writes split-preserving STEP artifacts for two-section rectangle, pentagon, hexagon, and asymmetric pentagon transitions, records JSON-only diagnostics for rejected/deferred inputs, and asserts the no-AirEdgeSweep/no-BrepBoundedChamfer/no-topology-graft/no-3D-Boolean/no-coplanar-merge guarantees. This is corpus evidence only; it does not promote the emitter to a production route.++## AIR-X3 BRepPlan note++AIR-X3 adds a non-production BRepPlan planner for the canonical prismatic section transition. The planner matches the existing emitter topology summary for the canonical split-preserving stack and does not rewrite or alter emitter behavior.diff --git a/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md b/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.mdindex 86fd833f..4458da44 100644--- a/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md+++ b/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md@@ -213,3 +213,7 @@ EDGE-LOOP-X1 confirms that the top-face outer-loop chamfer inherits the default## EDGE-LOOP-X2 split-preserving corpus noteEDGE-LOOP-X2 applies this split-preserving policy to a Class B top-face outer-loop chamfer corpus. Each successful corpus artifact keeps the lower prism side faces and the four chamfer transition faces as separate section-boundary topology. No coplanar merge is performed, and the JSON topology contract asserts `10` planar faces, `4` lower prism side faces, and `4` chamfer transition faces for every successful row.++## AIR-X3 split-policy note++AIR-X3 BRepPlan records `preserve-section-splits` explicitly for the prismatic section transition proof. The plan intentionally performs no coplanar merge and preserves the split topology expected by the existing emitter.diff --git a/docs/frictionlab/edge-prismatic-x5-section-transition-artifact-corpus.md b/docs/frictionlab/edge-prismatic-x5-section-transition-artifact-corpus.mdindex 2e930984..a3a0b039 100644--- a/docs/frictionlab/edge-prismatic-x5-section-transition-artifact-corpus.md+++ b/docs/frictionlab/edge-prismatic-x5-section-transition-artifact-corpus.md@@ -224,3 +224,7 @@ Alternative future milestones remain valid after X6:## 14. EDGE-PRISMATIC-X6 gated stability/analyzer noteEDGE-PRISMATIC-X6 adds an explicitly gated/manual stability and analyzer confirmation check for this X5 corpus. See `docs/frictionlab/edge-prismatic-x6-corpus-stability-and-analyzer-confirmation.md` for the `Category=ArtifactCorpus` trait, `AETHERIS_RUN_ARTIFACT_CORPUS_TESTS=1` guard, `PrismaticCorpusStability` filter, repeated-run JSON/STEP hash/normalized-summary comparisons, `analyze section` confirmation, and current `analyze map` primitive-raycast integration blocker. The X6 gate is not part of normal unit-test execution unless explicitly requested, and it does not change production chamfer/fillet behavior, production route authority, ProfileStack behavior, STEP exporter/importer behavior, Boolean core behavior, AirEdgeSweep behavior, or coplanar merge policy.++## AIR-X3 BRepPlan corpus note++AIR-X3 uses the same canonical three-section rectangle/inset stack as a planned-topology proof. The BRepPlan summary matches the existing emitted topology counts and bounds for this corpus shape while leaving artifact generation on the existing emitter path.