DWG: keep opaque registered entities and their source classes #2654
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 269 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.335
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2654"
general
weight: 0.35
mkzung
DWG import can drop opaque registered entities because the intermediate DXF gives them an unresolved class number. Convert them to standard proxies, preserving payload bit counts, graphics, references and separate string streams.
Keep the source CLASSES order, duplicate names and metadata through DXF writes, and through DWG writes of 2013 and later. When the bridge DXF's classes can't be written back as they are (before 2013, a binary DXF, a malformed CLASS), main's
proxy_classeshandles the proxies: matched by name, or left out and counted as unwritten. A proxy whose number names no class is left out and counted. No path returns an error for a proxy, so a pre-2013 DWG saves without them, as the save report says.On read, a registered entity with decoded properties and opaque data stays as read (as on main) and a read note names it.
dwgstays standalone: the source classes are read from the bridge's ASCII DXF by a bounded scan, like main'sdxf_class_names; no layering change.Tests: focused DWG/IO/engine tests, clippy -D warnings, fmt, layers and the wasm32 check of cadcraft-io pass.
Addresses #2643; overlaps the class-ID work in #2471. Source-version handling, rendering (#1361) and native parameter editing are outside this PR; another application's objects are #2917. Not yet opened in AutoCAD.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Improved preservation of proxy objects and registered entities across DXF and DWG conversions, including class identity, graphics, payload data, and object references.
Preserved proxy class information across repeated saves when the source class table is available, reducing the risk of data loss or incorrect class associations.
Standardized proxy record names when converting DXF data for the DWG bridge; ordinary DXF output remains unchanged.
* Improved handling of ambiguous class names and malformed unused class records, helping prevent them from interfering with other geometry.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->