Repository navigation
refactor(research): split partition_schema_mvp into modules by responsibility - #1141
Conversation
…nd quantise helpers dot, sub and cross move from ifc/body_geometry and native_parametric_surface, distance from native_symbol_cuts and native_parametric_mesh, and the shoelace area from geometry/recovery and ifc/from_decoded into the private vector_math module, with the expressions unchanged. polygon_area_sqft keeps its public path and calls the shared function. quantise is shared from partition_element_records.
native_index reads native_extensible_storage::guid_string instead of its own copy. The 22-digit alphabet is one constant in revit_global_ids, and derive_default_ifc_guid calls compress_ifc_guid, which computes the same string.
partition_level_records and partition_ifc_export_overrides use the memchr-backed copy in partition_element_records. All three returned None for an empty needle or a haystack shorter than the needle and the first match otherwise.
partition_arc_walls names a storey through element_record_storeys::elevation_storey_name instead of its own identical format.
…elpers native_json holds element_id (u64 and signed forms), finite_triple and agree, read by native_column_joins, native_connectors, native_element_types, native_mullion_hosts, native_rendered_content, native_stairs, native_symbol_cuts, native_wall_types and native_walls. The readers that differ stay in place: native_walls' triple (no finiteness check), native_stairs' element_id (as_u64), native_family_forms' Option argument and native_saved_mesh's Result point.
…imits The production walk, the partition MVP and the IFC export (twice) each ran scan_partition_arc_walls_with_limits over every Partitions stream. RevitFile now memoises the scan under its release and WalkerLimits, as it does the walk; the public function returns a copy of the memoised scan and the four internal readers share it.
… le_bytes The partition readers, compression and basic_file_info read integers, floats and UTF-16 units at an offset with the same bounds as before and through the one le_bytes module. le_bytes gains i32_at and u16_units for the reads the existing helpers did not cover.
… index and document readers The reads that were bounds-checked by a get or an ensure! before an infallible try_into now use u16_at and u32_at with the same error text, and the UTF-16 unit decodes use u16_units. The walker, ElemTable, partitions and ArcWall trailer readers take the same helpers where the surrounding function already returned None on a short buffer.
…roof_slopes read ElementIds through native_json
…hangelog fragment
…ported Four calls already on main read crate::le_bytes::*_at in files this branch now imports le_bytes into, which the workspace's unused_qualifications lint (an error under -D warnings) rejects.
The 75 research modules sat in src/ beside the stable ones and src/research.rs reached them with a #[path] attribute each. They now live in src/research/, declared as plain modules, so the directory says which files are outside the semver promise. Module paths (crate::partition_schema_mvp, rvt::research::*) are unchanged. Current-state mentions of the moved files (the support matrix's evidence, one probe, one scorer, CONTRIBUTING's probe step) name the new paths; reports, dated notes and the changelog keep the paths they were written with.
# Conflicts: # src/research.rs
…ctor/split-partition-schema-mvp
…sibility src/research/partition_schema_mvp.rs was 12,553 lines. It now keeps the module doc, PartitionSchemaMvp, the recover_partition_schema_mvp orchestrator and the helpers every responsibility shares (the element record decoder and box, record references, the source stream, the partition iterators), and re-exports nineteen children from src/research/partition_schema_mvp/ with `pub use <child>::*`, so every `partition_schema_mvp::<item>` path resolves as before. - fields: all 175 constants - types, parameters: type picks and names, system families, type functions; named parameters, IsExternal, phases, serial numbers - openings, curtain, materials, layers - walls, wall_joins: axes, arcs, tapers, profile openings, lengths, tee reaches, butt joins, join trims - stairs, stair_bodies, framing, mep, rooms - slabs, roofs, levels - records, records_2023: category and instance selection, host binding, design-option and nesting filters; the Revit 2023 record path It is a pure move: items keep their bodies, doc comments, attributes and relative order. The only edits are `pub(super)` on the private items that moved out of the parent (private fields and methods: none), five doc links in constants that now reach their target through `super::`, and the imports that only one child uses, which moved into that child. fields.rs has no `use super::*`, since none of its constants names anything outside it.
…ion-schema-mvp # Conflicts: # src/research/partition_schema_mvp.rs
…thout pub parameters, records_2023 and stairs hold only items that were private, so their glob re-export has nothing public to carry and rustc's unused_imports rejects it under -D warnings. A plain use reaches the same items for the parent and its children.
|
Self-review (owner). A pure move of Checked independently of the agent's line script, by token multiset of the original against the 20 new files (commas aside, since rustfmt rewrapped 29 signatures): no token of the original is missing. The only additions are 148 Verification: CI passed on the head before the update-branch merge, with the same jobs running again now. Measure run 41047423569 ( |
…be unit-tested (#1149) ## Summary One rustdoc line in `src/research/partition_schema_mvp/records.rs` said `instances_from_records` was split out 'so the rule is unit-testable without a corpus file'. #1126 deleted every `src` unit test, so the line now just describes the function. ## Motivation Found while removing the support matrix's citations of the deleted unit tests (#1142). It waited for the split (#1141) so the two would not conflict. ## Testing N/A: one doc line. `rustfmt --check` passes. ## Audit-honesty checklist - [x] No claim of tests that do not exist - [x] No changelog fragment (no user-visible change) ## Breaking changes None.
Summary
Splits
src/research/partition_schema_mvp.rs(12,553 lines) into 19 child modules by responsibility, undersrc/research/partition_schema_mvp/. The parent keeps the module doc,PartitionSchemaMvp, therecover_partition_schema_mvporchestrator and the helpers every responsibility shares, and re-exports each child withpub use <child>::*, so everypartition_schema_mvp::<item>path used insrc/,tests/,probes/anddocs/resolves as before. It is a pure move: bodies, doc comments, attributes and the relative order of items are unchanged.Stacked on #1136 and #1139, both of which have since landed on main (squash commits f07614f and 580982d); this branch merged main, so only the split remains in the diff. It stays a draft until a Measure run on the head confirms the move is byte-identical.
Motivation
One of the repository-audit refactors Griffin chose on 2026-10-30: one 12.5k-line file held 175 constants and about 200 functions for a dozen unrelated responsibilities.
Changes
partition_schema_mvp.rs(1,130 lines): module doc, imports,PartitionSchemaMvp,recover_partition_schema_mvp,element_record_decoded,element_record_bbox,record_references,element_source_stream,partition_streams_largest_first,rect_openings_from_partitions, and themod/pub uselines.fields(933): all 175 constants.types(961),parameters(282): type picks and names, system families, type functions; named parameters,IsExternal, phases created, serial numbers.openings(765),curtain(399),materials(704),layers(292).walls(728),wall_joins(453).stairs(730),stair_bodies(1,111),framing(509),mep(750),rooms(289).slabs(592),roofs(862),levels(511).records(495),records_2023(325): category and instance selection, host binding, design-option and nesting filters; the Revit 2023 record path.The only edits to moved text:
pub(super)on the 148 private top-level items that left the parent (the file has no private struct fields or methods).fields.rshas nouse super::*;, since none of its constants names anything outside it. Five of its doc links named a function that now lives in another child, so they read[super::system_family],[super::attach_is_external],[super::bind_opening_hosts],[super::roof_slope_edge_fields]and[super::roof_slope_plate_offset_field].le_bytesintocurtainandopenings,partition_arc_walls/PartitionArcWallintolevels,NameBucket/classify_nameintomaterials,FRAC_PI_4intowalls), so the parent has no unused import.Checked before pushing: every original non-blank line appears in the new files the same number of times, except the added
pub(super)tokens, themod/pub use/use super::*;/ child//!lines, the five doc links and the moved imports;rustfmt +stable --edition 2024 --checkpasses on the parent and every child, and rustfmt's own changes (29 signatures rewrapped by the longer visibility prefix) differ from the unformatted output only in whitespace and trailing commas. Everypartition_schema_mvp::<name>that code outside the module uses (src/,tests/,probes/,fuzz/,tools/) names apubitem; the non-pubnames that remain are prose in docs and reports, as before.Testing
Unit tests are banned in this repository. No local builds on this machine: CI is the compile gate.
tools/check-local.shpasses: not run here (no local compilation);CI passedis the gate-f base=main -f nordic=true -f r2025=true) before this leaves draftAudit-honesty checklist
docs/support-matrix.jsoncitespartition_schema_mvp::<item>module paths, which still resolveLegal and contribution hygiene
Breaking changes
None: the module's public items keep their paths.