Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add EDGE-X11 AirChamfer corpus CLI
Yuechen Lib0a14d00b5af
diff --git a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs b/Aetheris.CLI.Tests/CliHelpAndUsageTests.csindex c795d656..322887f2 100644--- a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs+++ b/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs@@ -38,6 +38,7 @@ public sealed class CliHelpAndUsageTests[InlineData("analyze", "section")][InlineData("experimental")][InlineData("experimental", "airchamfer-cube")]+ [InlineData("experimental", "airchamfer-corpus")]public void Subcommand_Help_Lists_Usage_And_Examples(params string[] prefix){var stdout = new StringWriter();diff --git a/Aetheris.CLI.Tests/ExperimentalAirChamferStepArtifactTests.cs b/Aetheris.CLI.Tests/ExperimentalAirChamferStepArtifactTests.csindex 71f9d515..529a36e1 100644--- a/Aetheris.CLI.Tests/ExperimentalAirChamferStepArtifactTests.cs+++ b/Aetheris.CLI.Tests/ExperimentalAirChamferStepArtifactTests.cs@@ -73,4 +73,114 @@ public sealed class ExperimentalAirChamferStepArtifactTests}}}++ [Fact]+ public void Experimental_AirChamfer_Corpus_Help_Is_Discoverable_And_Explicitly_Lab_Only()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "airchamfer-corpus", "--help"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));+ var text = stdout.ToString();+ Assert.Contains("Usage: aetheris experimental airchamfer-corpus --out-dir <dir> [--json]", text, StringComparison.Ordinal);+ Assert.Contains("EDGE-X11", text, StringComparison.Ordinal);+ Assert.Contains("Experimental/lab-only", text, StringComparison.Ordinal);+ Assert.Contains("no production chamfer route replacement", text, StringComparison.OrdinalIgnoreCase);+ Assert.Contains("no 3D Boolean", text, StringComparison.Ordinal);+ }++ [Fact]+ public void Experimental_AirChamfer_Corpus_Writes_Successful_Artifacts_And_Json_Only_Rejections()+ {+ var outputDir = Path.Combine(Path.GetTempPath(), $"edge-x11-airchamfer-corpus-{Guid.NewGuid():N}");+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ try+ {+ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "airchamfer-corpus", "--out-dir", outputDir, "--json"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));++ var canonicalPath = Path.Combine(outputDir, "edge-x11-airchamfer-cube-canonical.step");+ var nonOrthogonalPath = Path.Combine(outputDir, "edge-x11-airchamfer-cube-nonorthogonal.step");+ var invalidDistancePath = Path.Combine(outputDir, "edge-x11-airchamfer-invalid-distance.step");+ var legacyDependentPath = Path.Combine(outputDir, "edge-x11-airchamfer-triangle-legacy-dependent.step");+ var summaryPath = Path.Combine(outputDir, "edge-x11-airchamfer-corpus.json");++ Assert.True(File.Exists(canonicalPath));+ Assert.True(new FileInfo(canonicalPath).Length > 0);+ Assert.True(File.Exists(nonOrthogonalPath));+ Assert.True(new FileInfo(nonOrthogonalPath).Length > 0);+ Assert.False(File.Exists(invalidDistancePath));+ Assert.False(File.Exists(legacyDependentPath));+ Assert.True(File.Exists(summaryPath));++ AssertStepMarkers(File.ReadAllText(canonicalPath));+ AssertStepMarkers(File.ReadAllText(nonOrthogonalPath));++ using var stdoutDoc = JsonDocument.Parse(stdout.ToString());+ using var fileDoc = JsonDocument.Parse(File.ReadAllText(summaryPath));+ Assert.Equal(stdoutDoc.RootElement.GetProperty("milestone").GetString(), fileDoc.RootElement.GetProperty("milestone").GetString());++ var root = stdoutDoc.RootElement;+ Assert.Equal("EDGE-X11", root.GetProperty("corpusVersion").GetString());+ Assert.Equal("EDGE-X11", root.GetProperty("milestone").GetString());+ Assert.Equal("AirChamferShadowRoute->AirChamferRealBodyPrototype", root.GetProperty("candidatePath").GetString());+ Assert.Equal("experimental-cli-airchamfer-corpus", root.GetProperty("route").GetString());+ Assert.True(root.GetProperty("legacyAuthorityPreserved").GetBoolean());+ Assert.False(root.GetProperty("productionOutputChanged").GetBoolean());+ Assert.True(root.GetProperty("noProductionRouteReplacement").GetBoolean());+ Assert.True(root.GetProperty("no3DBooleanUsed").GetBoolean());++ var cases = root.GetProperty("cases").EnumerateArray().ToDictionary(x => x.GetProperty("caseName").GetString()!);+ Assert.Equal("succeeded", cases["canonical"].GetProperty("status").GetString());+ Assert.Equal("succeeded", cases["nonorthogonal"].GetProperty("status").GetString());+ Assert.Equal("rejected", cases["invalid-distance"].GetProperty("status").GetString());+ Assert.Equal("deferred", cases["triangle-legacy-dependent"].GetProperty("status").GetString());+ Assert.Equal("AirChamferShadowRoute->AirChamferRealBodyPrototype", cases["canonical"].GetProperty("candidatePath").GetString());+ Assert.Equal("experimental-cli-airchamfer-corpus", cases["canonical"].GetProperty("route").GetString());+ Assert.Equal(canonicalPath, cases["canonical"].GetProperty("artifactPath").GetString());+ Assert.Equal(nonOrthogonalPath, cases["nonorthogonal"].GetProperty("artifactPath").GetString());+ Assert.Equal(JsonValueKind.Null, cases["invalid-distance"].GetProperty("artifactPath").ValueKind);+ Assert.Equal(JsonValueKind.Null, cases["triangle-legacy-dependent"].GetProperty("artifactPath").ValueKind);++ var canonicalMarkers = cases["canonical"].GetProperty("stepMarkerSummary");+ Assert.True(canonicalMarkers.GetProperty("requiredPresentSatisfied").GetBoolean());+ Assert.True(canonicalMarkers.GetProperty("forbiddenAbsentSatisfied").GetBoolean());+ Assert.NotEqual(JsonValueKind.Null, cases["canonical"].GetProperty("topologySummary").ValueKind);++ var diagnostics = root.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains("edge-x11-legacy-authority-preserved", diagnostics);+ Assert.Contains("edge-x11-no-production-route-replacement", diagnostics);+ Assert.Contains("edge-x11-no-3d-boolean-used", diagnostics);+ Assert.Contains("edge-x11-step-smoke-succeeded:canonical", diagnostics);+ Assert.Contains("edge-x11-step-smoke-succeeded:nonorthogonal", diagnostics);+ Assert.Contains("edge-x11-case-rejected:invalid-distance:reject-invalid-distance", diagnostics);+ Assert.Contains("edge-x11-case-deferred:triangle-legacy-dependent:legacy-dependent-fallback", diagnostics);+ }+ finally+ {+ if (Directory.Exists(outputDir))+ {+ Directory.Delete(outputDir, recursive: true);+ }+ }+ }++ private static void AssertStepMarkers(string stepText)+ {+ Assert.False(string.IsNullOrWhiteSpace(stepText));+ Assert.Contains("ISO-10303-21", stepText, StringComparison.Ordinal);+ Assert.Contains("MANIFOLD_SOLID_BREP", stepText, StringComparison.Ordinal);+ Assert.Contains("ADVANCED_FACE", stepText, StringComparison.Ordinal);+ Assert.Contains("PLANE", stepText, StringComparison.Ordinal);+ Assert.DoesNotContain("CYLINDRICAL_SURFACE", stepText, StringComparison.Ordinal);+ Assert.DoesNotContain("BREP_WITH_VOIDS", stepText, StringComparison.Ordinal);+ }+}diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex c3790dbb..0bac12f1 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -27,7 +27,9 @@ public static class CliRunnerprivate const string CanonUsage = "Usage: aetheris canon <file.step> --out <canonical.step> [--json]";private const string AsmExecUsage = "Usage: aetheris asm exec <file.firmasm> [--json]";private const string AsmExportUsage = "Usage: aetheris asm export <file.firmasm> --out <directory> [--json]";- private const string ExperimentalUsage = "Usage: aetheris experimental airchamfer-cube --out <path> [--json]";+ private const string ExperimentalUsage = "Usage: aetheris experimental <airchamfer-cube|airchamfer-corpus> [options]";+ private const string ExperimentalAirChamferCubeUsage = "Usage: aetheris experimental airchamfer-cube --out <path> [--json]";+ private const string ExperimentalAirChamferCorpusUsage = "Usage: aetheris experimental airchamfer-corpus --out-dir <dir> [--json]";private static readonly JsonSerializerOptions JsonOptions = new(){@@ -854,6 +856,11 @@ public static class CliRunnerreturn RunExperimentalAirChamferCube(args.Skip(1).ToArray(), stdout, stderr);}+ if (string.Equals(args[0], "airchamfer-corpus", StringComparison.Ordinal))+ {+ return RunExperimentalAirChamferCorpus(args.Skip(1).ToArray(), stdout, stderr);+ }+stderr.WriteLine($"Unknown experimental subcommand '{args[0]}'.");stderr.WriteLine(ExperimentalUsage);return 1;@@ -873,7 +880,7 @@ public static class CliRunnerbreak;case "--out":stderr.WriteLine("Experimental airchamfer-cube option --out requires a path value.");- stderr.WriteLine(ExperimentalUsage);+ stderr.WriteLine(ExperimentalAirChamferCubeUsage);return 1;case "--json":json = true;@@ -884,7 +891,7 @@ public static class CliRunnerreturn 0;default:stderr.WriteLine($"Unknown experimental airchamfer-cube option '{args[i]}'.");- stderr.WriteLine(ExperimentalUsage);+ stderr.WriteLine(ExperimentalAirChamferCubeUsage);return 1;}}@@ -892,7 +899,7 @@ public static class CliRunnerif (string.IsNullOrWhiteSpace(outPath)){stderr.WriteLine("Experimental airchamfer-cube requires --out <path>.");- stderr.WriteLine(ExperimentalUsage);+ stderr.WriteLine(ExperimentalAirChamferCubeUsage);return 1;}@@ -931,6 +938,61 @@ public static class CliRunnerreturn 0;}++ private static int RunExperimentalAirChamferCorpus(string[] args, TextWriter stdout, TextWriter stderr)+ {+ string? outDir = null;+ var json = false;++ for (var i = 0; i < args.Length; i++)+ {+ switch (args[i])+ {+ case "--out-dir" when i + 1 < args.Length:+ outDir = args[++i];+ break;+ case "--out-dir":+ stderr.WriteLine("Experimental airchamfer-corpus option --out-dir requires a directory value.");+ stderr.WriteLine(ExperimentalAirChamferCorpusUsage);+ return 1;+ case "--json":+ json = true;+ break;+ case "-h":+ case "--help":+ WriteExperimentalAirChamferCorpusHelp(stdout);+ return 0;+ default:+ stderr.WriteLine($"Unknown experimental airchamfer-corpus option '{args[i]}'.");+ stderr.WriteLine(ExperimentalAirChamferCorpusUsage);+ return 1;+ }+ }++ if (string.IsNullOrWhiteSpace(outDir))+ {+ stderr.WriteLine("Experimental airchamfer-corpus requires --out-dir <dir>.");+ stderr.WriteLine(ExperimentalAirChamferCorpusUsage);+ return 1;+ }++ var corpus = AirChamferStepArtifactLab.WriteEdgeX11Corpus(outDir);+ if (json)+ {+ stdout.WriteLine(JsonSerializer.Serialize(corpus, JsonOptions));+ return corpus.Errors.Count == 0 ? 0 : 1;+ }++ foreach (var diagnostic in corpus.Diagnostics)+ {+ stdout.WriteLine(diagnostic);+ }++ stdout.WriteLine($"Experimental AirChamfer EDGE-X11 corpus summary written: {corpus.SummaryPath}");+ stdout.WriteLine("Route: experimental/lab AirChamfer shadow candidate corpus; production chamfer remains legacy-authoritative.");+ return corpus.Errors.Count == 0 ? 0 : 1;+ }+private static int RunAsm(string[] args, TextWriter stdout, TextWriter stderr){if (args.Length == 0 || IsHelpFlag(args[0]))@@ -1640,22 +1702,24 @@ public static class CliRunnerstdout.WriteLine(ExperimentalUsage);stdout.WriteLine();stdout.WriteLine("Subcommands:");- stdout.WriteLine(" airchamfer-cube Export a controlled one-edge AirChamfer candidate cube/box STEP artifact.");+ stdout.WriteLine(" airchamfer-cube Export a controlled one-edge AirChamfer candidate cube/box STEP artifact.");+ stdout.WriteLine(" airchamfer-corpus Generate the EDGE-X11 tiny AirChamfer STEP regression corpus.");stdout.WriteLine();stdout.WriteLine("Notes:");stdout.WriteLine(" - Experimental only; does not route production Firmament chamfer operations through AirChamfer.");stdout.WriteLine(" - Legacy BrepBoundedChamfer remains production-authoritative.");stdout.WriteLine(" - The candidate path uses no 3D Boolean fallback.");stdout.WriteLine();- stdout.WriteLine("Example:");+ stdout.WriteLine("Examples:");stdout.WriteLine(" aetheris experimental airchamfer-cube --out edge-x10-airchamfer-cube-one-edge.step --json");+ stdout.WriteLine(" aetheris experimental airchamfer-corpus --out-dir artifacts/edge-x11 --json");}private static void WriteExperimentalAirChamferCubeHelp(TextWriter stdout){stdout.WriteLine("Export a controlled one-edge AirChamfer candidate cube/box STEP artifact.");stdout.WriteLine();- stdout.WriteLine(ExperimentalUsage);+ stdout.WriteLine(ExperimentalAirChamferCubeUsage);stdout.WriteLine();stdout.WriteLine("Options:");stdout.WriteLine(" --out <path> Required deterministic STEP output path.");@@ -1672,6 +1736,29 @@ public static class CliRunnerstdout.WriteLine(" aetheris experimental airchamfer-cube --out edge-x10-airchamfer-cube-one-edge.step --json");}+ private static void WriteExperimentalAirChamferCorpusHelp(TextWriter stdout)+ {+ stdout.WriteLine("Generate the EDGE-X11 tiny AirChamfer STEP artifact regression corpus.");+ stdout.WriteLine();+ stdout.WriteLine(ExperimentalAirChamferCorpusUsage);+ stdout.WriteLine();+ stdout.WriteLine("Options:");+ stdout.WriteLine(" --out-dir <dir> Required deterministic corpus output directory.");+ stdout.WriteLine(" --json Emit the corpus JSON summary to stdout after writing it to disk.");+ stdout.WriteLine(" -h, --help Show this help.");+ stdout.WriteLine();+ stdout.WriteLine("Artifacts:");+ stdout.WriteLine(" edge-x11-airchamfer-cube-canonical.step");+ stdout.WriteLine(" edge-x11-airchamfer-cube-nonorthogonal.step when supported; otherwise JSON-only deferred diagnostics.");+ stdout.WriteLine($" {AirChamferStepArtifactLab.DefaultCorpusSummaryFileName}");+ stdout.WriteLine();+ stdout.WriteLine("Production safety:");+ stdout.WriteLine(" Experimental/lab-only route; no production chamfer route replacement and no 3D Boolean.");+ stdout.WriteLine();+ stdout.WriteLine("Example:");+ stdout.WriteLine(" aetheris experimental airchamfer-corpus --out-dir artifacts/edge-x11 --json");+ }+private static void WriteAsmHelp(TextWriter stdout){stdout.WriteLine("Execute flattened .firmasm assemblies as rigidly placed body instances, or export STEP interop packages.");diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/AirChamferStepArtifactLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/AirChamferStepArtifactLab.csindex f7c5417e..68096864 100644--- a/Aetheris.Firmament.FrictionLab/CIRLab/AirChamferStepArtifactLab.cs+++ b/Aetheris.Firmament.FrictionLab/CIRLab/AirChamferStepArtifactLab.cs@@ -24,10 +24,51 @@ public sealed record AirChamferStepArtifactResult(IReadOnlyList<string> Diagnostics,string? Error);++public sealed record AirChamferStepMarkerExpectationSummary(+ IReadOnlyList<string> RequiredPresent,+ IReadOnlyList<string> ForbiddenAbsent,+ bool RequiredPresentSatisfied,+ bool ForbiddenAbsentSatisfied,+ AirChamferStepArtifactMarkerSummary Markers);++public sealed record AirChamferStepCorpusCaseResult(+ string CaseName,+ string Status,+ string? ArtifactPath,+ string? ArtifactFileName,+ string CandidatePath,+ string Route,+ AirChamferStepMarkerExpectationSummary? StepMarkerSummary,+ AirChamferRealBodyTopologySummary? TopologySummary,+ IReadOnlyList<string> Diagnostics,+ bool LegacyAuthorityPreserved,+ bool ProductionOutputChanged,+ bool NoProductionRouteReplacement,+ bool No3DBooleanUsed,+ IReadOnlyList<string> Errors);++public sealed record AirChamferStepCorpusResult(+ string CorpusVersion,+ string Milestone,+ string OutputDirectory,+ string SummaryPath,+ string CandidatePath,+ string Route,+ bool LegacyAuthorityPreserved,+ bool ProductionOutputChanged,+ bool NoProductionRouteReplacement,+ bool No3DBooleanUsed,+ IReadOnlyList<AirChamferStepCorpusCaseResult> Cases,+ IReadOnlyList<string> Diagnostics,+ IReadOnlyList<string> Errors);+public static class AirChamferStepArtifactLab{public const string DefaultArtifactFileName = "edge-x10-airchamfer-cube-one-edge.step";+ public const string DefaultCorpusSummaryFileName = "edge-x11-airchamfer-corpus.json";public const string ExperimentalRoute = "experimental-cli-airchamfer-cube";+ public const string ExperimentalCorpusRoute = "experimental-cli-airchamfer-corpus";public const string CandidatePath = "AirChamferShadowRoute->AirChamferRealBodyPrototype";public static AirChamferStepArtifactResult WriteControlledCubeOneEdgeStep(string outputPath)@@ -121,6 +162,270 @@ public static class AirChamferStepArtifactLabsmokeSucceeded ? null : "STEP marker validation failed for the AirChamfer candidate artifact.");}++ public static AirChamferStepCorpusResult WriteEdgeX11Corpus(string outputDirectory)+ {+ if (string.IsNullOrWhiteSpace(outputDirectory))+ {+ throw new ArgumentException("Output directory is required.", nameof(outputDirectory));+ }++ var fullDirectory = Path.GetFullPath(outputDirectory);+ Directory.CreateDirectory(fullDirectory);++ var diagnostics = new List<string>+ {+ "edge-x11-airchamfer-corpus-started",+ "edge-x11-legacy-authority-preserved",+ "edge-x11-no-production-route-replacement",+ "edge-x11-no-3d-boolean-used"+ };++ var cases = new[]+ {+ RunCorpusCase(+ fullDirectory,+ "canonical",+ "edge-x11-airchamfer-cube-canonical.step",+ 1d,+ invalidEdge: false,+ missingFace: false,+ faceFamily: AirChamferFaceFamily.Planar,+ edgeChain: false,+ cornerChain: false,+ legacyDependency: false,+ nonOrthogonal: false),+ RunCorpusCase(+ fullDirectory,+ "nonorthogonal",+ "edge-x11-airchamfer-cube-nonorthogonal.step",+ 1d,+ invalidEdge: false,+ missingFace: false,+ faceFamily: AirChamferFaceFamily.Planar,+ edgeChain: false,+ cornerChain: false,+ legacyDependency: false,+ nonOrthogonal: true),+ RunCorpusCase(+ fullDirectory,+ "invalid-distance",+ artifactFileName: null,+ distance: 0d,+ invalidEdge: false,+ missingFace: false,+ faceFamily: AirChamferFaceFamily.Planar,+ edgeChain: false,+ cornerChain: false,+ legacyDependency: false,+ nonOrthogonal: false),+ RunCorpusCase(+ fullDirectory,+ "triangle-legacy-dependent",+ artifactFileName: null,+ distance: 1d,+ invalidEdge: false,+ missingFace: false,+ faceFamily: AirChamferFaceFamily.Planar,+ edgeChain: false,+ cornerChain: false,+ legacyDependency: true,+ nonOrthogonal: false)+ };++ foreach (var c in cases)+ {+ diagnostics.AddRange(c.Diagnostics.Where(d => d.StartsWith("edge-x11-", StringComparison.Ordinal)));+ }++ diagnostics.Add("edge-x11-json-summary-written");+ var summaryPath = Path.Combine(fullDirectory, DefaultCorpusSummaryFileName);+ var result = new AirChamferStepCorpusResult(+ "EDGE-X11",+ "EDGE-X11",+ fullDirectory,+ summaryPath,+ CandidatePath,+ ExperimentalCorpusRoute,+ LegacyAuthorityPreserved: true,+ ProductionOutputChanged: false,+ NoProductionRouteReplacement: true,+ No3DBooleanUsed: true,+ cases,+ diagnostics.Distinct().OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ cases.SelectMany(c => c.Errors).Distinct(StringComparer.Ordinal).OrderBy(x => x, StringComparer.Ordinal).ToArray());++ File.WriteAllText(summaryPath, System.Text.Json.JsonSerializer.Serialize(result, new System.Text.Json.JsonSerializerOptions+ {+ WriteIndented = true,+ PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase,+ Converters = { new System.Text.Json.Serialization.JsonStringEnumConverter() }+ }));++ return result;+ }++ private static AirChamferStepCorpusCaseResult RunCorpusCase(+ string outputDirectory,+ string caseName,+ string? artifactFileName,+ double distance,+ bool invalidEdge,+ bool missingFace,+ AirChamferFaceFamily faceFamily,+ bool edgeChain,+ bool cornerChain,+ bool legacyDependency,+ bool nonOrthogonal)+ {+ var diagnostics = new List<string>+ {+ $"edge-x11-case-started:{caseName}",+ "edge-x11-legacy-authority-preserved",+ "edge-x11-no-production-route-replacement",+ "edge-x11-no-3d-boolean-used"+ };++ var sourceBody = BrepPrimitives.CreateBox(10d, 8d, 6d).Value;+ var edgeStart = new Vector3(5f, 4f, -3f);+ var edgeEnd = invalidEdge ? edgeStart : new Vector3(5f, 4f, 3f);+ Vector3? faceA = new(1f, 0f, 0f);+ Vector3? faceB = missingFace ? null : (nonOrthogonal ? Vector3.Normalize(new Vector3(1f, 1f, 0f)) : new Vector3(0f, 1f, 0f));+ var classification = edgeChain || cornerChain || legacyDependency+ ? AirChamferClassificationExpectation.Concave+ : AirChamferClassificationExpectation.Convex;++ var report = AirChamferShadowRoute.Evaluate(new AirChamferShadowRouteRequest(+ $"edge-x11-{caseName}",+ sourceBody,+ edgeStart,+ edgeEnd,+ faceA,+ faceB,+ distance,+ faceFamily,+ edgeChain,+ cornerChain,+ legacyDependency,+ classification,+ !nonOrthogonal,+ ReferenceEnvelope: 10d,+ IncludeStepSmoke: true));++ diagnostics.AddRange(report.Diagnostics);++ if (!report.ShadowCandidateProduced || report.ShadowCandidateBody is null)+ {+ var status = report.ShadowCandidateStatus is AirChamferShadowCandidateStatus.Deferred or AirChamferShadowCandidateStatus.FallbackLegacy+ ? "deferred"+ : report.ShadowCandidateStatus is AirChamferShadowCandidateStatus.Rejected+ ? "rejected"+ : "failed";+ var reason = report.ShadowCandidateStatus is AirChamferShadowCandidateStatus.FallbackLegacy+ ? "legacy-dependent-fallback"+ : report.AirChamferDecision;+ diagnostics.Add(status == "rejected"+ ? $"edge-x11-case-rejected:{caseName}:{reason}"+ : $"edge-x11-case-deferred:{caseName}:{reason}");++ return new AirChamferStepCorpusCaseResult(+ caseName,+ status,+ ArtifactPath: null,+ ArtifactFileName: null,+ CandidatePath,+ ExperimentalCorpusRoute,+ StepMarkerSummary: null,+ report.TopologySummary,+ diagnostics.Distinct().OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ LegacyAuthorityPreserved: true,+ ProductionOutputChanged: false,+ NoProductionRouteReplacement: true,+ No3DBooleanUsed: true,+ Array.Empty<string>());+ }++ if (string.IsNullOrWhiteSpace(artifactFileName))+ {+ diagnostics.Add($"edge-x11-case-deferred:{caseName}:no-artifact-filename");+ return new AirChamferStepCorpusCaseResult(+ caseName,+ "deferred",+ ArtifactPath: null,+ ArtifactFileName: null,+ CandidatePath,+ ExperimentalCorpusRoute,+ StepMarkerSummary: null,+ report.TopologySummary,+ diagnostics.Distinct().OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ LegacyAuthorityPreserved: true,+ ProductionOutputChanged: false,+ NoProductionRouteReplacement: true,+ No3DBooleanUsed: true,+ Array.Empty<string>());+ }++ var export = Step242Exporter.ExportBody(report.ShadowCandidateBody);+ if (!export.IsSuccess)+ {+ diagnostics.Add($"edge-x11-case-deferred:{caseName}:step-export-failed");+ return new AirChamferStepCorpusCaseResult(+ caseName,+ "failed",+ ArtifactPath: null,+ ArtifactFileName: null,+ CandidatePath,+ ExperimentalCorpusRoute,+ StepMarkerSummary: null,+ report.TopologySummary,+ diagnostics.Distinct().OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ LegacyAuthorityPreserved: true,+ ProductionOutputChanged: false,+ NoProductionRouteReplacement: true,+ No3DBooleanUsed: true,+ new[] { "step-export-failed" });+ }++ var fullPath = Path.Combine(outputDirectory, artifactFileName);+ File.WriteAllText(fullPath, export.Value);+ diagnostics.Add($"edge-x11-step-artifact-written:{caseName}");++ var markers = SummarizeMarkers(export.Value);+ var stepSummary = CreateExpectationSummary(markers);+ if (stepSummary.RequiredPresentSatisfied && stepSummary.ForbiddenAbsentSatisfied)+ {+ diagnostics.Add($"edge-x11-step-smoke-succeeded:{caseName}");+ }+ else+ {+ diagnostics.Add($"edge-x11-step-smoke-failed:{caseName}:marker-validation");+ }++ return new AirChamferStepCorpusCaseResult(+ caseName,+ stepSummary.RequiredPresentSatisfied && stepSummary.ForbiddenAbsentSatisfied ? "succeeded" : "failed",+ fullPath,+ artifactFileName,+ CandidatePath,+ ExperimentalCorpusRoute,+ stepSummary,+ report.TopologySummary,+ diagnostics.Distinct().OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ LegacyAuthorityPreserved: true,+ ProductionOutputChanged: false,+ NoProductionRouteReplacement: true,+ No3DBooleanUsed: true,+ stepSummary.RequiredPresentSatisfied && stepSummary.ForbiddenAbsentSatisfied ? Array.Empty<string>() : new[] { "step-marker-validation-failed" });+ }++ private static AirChamferStepMarkerExpectationSummary CreateExpectationSummary(AirChamferStepArtifactMarkerSummary markers)+ => new(+ new[] { "ISO-10303-21", "MANIFOLD_SOLID_BREP", "ADVANCED_FACE", "PLANE" },+ new[] { "CYLINDRICAL_SURFACE", "BREP_WITH_VOIDS" },+ markers.HasIso && markers.HasManifoldSolidBrep && markers.HasAdvancedFace && markers.HasPlane,+ !markers.HasCylindricalSurface && !markers.HasBrepWithVoids,+ markers);+private static AirChamferStepArtifactResult CreateFailure(string fullPath,AirChamferShadowCandidateStatus status,diff --git a/docs/edge-v3-air-chamfer-shadow-route.md b/docs/edge-v3-air-chamfer-shadow-route.mdindex ed9a9e9a..eafa6813 100644--- a/docs/edge-v3-air-chamfer-shadow-route.md+++ b/docs/edge-v3-air-chamfer-shadow-route.md@@ -155,3 +155,7 @@ Because the canonical and safe non-orthogonal shadow route fixtures are expected## EDGE-X10 export-artifact noteEDGE-X10 adds the first CLI-visible AirChamfer candidate STEP artifact route: `aetheris experimental airchamfer-cube --out <path> [--json]`. The route uses `AirChamferShadowRoute` to invoke the EDGE-V2 real-body prototype and exports the resulting controlled one-edge candidate body to `edge-x10-airchamfer-cube-one-edge.step` by convention. The route remains experimental/lab-only; legacy `BrepBoundedChamfer` stays production-authoritative, normal Firmament chamfer routing is not replaced, and the AirChamfer candidate path still uses no 3D Boolean.+## EDGE-X11 corpus note++EDGE-X11 adds a tiny deterministic regression corpus command: `aetheris experimental airchamfer-corpus --out-dir <dir> [--json]`. It reuses the same non-authoritative `AirChamferShadowRoute->AirChamferRealBodyPrototype` path as EDGE-X10, writes STEP only for successful controlled candidate cases, and emits JSON-only diagnostics for rejected/deferred rows. Legacy `BrepBoundedChamfer` remains production-authoritative; no production route replacement and no 3D Boolean fallback are introduced.+diff --git a/docs/frictionlab/edge-x10-airchamfer-cube-step-artifact.md b/docs/frictionlab/edge-x10-airchamfer-cube-step-artifact.mdindex cdb0cdb3..1423cbe1 100644--- a/docs/frictionlab/edge-x10-airchamfer-cube-step-artifact.md+++ b/docs/frictionlab/edge-x10-airchamfer-cube-step-artifact.md@@ -5,6 +5,8 @@ EDGE-X10 answers whether existing Aetheris CLI/export infrastructure can produceThis is the first AirChamfer candidate STEP artifact exposed through CLI/export plumbing. It is not a production AirChamfer feature.+EDGE-X11 expands this single trophy artifact into a tiny experimental regression corpus via `aetheris experimental airchamfer-corpus --out-dir <dir> [--json]`, preserving the same shadow/prototype candidate path and production-safety boundaries.+## References- EDGE-V2: `docs/edge-v2-real-body-air-chamfer-prototype.md`- EDGE-X9: `docs/frictionlab/edge-x9-air-chamfer-feature-recognition-parity-lab.md`diff --git a/docs/frictionlab/edge-x11-airchamfer-step-artifact-corpus.md b/docs/frictionlab/edge-x11-airchamfer-step-artifact-corpus.mdnew file mode 100644index 00000000..7f3d65b6--- /dev/null+++ b/docs/frictionlab/edge-x11-airchamfer-step-artifact-corpus.md@@ -0,0 +1,155 @@+# EDGE-X11 — AirChamfer STEP artifact regression corpus++## Purpose and scope++EDGE-X11 turns the EDGE-X10 single CLI-visible AirChamfer STEP artifact into a tiny deterministic regression corpus. The corpus is still experimental/lab-only: it exercises controlled AirChamfer shadow/prototype output, STEP smoke markers, topology summaries, and JSON diagnostics without replacing production chamfer behavior.++The corpus is intentionally narrow. It does not accept arbitrary model input and does not add arbitrary edge selection. It exists to keep the first AirChamfer candidate artifact repeatable as Aetheris evolves.++## References++- EDGE-X10: `docs/frictionlab/edge-x10-airchamfer-cube-step-artifact.md` introduced `aetheris experimental airchamfer-cube --out <path> [--json]` and the `edge-x10-airchamfer-cube-one-edge.step` trophy artifact.+- EDGE-V3: `docs/edge-v3-air-chamfer-shadow-route.md` defines the non-authoritative AirChamfer shadow route used by the CLI lane.+- EDGE-V2: `AirChamferRealBodyPrototype` remains the internal production-adjacent candidate body prototype behind the shadow route.+- EDGE-X9: feature-recognition parity remains analyzer/shadow evidence only and does not authorize route replacement.++## CLI commands++EDGE-X11 adds this experimental command:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental airchamfer-corpus --out-dir <dir> --json+```++The existing EDGE-X10 command remains supported:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental airchamfer-cube --out <path> --json+```++## Corpus cases++| Case | Expected status | STEP output | Notes |+| --- | --- | --- | --- |+| `canonical` | `succeeded` | yes | Canonical orthogonal one-edge cube candidate equivalent to EDGE-X10. |+| `nonorthogonal` | `succeeded` when current EDGE-V2/V3 support accepts it | yes when accepted | Controlled one-edge non-orthogonal planar pair. If support regresses, this should become deterministic JSON-only evidence rather than a production fallback. |+| `invalid-distance` | `rejected` | no | Uses an invalid zero chamfer distance and emits deterministic rejection diagnostics. |+| `triangle-legacy-dependent` | `deferred` | no | Represents a legacy-dependent triangle/chamfer fixture lane and preserves legacy authority. |++## Artifact filenames and path convention++The command writes successful STEP artifacts under the supplied `--out-dir`:++- `edge-x11-airchamfer-cube-canonical.step`+- `edge-x11-airchamfer-cube-nonorthogonal.step` when the controlled non-orthogonal candidate succeeds+- `edge-x11-airchamfer-corpus.json`++Rejected and deferred cases do not write STEP files. Their evidence lives in the corpus JSON summary.++## JSON summary schema++The corpus command writes `edge-x11-airchamfer-corpus.json` and, with `--json`, emits the same summary to stdout. Important fields include:++- `corpusVersion` / `milestone`: `EDGE-X11`+- `outputDirectory`+- `summaryPath`+- `candidatePath`: `AirChamferShadowRoute->AirChamferRealBodyPrototype`+- `route`: `experimental-cli-airchamfer-corpus`+- `legacyAuthorityPreserved`+- `productionOutputChanged`+- `noProductionRouteReplacement`+- `no3DBooleanUsed`+- `cases[]`+ - `caseName`+ - `status`: `succeeded`, `rejected`, `deferred`, or `failed`+ - `artifactPath` / `artifactFileName` when STEP output is written+ - `candidatePath`+ - `route`+ - `stepMarkerSummary` when a STEP body exists+ - `topologySummary` when a candidate body exists+ - `diagnostics`+ - `errors`+- top-level `diagnostics`+- top-level `errors`++## STEP marker expectations++Successful STEP artifacts must satisfy the same smoke markers as EDGE-X10:++Required present:++- `ISO-10303-21`+- `MANIFOLD_SOLID_BREP`+- `ADVANCED_FACE`+- `PLANE`++Forbidden absent:++- `CYLINDRICAL_SURFACE`+- `BREP_WITH_VOIDS`++The JSON `stepMarkerSummary` records both the raw marker booleans and whether the required-present and forbidden-absent checks passed.++## Invalid and deferred behavior++Invalid or deferred cases must be deterministic JSON-only rows. They must not write STEP files. Expected diagnostics include patterns such as:++- `edge-x11-case-rejected:invalid-distance:reject-invalid-distance`+- `edge-x11-case-deferred:triangle-legacy-dependent:legacy-dependent-fallback`+- `edge-x11-legacy-authority-preserved`+- `edge-x11-no-production-route-replacement`+- `edge-x11-no-3d-boolean-used`++## Candidate path++The corpus uses the same experimental candidate path as EDGE-X10:++```text+AirChamferShadowRoute -> AirChamferRealBodyPrototype+```++This is reported in JSON as `AirChamferShadowRoute->AirChamferRealBodyPrototype`.++## Legacy authority and route boundary++Legacy `BrepBoundedChamfer` remains production-authoritative. EDGE-X11 does not route normal Firmament chamfer operations through AirChamfer, does not replace production output, and does not introduce a stable public API. The CLI hook is explicitly experimental/lab-only.++## No-3D-Boolean guarantee++The AirChamfer corpus candidate path uses no 3D Boolean fallback. STEP export is only performed for candidate bodies produced by the shadow/prototype path.++## Tests run++Recommended gates for this milestone:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- --help+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental airchamfer-cube --out "$tmp/edge-x10-airchamfer-cube-one-edge.step" --json+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental airchamfer-corpus --out-dir "$tmp/edge-x11" --json+dotnet test Aetheris.CLI.Tests/Aetheris.CLI.Tests.csproj --filter "AirChamfer|Experimental|Lab|Step|CliBaseline|Export|Corpus"+dotnet test Aetheris.FrictionLab.Tests/Aetheris.FrictionLab.Tests.csproj -c Release -f net10.0 --filter "AirChamferShadow|AirChamferFeatureRecognition|AirChamferControlledBody|AirChamferTopologyGraft|AirChamferClosedWitness|AirChamferGeometryArtifact|AirChamferTopologyPlan|AirChamferJudgment|AirChamferPolicy|AirChamferPatch|EdgeSweep|Chamfer|Fillet|EdgeFinish|CIRLab"+dotnet test Aetheris.Kernel.Firmament.Tests/Aetheris.Kernel.Firmament.Tests.csproj --filter "Chamfer|Fillet|Corner|TriangularPrism|FirmamentPrimitive|FirmamentStepExporter|LineArcProfileExtrude|SemanticRecovery|FrepMaterializer|Rematerialize"+dotnet test Aetheris.Kernel.Core.Tests/Aetheris.Kernel.Core.Tests.csproj --filter "Judgment|Chamfer|Fillet|Corner|TriangularPrism|BrepPrimitives|Step242|Primitive|Extrude|Boolean|SafeComposition"+./scripts/test-all.sh+```++## Non-goals++EDGE-X11 does not add or change:++- production chamfer behavior+- production fillet behavior+- a stable public API+- arbitrary edge selection+- fillet geometry+- edge-chain or corner-chain support+- STEP exporter/importer behavior+- Boolean core behavior+- triangle migration+- sketch solver behavior+- clipping engine behavior+- NURBS/freeform support++## Recommended next milestone++Recommended next milestone: EDGE-X12 should compare the corpus summaries across known-good generated outputs and tighten deterministic diagnostic drift checks before considering any broader AirChamfer corpus shape expansion. Any route comparison must remain analyzer/shadow evidence only until a separate production authorization milestone exists.