From 73b0532212b17fb5cc3e04a8f695a5f78ac0825d Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Fri, 30 Oct 2026 00:35:26 -0400 Subject: [PATCH] Face capture test: extruding a split face in an uncaptured component is refused The refusal "capture the source occurrence position before generating a legacy face profile across components" lost its test when Offset Face got an exact history name (b6c3bf3c5). A half of a box's top that Split Face divided still has neither a construction certificate nor an exact history name, so Extrude from that face, in a component whose occurrence has an uncaptured move, takes the legacy path and is refused there; the document and the pending moves stay as they were. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/face_tests.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/crates/engine/src/cmd/face_tests.rs b/crates/engine/src/cmd/face_tests.rs index e9afe1389..3a0e0d9b9 100644 --- a/crates/engine/src/cmd/face_tests.rs +++ b/crates/engine/src/cmd/face_tests.rs @@ -184,6 +184,27 @@ fn internal_capture_in_another_component_anchors_an_offset_face_by_its_history_n assert_eq!(s.pending_moves, pending); } +/// Extrude from a face in another component whose occurrence has an uncaptured move, where the +/// face has neither a construction certificate nor an exact history name: a half of a box's top +/// that Split Face divided. The face profile would take the legacy path, which can't capture the +/// source's pending position, so the extrude is refused and changes nothing. +#[test] +fn face_extrude_of_a_split_face_in_another_component_refuses_an_uncaptured_source() { + let mut s = Session::default(); + let component = run(&mut s, "component.create", json!({"name":"Source","grounded":false})); + let occurrence = component["occurrence"].as_u64().unwrap(); + run(&mut s, "solid.box", json!({"length":40,"width":30,"height":20,"body_name":"Stock"})); + run(&mut s, "solid.split_face", json!({"faces":[[10,15,20]],"plane":{"origin":[20,0,0],"normal":[1,0,0]}})); + run(&mut s, "component.activate", json!({"component":0})); + run(&mut s, "occurrence.move", json!({"occurrence":occurrence,"translate":[30,0,0],"capture":false})); + let before = s.doc.to_json(); + let pending = s.pending_moves.clone(); + let error = s.execute("solid.extrude", &json!({"face":[40,15,20],"distance":5,"operation":"new"})).unwrap_err(); + assert!(error.to_string().contains("capture the source occurrence position"), "{error}"); + assert_eq!(s.doc.to_json(), before); + assert_eq!(s.pending_moves, pending); +} + #[test] fn repeated_source_face_profile_requires_and_uses_the_exact_active_occurrence() { let mut s = Session::default();