Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

Handle validation-report fixtures in trace corpus tests

Yuechen Li27d85c8c1525
diff --git a/Aetheris.CLI.Tests/FirmamentFixtureCorpusTests.cs b/Aetheris.CLI.Tests/FirmamentFixtureCorpusTests.cs
index f5ebfcd3..0ede6719 100644
--- a/Aetheris.CLI.Tests/FirmamentFixtureCorpusTests.cs
+++ b/Aetheris.CLI.Tests/FirmamentFixtureCorpusTests.cs
@@ -144,16 +144,37 @@ public sealed class FirmamentFixtureCorpusTests
{
foreach (var path in DiscoverV2TraceFixtures())
{
- using var doc = Trace(path);
- var root = doc.RootElement;
var metadata = LoadMetadata(path);
+ if (string.Equals(metadata["expected-stage"], "validation-report", StringComparison.Ordinal))
+ {
+ // Validation-report fixtures prove parser/report behavior through `validate`, not lowering `trace`.
+ using var doc = Validate(path);
+ var validation = doc.RootElement.GetProperty("firmamentV2Validation");
+ var validationStatus = validation.GetProperty("status").GetString();
+ if (metadata["expected"] == "valid")
+ {
+ Assert.Contains(validationStatus, new[] { "valid", "valid-with-deferred-export" });
+ }
+ else
+ {
+ Assert.Equal("invalid", validationStatus);
+ }
+ var diagnostics = validation.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetProperty("code").GetString()).ToArray();
+ if (metadata.TryGetValue("expected-diagnostic", out var expectedValidationDiagnostic)) Assert.Contains(expectedValidationDiagnostic, diagnostics);
+ Assert.Contains("firmament-v2-parser-invoked", diagnostics);
+ Assert.DoesNotContain("air-x11-firmament-parse-failed", diagnostics);
+ continue;
+ }
+
+ using var trace = Trace(path);
+ var root = trace.RootElement;
var isParserBacked = metadata["implementation"] == "parser-backed";
Assert.Equal(isParserBacked, root.GetProperty("fixture").GetProperty("parserBacked").GetBoolean());
Assert.True(root.GetProperty("fixture").GetProperty("expectationSatisfied").GetBoolean(), path);
Assert.Equal(metadata["expected-stage"], root.GetProperty("actualStageReached").GetString());
- var diagnostics = root.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();
- if (metadata.TryGetValue("expected-diagnostic", out var expectedDiagnostic)) Assert.Contains(expectedDiagnostic, diagnostics);
- Assert.DoesNotContain("air-x11-firmament-parse-failed", diagnostics);
+ var traceDiagnostics = root.GetProperty("diagnostics").EnumerateArray().Select(x => x.GetString()).ToArray();
+ if (metadata.TryGetValue("expected-diagnostic", out var expectedTraceDiagnostic)) Assert.Contains(expectedTraceDiagnostic, traceDiagnostics);
+ Assert.DoesNotContain("air-x11-firmament-parse-failed", traceDiagnostics);
}
}
@@ -456,4 +477,14 @@ public sealed class FirmamentFixtureCorpusTests
Assert.True(exit == 0, stderr.ToString());
return JsonDocument.Parse(stdout.ToString());
}
+
+ private static JsonDocument Validate(string fixturePath)
+ {
+ var stdout = new StringWriter(); var stderr = new StringWriter();
+ var exit = Aetheris.CLI.CliRunner.Run(["validate", fixturePath, "--json"], stdout, stderr);
+ var metadata = LoadMetadata(fixturePath);
+ Assert.Equal(metadata["expected"] == "valid" ? 0 : 1, exit);
+ Assert.Equal(string.Empty, stderr.ToString());
+ return JsonDocument.Parse(stdout.ToString());
+ }
}
diff --git a/docs/implementation/v2-phase1-p2-record-pmi-ap242-export.md b/docs/implementation/v2-phase1-p2-record-pmi-ap242-export.md
index 0fad0938..70e5cf29 100644
--- a/docs/implementation/v2-phase1-p2-record-pmi-ap242-export.md
+++ b/docs/implementation/v2-phase1-p2-record-pmi-ap242-export.md
@@ -52,6 +52,8 @@ Primary fixture:
`fixtures/FirmamentV2/InlineStep/valid/inline-step-v2-record-pmi-datum-diameter-step-verified.valid.firmfixture`
+Because this fixture imports `canonical-through-hole.step`, its `step-verified` corpus contract includes InlineStep trace metadata for the real through-hole body (`expected-volume: 461.15044407846124`, `expected-topology: faces=7`). Without that metadata, the generic parser-backed trace verifier falls back to the plain 10x8x6 box volume and reports a stale `step-v2-a1-volume-mismatch` even though the AP242 PMI export proof still succeeds.
+
Invalid/deferred fixtures:
- `fixtures/FirmamentV2/InlineStep/invalid/inline-step-v2-record-pmi-diameter-missing-tolerance.invalid.firmfixture`
diff --git a/fixtures/FirmamentV2/InlineStep/valid/inline-step-v2-record-pmi-datum-diameter-step-verified.valid.firmfixture b/fixtures/FirmamentV2/InlineStep/valid/inline-step-v2-record-pmi-datum-diameter-step-verified.valid.firmfixture
index be606259..56848ad4 100644
--- a/fixtures/FirmamentV2/InlineStep/valid/inline-step-v2-record-pmi-datum-diameter-step-verified.valid.firmfixture
+++ b/fixtures/FirmamentV2/InlineStep/valid/inline-step-v2-record-pmi-datum-diameter-step-verified.valid.firmfixture
@@ -11,13 +11,15 @@
// feature-area: v2-phase1-p2-record-pmi-ap242-export
// build-command: aetheris build
// roundtrip-required: true
+// expected-volume: 461.15044407846124
+// expected-topology: faces=7
// canonical-input-required: true
// recognized-region-required: true
// semantic-pmi-required: true
// graphical-pmi-required: false
// input-step: ../testdata/canonical-through-hole.step
// semantic-pmi-evidence: SHAPE_ASPECT('firmament-datum:A'), SHAPE_DIMENSION_REPRESENTATION('diameter:part.mountHoleADiameter'), SHAPE_DIMENSION_REPRESENTATION('diameter_tolerance:part.mountHoleADiameter')
-// notes: P2 proves record-shaped datum and toleranced diameter PMI over an existing canonical InlineStep model; no graphical PMI, drawing views, full GD&T, or geometry changes.
+// notes: P2 proves record-shaped datum and toleranced diameter PMI over the canonical through-hole InlineStep model; trace-stage step verification depends on matching the imported body's stable through-hole volume rather than the default 10x8x6 box volume.
model InlineStepRecordPmiDatumDiameter {
units mm