Skip to content

Next Gen STEP AP242 Native-ish BREP Geometric Modeling Kernel

fixtures: FrontendX4 authoring retest corpus and chimera

Claude7525f37fc6ec
diff --git a/fixtures/Regression/FrontendX4/README.md b/fixtures/Regression/FrontendX4/README.md
new file mode 100644
index 00000000..ae63a552
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/README.md
@@ -0,0 +1,110 @@
+# FrontendX4: authoring retest corpus
+
+This corpus covers what is still open after the X0–X2 frontend work. It is the "repeat all twelve
+sources" acceptance step from the
+[language decision register](../../../docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md),
+made concrete. Each case is the smallest file showing one remaining problem. Each must-build case
+comes with a reference spelling that builds today, and the reference is the geometry oracle.
+
+Recorded at `0a72e6f1`: **13 of 32 checks pass.** The 13 are the 11 guards plus two diagnostic
+cases (e02, f01). Every `fix` and `design` case fails, and so does the chimera.
+
+## Run
+
+```sh
+dotnet build Aetheris.CLI -c Release
+python fixtures/Regression/FrontendX4/run.py # everything
+python fixtures/Regression/FrontendX4/run.py --only a03,c03,chimera
+```
+
+Each case goes through both `validate --json` and `build`.
+
+- **Expected `valid`:** both commands must succeed, and `inspect` + `verify` must match the
+ reference built by the same CLI. That means equal face, edge and vertex counts, surface
+ families, structural assessment and bounding box, and volume within 1e-9 relative. The case
+ must also match the geometry recorded in `expected.json`.
+- **Expected `invalid`:** both commands must fail, and the named `code` must be reported at the
+ named source `line`.
+
+## Rules for whoever fixes these
+
+1. **Don't edit a case or the chimera to make it pass.** Fix the frontend. The exception is a
+ case marked `design`: its syntax depends on a register decision. If you decide a different
+ spelling, record the decision in the register and change the case, its reference and the
+ chimera line in the same commit.
+2. **Guards must keep passing**, with identical geometry. They cover today's admitted spellings
+ of the same constructs.
+3. **`--record` rewrites the recorded geometry.** Use it only when a geometry change is intended
+ and explained in the commit, as the M4 report did for its hash changes.
+4. **No new kernel capability is in scope.** Fillet plus Hole stays rejected (#24). Only its
+ diagnostic moves.
+
+## The chimera
+
+`chimera.firmament` is one ordinary part: a 70 × 60 × 6 mm NEMA17 motor mount with an octagonal
+outline, a through cable slot, a 22 mm pilot, four M3 motor holes, four M5 frame holes and a
+0.5 mm top chamfer. It is written the way the docs say an author should be able to write it.
+Every construct that does not build today is tagged `[Xn #k / Fm]` in the file.
+
+`chimera.baseline.firmament` is the same part in syntax that builds today. The chimera is done
+when it validates, builds, and matches the baseline:
+- 98 faces, 240 edges, 144 vertices;
+- bounding box [-35,-30,0]–[35,30,6];
+- volume 20769.2350 mm³.
+
+That volume agrees with the analytic value to 0.014%: the prism is 20797.46 mm³, and the chamfer
+removes about 31 mm³.
+
+| Chimera construct | Case |
+|---|---|
+| `Point2(Pitch / 2, …)` in a `Set` | a03 |
+| `[x, y]` Set entries | c06 |
+| `On: Top` in a Feature hole | c05 |
+| `Static Thickness` in Model, consumed by `To:` | a05 |
+| `Polygon2 { Points: [...] }` with arithmetic | f02, f04 |
+| `Pocket … End: ThroughAll` | e01 |
+| `On: face(+Z)`, `Center: [0mm, 0mm]` | c03, c04 |
+| `EdgeFinish<Chamfer>` | d01 |
+| Model-scope `Pattern … Over` | b01, b04 |
+
+## Cases
+
+| Id | Kind | Register | Finding | Today | Required |
+|---|---|---|---|---|---|
+| a01 | design | X2 #19 | F1 | `Unknown statement 'let'` (3,3) | `let` (or the decided keyword) in Model |
+| a03 | fix | X2 #9 | F18 | `static-set-entry-type-mismatch` | Static arithmetic in Set entries |
+| a05 | fix | X2 #9/#19 | F1 | `static-scalar-consumer-unsupported` | Model Static consumed by a Compose interval |
+| a06 | fix | X2 #9 | — | the same error, with the Static **unused** | An unused declaration can't have an unsupported consumer |
+| b01 | fix | X3 #12/#15 | F15 | `Unknown statement 'Hole'` at the Model line | Documented Model-scope Pattern with a Feature |
+| b04 | fix | X3 #12 | F15 | same | Model-scope Pattern beside a Modify |
+| c03 | fix | X2 #21 | F19 | `face(+Z)` and `Body.Top` switch to the Concept route; `Top` is refused as "only +Z" | All four planar-face spellings |
+| c04 | fix | X3 #10 | F23 | `canonical-point2-invalid` | `Center: [x, y]` in Modify |
+| c05 | fix | X2 #21 | F19 | "only +Z" for `On: Top` | `Top` in a Feature hole |
+| c06 | fix | X3 #10 | F23 | `static-set-entry-type-mismatch` | `[x, y]` entries in `Set<Point2>` |
+| d01 | fix | X3 #11 | F22 | `SemanticSourceNotFound` at (1,1), no message | `EdgeFinish<Chamfer>`, keeping `Kind:` as an alias |
+| d05 | diagnostic | #24 | F5 | `CombinedFeatureSelectionLost` at (1,1) | Same code, at the EdgeFinish line (6) |
+| e01 | fix | X3 #13 | F21 | `pocket-missing-required-field` | `Pocket … End: ThroughAll` = `Remove … Role: ThroughCut` |
+| e02 | diagnostic | X3 #13 | F21 | correct at (6,5) | Keep it |
+| f01 | diagnostic | X0 #5 | F9 | correct code at line 9, after `ConceptPathProfileNotAdmittedByCompose` noise | Keep it; drop the noise |
+| f02 | design | X3 #20 | F11 | `polygon2-variant-unsupported` | Inline `Points` list |
+| f03 | diagnostic | X3 #20 | F11 | `ConceptPathProfileNotAdmittedByCompose` (1,1) | Endpoint diagnostic at the first Segment (5), or admit and add a reference |
+| f04 | design | X3 #20 + X2 #9 | F11 F18 | `polygon2-variant-unsupported` | Inline `Points` with arithmetic |
+| g01 | design | X3 #20 | F13 | `polygon2-variant-unsupported` | Revolve a `Polygon2` point list |
+| h02 | fix | X3 #12/#15 | F15 | `Unknown statement 'Pattern'` (19,3) | The syntax.md Feature + Pattern grid, as taught |
+
+**Guards** (must stay as they are):
+- a02, a04: Model Static, Box arithmetic;
+- b02, b03: Pattern in Modify, under Model and Struct roots;
+- c01, c02: `+Z` under both roots;
+- d02–d04: the three admitted EdgeFinish spellings;
+- h00, h01: the Concept Grid pattern under both roots. Wrapping it in Model was F16; it is fixed
+ now.
+
+## Observations outside the frontend
+
+- **The chimera's chamfer splits every through-feature wall at the chamfer plane.** Without the
+ chamfer the part has 50 faces and 11 cylindrical surfaces. With it, it has 98 faces and 22
+ cylindrical surfaces (76 cylindrical faces in `inspect`). The geometry is exact; the topology is
+ heavier than it needs to be. This is not part of acceptance.
+- **Binding-level diagnostics still default to (1,1) or the Model header** (a05, a06, c03, c04,
+ d01, d05, e01, f02). Syntax-level ones already carry exact spans.
diff --git a/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament b/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament
new file mode 100644
index 00000000..7d85859d
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a01-let-in-model.firmament
@@ -0,0 +1,5 @@
+Model LetPlate {
+ Units: mm
+ let thickness = 6mm
+ Box Body { Size: [60mm, 40mm, thickness] }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/a02-static-in-model.firmament b/fixtures/Regression/FrontendX4/cases/a02-static-in-model.firmament
new file mode 100644
index 00000000..ff411e58
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a02-static-in-model.firmament
@@ -0,0 +1,5 @@
+Model StaticPlate {
+ Units: mm
+ Static Thickness: Length = 6mm
+ Box Body { Size: [60mm, 40mm, Thickness] }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/a03-set-entry-arithmetic.firmament b/fixtures/Regression/FrontendX4/cases/a03-set-entry-arithmetic.firmament
new file mode 100644
index 00000000..50f2e938
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a03-set-entry-arithmetic.firmament
@@ -0,0 +1,15 @@
+Static Pitch: Length = 31mm
+Static Bolts: Set<Point2> {
+ ne => Point2(Pitch / 2, Pitch / 2)
+ sw => Point2(-Pitch / 2, -Pitch / 2)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 3.4mm; End: ThroughAll }
+}
+Model SetArithmetic {
+ Units: mm
+ Box Body { Size: [42mm, 42mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/a04-box-size-arithmetic.firmament b/fixtures/Regression/FrontendX4/cases/a04-box-size-arithmetic.firmament
new file mode 100644
index 00000000..2c87ec87
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a04-box-size-arithmetic.firmament
@@ -0,0 +1,4 @@
+Model BoxArithmetic {
+ Units: mm
+ Box Body { Size: [20mm * 3, 40mm, 2mm + 4mm] }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/a05-static-in-compose-interval.firmament b/fixtures/Regression/FrontendX4/cases/a05-static-in-compose-interval.firmament
new file mode 100644
index 00000000..0d61a72e
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a05-static-in-compose-interval.firmament
@@ -0,0 +1,9 @@
+Model StaticInterval {
+ Units: mm
+ Static Thickness: Length = 6mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: Thickness; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/a06-unused-static-with-compose.firmament b/fixtures/Regression/FrontendX4/cases/a06-unused-static-with-compose.firmament
new file mode 100644
index 00000000..544cce63
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/a06-unused-static-with-compose.firmament
@@ -0,0 +1,9 @@
+Model StaticUnused {
+ Units: mm
+ Static Thickness: Length = 6mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 6mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/b01-pattern-model-scope.firmament b/fixtures/Regression/FrontendX4/cases/b01-pattern-model-scope.firmament
new file mode 100644
index 00000000..f68e7f3f
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/b01-pattern-model-scope.firmament
@@ -0,0 +1,12 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model PatternAtModel {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/b02-pattern-in-modify.firmament b/fixtures/Regression/FrontendX4/cases/b02-pattern-in-modify.firmament
new file mode 100644
index 00000000..3f6f72ff
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/b02-pattern-in-modify.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model PatternInModify {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/b03-pattern-in-modify-struct-root.firmament b/fixtures/Regression/FrontendX4/cases/b03-pattern-in-modify-struct-root.firmament
new file mode 100644
index 00000000..99f926b4
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/b03-pattern-in-modify-struct-root.firmament
@@ -0,0 +1,13 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Struct PatternInModify {
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/b04-pattern-model-scope-with-modify.firmament b/fixtures/Regression/FrontendX4/cases/b04-pattern-model-scope-with-modify.firmament
new file mode 100644
index 00000000..49f18deb
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/b04-pattern-model-scope-with-modify.firmament
@@ -0,0 +1,15 @@
+Static FrameHoles: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature M5Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 5.5mm; End: ThroughAll }
+}
+Model PatternBesideModify {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> Pilot { On: +Z; Center: Point2(0mm, 0mm); Diameter: 8mm; End: ThroughAll }
+ }
+ Pattern Frame Over FrameHoles { p => M5Clearance(center: p) }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c01-hole-on-plusz-struct-root.firmament b/fixtures/Regression/FrontendX4/cases/c01-hole-on-plusz-struct-root.firmament
new file mode 100644
index 00000000..44246b13
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c01-hole-on-plusz-struct-root.firmament
@@ -0,0 +1,6 @@
+Struct Plate {
+ Box Body { Size: [40mm, 40mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> Bore { On: +Z; Center: Point2(0mm, 0mm); Diameter: 10mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c02-hole-on-plusz-model-root.firmament b/fixtures/Regression/FrontendX4/cases/c02-hole-on-plusz-model-root.firmament
new file mode 100644
index 00000000..fad4fa94
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c02-hole-on-plusz-model-root.firmament
@@ -0,0 +1,7 @@
+Model Plate {
+ Units: mm
+ Box Body { Size: [40mm, 40mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> Bore { On: +Z; Center: Point2(0mm, 0mm); Diameter: 10mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c03-face-reference-spellings.firmament b/fixtures/Regression/FrontendX4/cases/c03-face-reference-spellings.firmament
new file mode 100644
index 00000000..14afbded
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c03-face-reference-spellings.firmament
@@ -0,0 +1,10 @@
+Model FaceRefs {
+ Units: mm
+ Box Body { Size: [80mm, 20mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> A { On: +Z; Center: Point2(-30mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> B { On: face(+Z); Center: Point2(-10mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> C { On: Body.Top; Center: Point2(10mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> D { On: Top; Center: Point2(30mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c04-point-literal-spellings.firmament b/fixtures/Regression/FrontendX4/cases/c04-point-literal-spellings.firmament
new file mode 100644
index 00000000..db9c66de
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c04-point-literal-spellings.firmament
@@ -0,0 +1,8 @@
+Model PointLiterals {
+ Units: mm
+ Box Body { Size: [60mm, 20mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> A { On: +Z; Center: Point2(-15mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> B { On: +Z; Center: [15mm, 0mm]; Diameter: 4mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c05-feature-hole-on-top.firmament b/fixtures/Regression/FrontendX4/cases/c05-feature-hole-on-top.firmament
new file mode 100644
index 00000000..f352845a
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c05-feature-hole-on-top.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: Top; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model FeatureOnTop {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/c06-set-array-literal-entries.firmament b/fixtures/Regression/FrontendX4/cases/c06-set-array-literal-entries.firmament
new file mode 100644
index 00000000..e26dfbec
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/c06-set-array-literal-entries.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => [-20mm, 0mm]
+ b => [20mm, 0mm]
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model ArrayEntries {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/d01-edgefinish-generic-variant.firmament b/fixtures/Regression/FrontendX4/cases/d01-edgefinish-generic-variant.firmament
new file mode 100644
index 00000000..9da2578a
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/d01-edgefinish-generic-variant.firmament
@@ -0,0 +1,11 @@
+Model GenericChamfer {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 10mm; Role: Stock }
+ }
+ Modify Body {
+ EdgeFinish<Chamfer> TopEdge { Target: Stock.Outer; On: Top; Distance: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/d02-edgefinish-kind-field.firmament b/fixtures/Regression/FrontendX4/cases/d02-edgefinish-kind-field.firmament
new file mode 100644
index 00000000..9df346f2
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/d02-edgefinish-kind-field.firmament
@@ -0,0 +1,11 @@
+Model GenericChamfer {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 10mm; Role: Stock }
+ }
+ Modify Body {
+ EdgeFinish TopEdge { Target: Stock.Outer; On: Top; Kind: Chamfer; Distance: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/d03-edgefinish-primitive-selector.firmament b/fixtures/Regression/FrontendX4/cases/d03-edgefinish-primitive-selector.firmament
new file mode 100644
index 00000000..3d7b00f0
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/d03-edgefinish-primitive-selector.firmament
@@ -0,0 +1,7 @@
+Model PrimitiveChamfer {
+ Units: mm
+ Box Body { Size: [60mm, 40mm, 10mm] }
+ Modify Body {
+ EdgeFinish TopEdge { Face: +Z; Target: Boundary; Kind: Chamfer; Distance: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/d04-edgefinish-lowercase-fields.firmament b/fixtures/Regression/FrontendX4/cases/d04-edgefinish-lowercase-fields.firmament
new file mode 100644
index 00000000..68c926d8
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/d04-edgefinish-lowercase-fields.firmament
@@ -0,0 +1,7 @@
+Model LowercaseChamfer {
+ Units: mm
+ Box Body { Size: [60mm, 40mm, 10mm] }
+ Modify Body {
+ EdgeFinish TopEdge { face: +Z; target: Boundary; kind: Chamfer; distance: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament b/fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament
new file mode 100644
index 00000000..d4a4c55f
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/d05-fillet-with-hole.firmament
@@ -0,0 +1,8 @@
+Model FilletAndHole {
+ Units: mm
+ Box Body { Size: [60mm, 40mm, 10mm] }
+ Modify Body {
+ Hole<Shaft> Bore { On: +Z; Center: Point2(0mm, 0mm); Diameter: 8mm; End: ThroughAll }
+ EdgeFinish TopEdge { Face: +Z; Target: Boundary; Kind: Fillet; Radius: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/e01-pocket-through.firmament b/fixtures/Regression/FrontendX4/cases/e01-pocket-through.firmament
new file mode 100644
index 00000000..fd252ace
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/e01-pocket-through.firmament
@@ -0,0 +1,11 @@
+Model ThroughPocket {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [80mm,40mm] }
+ Slot2 Groove { Center: [0mm,0mm] Length: 50mm Width: 8mm }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Profile GrooveProfile { Loop Outer { Groove |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 12mm; Role: Stock }
+ Pocket Slot { On: Top; Profile: GrooveProfile; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/e02-cut-in-modify.firmament b/fixtures/Regression/FrontendX4/cases/e02-cut-in-modify.firmament
new file mode 100644
index 00000000..c9853d42
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/e02-cut-in-modify.firmament
@@ -0,0 +1,8 @@
+Model CutInModify {
+ Units: mm
+ Box Body { Size: [80mm, 40mm, 12mm] }
+ Slot2 Groove { Center: [0mm, 0mm]; Length: 50mm; Width: 8mm }
+ Modify Body {
+ Cut Groove { Profile: Groove; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/f01-xz-layout.firmament b/fixtures/Regression/FrontendX4/cases/f01-xz-layout.firmament
new file mode 100644
index 00000000..4edb0a02
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/f01-xz-layout.firmament
@@ -0,0 +1,17 @@
+Static Corners: Set<Point2> {
+ Heel => Point2(0mm, 0mm)
+ Toe => Point2(60mm, 0mm)
+ Lip => Point2(60mm, 5mm)
+ Inner => Point2(5mm, 5mm)
+ Top => Point2(5mm, 40mm)
+ Back => Point2(0mm, 40mm)
+}
+Concept Struct Layout On XZ {
+ Polygon2<Explicit> Outline { Vertices: Corners }
+}
+Profile Section Using Layout { Loop Outer { Outline |> TraceLoop } }
+Struct Bracket {
+ Compose Body {
+ Base Stock { Profile: Section; From: 0mm; To: 30mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/f02-inline-polygon.firmament b/fixtures/Regression/FrontendX4/cases/f02-inline-polygon.firmament
new file mode 100644
index 00000000..1b346f97
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/f02-inline-polygon.firmament
@@ -0,0 +1,8 @@
+Model InlinePolygon {
+ Units: mm
+ Polygon2 Outline { Points: [[0mm,0mm], [60mm,0mm], [60mm,5mm], [5mm,5mm], [5mm,40mm], [0mm,40mm]] }
+ Profile Section { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Stock { Profile: Section; From: 0mm; To: 30mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/f03-segment-inline-coordinates.firmament b/fixtures/Regression/FrontendX4/cases/f03-segment-inline-coordinates.firmament
new file mode 100644
index 00000000..c41e20e7
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/f03-segment-inline-coordinates.firmament
@@ -0,0 +1,14 @@
+Model InlineSegments {
+ Units: mm
+ Profile Section {
+ Loop Outer {
+ Segment A { From: [0mm,0mm]; To: [40mm,0mm] }
+ Segment B { From: [40mm,0mm]; To: [40mm,20mm] }
+ Segment C { From: [40mm,20mm]; To: [0mm,20mm] }
+ Segment D { From: [0mm,20mm]; To: [0mm,0mm] }
+ }
+ }
+ Compose Body {
+ Base Stock { Profile: Section; From: 0mm; To: 5mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/f04-inline-polygon-arithmetic.firmament b/fixtures/Regression/FrontendX4/cases/f04-inline-polygon-arithmetic.firmament
new file mode 100644
index 00000000..9268ebe4
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/f04-inline-polygon-arithmetic.firmament
@@ -0,0 +1,12 @@
+Static Chamfer: Length = 5mm
+Model InlinePolygonArithmetic {
+ Units: mm
+ Polygon2 Outline {
+ Points: [[-35mm + Chamfer, -30mm], [35mm - Chamfer, -30mm], [35mm, -30mm + Chamfer], [35mm, 30mm],
+ [-35mm, 30mm], [-35mm, -30mm + Chamfer]]
+ }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Plate { Profile: Stock; From: 0mm; To: 6mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/g01-revolve-point-list.firmament b/fixtures/Regression/FrontendX4/cases/g01-revolve-point-list.firmament
new file mode 100644
index 00000000..ffa9227c
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/g01-revolve-point-list.firmament
@@ -0,0 +1,8 @@
+schema Mechanical
+
+Model Sleeve {
+ Units: mm
+ Axis MainAxis { Origin: [0mm, 0mm, 0mm]; Direction: [0, 1, 0] }
+ Polygon2 Section { Points: [[5mm, 0mm], [10mm, 0mm], [10mm, 20mm], [5mm, 20mm]] }
+ Revolve Body { Profile: Section; About: MainAxis; Angle: full }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/h00-concept-grid-struct-root.firmament b/fixtures/Regression/FrontendX4/cases/h00-concept-grid-struct-root.firmament
new file mode 100644
index 00000000..e34ce18e
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/h00-concept-grid-struct-root.firmament
@@ -0,0 +1,13 @@
+Struct GridPlate {
+ Concept Struct Design {
+ Bounds: Box3 { Size: [60mm, 40mm, 10mm] }
+ Points: Grid { Within: Bounds.Face(+Z).Inset(8mm); Columns: 3; Rows: 2 }
+ }
+ Box Base { Bounds: Design.Bounds }
+ Modify Base {
+ Pattern Mounts {
+ Source: Design.Points
+ Hole<Shaft> Item { On: Base.Top; Center: Item; Diameter: 5mm; End: ThroughAll }
+ }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/h01-concept-grid-model-root.firmament b/fixtures/Regression/FrontendX4/cases/h01-concept-grid-model-root.firmament
new file mode 100644
index 00000000..4c3b1b2a
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/h01-concept-grid-model-root.firmament
@@ -0,0 +1,16 @@
+Model GridPlate {
+ Units: mm
+ Struct GridPlate {
+ Concept Struct Design {
+ Bounds: Box3 { Size: [60mm, 40mm, 10mm] }
+ Points: Grid { Within: Bounds.Face(+Z).Inset(8mm); Columns: 3; Rows: 2 }
+ }
+ Box Base { Bounds: Design.Bounds }
+ Modify Base {
+ Pattern Mounts {
+ Source: Design.Points
+ Hole<Shaft> Item { On: Base.Top; Center: Item; Diameter: 5mm; End: ThroughAll }
+ }
+ }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/h02-documented-feature-pattern.firmament b/fixtures/Regression/FrontendX4/cases/h02-documented-feature-pattern.firmament
new file mode 100644
index 00000000..501cd125
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/h02-documented-feature-pattern.firmament
@@ -0,0 +1,23 @@
+Model GridPlate {
+ Units: mm
+
+ Box Base { Size: [60mm, 40mm, 10mm] }
+
+ Concept Struct Design {
+ Bounds: Box3 { Size: [60mm, 40mm, 10mm] }
+ Points: Grid {
+ Within: Bounds.Face(+Z).Inset(8mm)
+ Columns: 3
+ Rows: 2
+ }
+ }
+
+ Feature MountHole(Center: Point3, Diameter: Length = 5mm) -> Hole<Shaft> {
+ return Hole<Shaft> { On: Base.Top; Center: Center; Diameter: Diameter; End: ThroughAll }
+ }
+
+ Pattern Mounts {
+ Source: Design.Points
+ MountHole(Center: Item)
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/a01-let-in-model.firmament b/fixtures/Regression/FrontendX4/cases/reference/a01-let-in-model.firmament
new file mode 100644
index 00000000..18f2d4b5
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/a01-let-in-model.firmament
@@ -0,0 +1,4 @@
+Model LetPlate {
+ Units: mm
+ Box Body { Size: [60mm, 40mm, 6mm] }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/a03-set-entry-arithmetic.firmament b/fixtures/Regression/FrontendX4/cases/reference/a03-set-entry-arithmetic.firmament
new file mode 100644
index 00000000..8652437d
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/a03-set-entry-arithmetic.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ ne => Point2(15.5mm, 15.5mm)
+ sw => Point2(-15.5mm, -15.5mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 3.4mm; End: ThroughAll }
+}
+Model SetArithmetic {
+ Units: mm
+ Box Body { Size: [42mm, 42mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/a05-static-in-compose-interval.firmament b/fixtures/Regression/FrontendX4/cases/reference/a05-static-in-compose-interval.firmament
new file mode 100644
index 00000000..01a2b64c
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/a05-static-in-compose-interval.firmament
@@ -0,0 +1,8 @@
+Model StaticInterval {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 6mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/a06-unused-static-with-compose.firmament b/fixtures/Regression/FrontendX4/cases/reference/a06-unused-static-with-compose.firmament
new file mode 100644
index 00000000..d9e02299
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/a06-unused-static-with-compose.firmament
@@ -0,0 +1,8 @@
+Model StaticUnused {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 6mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/b01-pattern-model-scope.firmament b/fixtures/Regression/FrontendX4/cases/reference/b01-pattern-model-scope.firmament
new file mode 100644
index 00000000..3f6f72ff
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/b01-pattern-model-scope.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model PatternInModify {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/b04-pattern-model-scope-with-modify.firmament b/fixtures/Regression/FrontendX4/cases/reference/b04-pattern-model-scope-with-modify.firmament
new file mode 100644
index 00000000..b01e065f
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/b04-pattern-model-scope-with-modify.firmament
@@ -0,0 +1,15 @@
+Static FrameHoles: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature M5Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 5.5mm; End: ThroughAll }
+}
+Model PatternBesideModify {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> Pilot { On: +Z; Center: Point2(0mm, 0mm); Diameter: 8mm; End: ThroughAll }
+ Pattern Frame Over FrameHoles { p => M5Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/c03-face-reference-spellings.firmament b/fixtures/Regression/FrontendX4/cases/reference/c03-face-reference-spellings.firmament
new file mode 100644
index 00000000..44974fcd
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/c03-face-reference-spellings.firmament
@@ -0,0 +1,10 @@
+Model FaceRefs {
+ Units: mm
+ Box Body { Size: [80mm, 20mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> A { On: +Z; Center: Point2(-30mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> B { On: +Z; Center: Point2(-10mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> C { On: +Z; Center: Point2(10mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> D { On: +Z; Center: Point2(30mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/c04-point-literal-spellings.firmament b/fixtures/Regression/FrontendX4/cases/reference/c04-point-literal-spellings.firmament
new file mode 100644
index 00000000..e2908584
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/c04-point-literal-spellings.firmament
@@ -0,0 +1,8 @@
+Model PointLiterals {
+ Units: mm
+ Box Body { Size: [60mm, 20mm, 5mm] }
+ Modify Body {
+ Hole<Shaft> A { On: +Z; Center: Point2(-15mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ Hole<Shaft> B { On: +Z; Center: Point2(15mm, 0mm); Diameter: 4mm; End: ThroughAll }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/c05-feature-hole-on-top.firmament b/fixtures/Regression/FrontendX4/cases/reference/c05-feature-hole-on-top.firmament
new file mode 100644
index 00000000..6b0647ea
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/c05-feature-hole-on-top.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model FeatureOnTop {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/c06-set-array-literal-entries.firmament b/fixtures/Regression/FrontendX4/cases/reference/c06-set-array-literal-entries.firmament
new file mode 100644
index 00000000..c0fef528
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/c06-set-array-literal-entries.firmament
@@ -0,0 +1,14 @@
+Static Bolts: Set<Point2> {
+ a => Point2(-20mm, 0mm)
+ b => Point2(20mm, 0mm)
+}
+Feature Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 4mm; End: ThroughAll }
+}
+Model ArrayEntries {
+ Units: mm
+ Box Body { Size: [60mm, 30mm, 5mm] }
+ Modify Body {
+ Pattern Holes Over Bolts { p => Clearance(center: p) }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/d01-edgefinish-generic-variant.firmament b/fixtures/Regression/FrontendX4/cases/reference/d01-edgefinish-generic-variant.firmament
new file mode 100644
index 00000000..9df346f2
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/d01-edgefinish-generic-variant.firmament
@@ -0,0 +1,11 @@
+Model GenericChamfer {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [60mm,40mm] }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 10mm; Role: Stock }
+ }
+ Modify Body {
+ EdgeFinish TopEdge { Target: Stock.Outer; On: Top; Kind: Chamfer; Distance: 1mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/e01-pocket-through.firmament b/fixtures/Regression/FrontendX4/cases/reference/e01-pocket-through.firmament
new file mode 100644
index 00000000..95cf02ed
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/e01-pocket-through.firmament
@@ -0,0 +1,11 @@
+Model ThroughPocket {
+ Units: mm
+ Rect2 Outline { Center: [0mm,0mm] Size: [80mm,40mm] }
+ Slot2 Groove { Center: [0mm,0mm] Length: 50mm Width: 8mm }
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Profile GrooveProfile { Loop Outer { Groove |> TraceLoop } }
+ Compose Body {
+ Base Block { Profile: Stock; From: 0mm; To: 12mm; Role: Stock }
+ Remove Slot { Profile: GrooveProfile; From: 0mm; To: 12mm; Role: ThroughCut }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/f02-inline-polygon.firmament b/fixtures/Regression/FrontendX4/cases/reference/f02-inline-polygon.firmament
new file mode 100644
index 00000000..1f6649c5
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/f02-inline-polygon.firmament
@@ -0,0 +1,18 @@
+Static OutlineVertices: Set<Point2> {
+ V0 => Point2(0mm, 0mm)
+ V1 => Point2(60mm, 0mm)
+ V2 => Point2(60mm, 5mm)
+ V3 => Point2(5mm, 5mm)
+ V4 => Point2(5mm, 40mm)
+ V5 => Point2(0mm, 40mm)
+}
+Model InlinePolygon {
+ Units: mm
+ Concept Struct Layout On XY {
+ Polygon2<Explicit> Outline { Vertices: OutlineVertices }
+ }
+ Profile Section Using Layout { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Stock { Profile: Section; From: 0mm; To: 30mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/f04-inline-polygon-arithmetic.firmament b/fixtures/Regression/FrontendX4/cases/reference/f04-inline-polygon-arithmetic.firmament
new file mode 100644
index 00000000..2adef37e
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/f04-inline-polygon-arithmetic.firmament
@@ -0,0 +1,18 @@
+Static OutlineVertices: Set<Point2> {
+ V0 => Point2(-30mm, -30mm)
+ V1 => Point2(30mm, -30mm)
+ V2 => Point2(35mm, -25mm)
+ V3 => Point2(35mm, 30mm)
+ V4 => Point2(-35mm, 30mm)
+ V5 => Point2(-35mm, -25mm)
+}
+Model InlinePolygonArithmetic {
+ Units: mm
+ Concept Struct Layout On XY {
+ Polygon2<Explicit> Outline { Vertices: OutlineVertices }
+ }
+ Profile Section Using Layout { Loop Outer { Outline |> TraceLoop } }
+ Compose Body {
+ Base Stock { Profile: Section; From: 0mm; To: 6mm; Role: Stock }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/g01-revolve-point-list.firmament b/fixtures/Regression/FrontendX4/cases/reference/g01-revolve-point-list.firmament
new file mode 100644
index 00000000..de8e74d1
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/g01-revolve-point-list.firmament
@@ -0,0 +1,16 @@
+schema Mechanical
+
+Model Sleeve {
+ Units: mm
+ Axis MainAxis { Origin: [0mm, 0mm, 0mm]; Direction: [0, 1, 0] }
+ Point2 a { Position: [5mm, 0mm] }
+ Point2 b { Position: [10mm, 0mm] }
+ Point2 c { Position: [10mm, 20mm] }
+ Point2 d { Position: [5mm, 20mm] }
+ Line2 bottom { From: a; To: b }
+ Line2 outer { From: b; To: c }
+ Line2 top { From: c; To: d }
+ Line2 bore { From: d; To: a }
+ Profile Section { bottom |> outer |> top |> bore |> Close }
+ Revolve Body { Profile: Section; About: MainAxis; Angle: full }
+}
diff --git a/fixtures/Regression/FrontendX4/cases/reference/h02-documented-feature-pattern.firmament b/fixtures/Regression/FrontendX4/cases/reference/h02-documented-feature-pattern.firmament
new file mode 100644
index 00000000..4c3b1b2a
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/cases/reference/h02-documented-feature-pattern.firmament
@@ -0,0 +1,16 @@
+Model GridPlate {
+ Units: mm
+ Struct GridPlate {
+ Concept Struct Design {
+ Bounds: Box3 { Size: [60mm, 40mm, 10mm] }
+ Points: Grid { Within: Bounds.Face(+Z).Inset(8mm); Columns: 3; Rows: 2 }
+ }
+ Box Base { Bounds: Design.Bounds }
+ Modify Base {
+ Pattern Mounts {
+ Source: Design.Points
+ Hole<Shaft> Item { On: Base.Top; Center: Item; Diameter: 5mm; End: ThroughAll }
+ }
+ }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/chimera.baseline.firmament b/fixtures/Regression/FrontendX4/chimera.baseline.firmament
new file mode 100644
index 00000000..6b036c3b
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/chimera.baseline.firmament
@@ -0,0 +1,58 @@
+// Reference spelling of chimera.firmament using only syntax admitted at 0a72e6f.
+// It must keep building; chimera.firmament must produce the same geometry.
+Static OutlineVertices: Set<Point2> {
+ SW => Point2(-30mm, -30mm)
+ SSE => Point2(30mm, -30mm)
+ ESE => Point2(35mm, -25mm)
+ ENE => Point2(35mm, 25mm)
+ NNE => Point2(30mm, 30mm)
+ NNW => Point2(-30mm, 30mm)
+ WNW => Point2(-35mm, 25mm)
+ WSW => Point2(-35mm, -25mm)
+}
+
+Static MotorBolts: Set<Point2> {
+ NE => Point2(15.5mm, 15.5mm)
+ NW => Point2(-15.5mm, 15.5mm)
+ SW => Point2(-15.5mm, -15.5mm)
+ SE => Point2(15.5mm, -15.5mm)
+}
+
+Static FrameHoles: Set<Point2> {
+ NE => Point2(28mm, 23mm)
+ NW => Point2(-28mm, 23mm)
+ SW => Point2(-28mm, -23mm)
+ SE => Point2(28mm, -23mm)
+}
+
+Feature M3Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 3.4mm; End: ThroughAll }
+}
+
+Feature M5Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 5.5mm; End: ThroughAll }
+}
+
+Model MotorMount {
+ Units: mm
+
+ Concept Struct Layout On XY {
+ Polygon2<Explicit> Outline { Vertices: OutlineVertices }
+ Slot2 CableSlot { Center: [0mm, -22mm]; Length: 30mm; Width: 6mm }
+ }
+
+ Profile Stock Using Layout { Loop Outer { Outline |> TraceLoop } }
+ Profile SlotProfile Using Layout { Loop Outer { CableSlot |> TraceLoop } }
+
+ Compose Body {
+ Base Plate { Profile: Stock; From: 0mm; To: 6mm; Role: Stock }
+ Remove Cable { Profile: SlotProfile; From: 0mm; To: 6mm; Role: ThroughCut }
+ }
+
+ Modify Body {
+ Hole<Shaft> Pilot { On: +Z; Center: Point2(0mm, 0mm); Diameter: 22mm; End: ThroughAll }
+ Pattern Motor Over MotorBolts { p => M3Clearance(center: p) }
+ Pattern Frame Over FrameHoles { p => M5Clearance(center: p) }
+ EdgeFinish TopBreak { Target: Stock.Outer; On: Top; Kind: Chamfer; Distance: 0.5mm }
+ }
+}
diff --git a/fixtures/Regression/FrontendX4/chimera.firmament b/fixtures/Regression/FrontendX4/chimera.firmament
new file mode 100644
index 00000000..62f4a5ef
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/chimera.firmament
@@ -0,0 +1,77 @@
+// FrontendX4 chimera: NEMA17 motor mount, 70 x 60 x 6 mm.
+//
+// One ordinary part written the way the public docs (and the X0-X4 register)
+// say an author should be able to write it. Every [Xn #k / Fm] tag marks a
+// construct that does not build at 0a72e6f. Acceptance: this file validates,
+// builds, and produces the same geometry as chimera.baseline.firmament
+// (see expected.json). Do not edit this file to make it pass; fix the
+// frontend, or record an explicit language decision in
+// docs/development/FIRMAMENT-LANGUAGE-DECISIONS-2026-10.md and update the
+// tagged line together with that decision.
+
+Static Pitch: Length = 31mm
+Static Chamfer: Length = 5mm
+
+// [X2 #9 / F18] arithmetic on Statics inside collection entries.
+Static MotorBolts: Set<Point2> {
+ NE => Point2(Pitch / 2, Pitch / 2)
+ NW => Point2(-Pitch / 2, Pitch / 2)
+ SW => Point2(-Pitch / 2, -Pitch / 2)
+ SE => Point2(Pitch / 2, -Pitch / 2)
+}
+
+// [X3 #10 / F23] array point literals mean the same as Point2(...).
+Static FrameHoles: Set<Point2> {
+ NE => [28mm, 23mm]
+ NW => [-28mm, 23mm]
+ SW => [-28mm, -23mm]
+ SE => [28mm, -23mm]
+}
+
+// [X2 #21 / F19] `Top` is a planar-face reference like +Z.
+Feature M3Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: Top; Center: center; Diameter: 3.4mm; End: ThroughAll }
+}
+
+Feature M5Clearance(center: Point2) -> Hole<Shaft> {
+ return Hole<Shaft> { On: +Z; Center: center; Diameter: 5.5mm; End: ThroughAll }
+}
+
+Model MotorMount {
+ Units: mm
+
+ // [X2 #19 / F1] a scope-local named value, consumed by the Compose interval.
+ Static Thickness: Length = 6mm
+
+ // [X3 #20 / F11] inline vertices; [X2 #9] arithmetic inside the list.
+ Polygon2 Outline {
+ Points: [
+ [-35mm + Chamfer, -30mm], [35mm - Chamfer, -30mm], [35mm, -30mm + Chamfer],
+ [35mm, 30mm - Chamfer], [35mm - Chamfer, 30mm], [-35mm + Chamfer, 30mm],
+ [-35mm, 30mm - Chamfer], [-35mm, -30mm + Chamfer]
+ ]
+ }
+ Slot2 CableSlot { Center: [0mm, -22mm]; Length: 30mm; Width: 6mm }
+
+ Profile Stock { Loop Outer { Outline |> TraceLoop } }
+ Profile SlotProfile { Loop Outer { CableSlot |> TraceLoop } }
+
+ Compose Body {
+ Base Plate { Profile: Stock; From: 0mm; To: Thickness; Role: Stock }
+ // [X3 #13 / F21] a through Pocket uses Hole's termination vocabulary.
+ Pocket Cable { On: Top; Profile: SlotProfile; End: ThroughAll }
+ }
+
+ Modify Body {
+ // [X2 #21 / F19] face(+Z) must not switch the hole into another route;
+ // [X3 #10 / F23] array literal Center.
+ Hole<Shaft> Pilot { On: face(+Z); Center: [0mm, 0mm]; Diameter: 22mm; End: ThroughAll }
+ Pattern Motor Over MotorBolts { p => M3Clearance(center: p) }
+ // [X3 #11 / F22] generic EdgeFinish variant, Kind: kept as alias.
+ EdgeFinish<Chamfer> TopBreak { Target: Stock.Outer; On: Top; Distance: 0.5mm }
+ }
+
+ // [X3 #12, #15 / F15] the documented Model-scope Pattern form; its single
+ // body target is the Model's only body.
+ Pattern Frame Over FrameHoles { p => M5Clearance(center: p) }
+}
diff --git a/fixtures/Regression/FrontendX4/expected.json b/fixtures/Regression/FrontendX4/expected.json
new file mode 100644
index 00000000..21858ece
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/expected.json
@@ -0,0 +1,977 @@
+{
+ "description": "FrontendX4 authoring corpus. See README.md.",
+ "compilerRevision": "0a72e6f1",
+ "chimera": {
+ "file": "chimera.firmament",
+ "reference": "chimera.baseline.firmament",
+ "geometry": {
+ "faces": 98,
+ "edges": 240,
+ "vertices": 144,
+ "bbox": [
+ [
+ -35,
+ -30,
+ 0
+ ],
+ [
+ 35,
+ 30,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 22,
+ "cylinder": 76
+ },
+ "volume": 20769.234952815874
+ }
+ },
+ "cases": [
+ {
+ "id": "a01",
+ "file": "cases/a01-let-in-model.firmament",
+ "kind": "design",
+ "register": "X2 #19",
+ "findings": "F1",
+ "expect": "valid",
+ "observedAt0a72e6f": "Unknown statement 'let' (3,3)",
+ "note": "Scope-local named value in Model. Feature bodies already admit `let`; the spelling for Model scope is a register decision. If the decision is a different keyword, change this file and the chimera together with the decision.",
+ "reference": "cases/reference/a01-let-in-model.firmament",
+ "geometry": {
+ "faces": 6,
+ "edges": 12,
+ "vertices": 8,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6
+ },
+ "volume": 14400
+ }
+ },
+ {
+ "id": "a02",
+ "file": "cases/a02-static-in-model.firmament",
+ "kind": "guard",
+ "register": "X2 #19",
+ "findings": "F1",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Static scalar in Model consumed by a primitive field. Must keep working.",
+ "geometry": {
+ "faces": 6,
+ "edges": 12,
+ "vertices": 8,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6
+ },
+ "volume": 14400
+ }
+ },
+ {
+ "id": "a03",
+ "file": "cases/a03-set-entry-arithmetic.firmament",
+ "kind": "fix",
+ "register": "X2 #9",
+ "findings": "F18",
+ "expect": "valid",
+ "observedAt0a72e6f": "static-set-entry-type-mismatch:Bolts:ne:expected-Point2",
+ "note": "Arithmetic on Statics inside Set<Point2> entries. The shared numeric evaluator already serves fields and Feature arguments.",
+ "reference": "cases/reference/a03-set-entry-arithmetic.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -21,
+ -21,
+ 0
+ ],
+ [
+ 21,
+ 21,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8730.241555158445
+ }
+ },
+ {
+ "id": "a04",
+ "file": "cases/a04-box-size-arithmetic.firmament",
+ "kind": "guard",
+ "register": "X2 #9",
+ "findings": "",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Arithmetic in Box Size. Must keep working.",
+ "geometry": {
+ "faces": 6,
+ "edges": 12,
+ "vertices": 8,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6
+ },
+ "volume": 14400
+ }
+ },
+ {
+ "id": "a05",
+ "file": "cases/a05-static-in-compose-interval.firmament",
+ "kind": "fix",
+ "register": "X2 #9 / #19",
+ "findings": "F1",
+ "expect": "valid",
+ "observedAt0a72e6f": "static-scalar-consumer-unsupported: Model Static scalars currently bind direct primitive and Modify fields",
+ "note": "A Model Static consumed by a Compose interval (To:).",
+ "reference": "cases/reference/a05-static-in-compose-interval.firmament",
+ "geometry": {
+ "faces": 6,
+ "edges": 12,
+ "vertices": 8,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6
+ },
+ "volume": 14400
+ }
+ },
+ {
+ "id": "a06",
+ "file": "cases/a06-unused-static-with-compose.firmament",
+ "kind": "fix",
+ "register": "X2 #9",
+ "findings": "",
+ "expect": "valid",
+ "observedAt0a72e6f": "parse-failed + static-scalar-consumer-unsupported",
+ "note": "An UNUSED Model Static fails a Compose model. A declaration nobody consumes cannot have an unsupported consumer.",
+ "reference": "cases/reference/a06-unused-static-with-compose.firmament",
+ "geometry": {
+ "faces": 6,
+ "edges": 12,
+ "vertices": 8,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6
+ },
+ "volume": 14400
+ }
+ },
+ {
+ "id": "b01",
+ "file": "cases/b01-pattern-model-scope.firmament",
+ "kind": "fix",
+ "register": "X3 #12 / #15",
+ "findings": "F15",
+ "expect": "valid",
+ "observedAt0a72e6f": "Unknown statement 'Hole' at the Model line (8,1)",
+ "note": "Documented Model-scope `Pattern ... Over` with a Feature. The current message names a statement the author never wrote.",
+ "reference": "cases/reference/b01-pattern-model-scope.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8875.766858350791
+ }
+ },
+ {
+ "id": "b02",
+ "file": "cases/b02-pattern-in-modify.firmament",
+ "kind": "guard",
+ "register": "X3 #12",
+ "findings": "",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Pattern Over a Static Set inside Modify. Must keep working.",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8875.766858350791
+ }
+ },
+ {
+ "id": "b03",
+ "file": "cases/b03-pattern-in-modify-struct-root.firmament",
+ "kind": "guard",
+ "register": "X3 #14",
+ "findings": "F16",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Same as b02 under a bare Struct root. Must keep working.",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8875.766858350791
+ }
+ },
+ {
+ "id": "b04",
+ "file": "cases/b04-pattern-model-scope-with-modify.firmament",
+ "kind": "fix",
+ "register": "X3 #12",
+ "findings": "F15",
+ "expect": "valid",
+ "observedAt0a72e6f": "Unknown statement 'Hole' (8,1)",
+ "note": "Model-scope Pattern next to an existing Modify on the only body.",
+ "reference": "cases/reference/b04-pattern-model-scope-with-modify.firmament",
+ "geometry": {
+ "faces": 9,
+ "edges": 21,
+ "vertices": 20,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 3
+ },
+ "volume": 8516.655433271042
+ }
+ },
+ {
+ "id": "c01",
+ "file": "cases/c01-hole-on-plusz-struct-root.firmament",
+ "kind": "guard",
+ "register": "X2 #21",
+ "findings": "F19",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "On: +Z under a Struct root. Must keep working.",
+ "geometry": {
+ "faces": 7,
+ "edges": 15,
+ "vertices": 12,
+ "bbox": [
+ [
+ -20,
+ -20,
+ 0
+ ],
+ [
+ 20,
+ 20,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 1
+ },
+ "volume": 7611.771432346218
+ }
+ },
+ {
+ "id": "c02",
+ "file": "cases/c02-hole-on-plusz-model-root.firmament",
+ "kind": "guard",
+ "register": "X2 #21",
+ "findings": "F19",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "On: +Z under a Model root. Must keep working.",
+ "geometry": {
+ "faces": 7,
+ "edges": 15,
+ "vertices": 12,
+ "bbox": [
+ [
+ -20,
+ -20,
+ 0
+ ],
+ [
+ 20,
+ 20,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 1
+ },
+ "volume": 7611.771432346218
+ }
+ },
+ {
+ "id": "c03",
+ "file": "cases/c03-face-reference-spellings.firmament",
+ "kind": "fix",
+ "register": "X2 #21",
+ "findings": "F19",
+ "expect": "valid",
+ "observedAt0a72e6f": "face(+Z)/Body.Top: concept-invalid-spatial-derivation; Top: point-projection-unsupported:only-planar-+Z (1,1)",
+ "note": "+Z, face(+Z), Body.Top and Top on one Box. A face spelling must not switch the hole into the Concept route, and `Top` must not be refused as 'only +Z'.",
+ "reference": "cases/reference/c03-face-reference-spellings.firmament",
+ "geometry": {
+ "faces": 10,
+ "edges": 24,
+ "vertices": 24,
+ "bbox": [
+ [
+ -40,
+ -10,
+ 0
+ ],
+ [
+ 40,
+ 10,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 4
+ },
+ "volume": 7818.2003833682475
+ }
+ },
+ {
+ "id": "c04",
+ "file": "cases/c04-point-literal-spellings.firmament",
+ "kind": "fix",
+ "register": "X3 #10",
+ "findings": "F23",
+ "expect": "valid",
+ "observedAt0a72e6f": "canonical-point2-invalid (1,1)",
+ "note": "Center: [x, y] in Modify means Point2(x, y).",
+ "reference": "cases/reference/c04-point-literal-spellings.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -10,
+ 0
+ ],
+ [
+ 30,
+ 10,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 5875.766858350791
+ }
+ },
+ {
+ "id": "c05",
+ "file": "cases/c05-feature-hole-on-top.firmament",
+ "kind": "fix",
+ "register": "X2 #21",
+ "findings": "F19",
+ "expect": "valid",
+ "observedAt0a72e6f": "point-projection-unsupported:only-planar-+Z (8,1)",
+ "note": "Feature-returned Hole with On: Top.",
+ "reference": "cases/reference/c05-feature-hole-on-top.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8875.766858350791
+ }
+ },
+ {
+ "id": "c06",
+ "file": "cases/c06-set-array-literal-entries.firmament",
+ "kind": "fix",
+ "register": "X3 #10",
+ "findings": "F23",
+ "expect": "valid",
+ "observedAt0a72e6f": "static-set-entry-type-mismatch:expected-Point2",
+ "note": "Set<Point2> entries written as [x, y].",
+ "reference": "cases/reference/c06-set-array-literal-entries.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 16,
+ "bbox": [
+ [
+ -30,
+ -15,
+ 0
+ ],
+ [
+ 30,
+ 15,
+ 5
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 2
+ },
+ "volume": 8875.766858350791
+ }
+ },
+ {
+ "id": "d01",
+ "file": "cases/d01-edgefinish-generic-variant.firmament",
+ "kind": "fix",
+ "register": "X3 #11",
+ "findings": "F22",
+ "expect": "valid",
+ "observedAt0a72e6f": "SemanticSourceNotFound (1,1), message text dropped",
+ "note": "EdgeFinish<Chamfer>, with Kind: kept as an alias. If X3 rejects the generic form instead, it must be rejected at the EdgeFinish line with a sentence naming `Kind: Chamfer`, and this case changes with that decision.",
+ "reference": "cases/reference/d01-edgefinish-generic-variant.firmament",
+ "geometry": {
+ "faces": 10,
+ "edges": 20,
+ "vertices": 12,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 10
+ },
+ "volume": 23901.333333333332
+ }
+ },
+ {
+ "id": "d02",
+ "file": "cases/d02-edgefinish-kind-field.firmament",
+ "kind": "guard",
+ "register": "X3 #11",
+ "findings": "",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Kind: Chamfer on a Compose profile target. Must keep working.",
+ "geometry": {
+ "faces": 10,
+ "edges": 20,
+ "vertices": 12,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 10
+ },
+ "volume": 23901.333333333332
+ }
+ },
+ {
+ "id": "d03",
+ "file": "cases/d03-edgefinish-primitive-selector.firmament",
+ "kind": "guard",
+ "register": "X3 #11",
+ "findings": "F7",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Face: +Z; Target: Boundary on a Box. Must keep working.",
+ "geometry": {
+ "faces": 10,
+ "edges": 20,
+ "vertices": 12,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 10
+ },
+ "volume": 23901.333333333332
+ }
+ },
+ {
+ "id": "d04",
+ "file": "cases/d04-edgefinish-lowercase-fields.firmament",
+ "kind": "guard",
+ "register": "X3 #17",
+ "findings": "F4",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Lowercase EdgeFinish fields. Must keep working.",
+ "geometry": {
+ "faces": 10,
+ "edges": 20,
+ "vertices": 12,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 10
+ },
+ "volume": 23901.333333333332
+ }
+ },
+ {
+ "id": "d05",
+ "file": "cases/d05-fillet-with-hole.firmament",
+ "kind": "diagnostic",
+ "register": "#24",
+ "findings": "F5",
+ "expect": "invalid",
+ "observedAt0a72e6f": "CombinedFeatureSelectionLost at (1,1)",
+ "note": "Capability gap, stays rejected. The diagnostic must point at the EdgeFinish line.",
+ "code": "CombinedFeatureSelectionLost",
+ "line": 6
+ },
+ {
+ "id": "e01",
+ "file": "cases/e01-pocket-through.firmament",
+ "kind": "fix",
+ "register": "X3 #13",
+ "findings": "F21",
+ "expect": "valid",
+ "observedAt0a72e6f": "pocket-missing-required-field:required=On,Profile,Depth",
+ "note": "Pocket with End: ThroughAll means Remove ... Role: ThroughCut.",
+ "reference": "cases/reference/e01-pocket-through.firmament",
+ "geometry": {
+ "faces": 10,
+ "edges": 24,
+ "vertices": 16,
+ "bbox": [
+ [
+ -40,
+ -20,
+ 0
+ ],
+ [
+ 40,
+ 20,
+ 12
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 8,
+ "cylinder": 2
+ },
+ "volume": 33766.53530625001
+ }
+ },
+ {
+ "id": "e02",
+ "file": "cases/e02-cut-in-modify.firmament",
+ "kind": "diagnostic",
+ "register": "X3 #13",
+ "findings": "F21",
+ "expect": "invalid",
+ "observedAt0a72e6f": "Unknown statement 'Cut' in Modify (6,5)",
+ "note": "Already correct: keep the span and the sentence.",
+ "code": "firmament-v2-canonical-declaration-unknown",
+ "line": 6
+ },
+ {
+ "id": "f01",
+ "file": "cases/f01-xz-layout.firmament",
+ "kind": "diagnostic",
+ "register": "X0 #5",
+ "findings": "F9",
+ "expect": "invalid",
+ "observedAt0a72e6f": "profile-layout-placement-unsupported at (9,1), preceded by ConceptPathProfileNotAdmittedByCompose",
+ "note": "Stays rejected for the frame reason. Passes today; the extra ConceptPathProfileNotAdmittedByCompose noise ahead of it should go.",
+ "code": "profile-layout-placement-unsupported",
+ "line": 9
+ },
+ {
+ "id": "f02",
+ "file": "cases/f02-inline-polygon.firmament",
+ "kind": "design",
+ "register": "X3 #20",
+ "findings": "F11",
+ "expect": "valid",
+ "observedAt0a72e6f": "polygon2-variant-unsupported:Outline (1,1)",
+ "note": "Polygon2 with an inline Points list. Field name is a register decision.",
+ "reference": "cases/reference/f02-inline-polygon.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 12,
+ "bbox": [
+ [
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 60,
+ 40,
+ 30
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 8
+ },
+ "volume": 14250
+ }
+ },
+ {
+ "id": "f03",
+ "file": "cases/f03-segment-inline-coordinates.firmament",
+ "kind": "diagnostic",
+ "register": "X3 #20",
+ "findings": "F11",
+ "expect": "invalid",
+ "observedAt0a72e6f": "ConceptPathProfileNotAdmittedByCompose (1,1)",
+ "note": "If X3 admits inline Segment endpoints, change to valid with a reference. Otherwise reject at the first Segment with the endpoint diagnostic, not a Compose admission error.",
+ "code": "ProfileSegmentEndpointMustReferenceNamedPoint",
+ "line": 5
+ },
+ {
+ "id": "f04",
+ "file": "cases/f04-inline-polygon-arithmetic.firmament",
+ "kind": "design",
+ "register": "X3 #20 + X2 #9",
+ "findings": "F11 F18",
+ "expect": "valid",
+ "observedAt0a72e6f": "polygon2-variant-unsupported",
+ "note": "Inline Points with Static arithmetic.",
+ "reference": "cases/reference/f04-inline-polygon-arithmetic.firmament",
+ "geometry": {
+ "faces": 8,
+ "edges": 18,
+ "vertices": 12,
+ "bbox": [
+ [
+ -35,
+ -30,
+ 0
+ ],
+ [
+ 35,
+ 30,
+ 6
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 8
+ },
+ "volume": 25050
+ }
+ },
+ {
+ "id": "g01",
+ "file": "cases/g01-revolve-point-list.firmament",
+ "kind": "design",
+ "register": "X3 #20",
+ "findings": "F13",
+ "expect": "valid",
+ "observedAt0a72e6f": "polygon2-variant-unsupported (3,1)",
+ "note": "Revolve of a Polygon2 point list instead of Point2 + Line2 per vertex.",
+ "reference": "cases/reference/g01-revolve-point-list.firmament",
+ "geometry": {
+ "faces": 4,
+ "edges": 6,
+ "vertices": 4,
+ "bbox": [
+ [
+ -10,
+ 0,
+ -10
+ ],
+ [
+ 10,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 2,
+ "cylinder": 2
+ },
+ "volume": 1552.914270615124
+ }
+ },
+ {
+ "id": "h00",
+ "file": "cases/h00-concept-grid-struct-root.firmament",
+ "kind": "guard",
+ "register": "X3 #14",
+ "findings": "F16",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Concept Grid pattern under a Struct root. Must keep working.",
+ "geometry": {
+ "faces": 12,
+ "edges": 30,
+ "vertices": 32,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 6
+ },
+ "volume": 22835.31429703865
+ }
+ },
+ {
+ "id": "h01",
+ "file": "cases/h01-concept-grid-model-root.firmament",
+ "kind": "guard",
+ "register": "X3 #14",
+ "findings": "F16",
+ "expect": "valid",
+ "observedAt0a72e6f": "valid",
+ "note": "Same wrapped in Model. Fixed since the original audit; must keep working.",
+ "geometry": {
+ "faces": 12,
+ "edges": 30,
+ "vertices": 32,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 6
+ },
+ "volume": 22835.31429703865
+ }
+ },
+ {
+ "id": "h02",
+ "file": "cases/h02-documented-feature-pattern.firmament",
+ "kind": "fix",
+ "register": "X3 #12 / #15",
+ "findings": "F15",
+ "expect": "valid",
+ "observedAt0a72e6f": "Unknown statement 'Pattern' (19,3)",
+ "note": "The original audit's grid part as syntax.md teaches it: Model-scope Feature + Pattern { Source; MountHole(Center: Item) }.",
+ "reference": "cases/reference/h02-documented-feature-pattern.firmament",
+ "geometry": {
+ "faces": 12,
+ "edges": 30,
+ "vertices": 32,
+ "bbox": [
+ [
+ -30,
+ -20,
+ 0
+ ],
+ [
+ 30,
+ 20,
+ 10
+ ]
+ ],
+ "assessment": "enclosed-manifold",
+ "surfaces": {
+ "plane": 6,
+ "cylinder": 6
+ },
+ "volume": 22835.31429703865
+ }
+ }
+ ]
+}
diff --git a/fixtures/Regression/FrontendX4/run.py b/fixtures/Regression/FrontendX4/run.py
new file mode 100644
index 00000000..bd10d240
--- /dev/null
+++ b/fixtures/Regression/FrontendX4/run.py
@@ -0,0 +1,182 @@
+#!/usr/bin/env python3
+"""FrontendX4 corpus runner.
+
+Every case is run through both `aetheris validate --json` and `aetheris build`.
+
+- A case expected `valid` must validate, build, and match its geometry. A case with a
+ `reference` must match the reference file built by the same CLI. Every valid case must
+ also match the numbers recorded in expected.json.
+- A case expected `invalid` must fail both commands. Its `code` must be among the build
+ diagnostics, reported at `line`.
+- The chimera must match chimera.baseline.firmament.
+
+Usage:
+ python fixtures/Regression/FrontendX4/run.py [--cli PATH] [--only a03,c04] [--record]
+
+--record measures the references and guards with the current CLI and rewrites the
+geometry recorded in expected.json. Use it only when a geometry change is intended and
+explained.
+"""
+from __future__ import annotations
+
+import argparse
+import json
+import os
+import re
+import subprocess
+import sys
+import tempfile
+from pathlib import Path
+
+HERE = Path(__file__).resolve().parent
+ROOT = HERE.parents[2]
+VOLUME_REL = 1e-9
+
+
+def default_cli() -> Path:
+ exe = "aetheris.exe" if os.name == "nt" else "aetheris"
+ return ROOT / "Aetheris.CLI" / "bin" / "Release" / "net10.0" / exe
+
+
+def run(cli: Path, *args: str) -> subprocess.CompletedProcess:
+ return subprocess.run([str(cli), *args], capture_output=True, text=True, cwd=HERE)
+
+
+def validate_status(cli: Path, source: Path) -> str:
+ p = run(cli, "validate", str(source), "--json")
+ try:
+ doc = json.loads(p.stdout)
+ except json.JSONDecodeError:
+ return "unparseable-json"
+ return str(doc.get("firmamentV2Validation", doc).get("status"))
+
+
+def build(cli: Path, source: Path, out: Path) -> tuple[bool, str]:
+ p = run(cli, "build", str(source), "--output", str(out))
+ return p.returncode == 0 and out.exists(), p.stdout + p.stderr
+
+
+def geometry(cli: Path, step: Path) -> dict:
+ s = json.loads(run(cli, "inspect", str(step), "--json").stdout)["summary"]
+ evidence = Path(tempfile.mkdtemp(prefix="x4-verify-"))
+ v = json.loads(run(cli, "verify", str(step), "--json", "--evidence-dir", str(evidence)).stdout)
+ bb = s["boundingBox"]
+ return {
+ "faces": s["faceCount"],
+ "edges": s["edgeCount"],
+ "vertices": s["vertexCount"],
+ "bbox": [[bb["min"][k] for k in "xyz"], [bb["max"][k] for k in "xyz"]],
+ "assessment": s["structuralAssessment"],
+ "surfaces": {k: n for k, n in s["surfaceFamilies"].items() if n},
+ "volume": v["brepMassProperties"]["absoluteVolume"],
+ }
+
+
+def same_geometry(a: dict, b: dict) -> list[str]:
+ diffs = [f"{k}: {a[k]} != {b[k]}" for k in ("faces", "edges", "vertices", "assessment", "surfaces") if a[k] != b[k]]
+ for i in range(2):
+ for j in range(3):
+ if abs(a["bbox"][i][j] - b["bbox"][i][j]) > 1e-9:
+ diffs.append(f"bbox: {a['bbox']} != {b['bbox']}")
+ break
+ if abs(a["volume"] - b["volume"]) > VOLUME_REL * max(1.0, abs(b["volume"])):
+ diffs.append(f"volume: {a['volume']!r} != {b['volume']!r}")
+ return diffs
+
+
+def diagnostic_lines(output: str, name: str, code: str) -> list[int]:
+ pattern = re.compile(rf"{re.escape(name)}\((\d+),(\d+)\): fatal ([^:\s]+)")
+ return [int(m.group(1)) for m in pattern.finditer(output) if m.group(3).startswith(code)]
+
+
+def check_case(cli: Path, case: dict, tmp: Path, record: bool) -> tuple[bool, str]:
+ source = HERE / case["file"]
+ status = validate_status(cli, source)
+ built, output = build(cli, source, tmp / (case["id"] + ".step"))
+ if case["expect"] == "invalid":
+ problems = []
+ if status != "invalid":
+ problems.append(f"validate={status}")
+ if built:
+ problems.append("build succeeded")
+ lines = diagnostic_lines(output, source.name, case["code"])
+ if not lines:
+ problems.append(f"no {case['code']} diagnostic")
+ elif case.get("line") and case["line"] not in lines:
+ problems.append(f"{case['code']} at line(s) {lines}, expected {case['line']}")
+ return not problems, "; ".join(problems) or "rejected as required"
+ if record and case.get("reference"):
+ rb, rout = build(cli, HERE / case["reference"], tmp / (case["id"] + ".ref.step"))
+ if not rb:
+ return False, "reference does not build: " + rout.strip().splitlines()[-1]
+ case["geometry"] = geometry(cli, tmp / (case["id"] + ".ref.step"))
+ elif record and case["kind"] == "guard" and built:
+ case["geometry"] = geometry(cli, tmp / (case["id"] + ".step"))
+ if status != "valid" or not built:
+ first = next((l for l in output.splitlines() if "fatal" in l or "Error" in l), output.strip()[-200:])
+ first = first.replace(str(source.parent) + os.sep, "")
+ return False, f"validate={status}, build={'ok' if built else 'failed'}: {first.strip()[:220]}"
+ got = geometry(cli, tmp / (case["id"] + ".step"))
+ diffs = []
+ if case.get("reference") and not record:
+ rb, _ = build(cli, HERE / case["reference"], tmp / (case["id"] + ".ref.step"))
+ if not rb:
+ return False, "reference does not build"
+ diffs += ["vs reference " + d for d in same_geometry(got, geometry(cli, tmp / (case["id"] + ".ref.step")))]
+ if case.get("geometry"):
+ diffs += ["vs recorded " + d for d in same_geometry(got, case["geometry"])]
+ return not diffs, "; ".join(diffs) or "builds the expected geometry"
+
+
+def main() -> int:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--cli", type=Path, default=default_cli())
+ ap.add_argument("--only", default="")
+ ap.add_argument("--record", action="store_true")
+ args = ap.parse_args()
+ manifest_path = HERE / "expected.json"
+ manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
+ only = {x.strip() for x in args.only.split(",") if x.strip()}
+ tmp = Path(tempfile.mkdtemp(prefix="x4-"))
+ failures = 0
+ rows = []
+ for case in manifest["cases"]:
+ if only and case["id"] not in only:
+ continue
+ ok, why = check_case(args.cli, case, tmp, args.record)
+ failures += not ok
+ rows.append((case["id"], case["kind"], case["register"], "PASS" if ok else "FAIL", why))
+ if not only or "chimera" in only:
+ ch = manifest["chimera"]
+ status = validate_status(args.cli, HERE / ch["file"])
+ built, out = build(args.cli, HERE / ch["file"], tmp / "chimera.step")
+ rb, rout = build(args.cli, HERE / ch["reference"], tmp / "chimera.ref.step")
+ if not rb:
+ ok, why = False, "chimera.baseline.firmament no longer builds: " + rout.strip().splitlines()[-1]
+ else:
+ ref = geometry(args.cli, tmp / "chimera.ref.step")
+ if args.record:
+ ch["geometry"] = ref
+ base_diffs = same_geometry(ref, ch["geometry"]) if ch.get("geometry") else []
+ if base_diffs:
+ ok, why = False, "baseline drifted from recorded: " + "; ".join(base_diffs)
+ elif status != "valid" or not built:
+ first = next((l for l in out.splitlines() if "fatal" in l or "Error" in l), out.strip()[-200:])
+ first = first.replace(str(HERE) + os.sep, "")
+ ok, why = False, f"validate={status}: {first.strip()[:220]}"
+ else:
+ d = same_geometry(geometry(args.cli, tmp / "chimera.step"), ref)
+ ok, why = not d, "; ".join(d) or "matches the baseline"
+ failures += not ok
+ rows.append(("chimera", "target", "all", "PASS" if ok else "FAIL", why))
+ if args.record:
+ manifest_path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
+ width = max(len(r[2]) for r in rows)
+ for r in rows:
+ print(f"{r[0]:8} {r[1]:10} {r[2]:{width}} {r[3]} {r[4]}")
+ print(f"\n{len(rows) - failures}/{len(rows)} pass")
+ return 1 if failures else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())