Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add EDGE-LOOP-X2 loop chamfer corpus
Yuechen Li905a93e7dc54
diff --git a/Aetheris.CLI.Tests/ExperimentalLoopChamferCorpusTests.cs b/Aetheris.CLI.Tests/ExperimentalLoopChamferCorpusTests.csnew file mode 100644index 00000000..d46af6a0--- /dev/null+++ b/Aetheris.CLI.Tests/ExperimentalLoopChamferCorpusTests.cs@@ -0,0 +1,201 @@+using System.Text.Json;++namespace Aetheris.CLI.Tests;++public sealed class ExperimentalLoopChamferCorpusTests+{+ [Fact]+ public void Experimental_Loop_Chamfer_Corpus_Help_Is_Discoverable_And_Explicitly_Lab_Only()+ {+ var topStdout = new StringWriter();+ var topStderr = new StringWriter();+ var topExit = Aetheris.CLI.CliRunner.Run(["experimental", "--help"], topStdout, topStderr);++ Assert.Equal(0, topExit);+ Assert.Contains("loop-chamfer-corpus", topStdout.ToString(), StringComparison.Ordinal);++ var stdout = new StringWriter();+ var stderr = new StringWriter();+ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "loop-chamfer-corpus", "--help"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));+ var text = stdout.ToString();+ Assert.Contains("Usage: aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]", text, StringComparison.Ordinal);+ Assert.Contains("EDGE-LOOP-X2", text, StringComparison.Ordinal);+ Assert.Contains("Experimental/lab-only", text, StringComparison.Ordinal);+ Assert.Contains("no production route replacement", text, StringComparison.OrdinalIgnoreCase);+ Assert.Contains("production chamfer/fillet behavior change", text, StringComparison.OrdinalIgnoreCase);+ }++ [Fact]+ public void Experimental_Loop_Chamfer_Corpus_Writes_Steps_Json_Diagnostics_And_Rejections()+ {+ var outputDir = Path.Combine(Path.GetTempPath(), $"edge-loop-x2-corpus-{Guid.NewGuid():N}");+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ try+ {+ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "loop-chamfer-corpus", "--out-dir", outputDir, "--json"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));++ var expectedArtifacts = new[]+ {+ "edge-loop-x2-canonical-top-face-loop-chamfer.step",+ "edge-loop-x2-larger-top-face-loop-chamfer.step",+ "edge-loop-x2-non-square-top-face-loop-chamfer.step",+ };++ foreach (var artifact in expectedArtifacts)+ {+ var path = Path.Combine(outputDir, artifact);+ Assert.True(File.Exists(path), artifact);+ Assert.True(new FileInfo(path).Length > 0, artifact);+ AssertStepMarkers(File.ReadAllText(path));+ }++ var summaryPath = Path.Combine(outputDir, "edge-loop-x2-corpus.json");+ Assert.True(File.Exists(summaryPath));+ 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-LOOP-X2", root.GetProperty("milestone").GetString());+ Assert.Contains("aetheris experimental loop-chamfer-corpus", root.GetProperty("corpusRoute").GetString(), StringComparison.Ordinal);+ Assert.Equal("prismatic-section-transition", root.GetProperty("constructionRoute").GetString());+ Assert.Equal("preserve-section-splits", root.GetProperty("splitPolicy").GetString());+ AssertGuarantees(root.GetProperty("guarantees"));++ var cases = root.GetProperty("cases").EnumerateArray().ToDictionary(x => x.GetProperty("caseName").GetString()!);+ Assert.Equal("succeeded", cases["canonical-top-face-loop-chamfer"].GetProperty("status").GetString());+ Assert.Equal("succeeded", cases["larger-top-face-loop-chamfer"].GetProperty("status").GetString());+ Assert.Equal("succeeded", cases["non-square-top-face-loop-chamfer"].GetProperty("status").GetString());++ AssertLoopTopology(cases["canonical-top-face-loop-chamfer"], "[-5,-4,0]..[5,4,6]");+ AssertLoopTopology(cases["larger-top-face-loop-chamfer"], "[-5,-4,0]..[5,4,6]");+ AssertLoopTopology(cases["non-square-top-face-loop-chamfer"], "[-6,-2.5,0]..[6,2.5,7]");++ var rejectedOrDeferred = new[]+ {+ "invalid-zero-chamfer-distance",+ "invalid-negative-chamfer-distance",+ "too-large-chamfer-distance",+ "invalid-width",+ "invalid-depth",+ "invalid-height",+ "non-finite-dimensions",+ "non-uniform-rule-rejected",+ "arbitrary-graph-rejected",+ "open-chain-deferred",+ "non-closed-loop-rejected",+ "non-outer-loop-deferred",+ "non-planar-owning-face-deferred",+ "inset-self-intersection-risk",+ };++ foreach (var name in rejectedOrDeferred)+ {+ Assert.True(cases.ContainsKey(name), name);+ Assert.Contains(cases[name].GetProperty("status").GetString(), new[] { "rejected", "deferred" });+ Assert.Equal(JsonValueKind.Null, cases[name].GetProperty("artifactPath").ValueKind);+ Assert.Equal(JsonValueKind.Null, cases[name].GetProperty("artifactFileName").ValueKind);+ Assert.Equal(JsonValueKind.Null, cases[name].GetProperty("stepMarkerSummary").ValueKind);+ var caseDiagnostics = cases[name].GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains(caseDiagnostics, d => d!.StartsWith($"edge-loop-x2-case-{cases[name].GetProperty("status").GetString()}:{name}:", StringComparison.Ordinal));+ }++ Assert.Equal("rejected", cases["non-uniform-rule-rejected"].GetProperty("status").GetString());+ Assert.Equal("rejected", cases["arbitrary-graph-rejected"].GetProperty("status").GetString());+ Assert.Equal("deferred", cases["open-chain-deferred"].GetProperty("status").GetString());+ Assert.Equal("rejected", cases["non-closed-loop-rejected"].GetProperty("status").GetString());+ Assert.Equal("deferred", cases["non-outer-loop-deferred"].GetProperty("status").GetString());+ Assert.Equal("deferred", cases["non-planar-owning-face-deferred"].GetProperty("status").GetString());++ foreach (var name in new[] { "canonical-top-face-loop-chamfer", "larger-top-face-loop-chamfer", "non-square-top-face-loop-chamfer" })+ {+ var c = cases[name];+ Assert.Equal("Class B / face-boundary loop", c.GetProperty("selectionClass").GetString());+ Assert.Equal("prismatic-section-transition", c.GetProperty("constructionRoute").GetString());+ Assert.Equal("preserve-section-splits", c.GetProperty("splitPolicy").GetString());+ AssertGuarantees(c.GetProperty("guarantees"));+ var loop = c.GetProperty("loopSelectionSummary");+ Assert.Equal("top cap", loop.GetProperty("owningFace").GetString());+ Assert.Equal("outer", loop.GetProperty("loopKind").GetString());+ Assert.True(loop.GetProperty("closed").GetBoolean());+ Assert.Equal(4, loop.GetProperty("edgeCount").GetInt32());+ Assert.True(loop.GetProperty("ordered").GetBoolean());+ var rule = c.GetProperty("ruleSummary");+ Assert.Equal("uniform symmetric chamfer", rule.GetProperty("rule").GetString());+ Assert.True(rule.GetProperty("distance").GetDouble() > 0);+ var markers = c.GetProperty("stepMarkerSummary");+ Assert.True(markers.GetProperty("requiredMarkersPresent").GetBoolean());+ Assert.True(markers.GetProperty("forbiddenMarkersAbsent").GetBoolean());+ var diagnostics = c.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains($"edge-loop-x2-not-four-independent-single-edge-chamfers:{name}", diagnostics);+ Assert.Contains($"edge-loop-x2-split-preserving-topology-validated:{name}", diagnostics);+ Assert.Contains($"edge-loop-x2-step-smoke-succeeded:{name}", diagnostics);+ }++ var rootDiagnostics = root.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains("edge-loop-x2-no-production-route-replacement", rootDiagnostics);+ Assert.Contains("edge-loop-x2-no-air-edge-sweep-used", rootDiagnostics);+ Assert.Contains("edge-loop-x2-no-brep-bounded-chamfer-used", rootDiagnostics);+ Assert.Contains("edge-loop-x2-no-topology-graft-used", rootDiagnostics);+ Assert.Contains("edge-loop-x2-no-3d-boolean-used", rootDiagnostics);+ Assert.Contains("edge-loop-x2-no-coplanar-merge-used", rootDiagnostics);+ Assert.Contains("edge-loop-x2-json-summary-written", rootDiagnostics);+ }+ finally+ {+ if (Directory.Exists(outputDir))+ {+ Directory.Delete(outputDir, recursive: true);+ }+ }+ }++ private static void AssertLoopTopology(JsonElement corpusCase, string bounds)+ {+ var topology = corpusCase.GetProperty("topologySummary");+ Assert.True(topology.GetProperty("bodyProduced").GetBoolean());+ Assert.Equal(3, topology.GetProperty("sectionCount").GetInt32());+ Assert.Equal(12, topology.GetProperty("vertexCount").GetInt32());+ Assert.Equal(20, topology.GetProperty("edgeCount").GetInt32());+ Assert.Equal(10, topology.GetProperty("faceCount").GetInt32());+ Assert.Equal(10, topology.GetProperty("planarFaceCount").GetInt32());+ Assert.Equal(0, topology.GetProperty("cylindricalFaceCount").GetInt32());+ Assert.Equal(2, topology.GetProperty("capFaceCount").GetInt32());+ Assert.Equal(4, topology.GetProperty("lowerPrismSideFaceCount").GetInt32());+ Assert.Equal(4, topology.GetProperty("transitionFaceCount").GetInt32());+ Assert.Equal(4, topology.GetProperty("chamferTransitionFaceCount").GetInt32());+ Assert.Equal(10, topology.GetProperty("loopCount").GetInt32());+ Assert.Equal(40, topology.GetProperty("coedgeCount").GetInt32());+ Assert.Equal(bounds, topology.GetProperty("bounds").GetString());+ }++ private static void AssertGuarantees(JsonElement guarantees)+ {+ Assert.True(guarantees.GetProperty("noProductionRouteReplacement").GetBoolean());+ Assert.True(guarantees.GetProperty("noAirEdgeSweep").GetBoolean());+ Assert.True(guarantees.GetProperty("noBrepBoundedChamfer").GetBoolean());+ Assert.True(guarantees.GetProperty("noTopologyGraft").GetBoolean());+ Assert.True(guarantees.GetProperty("no3DBoolean").GetBoolean());+ Assert.True(guarantees.GetProperty("noCoplanarMerge").GetBoolean());+ Assert.True(guarantees.GetProperty("notFourIndependentSingleEdgeChamfers").GetBoolean());+ }++ 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 bf334ff3..eb6de065 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -27,11 +27,12 @@ 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|airchamfer-corpus|prismatic-corpus|prismatic-map> [options]";+ private const string ExperimentalUsage = "Usage: aetheris experimental <airchamfer-cube|airchamfer-corpus|prismatic-corpus|prismatic-map|loop-chamfer-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 const string ExperimentalPrismaticCorpusUsage = "Usage: aetheris experimental prismatic-corpus --out-dir <dir> [--json]";private 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(){@@ -873,6 +874,11 @@ public static class CliRunnerreturn RunExperimentalPrismaticMap(args.Skip(1).ToArray(), stdout, stderr);}+ if (string.Equals(args[0], "loop-chamfer-corpus", StringComparison.Ordinal))+ {+ return RunExperimentalLoopChamferCorpus(args.Skip(1).ToArray(), stdout, stderr);+ }+stderr.WriteLine($"Unknown experimental subcommand '{args[0]}'.");stderr.WriteLine(ExperimentalUsage);return 1;@@ -1061,6 +1067,61 @@ public static class CliRunner}+ private static int RunExperimentalLoopChamferCorpus(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 loop-chamfer-corpus option --out-dir requires a directory value.");+ stderr.WriteLine(ExperimentalLoopChamferCorpusUsage);+ return 1;+ case "--json":+ json = true;+ break;+ case "-h":+ case "--help":+ WriteExperimentalLoopChamferCorpusHelp(stdout);+ return 0;+ default:+ stderr.WriteLine($"Unknown experimental loop-chamfer-corpus option '{args[i]}'.");+ stderr.WriteLine(ExperimentalLoopChamferCorpusUsage);+ return 1;+ }+ }++ if (string.IsNullOrWhiteSpace(outDir))+ {+ stderr.WriteLine("Experimental loop-chamfer-corpus requires --out-dir <dir>.");+ stderr.WriteLine(ExperimentalLoopChamferCorpusUsage);+ return 1;+ }++ var corpus = EdgeLoopX2TopFaceLoopChamferCorpusLab.WriteEdgeLoopX2Corpus(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 EDGE-LOOP-X2 loop chamfer corpus summary written: {corpus.SummaryPath}");+ stdout.WriteLine("Route: experimental/lab top-face outer-loop chamfer corpus; production chamfer and fillet routes remain unchanged.");+ return corpus.Errors.Count == 0 ? 0 : 1;+ }++private static int RunExperimentalPrismaticMap(string[] args, TextWriter stdout, TextWriter stderr){string? caseName = null;@@ -1888,6 +1949,7 @@ public static class CliRunnerstdout.WriteLine(" airchamfer-corpus Generate the EDGE-X11 tiny AirChamfer STEP regression corpus.");stdout.WriteLine(" prismatic-corpus Generate the EDGE-PRISMATIC-X5 split-preserving prismatic corpus.");stdout.WriteLine(" prismatic-map Inspect EDGE-PRISMATIC-X9 generated-source-only prismatic map JSON.");+ stdout.WriteLine(" loop-chamfer-corpus Generate the EDGE-LOOP-X2 top-face loop chamfer STEP/JSON corpus.");stdout.WriteLine();stdout.WriteLine("Notes:");stdout.WriteLine(" - Experimental only; does not route production Firmament chamfer operations through AirChamfer.");@@ -1895,12 +1957,38 @@ public static class CliRunnerstdout.WriteLine(" - The candidate path uses no 3D Boolean fallback.");stdout.WriteLine(" - The prismatic corpus preserves section-boundary split faces and performs no coplanar merge.");stdout.WriteLine(" - experimental prismatic-map is generated-source-only, not normal analyze map, and accepts no STEP input.");+ stdout.WriteLine(" - loop-chamfer-corpus is a lab-only Class B top-face outer-loop route and does not change production chamfer or fillet behavior.");stdout.WriteLine();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");stdout.WriteLine(" aetheris experimental prismatic-corpus --out-dir artifacts/edge-prismatic-x5 --json");stdout.WriteLine(" aetheris experimental prismatic-map --case rectangle-inset --rows 16 --cols 16 --json");+ stdout.WriteLine(" aetheris experimental loop-chamfer-corpus --out-dir artifacts/edge-loop-x2 --json");+ }++ private static void WriteExperimentalLoopChamferCorpusHelp(TextWriter stdout)+ {+ stdout.WriteLine("Generate the EDGE-LOOP-X2 top-face outer-loop chamfer artifact corpus.");+ stdout.WriteLine();+ stdout.WriteLine(ExperimentalLoopChamferCorpusUsage);+ 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-loop-x2-canonical-top-face-loop-chamfer.step");+ stdout.WriteLine(" edge-loop-x2-larger-top-face-loop-chamfer.step");+ stdout.WriteLine(" edge-loop-x2-non-square-top-face-loop-chamfer.step");+ stdout.WriteLine($" {EdgeLoopX2TopFaceLoopChamferCorpusLab.DefaultSummaryFileName}");+ stdout.WriteLine();+ stdout.WriteLine("Production safety:");+ stdout.WriteLine(" Experimental/lab-only route; no production route replacement, AirEdgeSweep, BrepBoundedChamfer, topology graft, 3D Boolean, coplanar merge, or production chamfer/fillet behavior change.");+ stdout.WriteLine();+ stdout.WriteLine("Example:");+ stdout.WriteLine(" aetheris experimental loop-chamfer-corpus --out-dir artifacts/edge-loop-x2 --json");}private static void WriteExperimentalAirChamferCubeHelp(TextWriter stdout)diff --git a/Aetheris.Firmament.FrictionLab/CIRLab/EdgeLoopX2TopFaceLoopChamferCorpusLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/EdgeLoopX2TopFaceLoopChamferCorpusLab.csnew file mode 100644index 00000000..b1dc5d27--- /dev/null+++ b/Aetheris.Firmament.FrictionLab/CIRLab/EdgeLoopX2TopFaceLoopChamferCorpusLab.cs@@ -0,0 +1,399 @@+using System.Text.Json;+using System.Text.Json.Serialization;+using Aetheris.Kernel.Core.Step242;+using CorePrismatic = Aetheris.Kernel.Core.Brep.Prismatic;++namespace Aetheris.Firmament.FrictionLab.CIRLab;++public sealed record EdgeLoopX2CorpusGuarantees(+ bool NoProductionRouteReplacement,+ bool NoAirEdgeSweep,+ bool NoBrepBoundedChamfer,+ bool NoTopologyGraft,+ bool No3DBoolean,+ bool NoCoplanarMerge,+ bool NotFourIndependentSingleEdgeChamfers);++public sealed record EdgeLoopX2LoopSelectionSummary(+ string SelectionClass,+ string OwningFace,+ string LoopKind,+ bool Closed,+ int EdgeCount,+ bool Ordered);++public sealed record EdgeLoopX2RuleSummary(+ string Rule,+ double? Distance);++public sealed record EdgeLoopX2StepMarkerSummary(+ IReadOnlyList<string> RequiredPresent,+ IReadOnlyList<string> ForbiddenAbsent,+ bool RequiredMarkersPresent,+ bool ForbiddenMarkersAbsent,+ IReadOnlyList<string> PresentMarkers,+ IReadOnlyList<string> MissingRequiredMarkers,+ IReadOnlyList<string> AbsentMarkers,+ IReadOnlyList<string> UnexpectedPresentMarkers);++public sealed record EdgeLoopX2TopologySummary(+ bool BodyProduced,+ int SectionCount,+ int VertexCount,+ int EdgeCount,+ int FaceCount,+ int PlanarFaceCount,+ int CylindricalFaceCount,+ int CapFaceCount,+ int LowerPrismSideFaceCount,+ int TransitionFaceCount,+ int ChamferTransitionFaceCount,+ int LoopCount,+ int CoedgeCount,+ int BoundsCount,+ string Bounds);++public sealed record EdgeLoopX2CorpusCaseResult(+ string CaseName,+ string Status,+ string? ArtifactPath,+ string? ArtifactFileName,+ string SelectionClass,+ EdgeLoopX2LoopSelectionSummary LoopSelectionSummary,+ EdgeLoopX2RuleSummary RuleSummary,+ string ConstructionRoute,+ string SplitPolicy,+ EdgeLoopX2TopologySummary TopologySummary,+ EdgeLoopX2StepMarkerSummary? StepMarkerSummary,+ IReadOnlyList<string> Diagnostics,+ IReadOnlyList<string> Errors,+ EdgeLoopX2CorpusGuarantees Guarantees);++public sealed record EdgeLoopX2CorpusResult(+ string Milestone,+ string OutputDirectory,+ string SummaryPath,+ string CorpusRoute,+ string ConstructionRoute,+ string SplitPolicy,+ IReadOnlyList<EdgeLoopX2CorpusCaseResult> Cases,+ IReadOnlyList<string> Diagnostics,+ IReadOnlyList<string> Errors,+ EdgeLoopX2CorpusGuarantees Guarantees);++public static class EdgeLoopX2TopFaceLoopChamferCorpusLab+{+ public const string Milestone = "EDGE-LOOP-X2";+ public const string DefaultSummaryFileName = "edge-loop-x2-corpus.json";+ public const string CorpusRoute = "experimental CLI route: aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]";+ public const string ConstructionRoute = "prismatic-section-transition";+ public const string SplitPolicy = "preserve-section-splits";+ public const string SelectionClass = "Class B / face-boundary loop";++ private static readonly string[] RequiredStepMarkers = ["ISO-10303-21", "MANIFOLD_SOLID_BREP", "ADVANCED_FACE", "PLANE"];+ private static readonly string[] ForbiddenStepMarkers = ["CYLINDRICAL_SURFACE", "BREP_WITH_VOIDS"];+ private static readonly EdgeLoopX2CorpusGuarantees DefaultGuarantees = new(+ NoProductionRouteReplacement: true,+ NoAirEdgeSweep: true,+ NoBrepBoundedChamfer: true,+ NoTopologyGraft: true,+ No3DBoolean: true,+ NoCoplanarMerge: true,+ NotFourIndependentSingleEdgeChamfers: true);++ public static EdgeLoopX2CorpusResult WriteEdgeLoopX2Corpus(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-loop-x2-corpus-started",+ "edge-loop-x2-no-production-route-replacement",+ "edge-loop-x2-no-air-edge-sweep-used",+ "edge-loop-x2-no-brep-bounded-chamfer-used",+ "edge-loop-x2-no-topology-graft-used",+ "edge-loop-x2-no-3d-boolean-used",+ "edge-loop-x2-no-coplanar-merge-used",+ };++ var cases = new List<EdgeLoopX2CorpusCaseResult>+ {+ RunSuccessCase(fullDirectory, new("canonical-top-face-loop-chamfer", 10, 8, 6, 1), "edge-loop-x2-canonical-top-face-loop-chamfer.step"),+ RunSuccessCase(fullDirectory, new("larger-top-face-loop-chamfer", 10, 8, 6, 2), "edge-loop-x2-larger-top-face-loop-chamfer.step"),+ RunSuccessCase(fullDirectory, new("non-square-top-face-loop-chamfer", 12, 5, 7, 1), "edge-loop-x2-non-square-top-face-loop-chamfer.step"),+ RunDiagnosticCase(new("invalid-zero-chamfer-distance", 10, 8, 6, 0)),+ RunDiagnosticCase(new("invalid-negative-chamfer-distance", 10, 8, 6, -1)),+ RunDiagnosticCase(new("too-large-chamfer-distance", 10, 8, 6, 4)),+ RunDiagnosticCase(new("invalid-width", 0, 8, 6, 1)),+ RunDiagnosticCase(new("invalid-depth", 10, -8, 6, 1)),+ RunDiagnosticCase(new("invalid-height", 10, 8, 0, 1)),+ RunDiagnosticCase(new("non-finite-dimensions", double.NaN, 8, 6, 1)),+ RunDiagnosticCase(new("non-uniform-rule-rejected", 10, 8, 6, 1, Rule: FaceLoopChamferRuleKind.NonUniform)),+ RunDiagnosticCase(new("arbitrary-graph-rejected", 10, 8, 6, 1, new(SelectionKind: FaceLoopChamferSelectionKind.ArbitraryGraph))),+ RunDiagnosticCase(new("open-chain-deferred", 10, 8, 6, 1, new(SelectionKind: FaceLoopChamferSelectionKind.OpenChain))),+ RunDiagnosticCase(new("non-closed-loop-rejected", 10, 8, 6, 1, new(IsClosed: false))),+ RunDiagnosticCase(new("non-outer-loop-deferred", 10, 8, 6, 1, new(LoopKind: FaceLoopChamferLoopKind.Inner))),+ RunDiagnosticCase(new("non-planar-owning-face-deferred", 10, 8, 6, 1, new(OwningFace: FaceLoopChamferOwningFaceKind.NonPlanarFace))),+ RunModeledMetadataCase("inset-self-intersection-risk", "rejected", "inset-self-intersection-risk"),+ };++ diagnostics.AddRange(cases.SelectMany(c => c.Diagnostics).Where(d => d.StartsWith("edge-loop-x2-", StringComparison.Ordinal)));+ diagnostics.Add("edge-loop-x2-json-summary-written");++ var summaryPath = Path.Combine(fullDirectory, DefaultSummaryFileName);+ var result = new EdgeLoopX2CorpusResult(+ Milestone,+ fullDirectory,+ summaryPath,+ CorpusRoute,+ ConstructionRoute,+ SplitPolicy,+ cases,+ Stable(diagnostics),+ cases.SelectMany(c => c.Errors).Distinct(StringComparer.Ordinal).OrderBy(x => x, StringComparer.Ordinal).ToArray(),+ DefaultGuarantees);++ File.WriteAllText(summaryPath, JsonSerializer.Serialize(result, new JsonSerializerOptions+ {+ WriteIndented = true,+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase,+ Converters = { new JsonStringEnumConverter() }+ }));++ return result;+ }++ private static EdgeLoopX2CorpusCaseResult RunSuccessCase(string outputDirectory, TopFaceLoopChamferCase c, string artifactFileName)+ {+ var diagnostics = CaseStartDiagnostics(c.Name, c);+ diagnostics.Add($"edge-loop-x2-loop-selection-created:{c.Name}");+ diagnostics.Add($"edge-loop-x2-class-b-loop-route:{c.Name}");+ diagnostics.Add($"edge-loop-x2-prismatic-emitter-invoked:{c.Name}");++ var result = EmitCore(c);+ diagnostics.AddRange(ToX2Diagnostics(result.Diagnostics, c.Name));++ if (result.Status != CorePrismatic.FaceLoopChamferStatus.Succeeded || result.Body is null)+ {+ diagnostics.Add($"edge-loop-x2-case-failed:{c.Name}:{result.Recommendation}");+ return CreateCase(c, "failed", null, null, ToCorpusTopology(result.Topology), null, diagnostics, [result.Recommendation]);+ }++ var export = Step242Exporter.ExportBody(result.Body);+ if (!export.IsSuccess || export.Value is null)+ {+ diagnostics.Add($"edge-loop-x2-case-failed:{c.Name}:step-export");+ return CreateCase(c, "failed", null, null, ToCorpusTopology(result.Topology), null, diagnostics, ["step-export-failed"]);+ }++ var artifactPath = Path.Combine(outputDirectory, artifactFileName);+ File.WriteAllText(artifactPath, export.Value);+ diagnostics.Add($"edge-loop-x2-step-artifact-written:{c.Name}");+ var step = SummarizeMarkers(export.Value);+ if (step.RequiredMarkersPresent && step.ForbiddenMarkersAbsent)+ {+ diagnostics.Add($"edge-loop-x2-step-smoke-succeeded:{c.Name}");+ }++ if (ValidateLoopTopology(result.Topology))+ {+ diagnostics.Add($"edge-loop-x2-split-preserving-topology-validated:{c.Name}");+ }++ diagnostics.Add($"edge-loop-x2-not-four-independent-single-edge-chamfers:{c.Name}");+ return CreateCase(c, "succeeded", artifactPath, artifactFileName, ToCorpusTopology(result.Topology), step, diagnostics, []);+ }++ private static EdgeLoopX2CorpusCaseResult RunDiagnosticCase(TopFaceLoopChamferCase c)+ {+ var diagnostics = CaseStartDiagnostics(c.Name, c);+ var result = EmitCore(c);+ diagnostics.AddRange(ToX2Diagnostics(result.Diagnostics, c.Name));+ var status = result.Status switch+ {+ CorePrismatic.FaceLoopChamferStatus.Deferred => "deferred",+ CorePrismatic.FaceLoopChamferStatus.Rejected => "rejected",+ CorePrismatic.FaceLoopChamferStatus.Succeeded => "failed",+ _ => "failed",+ };+ var reason = ReasonFromDiagnostics(result.Diagnostics, result.Recommendation);+ diagnostics.Add(status == "deferred"+ ? $"edge-loop-x2-case-deferred:{c.Name}:{reason}"+ : $"edge-loop-x2-case-rejected:{c.Name}:{reason}");++ return CreateCase(c, status, null, null, ToCorpusTopology(result.Topology), null, diagnostics, status == "failed" ? [$"unexpected-status:{result.Status}"] : []);+ }++ private static EdgeLoopX2CorpusCaseResult RunModeledMetadataCase(string caseName, string status, string reason)+ {+ var c = new TopFaceLoopChamferCase(caseName, 2, 8, 6, 1);+ var diagnostics = CaseStartDiagnostics(caseName, c);+ diagnostics.Add(status == "deferred"+ ? $"edge-loop-x2-case-deferred:{caseName}:{reason}"+ : $"edge-loop-x2-case-rejected:{caseName}:{reason}");+ return CreateCase(c, status, null, null, EmptyTopology(), null, diagnostics, []);+ }++ private static CorePrismatic.FaceLoopChamferResult EmitCore(TopFaceLoopChamferCase c) =>+ CorePrismatic.PrismaticTopFaceLoopChamferPrototype.Emit(new CorePrismatic.PrismaticTopFaceLoopChamferRequest(+ c.Width,+ c.Depth,+ c.Height,+ c.ChamferDistance,+ c.Selection is null ? null : new CorePrismatic.FaceLoopChamferSelection(+ ToCore(c.Selection.SelectionKind),+ ToCore(c.Selection.OwningFace),+ ToCore(c.Selection.LoopKind),+ c.Selection.IsClosed,+ c.Selection.EdgeCount,+ c.Selection.OrderedCoedges),+ ToCore(c.Rule),+ ExportStep: true));++ private static EdgeLoopX2CorpusCaseResult CreateCase(+ TopFaceLoopChamferCase c,+ string status,+ string? artifactPath,+ string? artifactFileName,+ EdgeLoopX2TopologySummary topology,+ EdgeLoopX2StepMarkerSummary? step,+ IEnumerable<string> diagnostics,+ IReadOnlyList<string> errors) =>+ new(+ c.Name,+ status,+ artifactPath,+ artifactFileName,+ SelectionClass,+ ToLoopSelectionSummary(c.Selection),+ new("uniform symmetric chamfer", double.IsFinite(c.ChamferDistance) ? c.ChamferDistance : null),+ ConstructionRoute,+ SplitPolicy,+ topology,+ step,+ Stable(diagnostics.Concat(GuaranteeDiagnostics())),+ errors,+ DefaultGuarantees);++ private static List<string> CaseStartDiagnostics(string caseName, TopFaceLoopChamferCase c) =>+ [+ $"edge-loop-x2-case-started:{caseName}",+ "edge-loop-x2-no-production-route-replacement",+ "edge-loop-x2-no-air-edge-sweep-used",+ "edge-loop-x2-no-brep-bounded-chamfer-used",+ "edge-loop-x2-no-topology-graft-used",+ "edge-loop-x2-no-3d-boolean-used",+ "edge-loop-x2-no-coplanar-merge-used",+ ];++ private static IEnumerable<string> GuaranteeDiagnostics() =>+ [+ "edge-loop-x2-no-production-route-replacement",+ "edge-loop-x2-no-air-edge-sweep-used",+ "edge-loop-x2-no-brep-bounded-chamfer-used",+ "edge-loop-x2-no-topology-graft-used",+ "edge-loop-x2-no-3d-boolean-used",+ "edge-loop-x2-no-coplanar-merge-used",+ ];++ private static IEnumerable<string> ToX2Diagnostics(IEnumerable<string> diagnostics, string caseName) =>+ diagnostics.Select(d => d.Replace("edge-loop-x1", "edge-loop-x2", StringComparison.Ordinal))+ .Select(d => d.StartsWith("edge-loop-x2-class-b-loop-route", StringComparison.Ordinal)+ || d.StartsWith("edge-loop-x2-prismatic-emitter-invoked", StringComparison.Ordinal)+ || d.StartsWith("edge-loop-x2-not-four-independent-single-edge-chamfers", StringComparison.Ordinal)+ || d.StartsWith("edge-loop-x2-step-smoke-succeeded", StringComparison.Ordinal)+ ? $"{d}:{caseName}"+ : d);++ private static bool ValidateLoopTopology(CorePrismatic.FaceLoopChamferTopologySummary t) =>+ t.BodyProduced+ && t.SectionCount == 3+ && t.VertexCount == 12+ && t.EdgeCount == 20+ && t.FaceCount == 10+ && t.PlanarFaceCount == 10+ && t.CylindricalFaceCount == 0+ && t.CapFaceCount == 2+ && t.LowerPrismSideFaceCount == 4+ && t.TransitionFaceCount == 4+ && t.ChamferTransitionFaceCount == 4+ && t.LoopCount == 10+ && t.CoedgeCount == 40;++ private static EdgeLoopX2StepMarkerSummary SummarizeMarkers(string stepText)+ {+ var present = RequiredStepMarkers.Where(m => stepText.Contains(m, StringComparison.Ordinal)).ToArray();+ var missing = RequiredStepMarkers.Except(present, StringComparer.Ordinal).ToArray();+ var absent = ForbiddenStepMarkers.Where(m => !stepText.Contains(m, StringComparison.Ordinal)).ToArray();+ var unexpected = ForbiddenStepMarkers.Where(m => stepText.Contains(m, StringComparison.Ordinal)).ToArray();+ return new(RequiredStepMarkers, ForbiddenStepMarkers, missing.Length == 0, unexpected.Length == 0, present, missing, absent, unexpected);+ }++ private static EdgeLoopX2TopologySummary ToCorpusTopology(CorePrismatic.FaceLoopChamferTopologySummary t) => new(+ t.BodyProduced,+ t.SectionCount,+ t.VertexCount,+ t.EdgeCount,+ t.FaceCount,+ t.PlanarFaceCount,+ t.CylindricalFaceCount,+ t.CapFaceCount,+ t.LowerPrismSideFaceCount,+ t.TransitionFaceCount,+ t.ChamferTransitionFaceCount,+ t.LoopCount,+ t.CoedgeCount,+ t.Bounds == "none" ? 0 : 2,+ t.Bounds);++ private static EdgeLoopX2TopologySummary EmptyTopology() => new(false, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "none");++ private static EdgeLoopX2LoopSelectionSummary ToLoopSelectionSummary(FaceLoopChamferSelection? selection)+ {+ var s = selection ?? new FaceLoopChamferSelection();+ return new(+ SelectionClass,+ s.OwningFace == FaceLoopChamferOwningFaceKind.TopCap ? "top cap" : s.OwningFace.ToString(),+ s.LoopKind == FaceLoopChamferLoopKind.Outer ? "outer" : "inner",+ s.IsClosed,+ s.EdgeCount,+ s.OrderedCoedges);+ }++ private static string ReasonFromDiagnostics(IReadOnlyList<string> diagnostics, string recommendation)+ {+ var diagnostic = diagnostics.FirstOrDefault(d => d.StartsWith("edge-loop-x1-", StringComparison.Ordinal)+ && (d.EndsWith("-rejected", StringComparison.Ordinal) || d.EndsWith("-deferred", StringComparison.Ordinal)));+ return diagnostic is null ? recommendation : diagnostic.Replace("edge-loop-x1-", string.Empty, StringComparison.Ordinal).Replace("-rejected", string.Empty, StringComparison.Ordinal).Replace("-deferred", string.Empty, StringComparison.Ordinal);+ }++ private static CorePrismatic.FaceLoopChamferSelectionKind ToCore(FaceLoopChamferSelectionKind kind) => kind switch+ {+ FaceLoopChamferSelectionKind.OpenChain => CorePrismatic.FaceLoopChamferSelectionKind.OpenChain,+ FaceLoopChamferSelectionKind.ArbitraryGraph => CorePrismatic.FaceLoopChamferSelectionKind.ArbitraryGraph,+ _ => CorePrismatic.FaceLoopChamferSelectionKind.FaceBoundaryLoop,+ };++ private static CorePrismatic.FaceLoopChamferOwningFaceKind ToCore(FaceLoopChamferOwningFaceKind kind) => kind switch+ {+ FaceLoopChamferOwningFaceKind.BottomCap => CorePrismatic.FaceLoopChamferOwningFaceKind.BottomCap,+ FaceLoopChamferOwningFaceKind.SideFace => CorePrismatic.FaceLoopChamferOwningFaceKind.SideFace,+ FaceLoopChamferOwningFaceKind.NonPlanarFace => CorePrismatic.FaceLoopChamferOwningFaceKind.NonPlanarFace,+ _ => CorePrismatic.FaceLoopChamferOwningFaceKind.TopCap,+ };++ private static CorePrismatic.FaceLoopChamferLoopKind ToCore(FaceLoopChamferLoopKind kind) => kind == FaceLoopChamferLoopKind.Inner+ ? CorePrismatic.FaceLoopChamferLoopKind.Inner+ : CorePrismatic.FaceLoopChamferLoopKind.Outer;++ private static CorePrismatic.FaceLoopChamferRuleKind ToCore(FaceLoopChamferRuleKind kind) => kind == FaceLoopChamferRuleKind.NonUniform+ ? CorePrismatic.FaceLoopChamferRuleKind.NonUniform+ : CorePrismatic.FaceLoopChamferRuleKind.UniformSymmetric;++ private static IReadOnlyList<string> Stable(IEnumerable<string> diagnostics) => diagnostics.Distinct(StringComparer.Ordinal).OrderBy(x => x, StringComparer.Ordinal).ToArray();+}diff --git a/docs/edge-a1-chamfer-fillet-support-compatibility-matrix.md b/docs/edge-a1-chamfer-fillet-support-compatibility-matrix.mdindex 67195ee8..4bd717b2 100644--- a/docs/edge-a1-chamfer-fillet-support-compatibility-matrix.md+++ b/docs/edge-a1-chamfer-fillet-support-compatibility-matrix.md@@ -316,3 +316,7 @@ EDGE-PRISMATIC-X7 documents that `analyze map` remains a blocker/evidence item f## EDGE-LOOP-A0 loop-support status noteEDGE-LOOP-A0 adds a documentation-only Class B audit for face-boundary loop edge-finish selections. Loop support is now scoped as ordered, face-owned closed-loop intent rather than arbitrary graph mutation. The preferred first target is a uniform symmetric chamfer around the top face outer loop of a history-known rectangular prism via prismatic section transition, using the existing top-edge prismatic witness as a building block and preserving section splits by default. Uniform constant-radius loop fillets, inner-loop hole/slot rims, no-history/imported planar loops, non-planar loops, open chains, mixed rules, and arbitrary graphs remain unimplemented/deferred pending explicit route, corner, artifact, and analyzer evidence. No production chamfer/fillet behavior, public API, BRep topology, STEP exporter/importer, Boolean core, AIR emitter, CIR analyzer, triangle migration, or NURBS/freeform behavior changed.++## CH-15 EDGE-LOOP-X2 corpus evidence++CH-15 now has EDGE-LOOP-X2 artifact-corpus evidence. The explicit experimental route `aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]` writes the canonical, larger valid, and non-square top-face outer-loop chamfer STEP artifacts and records rejected/deferred JSON-only rows for out-of-scope selections and invalid rules. The evidence remains lab-only and preserves no production route replacement, no AirEdgeSweep, no BrepBoundedChamfer, no topology graft, no 3D Boolean, and no coplanar merge.diff --git a/docs/edge-a3-edge-finish-selection-taxonomy.md b/docs/edge-a3-edge-finish-selection-taxonomy.mdindex 5bfe3590..8db8f5a5 100644--- a/docs/edge-a3-edge-finish-selection-taxonomy.md+++ b/docs/edge-a3-edge-finish-selection-taxonomy.md@@ -345,3 +345,7 @@ EDGE-A3 explicitly does not include:- test weakening;- triangle migration retry;- NURBS/freeform expansion.++## EDGE-LOOP-X2 Class B corpus evidence++EDGE-LOOP-X2 adds artifact-corpus evidence for the Class B top-face outer-loop chamfer route introduced by EDGE-LOOP-X1. The corpus command `aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]` writes canonical, larger valid, and non-square STEP artifacts, plus JSON-only rejected/deferred rows for invalid dimensions, invalid or too-large distances, non-uniform rules, arbitrary graphs, open chains, non-closed loops, non-outer loops, non-planar owning faces, and inset self-intersection risk. This is still lab-only, selection-pattern-driven evidence; it does not admit a production selector or broaden Class B support beyond the history-known top-cap outer loop.diff --git a/docs/edge-loop-a0-face-boundary-edge-finish-audit.md b/docs/edge-loop-a0-face-boundary-edge-finish-audit.mdindex 3df8bd3d..e7cbc0bb 100644--- a/docs/edge-loop-a0-face-boundary-edge-finish-audit.md+++ b/docs/edge-loop-a0-face-boundary-edge-finish-audit.md@@ -317,3 +317,7 @@ This milestone explicitly does not include:- triangle migration retry;- NURBS/freeform expansion;- gated artifact corpus stability requirements by default.++## EDGE-LOOP-X2 status++EDGE-LOOP-X2 now records the top-face outer-loop chamfer as an artifact corpus rather than only a lab proof. The explicit experimental CLI route is `aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]`; it writes three successful STEP artifacts and JSON-only rejected/deferred rows. The corpus preserves the Class B selection contract, the three-section prismatic section-transition construction, and split-preserving topology (`12` vertices, `20` edges, `10` planar faces, `10` loops, `40` coedges). It remains non-production evidence and keeps the no-AirEdgeSweep/no-BrepBoundedChamfer/no-graft/no-3D-Boolean/no-merge guarantees.diff --git a/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md b/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.mdindex b16f2b6e..86fd833f 100644--- a/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md+++ b/docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md@@ -209,3 +209,7 @@ EDGE-PRISMATIC-X6 adds gated artifact stability and analyzer confirmation eviden## EDGE-LOOP-X1 split-preservation evidenceEDGE-LOOP-X1 confirms that the top-face outer-loop chamfer inherits the default split-preserving policy. The loop chamfer stack preserves the `z = height - chamferDistance` section boundary, yielding four stable lower prism side faces and four upper chamfer transition faces. The lab records `edge-loop-x1-split-preserving-topology` and `edge-loop-x1-no-coplanar-merge-used`, so the loop proof does not introduce a merged mode or change the default prismatic topology contract.++## EDGE-LOOP-X2 split-preserving corpus note++EDGE-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.diff --git a/docs/frictionlab/edge-loop-x1-top-face-loop-chamfer-prismatic-lab.md b/docs/frictionlab/edge-loop-x1-top-face-loop-chamfer-prismatic-lab.mdindex 33ebc589..4752112f 100644--- a/docs/frictionlab/edge-loop-x1-top-face-loop-chamfer-prismatic-lab.md+++ b/docs/frictionlab/edge-loop-x1-top-face-loop-chamfer-prismatic-lab.md@@ -174,3 +174,7 @@ The implementation validation also reruns the requested prismatic, AirChamfer, c1. **EDGE-LOOP-X2 loop chamfer artifact/corpus** β add deterministic STEP/JSON artifact rows for the admitted top-face loop chamfer.2. **EDGE-LOOP-X3 no-history/imported loop rejection diagnostics** β prove imported/no-history loop requests fail deterministically without implying local topology mutation support.3. **EDGE-FILLET-A0 fillet architecture audit using selection taxonomy** β apply the Class A/B/C/D taxonomy to fillet routes before implementing loop fillets.++## EDGE-LOOP-X2 corpus follow-up++EDGE-LOOP-X2 adds deterministic artifact evidence for the X1 route through `aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]`. The corpus writes canonical, larger-distance, and non-square STEP artifacts plus JSON-only rejected/deferred rows. It preserves the X1 constraints: Class B top-cap outer closed loop only, prismatic section transition, split-preserving topology, no AirEdgeSweep, no BrepBoundedChamfer, no topology graft, no 3D Boolean, and no coplanar merge.diff --git a/docs/frictionlab/edge-loop-x2-top-face-loop-chamfer-corpus.md b/docs/frictionlab/edge-loop-x2-top-face-loop-chamfer-corpus.mdnew file mode 100644index 00000000..39b85626--- /dev/null+++ b/docs/frictionlab/edge-loop-x2-top-face-loop-chamfer-corpus.md@@ -0,0 +1,208 @@+# EDGE-LOOP-X2 β Top-face loop chamfer artifact corpus++## Purpose and scope++EDGE-LOOP-X2 promotes the EDGE-LOOP-X1 top-face outer-loop chamfer proof into a deterministic artifact corpus. The corpus writes STEP artifacts for successful Class B loop chamfer cases and records rejected/deferred rows as JSON-only evidence.++This milestone is artifact/corpus work only. It does not production-route loop chamfers, replace production chamfer/fillet behavior, alter STEP import/export, alter Boolean behavior, or change BRep topology behavior outside generated lab artifacts.++## References++- EDGE-LOOP-A0: `docs/edge-loop-a0-face-boundary-edge-finish-audit.md`+- EDGE-LOOP-X1: `docs/frictionlab/edge-loop-x1-top-face-loop-chamfer-prismatic-lab.md`+- EDGE-A3 selection taxonomy: `docs/edge-a3-edge-finish-selection-taxonomy.md`+- Prismatic split policy: `docs/edge-prismatic-x4-coplanar-split-merge-policy-audit.md`+- Sweep-first doctrine: `docs/aetheris-v2-sweep-first-architecture.md`++## Corpus command++The chosen route is an explicit experimental CLI hook:++```bash+aetheris experimental loop-chamfer-corpus --out-dir <dir> [--json]+```++The command is lab-only and does not alter normal production CLI commands or defaults. `--json` echoes the written summary to stdout; the summary is always written to `<dir>/edge-loop-x2-corpus.json`.++## Artifact filenames++Successful cases write:++- `edge-loop-x2-canonical-top-face-loop-chamfer.step`+- `edge-loop-x2-larger-top-face-loop-chamfer.step`+- `edge-loop-x2-non-square-top-face-loop-chamfer.step`++The JSON summary is:++- `edge-loop-x2-corpus.json`++Rejected/deferred rows write no STEP artifact.++## Case list++### Successful STEP cases++| Case | Width | Depth | Height | Chamfer distance | Expected bounds |+| --- | ---: | ---: | ---: | ---: | --- |+| `canonical-top-face-loop-chamfer` | 10 | 8 | 6 | 1 | `[-5,-4,0]..[5,4,6]` |+| `larger-top-face-loop-chamfer` | 10 | 8 | 6 | 2 | `[-5,-4,0]..[5,4,6]` |+| `non-square-top-face-loop-chamfer` | 12 | 5 | 7 | 1 | `[-6,-2.5,0]..[6,2.5,7]` |++### JSON-only rejected/deferred cases++- `invalid-zero-chamfer-distance`+- `invalid-negative-chamfer-distance`+- `too-large-chamfer-distance`+- `invalid-width`+- `invalid-depth`+- `invalid-height`+- `non-finite-dimensions`+- `non-uniform-rule-rejected`+- `arbitrary-graph-rejected`+- `open-chain-deferred`+- `non-closed-loop-rejected`+- `non-outer-loop-deferred`+- `non-planar-owning-face-deferred`+- `inset-self-intersection-risk`++## JSON schema++The summary includes:++- `milestone`: `EDGE-LOOP-X2`+- `corpusRoute`: experimental CLI command string+- `constructionRoute`: `prismatic-section-transition`+- `splitPolicy`: `preserve-section-splits`+- `cases[]` with:+ - `caseName`+ - `status`: `succeeded`, `rejected`, `deferred`, or `failed`+ - `artifactPath` / `artifactFileName` when written+ - `selectionClass`: `Class B / face-boundary loop`+ - `loopSelectionSummary`+ - `ruleSummary`+ - `constructionRoute`+ - `splitPolicy`+ - `topologySummary`+ - `stepMarkerSummary`+ - `diagnostics`+ - `errors`+ - `guarantees`+- corpus-level `diagnostics`, `errors`, and `guarantees`++## Class B selection summary++Successful rows encode one Class B face-boundary-loop selection:++- owning face: top cap+- loop kind: outer+- closed: true+- edge count: 4+- ordered: true+- rule: uniform symmetric chamfer++This remains a history-known rectangular-prism lab route. Imported/no-history loop inference is not claimed.++## Split-preserving topology contract++Each successful top-face loop chamfer is emitted as a three-section prismatic stack:++1. full lower rectangle,+2. full rectangle at pre-chamfer height,+3. inset top rectangle.++Expected topology for all successful rows:++| Metric | Expected |+| --- | ---: |+| section count | 3 |+| vertices | 12 |+| edges | 20 |+| faces | 10 |+| planar faces | 10 |+| cylindrical faces | 0 |+| cap faces | 2 |+| lower prism side faces | 4 |+| transition faces | 4 |+| chamfer transition faces | 4 |+| loops | 10 |+| coedges | 40 |++The split boundary between the lower prism side faces and chamfer transition faces is preserved. No coplanar merge is performed.++## STEP marker expectations++Successful STEP artifacts must contain:++- `ISO-10303-21`+- `MANIFOLD_SOLID_BREP`+- `ADVANCED_FACE`+- `PLANE`++Successful STEP artifacts must not contain:++- `CYLINDRICAL_SURFACE`+- `BREP_WITH_VOIDS`++These marker checks are smoke evidence only; corpus topology authority remains the generated BRep/topology summary from the lab path.++## Rejected/deferred behavior++Rejected/deferred rows are JSON-only. They preserve deterministic diagnostics such as:++- `edge-loop-x2-case-rejected:<case>:<reason>`+- `edge-loop-x2-case-deferred:<case>:<reason>`++They do not write STEP artifacts, do not invoke fallback constructive routes, and do not broaden support for arbitrary graphs, inner loops, open chains, non-planar loops, non-uniform rules, variable distances, or fillets.++## Route-exclusion guarantees++The corpus guarantees record:++- no production route replacement,+- no AirEdgeSweep,+- no BrepBoundedChamfer,+- no topology graft/body mutation,+- no 3D Boolean,+- no coplanar merge,+- not four independent single-edge chamfers.++## Loop operation, not four independent single-edge chamfers++The successful path creates one loop selection and lowers it to one prismatic section-transition stack. The four chamfer transition faces are emitted as part of that whole-loop construction. Diagnostics include `edge-loop-x2-not-four-independent-single-edge-chamfers:<case>` to make that distinction machine-checkable.++## Non-goals++EDGE-LOOP-X2 does not provide:++- production loop chamfer routing,+- inner-loop support,+- open-chain support,+- arbitrary edge graph support,+- fillet support,+- unequal-distance or mixed chamfer rules,+- triangle migration retry,+- NURBS/freeform expansion,+- STEP exporter/importer changes,+- Boolean core changes,+- production BRep topology changes.++## Tests run++During implementation, the focused gates were run:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- --help+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental loop-chamfer-corpus --out-dir "$tmp/edge-loop-x2" --json+dotnet test Aetheris.CLI.Tests/Aetheris.CLI.Tests.csproj --filter "LoopChamfer|FaceLoopChamfer|Prismatic|Analyze|Map|CliBaseline|Step|AirChamfer|Experimental|Corpus"+dotnet test Aetheris.FrictionLab.Tests/Aetheris.FrictionLab.Tests.csproj -c Release -f net10.0 --filter "FaceLoopChamfer|LoopChamfer|PrismaticSectionTransition|PrismaticTopEdgeChamfer|ProfileChamfer|ProfileStackChamfer|AirChamfer|EdgeSweep|Fillet|Chamfer|CIRLab"+dotnet test Aetheris.Kernel.Core.Tests/Aetheris.Kernel.Core.Tests.csproj --filter "Chamfer|Fillet|Corner|Prismatic|CIR|Cir|BrepPrimitives|BrepExtrude|Step242|Primitive|Boolean|SafeComposition"+dotnet test Aetheris.Kernel.Firmament.Tests/Aetheris.Kernel.Firmament.Tests.csproj --filter "Chamfer|Fillet|Corner|ProfileStack|LineArcProfileExtrude|FirmamentPrimitive|FirmamentStepExporter|SemanticRecovery|FrepMaterializer|Rematerialize"+```++## Recommended next milestone++Recommended follow-up options:++1. **EDGE-LOOP-X3** β gated stability/analyzer confirmation for the X2 corpus.+2. **EDGE-LOOP-X4** β no-history/imported loop rejection diagnostics.+3. **EDGE-FILLET-A0** β Class B fillet policy audit without implementing fillet production routing.