Repository navigation
Level ElementId storey bind + honest AProperty parameters (#33/#35) - #144
Conversation
Wire LevelStoreyBind into the production IFC export path so Floors and Rooms resolve storey_index only when both sides carry matching ElementIds. Partition MVP Levels remain id-less on available corpora, so Floors/Rooms stay honestly Unassigned. Unit tests cover bind success and fail-closed cases; a corpus probe documents insufficient LevelAssociationCell evidence. Co-authored-by: DrunkOnJava <[email protected]>
Add APropertyString, ParameterEntry JSON helpers, and a parameters[] array on CLI/Python decoded elements. Host elements return [] until host↔AProperty joins recover. Diagnostics gain parameter_value_count; rvt-inspect and the viewer File Status Parameters row report honest empty on corpora. Decoder registry is now 81. Co-authored-by: DrunkOnJava <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Level bind depends on iteration order
- Deferred Floor/Room storey_index resolution to a second pass after all Levels are recorded, matching the existing pending_hosts pattern.
Or push these changes by commenting:
@cursor push 776e00dbd2
Preview (776e00dbd2)
diff --git a/src/ifc/export_content.rs b/src/ifc/export_content.rs
--- a/src/ifc/export_content.rs
+++ b/src/ifc/export_content.rs
@@ -113,6 +113,7 @@
) -> TypedProductionAppend {
let mut out = TypedProductionAppend::default();
let mut pending_hosts: Vec<(usize, u32)> = Vec::new();
+ let mut pending_storeys: Vec<(usize, u32)> = Vec::new();
let mut level_bind = crate::level_bind::LevelStoreyBind::new();
for decoded in decoded_iter {
@@ -223,18 +224,17 @@
}
// Floor/Room → storey via Level ElementId only when both sides
- // carry ids that match. Partition MVP Levels are id-less today,
- // so this stays None (honest Unassigned) on available corpora.
- let storey_index = level_bind.storey_index_for(&decoded);
- if storey_index.is_some() {
- out.level_elementid_binds += 1;
+ // carry ids that match. Defer until after the loop so Floors
+ // that precede their Level in iter_elements still bind.
+ if let Some(level_id) = crate::level_bind::level_id_from_decoded(&decoded) {
+ pending_storeys.push((entity_index, level_id));
}
entities.push(entities::IfcEntity::BuildingElement {
ifc_type,
name,
type_guid,
- storey_index,
+ storey_index: None,
material_index: None,
property_set,
location_feet,
@@ -261,6 +261,18 @@
}
}
+ for (entity_index, level_id) in pending_storeys {
+ if let Some(storey_index) = level_bind.storey_index_for_level_id(level_id) {
+ if let Some(entities::IfcEntity::BuildingElement {
+ storey_index: si, ..
+ }) = entities.get_mut(entity_index)
+ {
+ *si = Some(storey_index);
+ out.level_elementid_binds += 1;
+ }
+ }
+ }
+
out
}You can send follow-ups to the cloud agent here.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0ae3cb5. Configure here.
| let storey_index = level_bind.storey_index_for(&decoded); | ||
| if storey_index.is_some() { | ||
| out.level_elementid_binds += 1; | ||
| } |
There was a problem hiding this comment.
Level bind depends on iteration order
Medium Severity
append_typed_production_elements records Level ids and resolves Floor/Room storey_index in one pass. A Floor or Room that appears before its Level never binds, even when both sides already carry matching ElementIds. Host linking in the same function already defers resolution until after the loop; this bind does not, so the advertised success path is order-dependent and stays Unassigned whenever iter_elements yields hosts first (Global/Latest is score-desc, not class-ordered).
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0ae3cb5. Configure here.
Co-authored-by: DrunkOnJava <[email protected]>



Summary
LevelStoreyBindmaps Level ElementId → storey index and assigns Floor/Roomstorey_indexonly when both sides carry matching ids. Partition MVP Levels remain id-less on Einhoven / 2024 Core Interior, so Floors/Rooms stay honest Unassigned. Unit tests cover bind success + fail-closed;examples/probe_level_elementid_bind.rsdocuments insufficient LevelAssociationCell corpus evidence.APropertyString,ParameterEntryJSON helpers, and aparameters[]array on CLI (rvt-elements) + Pythondecoded_elements(). Host elements return[]until host↔AProperty joins recover. Diagnostics gainparameter_value_count;rvt-inspect+ viewer File Status Parameters row report honest empty on corpora. Decoder registry 81.Out of scope
Test plan
level_bind::*(5)parameters::tests::parameter_entries_*+aproperty_string_*all_decoders_len_is_eighty_onervt-elements→ allparameters: [];rvt-inspectParameters row honest emptycargo test --release --lib(839 pass)Note
Medium Risk
The decoded-elements JSON schema now requires
parameters, which may break strict validators; IFC storey assignment logic changed for Floor/Room when Level ElementIds appear on both sides.Overview
Adds fail-closed Level ElementId → IFC storey binding (#33): new
LevelStoreyBindrecords Level ids when present and sets Floor/Roomstorey_indexin production IFC export only when typedm_level_idmatches a recorded Level. Partition MVP Levels without ElementIds stay unassigned; diagnostics tracklevel_elementid_binds. Research probeprobe_level_elementid_binddocuments insufficient corpus evidence.Ships honest AProperty parameter surfacing (#35): registers
APropertyString(decoder count 81), extendsParameterValue/ParameterEntrywith JSON helpers, and adds a requiredparametersarray onrvt-elements, Pythondecoded_elements(), anddecoded-elements.schema.json—non-empty only for AProperty* carrier rows; host elements stay[]until host↔parameter joins exist.Diagnostics and UX gain
parameter_value_counton IFC export diagnostics;rvt-inspectand the viewer File Status Parameters row report recovered values or an explicit pending-join message. Docs (README, status, compatibility, roadmap) align on 81 decoders and the new honesty boundaries.Reviewed by Cursor Bugbot for commit 0ae3cb5. Configure here.