P025 — Body name overwritten by last-operation label on export

§12.6 assembly metadata

P1 — silent data loss

round-trip assembly

Sources

Sender

FreeCAD itself (regression late 2025)

Description

STEP write populates `PRODUCT.name` and `NEXT_ASSEMBLY_USAGE_OCCURRENCE.name` from the last operation's label rather than the body's label. Round-trip loses body names.

Reproducer recipe

STEP file where `PRODUCT_DEFINITION` chain has a name shadowed by a sub-feature label (e.g., "Pocket" instead of "MyPart_Body").

Expected kernel behavior

Heal and accept: maintain a stable mapping of body name to STEP product name across round-trip.

Notes

Synonyms: "body name overwritten by last operation label", "exported part name shows internal feature name", "body label corrupted by history rename", "feature name leaked as body name on export".

Expected validation

occt=shape(1)/shape(1) gmsh=shape(1) ifc=schema_n/a

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* P025: PRODUCT.name and NAUO.name populated from last-operation label not body label; PRODUCT entities carry names like 'Pocket' and 'Chamfer' — internal feature labels; body label 'MyPart_Body' / 'MyPart_Base' is absent from PRODUCT chain; round-trip loses correct body names; kernel must heal and preserve body-to-product mapping; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('P025'),'2;1');
5FILE_NAME('P025.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF { 1 0 10303 442 1 1 4 }'));
7ENDSEC;
8DATA;
9#9000=APPLICATION_CONTEXT('mechanical design');
10#1=CARTESIAN_POINT('',(0.0,0.0,0.0));
11#2=GEOMETRIC_CURVE_SET('',(#1));
12#9050=PRODUCT_CONTEXT('',#9000,'mechanical');
13#9051=PRODUCT('P025','P025','',(#9050));
14#9052=PRODUCT_DEFINITION_FORMATION('','',#9051);
15#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design');
16#9054=PRODUCT_DEFINITION('','','',#9052,#9053);
17#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054);
18#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
19#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
20#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
21#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value','');
22#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D'));
23#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#2),#9060);
24#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061);
25#9063=CARTESIAN_POINT('asm_origin',(0.0,0.0,0.0));
26#9064=DIRECTION('asm_z',(0.0,0.0,1.0));
27#9065=DIRECTION('asm_x',(1.0,0.0,0.0));
28#9066=AXIS2_PLACEMENT_3D('asm_plc',#9063,#9064,#9065);
29#9067=PRODUCT_CONTEXT('sub',#9000,'mechanical');
30#9068=PRODUCT('MyDocument','MyDocument','Document root',(#9067));
31#9069=PRODUCT_DEFINITION_FORMATION('','',#9068);
32#9070=PRODUCT_DEFINITION('design','',#9069,#9053);
33#9071=PRODUCT('Pocket','Pocket','body_label_should_be_MyPart_Body',(#9067));
34#9072=PRODUCT_DEFINITION_FORMATION('','',#9071);
35#9073=PRODUCT_DEFINITION('design','',#9072,#9053);
36#9074=SHAPE_REPRESENTATION('body1_rep',(#9066),#9060);
37#9075=REPRESENTATION_MAP(#9066,#9074);
38#9076=CARTESIAN_POINT('body1_inst_orig',(0.0,0.0,0.0));
39#9077=DIRECTION('body1_inst_z',(0.0,0.0,1.0));
40#9078=DIRECTION('body1_inst_x',(1.0,0.0,0.0));
41#9079=AXIS2_PLACEMENT_3D('body1_inst_plc',#9076,#9077,#9078);
42#9080=MAPPED_ITEM('body1_mi',#9075,#9079);
43#9081=NEXT_ASSEMBLY_USAGE_OCCURRENCE('1','Pocket','',#9070,#9073,$);
44#9082=PRODUCT('Chamfer','Chamfer','body_label_should_be_MyPart_Base',(#9067));
45#9083=PRODUCT_DEFINITION_FORMATION('','',#9082);
46#9084=PRODUCT_DEFINITION('design','',#9083,#9053);
47#9085=SHAPE_REPRESENTATION('body2_rep',(#9066),#9060);
48#9086=REPRESENTATION_MAP(#9066,#9085);
49#9087=CARTESIAN_POINT('body2_inst_orig',(10.0,0.0,0.0));
50#9088=DIRECTION('body2_inst_z',(0.0,0.0,1.0));
51#9089=DIRECTION('body2_inst_x',(1.0,0.0,0.0));
52#9090=AXIS2_PLACEMENT_3D('body2_inst_plc',#9087,#9088,#9089);
53#9091=MAPPED_ITEM('body2_mi',#9086,#9090);
54#9092=NEXT_ASSEMBLY_USAGE_OCCURRENCE('2','Chamfer','',#9070,#9084,$);
55ENDSEC;
56END-ISO-10303-21;