Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel
Add experimental prismatic map CLI route
Yuechen Li001e92301eb1
diff --git a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs b/Aetheris.CLI.Tests/CliHelpAndUsageTests.csindex 322887f2..aa26874a 100644--- a/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs+++ b/Aetheris.CLI.Tests/CliHelpAndUsageTests.cs@@ -39,6 +39,7 @@ public sealed class CliHelpAndUsageTests[InlineData("experimental")][InlineData("experimental", "airchamfer-cube")][InlineData("experimental", "airchamfer-corpus")]+ [InlineData("experimental", "prismatic-map")]public void Subcommand_Help_Lists_Usage_And_Examples(params string[] prefix){var stdout = new StringWriter();diff --git a/Aetheris.CLI.Tests/ExperimentalPrismaticMapTests.cs b/Aetheris.CLI.Tests/ExperimentalPrismaticMapTests.csnew file mode 100644index 00000000..c7901e0e--- /dev/null+++ b/Aetheris.CLI.Tests/ExperimentalPrismaticMapTests.cs@@ -0,0 +1,188 @@+using System.Text.Json;++namespace Aetheris.CLI.Tests;++public sealed class ExperimentalPrismaticMapTests+{+ [Fact]+ public void Experimental_Prismatic_Map_Help_Is_Discoverable_And_Explicitly_Generated_Source_Only()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "--help"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));+ var text = stdout.ToString();+ Assert.Contains("prismatic-map", text, StringComparison.Ordinal);+ Assert.Contains("generated-source-only", text, StringComparison.OrdinalIgnoreCase);+ Assert.Contains("accepts no STEP input", text, StringComparison.OrdinalIgnoreCase);+ }++ [Fact]+ public void Experimental_Prismatic_Map_Route_Help_States_Scope_And_No_Step_Input()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--help"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));+ var text = stdout.ToString();+ Assert.Contains("Usage: aetheris experimental prismatic-map --case <case> --rows <N> --cols <N> --json", text, StringComparison.Ordinal);+ Assert.Contains("generated AIR/prismatic source route only", text, StringComparison.Ordinal);+ Assert.Contains("not normal 'aetheris analyze map'", text, StringComparison.OrdinalIgnoreCase);+ Assert.Contains("No STEP input", text, StringComparison.Ordinal);+ Assert.Contains("map occupancy only", text, StringComparison.OrdinalIgnoreCase);+ }++ [Theory]+ [InlineData("rectangle-inset", 0.7d, 0.8d, 4d, 3.0d, 3.1d)]+ [InlineData("top-edge-chamfer", 3.3d, 3.4d, 4d, 3.9d, 4.0d)]+ public void Experimental_Prismatic_Map_Generated_Cases_Emit_Deterministic_Json_Summary(+ string caseName,+ double minLower,+ double minUpper,+ double expectedMax,+ double avgLower,+ double avgUpper)+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--case", caseName, "--rows", "16", "--cols", "16", "--json"], stdout, stderr);++ Assert.Equal(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stderr.ToString()));+ using var doc = JsonDocument.Parse(stdout.ToString());+ var root = doc.RootElement;+ Assert.True(root.GetProperty("success").GetBoolean());+ Assert.Equal("EDGE-PRISMATIC-X9", root.GetProperty("milestone").GetString());+ Assert.Equal("experimental prismatic-map", root.GetProperty("commandRoute").GetString());+ Assert.Equal(caseName, root.GetProperty("caseName").GetString());+ Assert.Equal("generated-air-prismatic-source", root.GetProperty("generatedSourceKind").GetString());+ Assert.Equal("cir-convex-polyhedron", root.GetProperty("backendSelected").GetString());+ Assert.Equal("mirror-admitted-exact", root.GetProperty("mirrorStatus").GetString());+ Assert.Equal("map-occupancy", root.GetProperty("requestedUse").GetString());+ Assert.Equal("top", root.GetProperty("view").GetString());+ Assert.Equal(16, root.GetProperty("rows").GetInt32());+ Assert.Equal(16, root.GetProperty("cols").GetInt32());+ Assert.Equal(256, root.GetProperty("occupiedCount").GetInt32());+ Assert.Equal(0, root.GetProperty("emptyCount").GetInt32());+ Assert.InRange(root.GetProperty("thicknessMin").GetDouble(), minLower, minUpper);+ Assert.Equal(expectedMax, root.GetProperty("thicknessMax").GetDouble(), 6);+ Assert.InRange(root.GetProperty("thicknessAverage").GetDouble(), avgLower, avgUpper);++ var losses = root.GetProperty("knownLosses").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains("face identity lost", losses);+ Assert.Contains("loop identity lost", losses);+ Assert.Contains("split-face lineage lost", losses);+ Assert.Contains("feature role labels lost", losses);+ Assert.Contains("topology parity unavailable", losses);++ var diagnostics = root.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();+ Assert.Contains("edge-prismatic-x9-no-step-input", diagnostics);+ Assert.Contains("edge-prismatic-x9-no-imported-step-mirror-inference", diagnostics);+ Assert.Contains("edge-prismatic-x9-no-production-analyzer-behavior-changed", diagnostics);+ Assert.Contains("edge-prismatic-x9-no-default-cli-behavior-changed", diagnostics);+ Assert.Contains($"edge-prismatic-x9-cir-mirror-admitted-exact:{caseName}", diagnostics);+ Assert.Contains("edge-prismatic-x9-backend-selected:cir-convex-polyhedron", diagnostics);+ Assert.Contains($"edge-prismatic-x9-map-summary-created:{caseName}", diagnostics);++ var guarantees = root.GetProperty("guarantees");+ Assert.True(guarantees.GetProperty("noProductionAnalyzerBehaviorChanged").GetBoolean());+ Assert.True(guarantees.GetProperty("noDefaultCliBehaviorChanged").GetBoolean());+ Assert.True(guarantees.GetProperty("noStepInput").GetBoolean());+ Assert.True(guarantees.GetProperty("noImportedStepMirrorInference").GetBoolean());+ Assert.True(guarantees.GetProperty("noCirToBrepExtraction").GetBoolean());+ Assert.True(guarantees.GetProperty("noTopologyIdentityClaim").GetBoolean());+ }++ [Fact]+ public void Experimental_Prismatic_Map_Unknown_Case_Rejects_With_Stable_Diagnostic()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--case", "non-convex", "--rows", "16", "--cols", "16", "--json"], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stdout.ToString()));+ Assert.Contains("edge-prismatic-x9-unknown-case:non-convex", stderr.ToString(), StringComparison.Ordinal);+ }++ [Theory]+ [InlineData("--case", "rectangle-inset", "--cols", "16", "--json")]+ [InlineData("--case", "rectangle-inset", "--rows", "16", "--json")]+ [InlineData("--case", "rectangle-inset", "--rows", "0", "--cols", "16", "--json")]+ [InlineData("--case", "rectangle-inset", "--rows", "16", "--cols", "-1", "--json")]+ public void Experimental_Prismatic_Map_Missing_Or_Invalid_Grid_Rejects(params string[] args)+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", .. args], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stdout.ToString()));+ Assert.Contains("edge-prismatic-x9-invalid-grid", stderr.ToString(), StringComparison.Ordinal);+ }++ [Fact]+ public void Experimental_Prismatic_Map_Missing_Case_Rejects()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--rows", "16", "--cols", "16", "--json"], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.Contains("edge-prismatic-x9-missing-case", stderr.ToString(), StringComparison.Ordinal);+ }++ [Fact]+ public void Experimental_Prismatic_Map_Json_Is_Required()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--case", "rectangle-inset", "--rows", "16", "--cols", "16"], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.Contains("edge-prismatic-x9-json-required", stderr.ToString(), StringComparison.Ordinal);+ }++ [Fact]+ public void Experimental_Prismatic_Map_Positional_Step_Input_Rejects_Without_Mirror_Inference()+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "part.step", "--case", "rectangle-inset", "--rows", "16", "--cols", "16", "--json"], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.True(string.IsNullOrWhiteSpace(stdout.ToString()));+ var error = stderr.ToString();+ Assert.Contains("edge-prismatic-x9-step-input-rejected", error, StringComparison.Ordinal);+ Assert.Contains("does not accept STEP input", error, StringComparison.Ordinal);+ }++ [Theory]+ [InlineData("face-identity")]+ [InlineData("topology-parity")]+ public void Experimental_Prismatic_Map_Lossy_Request_Rejects_With_Structured_Failure(string request)+ {+ var stdout = new StringWriter();+ var stderr = new StringWriter();++ var exitCode = Aetheris.CLI.CliRunner.Run(["experimental", "prismatic-map", "--case", "rectangle-inset", "--rows", "16", "--cols", "16", "--json", "--request", request], stdout, stderr);++ Assert.NotEqual(0, exitCode);+ Assert.Contains($"edge-prismatic-x9-lossy-request-rejected:{request}", stderr.ToString(), StringComparison.Ordinal);+ using var doc = JsonDocument.Parse(stdout.ToString());+ Assert.False(doc.RootElement.GetProperty("success").GetBoolean());+ Assert.Equal("unsupported", doc.RootElement.GetProperty("backendSelected").GetString());+ }+}diff --git a/Aetheris.CLI/CliRunner.cs b/Aetheris.CLI/CliRunner.csindex c1ce3afb..bf334ff3 100644--- a/Aetheris.CLI/CliRunner.cs+++ b/Aetheris.CLI/CliRunner.cs@@ -27,10 +27,11 @@ 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> [options]";+ private const string ExperimentalUsage = "Usage: aetheris experimental <airchamfer-cube|airchamfer-corpus|prismatic-corpus|prismatic-map> [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 static readonly JsonSerializerOptions JsonOptions = new(){@@ -867,6 +868,11 @@ public static class CliRunnerreturn RunExperimentalPrismaticCorpus(args.Skip(1).ToArray(), stdout, stderr);}+ if (string.Equals(args[0], "prismatic-map", StringComparison.Ordinal))+ {+ return RunExperimentalPrismaticMap(args.Skip(1).ToArray(), stdout, stderr);+ }+stderr.WriteLine($"Unknown experimental subcommand '{args[0]}'.");stderr.WriteLine(ExperimentalUsage);return 1;@@ -1054,6 +1060,120 @@ public static class CliRunnerreturn corpus.Errors.Count == 0 ? 0 : 1;}++ private static int RunExperimentalPrismaticMap(string[] args, TextWriter stdout, TextWriter stderr)+ {+ string? caseName = null;+ int? rows = null;+ int? cols = null;+ var json = false;+ string? request = null;++ for (var i = 0; i < args.Length; i++)+ {+ switch (args[i])+ {+ case "--case" when i + 1 < args.Length:+ caseName = args[++i];+ break;+ case "--case":+ stderr.WriteLine("edge-prismatic-x9-missing-case");+ stderr.WriteLine("Experimental prismatic-map option --case requires a generated case value.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ case "--rows" when i + 1 < args.Length && int.TryParse(args[++i], out var parsedRows):+ rows = parsedRows;+ break;+ case "--rows":+ stderr.WriteLine("edge-prismatic-x9-invalid-grid");+ stderr.WriteLine("Experimental prismatic-map option --rows requires an integer value.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ case "--cols" when i + 1 < args.Length && int.TryParse(args[++i], out var parsedCols):+ cols = parsedCols;+ break;+ case "--cols":+ stderr.WriteLine("edge-prismatic-x9-invalid-grid");+ stderr.WriteLine("Experimental prismatic-map option --cols requires an integer value.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ case "--request" when i + 1 < args.Length:+ request = args[++i];+ break;+ case "--request":+ stderr.WriteLine("edge-prismatic-x9-lossy-request-rejected:unknown");+ stderr.WriteLine("Experimental prismatic-map option --request requires a value; only map occupancy is supported.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ case "--json":+ json = true;+ break;+ case "-h":+ case "--help":+ WriteExperimentalPrismaticMapHelp(stdout);+ return 0;+ default:+ if (!args[i].StartsWith("-", StringComparison.Ordinal))+ {+ stderr.WriteLine("edge-prismatic-x9-step-input-rejected");+ stderr.WriteLine("experimental prismatic-map does not accept STEP input; use generated --case values only");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }++ stderr.WriteLine($"Unknown experimental prismatic-map option '{args[i]}'.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }+ }++ if (!json)+ {+ stderr.WriteLine("edge-prismatic-x9-json-required");+ stderr.WriteLine("Experimental prismatic-map requires --json to avoid implying a stable human-facing API.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }++ if (string.IsNullOrWhiteSpace(caseName))+ {+ stderr.WriteLine("edge-prismatic-x9-missing-case");+ stderr.WriteLine("Experimental prismatic-map requires --case <case>.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }++ if (!rows.HasValue || !cols.HasValue || rows <= 0 || cols <= 0)+ {+ stderr.WriteLine("edge-prismatic-x9-invalid-grid");+ stderr.WriteLine("Experimental prismatic-map requires positive --rows <N> and --cols <N> values.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }++ if (request is not null && !string.Equals(request, "map-occupancy", StringComparison.OrdinalIgnoreCase))+ {+ var failure = ExperimentalPrismaticMapLab.LossyRequestRejected(caseName, request, rows.Value, cols.Value);+ stdout.WriteLine(JsonSerializer.Serialize(failure, JsonOptions));+ stderr.WriteLine($"edge-prismatic-x9-lossy-request-rejected:{request.Trim().ToLowerInvariant().Replace(' ', '-')}");+ stderr.WriteLine("Experimental prismatic-map only supports map occupancy; face identity and topology parity are lossy.");+ return 1;+ }++ if (!ExperimentalPrismaticMapLab.SupportedCases.Contains(caseName, StringComparer.Ordinal))+ {+ var token = caseName.Trim().ToLowerInvariant().Replace(' ', '-');+ stderr.WriteLine($"edge-prismatic-x9-unknown-case:{token}");+ stderr.WriteLine($"Unknown experimental prismatic-map generated case '{caseName}'. Supported cases: {string.Join(", ", ExperimentalPrismaticMapLab.SupportedCases)}.");+ stderr.WriteLine(ExperimentalPrismaticMapUsage);+ return 1;+ }++ var result = ExperimentalPrismaticMapLab.Run(caseName, rows.Value, cols.Value);+ stdout.WriteLine(JsonSerializer.Serialize(result, JsonOptions));+ return result.Success ? 0 : 1;+ }+private static int RunAsm(string[] args, TextWriter stdout, TextWriter stderr){if (args.Length == 0 || IsHelpFlag(args[0]))@@ -1619,7 +1739,7 @@ public static class CliRunnerstdout.WriteLine(" analyze Analyze STEP topology, geometry, map, and sections.");stdout.WriteLine(" canon Import and re-export STEP/AP242 as canonical STEP.");stdout.WriteLine(" asm Execute/export .firmasm assembly IR using rigid world-space composition.");- stdout.WriteLine(" experimental Experimental/lab-only artifact export commands.");+ stdout.WriteLine(" experimental Experimental/lab-only artifact export and generated-source inspection commands.");stdout.WriteLine();stdout.WriteLine("Global options:");stdout.WriteLine(" -h, --help Show help.");@@ -1633,6 +1753,7 @@ public static class CliRunnerstdout.WriteLine(" aetheris asm exec assembly.firmasm --json");stdout.WriteLine(" aetheris asm export assembly.firmasm --out out/assembly-roundtrip --json");stdout.WriteLine(" aetheris experimental airchamfer-cube --out edge-x10-airchamfer-cube-one-edge.step --json");+ stdout.WriteLine(" aetheris experimental prismatic-map --case rectangle-inset --rows 16 --cols 16 --json");stdout.WriteLine(" aetheris analyze map model.step --top --rows 40 --cols 60 --json");stdout.WriteLine(" aetheris analyze section model.step --xy --offset 2.5 --json");stdout.WriteLine(" aetheris analyze volume model.step --json");@@ -1766,17 +1887,20 @@ public static class CliRunnerstdout.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(" 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();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(" - 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();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");}private static void WriteExperimentalAirChamferCubeHelp(TextWriter stdout)@@ -1850,6 +1974,32 @@ public static class CliRunnerstdout.WriteLine(" aetheris experimental prismatic-corpus --out-dir artifacts/edge-prismatic-x5 --json");}+++ private static void WriteExperimentalPrismaticMapHelp(TextWriter stdout)+ {+ stdout.WriteLine("Inspect the EDGE-PRISMATIC-X9 generated-source-only prismatic map proof as JSON.");+ stdout.WriteLine();+ stdout.WriteLine(ExperimentalPrismaticMapUsage);+ stdout.WriteLine();+ stdout.WriteLine("Options:");+ stdout.WriteLine(" --case <case> Required generated case: rectangle-inset or top-edge-chamfer.");+ stdout.WriteLine(" --rows <N> Required positive row count.");+ stdout.WriteLine(" --cols <N> Required positive column count.");+ stdout.WriteLine(" --json Required machine-readable output; no stable text API is promised.");+ stdout.WriteLine(" --request <use> Optional; only map-occupancy is supported. Face identity/topology parity reject as lossy.");+ stdout.WriteLine(" -h, --help Show this help.");+ stdout.WriteLine();+ stdout.WriteLine("Scope and authority:");+ stdout.WriteLine(" - Experimental generated AIR/prismatic source route only.");+ stdout.WriteLine(" - This is not normal 'aetheris analyze map' and does not change its STEP behavior.");+ stdout.WriteLine(" - No STEP input, imported STEP prismatic body, or arbitrary user geometry is accepted.");+ stdout.WriteLine(" - Output supports map occupancy only; no topology or face identity claims are made.");+ stdout.WriteLine();+ stdout.WriteLine("Example:");+ stdout.WriteLine(" aetheris experimental prismatic-map --case rectangle-inset --rows 16 --cols 16 --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/ExperimentalPrismaticMapLab.cs b/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.csnew file mode 100644index 00000000..6dc09bcc--- /dev/null+++ b/Aetheris.Firmament.FrictionLab/CIRLab/ExperimentalPrismaticMapLab.cs@@ -0,0 +1,219 @@+using Aetheris.Kernel.Core.Cir;+using Aetheris.Kernel.Core.Cir.Mirrors;+using Aetheris.Kernel.Core.Math;+using CorePrismatic = Aetheris.Kernel.Core.Brep.Prismatic;++namespace Aetheris.Firmament.FrictionLab.CIRLab;++public sealed record ExperimentalPrismaticMapBounds(+ ExperimentalPrismaticMapPoint Min,+ ExperimentalPrismaticMapPoint Max,+ double SizeX,+ double SizeY,+ double SizeZ);++public sealed record ExperimentalPrismaticMapPoint(double X, double Y, double Z);++public sealed record ExperimentalPrismaticMapGuarantees(+ bool NoProductionAnalyzerBehaviorChanged,+ bool NoDefaultCliBehaviorChanged,+ bool NoStepInput,+ bool NoImportedStepMirrorInference,+ bool NoCirToBrepExtraction,+ bool NoTopologyIdentityClaim);++public sealed record ExperimentalPrismaticMapResult(+ bool Success,+ string Milestone,+ string CommandRoute,+ string CaseName,+ string GeneratedSourceKind,+ string BackendSelected,+ string MirrorStatus,+ string RequestedUse,+ string View,+ int Rows,+ int Cols,+ int OccupiedCount,+ int EmptyCount,+ double? ThicknessMin,+ double? ThicknessMax,+ double? ThicknessAverage,+ ExperimentalPrismaticMapBounds? Bounds,+ IReadOnlyList<string> KnownLosses,+ IReadOnlyList<string> Diagnostics,+ ExperimentalPrismaticMapGuarantees Guarantees,+ string? Error = null);++public static class ExperimentalPrismaticMapLab+{+ public const string Milestone = "EDGE-PRISMATIC-X9";+ public const string CommandRoute = "experimental prismatic-map";+ public const string RequestedUse = "map-occupancy";+ public const string View = "top";++ public static readonly IReadOnlyList<string> SupportedCases = ["rectangle-inset", "top-edge-chamfer"];++ private static readonly string[] KnownLossDescriptions =+ [+ "face identity lost",+ "loop identity lost",+ "split-face lineage lost",+ "feature role labels lost",+ "topology parity unavailable",+ ];++ private static readonly ExperimentalPrismaticMapGuarantees DefaultGuarantees = new(+ NoProductionAnalyzerBehaviorChanged: true,+ NoDefaultCliBehaviorChanged: true,+ NoStepInput: true,+ NoImportedStepMirrorInference: true,+ NoCirToBrepExtraction: true,+ NoTopologyIdentityClaim: true);++ public static ExperimentalPrismaticMapResult Run(string caseName, int rows, int cols)+ {+ var token = Normalize(caseName);+ var diagnostics = StartDiagnostics();+ diagnostics.Add($"edge-prismatic-x9-generated-source-created:{token}");+ diagnostics.Add($"edge-prismatic-x9-cir-mirror-admission-requested:{token}");++ var sections = CreateSections(token);+ if (sections is null)+ {+ diagnostics.Add($"edge-prismatic-x9-unknown-case:{token}");+ AddAuthorityDiagnostics(diagnostics);+ return Failure(token, rows, cols, "unknown-case", diagnostics);+ }++ var mirrorResult = CirPrismaticMirrorBuilder.BuildFromSections(token, sections);+ diagnostics.AddRange(mirrorResult.Diagnostics);++ if (!mirrorResult.Succeeded || mirrorResult.Mirror is null)+ {+ diagnostics.Add($"edge-prismatic-x9-mirror-unavailable:{token}");+ diagnostics.Add("edge-prismatic-x9-backend-selected:unsupported");+ AddAuthorityDiagnostics(diagnostics);+ return Failure(token, rows, cols, "mirror-unavailable", diagnostics, mirrorResult.Admission.StatusText);+ }++ diagnostics.Add($"edge-prismatic-x9-cir-mirror-admitted-exact:{token}");+ diagnostics.Add("edge-prismatic-x9-backend-selected:cir-convex-polyhedron");+ AddLossDiagnostics(diagnostics);++ var summary = mirrorResult.Mirror.CreateTopViewSummary(rows, cols);+ diagnostics.Add($"edge-prismatic-x9-map-summary-created:{token}");+ AddAuthorityDiagnostics(diagnostics);++ return new ExperimentalPrismaticMapResult(+ Success: true,+ Milestone,+ CommandRoute,+ CaseName: token,+ GeneratedSourceKind: "generated-air-prismatic-source",+ BackendSelected: "cir-convex-polyhedron",+ MirrorStatus: mirrorResult.Admission.StatusText,+ RequestedUse,+ View,+ Rows: summary.Rows,+ Cols: summary.Cols,+ OccupiedCount: summary.OccupiedCount,+ EmptyCount: summary.EmptyCount,+ ThicknessMin: summary.ThicknessMin,+ ThicknessMax: summary.ThicknessMax,+ ThicknessAverage: summary.ThicknessAverage,+ Bounds: ToBounds(summary.Bounds),+ KnownLosses: KnownLossDescriptions,+ Diagnostics: StableDiagnostics(diagnostics),+ Guarantees: DefaultGuarantees);+ }++ public static ExperimentalPrismaticMapResult LossyRequestRejected(string caseName, string request, int rows, int cols)+ {+ var token = Normalize(caseName);+ var requestToken = Normalize(request);+ var diagnostics = StartDiagnostics();+ diagnostics.Add($"edge-prismatic-x9-generated-source-created:{token}");+ diagnostics.Add($"edge-prismatic-x9-lossy-request-rejected:{requestToken}");+ diagnostics.Add("edge-prismatic-x9-backend-selected:unsupported");+ AddLossDiagnostics(diagnostics);+ AddAuthorityDiagnostics(diagnostics);+ return Failure(token, rows, cols, "lossy-request-rejected", diagnostics, "mirror-rejected-lossy-for-request");+ }++ private static IReadOnlyList<CorePrismatic.PrismaticSection>? CreateSections(string caseName) => caseName switch+ {+ "rectangle-inset" =>+ [+ new CorePrismatic.PrismaticSection(0d, [(-5d, -3d), (5d, -3d), (5d, 3d), (-5d, 3d)]),+ new CorePrismatic.PrismaticSection(4d, [(-4d, -2d), (4d, -2d), (4d, 2d), (-4d, 2d)]),+ ],+ "top-edge-chamfer" => CorePrismatic.PrismaticTopEdgeChamferPrototype.CreateSectionStack(new CorePrismatic.PrismaticTopEdgeChamferRequest(10d, 6d, 4d, 1d)),+ _ => null,+ };++ private static ExperimentalPrismaticMapResult Failure(+ string caseName,+ int rows,+ int cols,+ string error,+ IReadOnlyList<string> diagnostics,+ string mirrorStatus = "unsupported") =>+ new(+ Success: false,+ Milestone,+ CommandRoute,+ CaseName: caseName,+ GeneratedSourceKind: "generated-air-prismatic-source",+ BackendSelected: "unsupported",+ MirrorStatus: mirrorStatus,+ RequestedUse,+ View,+ Rows: rows,+ Cols: cols,+ OccupiedCount: 0,+ EmptyCount: rows > 0 && cols > 0 ? rows * cols : 0,+ ThicknessMin: null,+ ThicknessMax: null,+ ThicknessAverage: null,+ Bounds: null,+ KnownLosses: KnownLossDescriptions,+ Diagnostics: StableDiagnostics(diagnostics),+ Guarantees: DefaultGuarantees,+ Error: error);++ private static List<string> StartDiagnostics() =>+ [+ "edge-prismatic-x9-cli-route-started",+ ];++ private static void AddLossDiagnostics(List<string> diagnostics)+ {+ diagnostics.Add("edge-prismatic-x9-loss-face-identity");+ diagnostics.Add("edge-prismatic-x9-loss-loop-identity");+ diagnostics.Add("edge-prismatic-x9-loss-split-face-lineage");+ diagnostics.Add("edge-prismatic-x9-loss-feature-role-labels");+ diagnostics.Add("edge-prismatic-x9-loss-topology-parity");+ }++ private static void AddAuthorityDiagnostics(List<string> diagnostics)+ {+ diagnostics.Add("edge-prismatic-x9-no-step-input");+ diagnostics.Add("edge-prismatic-x9-no-imported-step-mirror-inference");+ diagnostics.Add("edge-prismatic-x9-no-production-analyzer-behavior-changed");+ diagnostics.Add("edge-prismatic-x9-no-default-cli-behavior-changed");+ diagnostics.Add("edge-prismatic-x9-no-cir-to-brep-extraction");+ diagnostics.Add("edge-prismatic-x9-no-topology-identity-claim");+ }++ private static ExperimentalPrismaticMapBounds ToBounds(CirBounds bounds) =>+ new(ToPoint(bounds.Min), ToPoint(bounds.Max), bounds.SizeX, bounds.SizeY, bounds.SizeZ);++ private static ExperimentalPrismaticMapPoint ToPoint(Point3D point) => new(point.X, point.Y, point.Z);++ private static string Normalize(string value) =>+ string.IsNullOrWhiteSpace(value) ? "unknown" : value.Trim().ToLowerInvariant().Replace(' ', '-');++ private static IReadOnlyList<string> StableDiagnostics(IEnumerable<string> diagnostics) =>+ diagnostics.Distinct(StringComparer.Ordinal).ToArray();+}diff --git a/docs/cir-prismatic-x2-convex-polyhedron-mirror.md b/docs/cir-prismatic-x2-convex-polyhedron-mirror.mdindex d1b37dd7..40d2e8f4 100644--- a/docs/cir-prismatic-x2-convex-polyhedron-mirror.md+++ b/docs/cir-prismatic-x2-convex-polyhedron-mirror.md@@ -174,3 +174,7 @@ Likely next milestones are:## 12. EDGE-PRISMATIC-X8 consumption noteEDGE-PRISMATIC-X8 consumes the X2 `CirConvexPolyhedronMirror` in a lab/test-only hybrid map dispatcher. Generated `rectangle-inset` and `top-edge-chamfer` source sections are admitted through the X2 builder, select the `cir-convex-polyhedron` backend for occupancy/thickness summaries, and still reject face-identity/topology-parity requests as lossy. This consumption does not wire the mirror into production `StepAnalyzer.AnalyzeMap`, does not add a default CLI route, does not infer mirrors from imported STEP, and does not perform CIR-to-BRep extraction.++## EDGE-PRISMATIC-X9 CLI consumption note++EDGE-PRISMATIC-X9 consumes the CIR-PRISMATIC-X2 convex-polyhedron mirror from an explicit experimental CLI route: `aetheris experimental prismatic-map --case <case> --rows <n> --cols <n> --json`. The route admits generated prismatic sources for map occupancy only and reports known losses for face identity, loop identity, split-face lineage, feature role labels, and topology parity. It does not add CIR-to-BRep extraction and does not infer mirrors from imported STEP.diff --git a/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md b/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.mdindex 08361da2..6c5dee48 100644--- a/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md+++ b/docs/edge-prismatic-x7-analyze-map-cir-frep-audit.md@@ -405,3 +405,7 @@ CIR-PRISMATIC-X2 implements the first reusable convex prismatic CIR mirror (`Cir## EDGE-PRISMATIC-X8 follow-upEDGE-PRISMATIC-X8 prototypes the hybrid dispatch recommended by this audit in Core test scope. The prototype uses generated prismatic source data plus an admitted `CirConvexPolyhedronMirror` to select a CIR convex-polyhedron map backend for `rectangle-inset` and `top-edge-chamfer`, while preserving BRep raycast as the primitive baseline path and returning deterministic unsupported diagnostics for imported STEP-only/no-source cases. Production `analyze map` behavior and default CLI behavior remain unchanged.++## EDGE-PRISMATIC-X9 route boundary note++EDGE-PRISMATIC-X9 adds `aetheris experimental prismatic-map` as a generated-source-only inspection route for the X8/CIR-PRISMATIC-X2 prismatic mirror proof. Normal `aetheris analyze map <file.step> ... --json` remains unchanged and continues to use the existing STEP analyzer path. X9 does not accept STEP input on the experimental route, does not infer imported STEP mirrors, and does not make topology or face-identity claims from CIR maps.diff --git a/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md b/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.mdindex c5af65fd..87fd4f7e 100644--- a/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md+++ b/docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md@@ -165,3 +165,7 @@ Recommended next steps, in priority order:1. **EDGE-PRISMATIC-X9 experimental CLI prismatic-map route** — expose this generated-source-only path under an explicit experimental command, preserving normal `analyze map` behavior.2. **AIR-CIR-A1 mirror drift/parity policy** — define stale mirror detection and generated-source provenance checks before broader use.3. **Chamfer/fillet selection taxonomy return** — use the mirror evidence to refine when prismatic section transitions, AIR edge sweeps, or legacy BRep routes should compete.++## EDGE-PRISMATIC-X9 CLI exposure note++EDGE-PRISMATIC-X9 exposes the X8 generated-source-only hybrid map proof through `aetheris experimental prismatic-map --case <case> --rows <n> --cols <n> --json`. The route is experimental, accepts only the generated `rectangle-inset` and `top-edge-chamfer` cases, rejects positional STEP input, and preserves the X8 authority boundary: normal `aetheris analyze map` remains unchanged, imported STEP bodies do not infer CIR mirrors, and CIR map summaries make no topology or face-identity claims.diff --git a/docs/frictionlab/edge-prismatic-x9-experimental-prismatic-map-cli.md b/docs/frictionlab/edge-prismatic-x9-experimental-prismatic-map-cli.mdnew file mode 100644index 00000000..a54e5be7--- /dev/null+++ b/docs/frictionlab/edge-prismatic-x9-experimental-prismatic-map-cli.md@@ -0,0 +1,177 @@+# EDGE-PRISMATIC-X9 — Experimental generated-source prismatic map CLI++## Purpose and scope++EDGE-PRISMATIC-X9 exposes the EDGE-PRISMATIC-X8 hybrid prismatic map proof through an explicit experimental CLI route:++```bash+aetheris experimental prismatic-map --case <case> --rows <n> --cols <n> --json+```++The route is intentionally narrow. It only creates controlled generated AIR/prismatic source cases, admits their CIR convex-polyhedron mirrors, and reports top-view map occupancy summaries. It is not a production analyzer path, not a stable public API, and not an arbitrary geometry route.++## References++- EDGE-PRISMATIC-X8 hybrid dispatch: `docs/edge-prismatic-x8-hybrid-map-dispatch-prismatic-mirror.md`+- CIR-PRISMATIC-X2 convex polyhedron mirror: `docs/cir-prismatic-x2-convex-polyhedron-mirror.md`+- CIR map/mirror dispatch background: `docs/cir-map-x1-primitive-map-prototype.md` and `docs/cir-map-x2-mirror-aware-primitive-map-dispatch.md`+- AIR/CIR authority and mirror contract: `docs/air-cir-a0-authority-and-mirror-contract.md`++## CLI command and examples++Supported command:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental prismatic-map --case rectangle-inset --rows 16 --cols 16 --json+```++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental prismatic-map --case top-edge-chamfer --rows 16 --cols 16 --json+```++The route requires `--json` so the output remains machine-checkable and avoids implying a stable human-readable API. The route also accepts an optional `--request` guard; only `map-occupancy` is admitted. `face-identity` and `topology-parity` reject as lossy.++## Supported generated cases++- `rectangle-inset`+- `top-edge-chamfer`++Optional corpus cases such as `box-primitive`, `hexagon-scaled`, `pentagon-scaled`, and `pentagon-asymmetric` are not exposed by X9 unless a future milestone adds a policy-backed expansion.++## STEP input is not accepted++`experimental prismatic-map` accepts no positional STEP path, no imported STEP prismatic body, and no arbitrary user-provided geometry. A positional `.step` argument rejects with the stable diagnostic:++```text+edge-prismatic-x9-step-input-rejected+experimental prismatic-map does not accept STEP input; use generated --case values only+```++This preserves the AIR/CIR authority model: generated source with an admitted mirror may use this experimental route; imported STEP cannot infer a CIR mirror.++## JSON schema++The command emits one JSON object with these fields:++- `success`: boolean.+- `milestone`: `EDGE-PRISMATIC-X9`.+- `commandRoute`: `experimental prismatic-map`.+- `caseName`: supported generated case name.+- `generatedSourceKind`: currently `generated-air-prismatic-source`.+- `backendSelected`: `cir-convex-polyhedron`, `cir-tape`, or `unsupported`.+- `mirrorStatus`: mirror admission status such as `mirror-admitted-exact`.+- `requestedUse`: currently `map-occupancy`.+- `view`: currently `top`.+- `rows`, `cols`: requested positive grid dimensions.+- `occupiedCount`, `emptyCount`: map occupancy sample counts.+- `thicknessMin`, `thicknessMax`, `thicknessAverage`: top-view vertical thickness summary values, or `null` on unsupported/failure results.+- `bounds`: generated source bounds with `min`, `max`, `sizeX`, `sizeY`, and `sizeZ`, or `null` on unsupported/failure results.+- `knownLosses`: explicit loss statements.+- `diagnostics`: deterministic machine-checkable diagnostics.+- `guarantees`: authority-preservation booleans.+- `error`: `null` on success or a stable failure reason.++## Expected 16x16 top-view summaries++For `rectangle-inset`:++- `backendSelected`: `cir-convex-polyhedron`+- `mirrorStatus`: `mirror-admitted-exact`+- `occupiedCount`: `256`+- `emptyCount`: `0`+- `thicknessMin`: approximately `0.75`+- `thicknessMax`: approximately `4.0`+- `thicknessAverage`: approximately `3.05`++For `top-edge-chamfer`:++- `backendSelected`: `cir-convex-polyhedron`+- `mirrorStatus`: `mirror-admitted-exact`+- `occupiedCount`: `256`+- `emptyCount`: `0`+- `thicknessMin`: approximately `3.3125`+- `thicknessMax`: approximately `4.0`+- `thicknessAverage`: approximately `3.9531`++## Known losses++The JSON intentionally reports these losses and makes no topology identity claim:++- `face identity lost`+- `loop identity lost`+- `split-face lineage lost`+- `feature role labels lost`+- `topology parity unavailable`++## Diagnostics++Success diagnostics include:++- `edge-prismatic-x9-cli-route-started`+- `edge-prismatic-x9-generated-source-created:<case>`+- `edge-prismatic-x9-cir-mirror-admission-requested:<case>`+- `edge-prismatic-x9-cir-mirror-admitted-exact:<case>`+- `edge-prismatic-x9-backend-selected:cir-convex-polyhedron`+- `edge-prismatic-x9-map-summary-created:<case>`+- `edge-prismatic-x9-loss-face-identity`+- `edge-prismatic-x9-loss-split-face-lineage`+- `edge-prismatic-x9-loss-topology-parity`+- `edge-prismatic-x9-no-step-input`+- `edge-prismatic-x9-no-imported-step-mirror-inference`+- `edge-prismatic-x9-no-production-analyzer-behavior-changed`+- `edge-prismatic-x9-no-default-cli-behavior-changed`+- `edge-prismatic-x9-no-cir-to-brep-extraction`++Error diagnostics include:++- `edge-prismatic-x9-missing-case`+- `edge-prismatic-x9-unknown-case:<case>`+- `edge-prismatic-x9-invalid-grid`+- `edge-prismatic-x9-json-required`+- `edge-prismatic-x9-step-input-rejected`+- `edge-prismatic-x9-mirror-unavailable:<case>`+- `edge-prismatic-x9-lossy-request-rejected:<request>`++## Relationship to normal `aetheris analyze map`++Normal `aetheris analyze map <file.step> ... --json` remains unchanged. It continues to operate on STEP inputs through the existing analyzer behavior, including the established BRep-raycast/primitive-limited route for STEP map analysis. X9 does not route normal STEP analysis through CIR prismatic mirrors.++## Non-goals++EDGE-PRISMATIC-X9 does not change or add:++- production analyzer behavior;+- default CLI behavior;+- STEP exporter/importer behavior;+- Boolean core behavior;+- BRep topology behavior;+- AIR emitter behavior;+- production prismatic route behavior;+- CIR-to-BRep extraction;+- imported STEP mirror inference;+- topology identity, face identity, loop identity, split-face lineage, or topology parity claims;+- coplanar merge behavior.++## Tests run++Focused validation for this milestone should include:++```bash+dotnet run --project Aetheris.CLI --framework net10.0 -- --help+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental prismatic-map --case rectangle-inset --rows 16 --cols 16 --json+dotnet run --project Aetheris.CLI --framework net10.0 -- experimental prismatic-map --case top-edge-chamfer --rows 16 --cols 16 --json+dotnet test Aetheris.CLI.Tests/Aetheris.CLI.Tests.csproj --filter "PrismaticMap|Prismatic|Analyze|Map|CliBaseline|Step|AirChamfer|Experimental|Corpus"+dotnet test Aetheris.Kernel.Core.Tests/Aetheris.Kernel.Core.Tests.csproj --filter "EDGE-PRISMATIC-X8|PrismaticHybridMap|CirPrismatic|CirMirror|CirMap|CIR|Cir|BrepPrimitives|BrepSpatialQueries|Raycast|Step242|Primitive|Boolean|SafeComposition"+dotnet test Aetheris.FrictionLab.Tests/Aetheris.FrictionLab.Tests.csproj -c Release -f net10.0 --filter "PrismaticSectionTransition|PrismaticTopEdgeChamfer|ProfileStackChamfer|ProfileChamfer|ProfileStack|LineArcProfileExtrude|Profile2D|AirChamfer|EdgeSweep|CIRLab"+dotnet test Aetheris.Kernel.Firmament.Tests/Aetheris.Kernel.Firmament.Tests.csproj --filter "FirmamentPrimitive|FirmamentStepExporter|SemanticRecovery|FrepMaterializer|Rematerialize|Chamfer|Fillet|Corner|ProfileStack|LineArcProfileExtrude"+```++Do not enable gated artifact corpus stability tests by default.++## Next milestone++Recommended next work is one of:++- AIR-CIR-A1 mirror drift/parity policy;+- EDGE-A3 edge-finish selection taxonomy;+- a policy-backed optional experimental map expansion after mirror drift/parity policy is settled.