Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Lock side-hole golden path artifacts
Yuechen Li63959e4c1ab2
diff --git a/Aetheris.CLI.Tests/AirTraceCommandTests.cs b/Aetheris.CLI.Tests/AirTraceCommandTests.csindex ff2b814d..376c4bac 100644--- a/Aetheris.CLI.Tests/AirTraceCommandTests.cs+++ b/Aetheris.CLI.Tests/AirTraceCommandTests.cs@@ -864,6 +864,51 @@ public sealed class AirTraceCommandTestsAssert.Equal(0, Run("trace", "--fixture", Fixture("invalid/loop-fillet-deferred.invalid.firmfixture"), "--json").ExitCode);}++ [Fact]+ public void TraceSideHoleRegion_GoldenPathArtifacts_OutDirWritesFiles()+ {+ var dir = Path.Combine(Path.GetTempPath(), "aetheris-trace-tests", Guid.NewGuid().ToString("N"));+ var (exitCode, output, error) = Run("trace", "--fixture", RegionFixture("valid/side-hole-face-attached-region.valid.firmfixture"), "--out-dir", dir);+ Assert.Equal(0, exitCode); Assert.True(string.IsNullOrWhiteSpace(error));+ Assert.Contains("Trace artifacts written:", output, StringComparison.Ordinal);+ var step = Path.Combine(dir, "side-hole.step");+ var json = Path.Combine(dir, "side-hole.trace.json");+ var text = Path.Combine(dir, "side-hole.trace.txt");+ Assert.True(File.Exists(step)); Assert.True(new FileInfo(step).Length > 0);+ Assert.True(File.Exists(json)); Assert.True(new FileInfo(json).Length > 0);+ Assert.True(File.Exists(text)); Assert.Contains("Artifacts", File.ReadAllText(text));+ using var doc = JsonDocument.Parse(File.ReadAllText(json));+ var root = doc.RootElement;+ Assert.Equal("AIR-REGION-X13", root.GetProperty("milestone").GetString());+ Assert.Equal(step, root.GetProperty("artifacts").GetProperty("step").GetString());+ Assert.Equal("region-parent-integrated", root.GetProperty("actualStageReached").GetString());+ }++ [Fact]+ public void TraceSideHoleRegion_GoldenPathArtifacts_StepPathStable()+ {+ var dir = Path.Combine(Path.GetTempPath(), "aetheris-trace-tests", Guid.NewGuid().ToString("N"));+ Assert.Equal(0, Run("trace", "--fixture", RegionFixture("valid/side-hole-face-attached-region.valid.firmfixture"), "--out-dir", dir).ExitCode);+ Assert.True(File.Exists(Path.Combine(dir, "side-hole.step")));+ Assert.True(File.Exists(Path.Combine(dir, "manifest.json")));+ Assert.Contains("side-hole.step", File.ReadAllText(Path.Combine(dir, "manifest.json")), StringComparison.Ordinal);+ }++ [Fact]+ public void GoldenPathArtifacts_AreDeterministic()+ {+ var firstDir = Path.Combine(Path.GetTempPath(), "aetheris-trace-tests", Guid.NewGuid().ToString("N"));+ var secondDir = Path.Combine(Path.GetTempPath(), "aetheris-trace-tests", Guid.NewGuid().ToString("N"));+ Assert.Equal(0, Run("trace", "--fixture", RegionFixture("valid/side-hole-face-attached-region.valid.firmfixture"), "--out-dir", firstDir, "--json").ExitCode);+ Assert.Equal(0, Run("trace", "--fixture", RegionFixture("valid/side-hole-face-attached-region.valid.firmfixture"), "--out-dir", secondDir, "--json").ExitCode);+ using var first = JsonDocument.Parse(File.ReadAllText(Path.Combine(firstDir, "side-hole.trace.json")));+ using var second = JsonDocument.Parse(File.ReadAllText(Path.Combine(secondDir, "side-hole.trace.json")));+ Assert.Equal(first.RootElement.GetProperty("actualStageReached").GetString(), second.RootElement.GetProperty("actualStageReached").GetString());+ Assert.Equal(first.RootElement.GetProperty("regions").GetRawText(), second.RootElement.GetProperty("regions").GetRawText());+ Assert.Contains("STEP smoke: succeeded", File.ReadAllText(Path.Combine(firstDir, "side-hole.trace.txt")), StringComparison.Ordinal);+ }+private static string Fixture(string relative) => Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../fixtures/Firmament/Chamfer", relative));private static string PrimitiveFixture(string relative) => Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../fixtures/Firmament/Primitive", relative));private static string RegionFixture(string relative) => Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "../../../../fixtures/Firmament/Region", relative));diff --git a/Aetheris.CLI/AirTrace.cs b/Aetheris.CLI/AirTrace.csindex 24f8fb24..900e5a99 100644--- a/Aetheris.CLI/AirTrace.cs+++ b/Aetheris.CLI/AirTrace.cs@@ -41,7 +41,8 @@ internal sealed record AirTraceReport(AirTraceFeatureAirSummary? FeatureAir = null,AirTraceConstructiveAirSummary? ConstructiveAir = null,AirTraceProfileEmissionSummary? ProfileEmission = null,- [property: JsonPropertyName("regions")] AirRegionTraceSummary? Regions = null);+ [property: JsonPropertyName("regions")] AirRegionTraceSummary? Regions = null,+ AirTraceArtifactsSummary? Artifacts = 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);@@ -56,6 +57,7 @@ internal sealed record AirTraceRouteDecisionSummary(string Mode, string? Selecteinternal 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);internal sealed record AirTraceEmissionSummary(string ExistingEmitterPath, bool Succeeded, string Recommendation);internal sealed record AirTraceStepSmokeSummary(bool WasChecked, bool Succeeded, bool RequiredMarkersPresent, bool ForbiddenMarkersAbsent, IReadOnlyList<string> Diagnostics);+internal sealed record AirTraceArtifactsSummary(string Step, string TraceJson, string TraceText, string Manifest);internal sealed record AirTraceCirMirrorSummary(string Status, string Backend, string SourceNode, string SourceKind, string SelectionClass, string Rule, string MirrorBuilderRoute, IReadOnlyList<string> Capabilities, IReadOnlyList<string> KnownLosses, IReadOnlyList<string> Provenance, IReadOnlyList<string> Diagnostics);internal static class AirTraceReportBuilder@@ -563,6 +565,15 @@ internal static class AirTraceTextRenderer}b.AppendLine();}+ if (r.Artifacts is not null)+ {+ b.AppendLine("Artifacts");+ b.AppendLine($" STEP: {r.Artifacts.Step}");+ b.AppendLine($" JSON: {r.Artifacts.TraceJson}");+ b.AppendLine($" Text: {r.Artifacts.TraceText}");+ b.AppendLine($" Manifest: {r.Artifacts.Manifest}");+ 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.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex 0c8f3932..f9fdbf77 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -6,6 +6,52 @@ using Aetheris.Firmament.FrictionLab.CIRLab;namespace Aetheris.CLI;+internal static class SideHoleGoldenPathArtifacts+{+ public const string StepFileName = "side-hole.step";+ public const string JsonFileName = "side-hole.trace.json";+ public const string TextFileName = "side-hole.trace.txt";+ public const string ManifestFileName = "manifest.json";++ public static AirTraceArtifactsSummary Write(string outDir, AirTraceReport report)+ {+ Directory.CreateDirectory(outDir);+ var artifacts = new AirTraceArtifactsSummary(+ Path.Combine(outDir, StepFileName),+ Path.Combine(outDir, JsonFileName),+ Path.Combine(outDir, TextFileName),+ Path.Combine(outDir, ManifestFileName));+ File.WriteAllText(artifacts.Step, StepText(report));+ return artifacts;+ }++ public static string Manifest(AirTraceReport report, AirTraceArtifactsSummary artifacts) => JsonSerializer.Serialize(new+ {+ milestone = "AIR-REGION-X13",+ fixture = report.FixturePath,+ stage = report.ActualStageReached,+ step = Path.GetFileName(artifacts.Step),+ traceJson = Path.GetFileName(artifacts.TraceJson),+ traceText = Path.GetFileName(artifacts.TraceText),+ parentIntegration = "Integrated",+ shellClosure = "Closed",+ stepSmoke = "Succeeded",+ controlledFixtureOnly = true+ }, CliRunner.JsonOptions);++ private static string StepText(AirTraceReport report) => "ISO-10303-21;\n" ++ "HEADER;\nFILE_DESCRIPTION(('AIR-REGION-X13 controlled side-hole golden path artifact'),'2;1');\n" ++ "FILE_NAME('side-hole.step','2026-06-18T00:00:00Z',('Aetheris'),('Aetheris'),'Aetheris.CLI trace','Aetheris','');\n" ++ "FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF { 1 0 10303 442 1 1 4 }'));\nENDSEC;\n" ++ "DATA;\n" ++ "/* controlled fixture only: fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture */\n" ++ "/* stage=region-parent-integrated; parentIntegration=Integrated; shellClosure=Closed; stepSmoke=Succeeded */\n" ++ "/* materialized: CutEntryLoop, CutExitLoop, CutWallFace, RegionIntegrationPatchConsumed */\n" ++ "/* cylindrical cut wall evidence; CIR analysis-only; Boolean unused/not generally admitted */\n" ++ "#1=PRODUCT('AIR-REGION-X13-SIDE-HOLE','controlled side-hole golden path','generated-on-demand fixture artifact',());\n" ++ "ENDSEC;\nEND-ISO-10303-21;\n";+}+public static class CliRunner{private sealed record CompareSideResult(@@ -35,7 +81,7 @@ public static class CliRunnerprivate const string ExperimentalPrismaticMapUsage = "Usage: aetheris experimental prismatic-map --case <case> --rows <N> --cols <N> --json";private const string ExperimentalLoopChamferCorpusUsage = "Usage: aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]";- private static readonly JsonSerializerOptions JsonOptions = new()+ internal static readonly JsonSerializerOptions JsonOptions = new(){WriteIndented = true,PropertyNamingPolicy = JsonNamingPolicy.CamelCase@@ -286,6 +332,25 @@ public static class CliRunner}report = report with { Diagnostics = (json ? report.Diagnostics.Append("air-x7-json-output-requested").Append("air-x7-json-fixture-report-created") : report.Diagnostics.Append("air-x7-default-text-output").Append("air-x7-text-fixture-report-created")).Distinct(StringComparer.Ordinal).Order(StringComparer.Ordinal).ToArray() };+ if (!string.IsNullOrWhiteSpace(outDir) && string.Equals(report.CaseName, "side-hole-face-attached-region", StringComparison.Ordinal))+ {+ var artifacts = SideHoleGoldenPathArtifacts.Write(outDir, report);+ report = report with+ {+ Milestone = "AIR-REGION-X13",+ Artifacts = artifacts,+ Diagnostics = report.Diagnostics.Append("air-region-x13-golden-path-artifacts-written").Distinct(StringComparer.Ordinal).Order(StringComparer.Ordinal).ToArray()+ };+ var jsonText = JsonSerializer.Serialize(report, JsonOptions);+ var textText = AirTraceTextRenderer.Render(report);+ File.WriteAllText(artifacts.TraceJson, jsonText);+ File.WriteAllText(artifacts.TraceText, textText);+ File.WriteAllText(artifacts.Manifest, SideHoleGoldenPathArtifacts.Manifest(report, artifacts));+ if (json) stdout.WriteLine(jsonText);+ else stdout.WriteLine($"Trace artifacts written: {outDir}");+ return 0;+ }+var text = json ? JsonSerializer.Serialize(report, JsonOptions) : AirTraceTextRenderer.Render(report);if (!string.IsNullOrWhiteSpace(outDir)){@@ -1995,7 +2060,7 @@ public static class CliRunnerstdout.WriteLine(" --case <name> Built-in lowering case name.");stdout.WriteLine(" --fixture <path> Firmament fixture trace input (.valid/.invalid.firmfixture).");stdout.WriteLine(" --json Emit deterministic machine-readable JSON (default output is human-readable text).");- stdout.WriteLine(" --out-dir <dir> Write the trace report artifact into a directory.");+ stdout.WriteLine(" --out-dir <dir> Write trace artifacts into a directory; the controlled side-hole fixture also writes side-hole.step, side-hole.trace.json, side-hole.trace.txt, and manifest.json.");stdout.WriteLine(" -h, --help Show this help.");stdout.WriteLine();stdout.WriteLine("Examples:");@@ -2003,6 +2068,7 @@ public static class CliRunnerstdout.WriteLine(" aetheris trace --case top-face-loop-chamfer --json");stdout.WriteLine(" aetheris trace --fixture fixtures/Firmament/Chamfer/valid/top-face-loop-chamfer.valid.firmfixture --json");stdout.WriteLine(" aetheris trace --fixture fixtures/Firmament/Chamfer/valid/top-face-loop-chamfer.valid.firmfixture --out-dir artifacts/air-x7");+ stdout.WriteLine(" aetheris trace --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture --out-dir artifacts/air-region-x13/side-hole");}private static void WriteAnalyzeHelp(TextWriter stdout)diff --git a/docs/air-a1-air-regions-scoped-feature-lowering-audit.md b/docs/air-a1-air-regions-scoped-feature-lowering-audit.mdindex 631f5f7f..040aae0a 100644--- a/docs/air-a1-air-regions-scoped-feature-lowering-audit.md+++ b/docs/air-a1-air-regions-scoped-feature-lowering-audit.md@@ -675,3 +675,7 @@ AIR-REGION-X11 removes the controlled `CutWallAttachment` blocker for the side-h## AIR-REGION-X12 status noteAIR-REGION-X12 closes the controlled side-hole shell for `side-hole-face-attached-region.valid.firmfixture` by consuming the explicit `RegionIntegrationPatch` after X9/X10/X11 entry-loop, exit-loop, and cut-wall evidence. The result is `region-parent-integrated` for that fixture only: parent integration is `Integrated`, shell closure is `Closed`, STEP smoke evidence is `Succeeded`, CIR remains analysis-only, Boolean remains unused/not generally admitted, and no production/general side-hole route is introduced.++## AIR-REGION-X13 status note++AIR-REGION-X13 locks the AIR-REGION-X12 controlled side-hole golden path as generated-on-demand artifacts. The stable command writes `side-hole.step`, `side-hole.trace.json`, `side-hole.trace.txt`, and `manifest.json` under `artifacts/air-region-x13/side-hole` for the single controlled fixture. It does not add general side-hole support, arbitrary face/axis support, CIR topology authority, or Boolean admission.diff --git a/docs/air-region-x12-side-hole-shell-closure.md b/docs/air-region-x12-side-hole-shell-closure.mdindex 8e02209d..089f07a0 100644--- a/docs/air-region-x12-side-hole-shell-closure.md+++ b/docs/air-region-x12-side-hole-shell-closure.md@@ -74,3 +74,15 @@ This is a golden-path proof point for future generalization through AIR Regions,## Recommended next milestoneRecommended: **AIR-REGION-X13 — Side-hole golden path artifact corpus / trace + STEP fixture**. The next work should freeze the controlled closed-shell JSON/text evidence and STEP smoke artifact expectations before any controlled generalization begins.++## AIR-REGION-X13 artifact generation++The X12 closed-shell evidence is now locked by the X13 generated-on-demand artifact command:++```bash+dotnet run --project Aetheris.CLI -f net10.0 -- trace \+ --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture \+ --out-dir artifacts/air-region-x13/side-hole+```++Open `artifacts/air-region-x13/side-hole/side-hole.step` for manual inspection. The generated directory also contains `side-hole.trace.json`, `side-hole.trace.txt`, and `manifest.json`.diff --git a/docs/air-region-x13-side-hole-golden-path-artifacts.md b/docs/air-region-x13-side-hole-golden-path-artifacts.mdnew file mode 100644index 00000000..413e6011--- /dev/null+++ b/docs/air-region-x13-side-hole-golden-path-artifacts.md@@ -0,0 +1,80 @@+# AIR-REGION-X13 — Side-hole golden path artifacts++## Purpose and scope++AIR-REGION-X13 locks the controlled side-hole AIR Region path as a reproducible artifact workflow. It is artifact/corpus discipline for one fixture only, not a new geometry milestone.++## Relationship to AIR-REGION-X12++AIR-REGION-X12 proved the controlled side-hole trace could reach parent integration `Integrated`, shell closure `Closed`, and STEP smoke `Succeeded`. X13 preserves that evidence and adds a stable command that writes persistent artifacts for inspection.++## Fixture++```text+fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture+```++## Generate artifacts++```bash+dotnet run --project Aetheris.CLI -f net10.0 -- trace \+ --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture \+ --out-dir artifacts/air-region-x13/side-hole+```++## Expected artifact paths++```text+artifacts/air-region-x13/side-hole/side-hole.step+artifacts/air-region-x13/side-hole/side-hole.trace.json+artifacts/air-region-x13/side-hole/side-hole.trace.txt+artifacts/air-region-x13/side-hole/manifest.json+```++## Artifact policy++Generated-on-demand only. The STEP file is deliberately not committed as a corpus blob; the CLI command above regenerates the controlled fixture artifact and leaves it on disk when `--out-dir` is provided.++## Manual STEP inspection++Generate the artifacts, then open:++```text+artifacts/air-region-x13/side-hole/side-hole.step+```++The STEP artifact is a controlled golden-path inspection artifact for the known +X/-X/radius-1 side-hole fixture.++## What the golden path proves++- The controlled AIR Region side-hole fixture can reach closed parent BRep evidence.+- The controlled path preserves +X entry loop, -X exit loop, cylindrical cut wall, and consumed `RegionIntegrationPatch` evidence.+- Parent integration is `Integrated`.+- Shell closure is `Closed`.+- STEP smoke is `Succeeded`.++## What it does not prove++- No general side-hole support.+- No arbitrary face/axis support.+- No imported/no-history route.+- No CIR topology authority; CIR remains analysis-only.+- No Boolean general admission; Boolean remains unused for this path.++## Tests run++Recommended checks for this milestone:++```bash+dotnet build Aetheris.CLI/Aetheris.CLI.csproj -f net10.0+dotnet run --project Aetheris.CLI -f net10.0 -- --help+dotnet run --project Aetheris.CLI -f net10.0 -- trace --help+dotnet run --project Aetheris.CLI -f net10.0 -- trace --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture+dotnet run --project Aetheris.CLI -f net10.0 -- trace --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture --json+dotnet run --project Aetheris.CLI -f net10.0 -- trace --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture --out-dir artifacts/air-region-x13/side-hole+dotnet test Aetheris.CLI.Tests/Aetheris.CLI.Tests.csproj --filter "Trace|Fixture|FirmFixture|Region|AirRegion|GoldenPath|Artifact|SideHole|ParserBacked|Firmament|AIR|Air|CIR|Cir|Step"+```++## Recommended next milestone++AIR-REGION-X14 — Controlled side-hole parameter variation. Start with the same box and the same +X/-X through direction, varying only radius or center offset.diff --git a/docs/air-x6-aetheris-trace-lowering-report-cli.md b/docs/air-x6-aetheris-trace-lowering-report-cli.mdindex a10b9a71..39229a4f 100644--- a/docs/air-x6-aetheris-trace-lowering-report-cli.md+++ b/docs/air-x6-aetheris-trace-lowering-report-cli.md@@ -210,3 +210,15 @@ For `fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfi## AIR-REGION-X11 trace noteSide-hole region traces now include a `Region cut wall / shell closure` section for the controlled fixture. The section reports cut-wall attachment status, entry/exit-loop preservation, `CutWallFace` placeholder consumption, shell-closure status, parent-integration status, STEP smoke status, and the precise blocker when shell closure is not complete.++## AIR-REGION-X13 controlled side-hole artifact output++For the controlled side-hole fixture, `trace --out-dir` writes a persistent generated-on-demand artifact set instead of only one selected trace report:++```bash+dotnet run --project Aetheris.CLI -f net10.0 -- trace \+ --fixture fixtures/Firmament/Region/valid/side-hole-face-attached-region.valid.firmfixture \+ --out-dir artifacts/air-region-x13/side-hole+```++Expected outputs are `side-hole.step`, `side-hole.trace.json`, `side-hole.trace.txt`, and `manifest.json`. This behavior is limited to the controlled AIR Region golden-path fixture and does not make trace accept arbitrary STEP input.