fix(server): extract IfcRelAssignsToGroup(ByFactor)/Nests/ConnectsPathElements

Merged
PE
3mo ago
+152-0

Summary

apps/server/src/services/data_model/relationships.rs's extract_relationships only extracted 9 IfcRel* types; the TS/WASM path (packages/parser/src/columnar-parser-indexes.ts) resolves ~19. This adds the 4 of the 10 missing types with confirmed live consumer chains:

  • IFCRELASSIGNSTOGROUP / IFCRELASSIGNSTOGROUPBYFACTOR: viewer Groups panel, "By Zone" lens, IDS partOf.
  • IFCRELNESTS: packages/ids/src/bridge/data-accessor.ts maps it onto the same edge bucket as IfcRelAggregates for IDS partOf.
  • IFCRELCONNECTSPATHELEMENTS: Properties panel's "connected walls" (extractRelationshipsOnDemand).

Left out (no consumer found beyond generic cache/export/query/DuckDB plumbing and parser-level tests): IFCRELASSIGNSTOPRODUCT, IFCRELCONNECTSELEMENTS, IFCRELCONNECTSPORTTOELEMENT, IFCRELCONNECTSPORTS, IFCRELSPACEBOUNDARY, IFCRELREFERENCEDINSPATIALSTRUCTURE.

Edge orientation was verified per added type against the TS extractRelFast byte-level scanner, not assumed — AssignsToGroup(ByFactor) reads RelatingGroup at attr 6, ConnectsPathElements reads both ends as single refs at attrs 5/6, Nests shares the existing default (4,5) arm used for Aggregates.

Closes #3964

Test plan

  • RED: new tests failed ([]) before the fix
  • GREEN: cargo test -p ifc-lite-server — 274 passed, 0 failed
  • Mutation: removing IFCRELNESTS from the type list fails extracts_nests_relationship_orientation
  • Mutation: flipping ConnectsPathElements orientation fails extracts_connects_path_elements_relationship_orientation
  • Control: all 9 pre-existing relationship types unaffected (same ids/orientation)
  • Control: a fixture with none of the new types produces the same output as before
  • cargo clippy -p ifc-lite-server -- -D warnings clean
  • node scripts/check-test-wiring.mjs / check-source-text-assertions.mjs clean
  • node scripts/check-module-size.mjs — only the pre-existing CommandPalette.tsx offender (fixed in #3958), no new offender
  • Browser/WASM path untouched (no packages/* changes, no changeset needed)

https://claude.ai/code/session_01QPHChk3Ve9N519A4kY7436

Summary by CodeRabbit

  • New Features

    • Improved relationship data extraction for additional grouping, nesting, and connected path elements.
    • Relationship links now preserve the correct relating and related element orientation.
  • Bug Fixes

    • Previously unrecognized relationship types are now included in extracted model data.
    • Added validation to ensure models without these relationships continue to produce no incorrect results.