← Back to Pull requests

DXF/DWG: an object a kept object holds by a hard owner reference is kept #2919

Closed
unknown closed this pull request without merging on Nov 08, 2026 15:57 UTC
View on GitHub
unknown unknown commented on Nov 08, 2026 01:44 UTC
Author

What was wrong

The reader and writer decide which unmodelled objects to keep by following each object's owner (group 330) up to something kept. An object whose owner is null but which another kept object holds by a hard owner reference (group 360), as one application's proxy object held by another, broke that chain: it was dropped, and the holder kept a 360 that named nothing. Example: a named-dictionary entry OTHER_APP holding an XRECORD that holds a second XRECORD by 360, whose own 330 is 0; after write_dxf the second XRECORD is gone.

Fix

hard_owners maps each object to the first kept object that names it in a 360, and owner_of uses that owner when the object's own is null, in retained_objects (read) and in the liveness pass of finish (write). An object with a real owner is unchanged.

Tests

crates/io/tests/hard_owned_objects_kept.rs: DXF to DXF twice and DXF to DWG twice; the holder's 360 still names the held record. Fails on main (the held record is missing), passes here. cargo test -p cadcraft-io, clippy with -D warnings and fmt pass.

🤖 Generated with Claude Code

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Bug Fixes
Objects referenced through hard-owner links are now preserved when their standard owner is missing, including through DXF and DWG conversions.
Repeated conversions retain these referenced objects while excluding unrelated, unheld objects.
Cyclic hard-owner references remain intact when reachable from a retained object.
* Records with an unresolved, explicitly assigned owner are excluded, even if another object references them through a hard-owner link.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 231 lines (+173 / -58) across 2 files Reviewer: mkzung Review duration: 852m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 231 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.326
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2919"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37% (MEDIUM) · Higher = larger blast radius
37%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16% · Safe to merge
16%