feat(export): add audited section-clipping backend (#7711)
Clips admitted section geometry and writes the STEP metadata/style closure needed to reopen the saved IFC. Backend/API layer for #7711, below #7900 and #7908.
Current head: 9597ecb45ea648c3f3e2c6cb077dcb7fcfcca7f6 (adds the crossing-Axis and mixed-case-attachment review fixes 3a032ebbbc/6b365be5e1, then merges main 8e2778ca0). Fixes validated on Pop: cargo test --workspace, cargo clippy --workspace --all-targets -- -D warnings, pnpm typecheck; hosted required checks pass (one unrelated flow-nodes BCF shard flake passed on rerun). Earlier text below refers to the previously validated source b32d459312. The stack includes main 97d8add207104d5801c0c8d62e40fa7066e848f8 through normal merges preserving public history. Validation source b32d4593123d517de9c2f14bbc84e60a94c191bf exactly matches the pre-evidence top 7a9e055033d56761844d0580b1ee47215117601a. The current top adds ancestry/evidence only; production, tests, fixtures and build configuration are unchanged.
Current observed qualification:
- Native workspace: 6,805 passed, 0 failed, 46 ignored, checksum freshness confirmed; strict workspace Clippy passed.
- Root typecheck including the tail: passed, with 4,284 test files audited. API/generated STEP tables, documentation and lint passed.
- Full export suite: 1,999 passed, 15 skipped, including all seven section-export regressions. The original run then failed at a boundary import because renderer output was absent; its receipt remains failed. A follow-up built all packages through root Turbo and passed 229 WASM contracts (one historical-fingerprint skip) and seven mounted viewer tests (zero skips).
- Current real Archicad Haus crop: 23 trimmed, 34 excluded, 136 reopened meshes, zero checked plane violations. Independent IfcOpenShell/OCC reopened 56 products, checked all 23 trimmed identities and 13 opening links.
- Local bundle measurements pass the unchanged ceilings. The approved engine ceiling stays 2,396,446 bytes with 0.5% tolerance; viewer ceilings are unchanged.
Current compact evidence and limitations binds source/runtime/output hashes and original receipts. All 182 catalogued fixtures were restored; ignored and skipped tests remain disclosed. The oracle does not claim full EXPRESS validity, watertight caps, colours or GPU performance.
Performance qualified. Paired native cohort issue7711-backend-v3 (Pop, exclusive, 5 balanced rounds) of this head 9597ecb45e against main 8e2778ca04: geometry identity matched and no phase moved beyond the noise floor (TOTAL -0.4% to +1.7%). An earlier cohort (v2) was inconclusive only because one fixture phase fell below timer resolution; it is retained. Evidence: scripts/perf/evidence/section-export-7711/backend-20261026/ on #7908. Scope is native processing, not WASM/viewer/GPU. Hosted checks and review remain required.
Earlier stale-WASM, invocation/import, and unqualified preparation outcomes remain failures/unqualified outcomes. No historical result is promoted to current source. #7711 remains open until the useful stack is landed and verified.
Review is open while the original exclusive performance cohort remains queued. This status change does not waive performance qualification, required hosted checks, or current review. Cohort request: issue7711-checksum-v1-cohort; original job: fc8a84d6-346e-4a20-9013-b94fcf32011c. No replacement measurement has been submitted.
Earlier review findings are addressed in this head: excluded representation-less products skip no-op detachment while malformed representations fail (packages/export/src/section-export.ts); presentation attachments are indexed by target (rust/export/src/section_clip_safety.rs); unsupported geometry classes fail before grouping, covered by issue_8006_orphan_type_geometry_refuses_instead_of_leaking_uncropped_source (rust/export/src/section_clip_safety_tests.rs). The export README API note precedes License. Current native/export/WASM qualification is linked above.
Summary by CodeRabbit
- New Features
- Export IFC models cropped by one or more section planes, with trim mode for clipped geometry or whole-element mode for retaining intersected elements.
- Cropped exports preserve product identities and semantic relationships, and support open surfaces and separate mapped geometry origins.
- Bug Fixes
- Color-map data is better preserved, and superseded opening cutter geometry is detached while opening metadata is retained.
- Cropping is refused when geometry is incomplete, textured replacements are unsupported, or a crossing axis-based alignment cannot be safely clipped.
- Documentation
- Added guidance on section-cropped exports, available options, WASM requirements, and cases where cropping may be refused.
Update (2026-10-25). All review threads are addressed and resolved. The performance hold is cleared by cohort v3 above.