Repository navigation
docs: one home for the provenance table's size, and MCP descriptions that do not list readers (#1375) - #1378
Merged
Merged
Conversation
…that do not list readers (#1375) The table's size is stated once, in docs/export-diagnostics.md with the run that measured it, and every other document, doc comment and schema description links to it. The ValueSourceOut and SourcePartOut descriptions in rvt-mcp describe the fields and point to docs/export-diagnostics.md for the readers and rules, so a new reader no longer changes the MCP tool contract.
DrunkOnJava
marked this pull request as ready for review
November 4, 2026 19:50
Merged
7 of 8 tasks
8 of 10 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Nov 4, 2026
…n extrusion (#1368) (#1379) ## Summary Part 3 of #1368; Refs #1368 (it stays open for the rows listed below). Under `--element-provenance`: - a roof drawn from its slopes (`partition_roof_slope`) lists the slope block of each sketch line the slope was made from (`roof_slope_edges`: the defining edges, or the slope arrow and the boundary lines it rises from), those lines' own data (`roof_line_data`), its fascia depth and rafter cut where they were read (`roof_fascia_depth`, `roof_rafter_cut`) and the layers of its type that give its thickness (`roof_type_layers`), beside the outline (`sketch_lines`, `sketch_list`) and the box (`selected_frame`) it already listed; - a roof drawn from an extrusion (`partition_roof_extrusion`) lists the first frame of each of its sketch lines (`sketch_lines`, rule `frame`: the other frames are not compared), their data (`roof_line_data`), its Sketch's curve list (`sketch_list`) and `roof_type_layers`. Opt-in as before: nothing is noted unless the table is asked for, so the IFC and the default diagnostics are not changed. ## Changes - Each owner map is built where the roof reader already resolves its sketch, with no new pass: `attach_roof_slopes` (the lines of `defining`, `sloped_by_arrow` and `sloped_by_arrows`) and `attach_extrusion_roofs` (`lines_of`). `note_line_source` joins the notes the line scans made, by line id, into one source of the roof, one part per line. - The scans that read the blocks note their choice where they make it, through a new `CopyTrail`: `scan_edge_slopes` (`edge_slope`), `scan_arrow_heights` (`arrow_heights`), `scan_fascia_depths` (`roof_fascia_depth`, keyed by the roof) and `scan_type_layers` (`type_layers`, keyed by the type and attributed to each roof of it with `attribute_value_source`, as for a stair run's type). `scan_rafter_cuts` notes the roof's native record through `Options::value_source` and takes the note back for a roof that gave no cut. - `element_provenance`: `body_readers` for `partition_roof_slope` and `partition_roof_extrusion`; `CopyTrail`. - `tests/value_sources_offsets.rs`: both rows are `Recorded` (`roof_slope_edges`; `roof_line_data`). A roof's slope block is read again and must decode to a slope or a slope arrow (`edge_slope_in`, `arrow_heights`); its sketch line to a line, an arc, a circle, a curve or a spline; its type's layers are an element-data header and the type's id. A new test reads puzzbobb's Revit 2025 models (`RVT_R2025_DIR`): `MIN_READERS` pins `02_1Slope` and `05_1Slope_ArrowDefined` (roof_slope_edges, roof_line_data, roof_type_layers) and `11_RoofByExtrusion` (sketch_lines, roof_line_data, roof_type_layers) by name, the models must be in the set, and the set together must have sources from `R2025_READERS`. - `.github/workflows/ci.yml`: Corpus health restores puzzbobb's models from the Actions cache under the key Measure uses for them (`r2025-<hash of research/r2025-models.tsv and tools/ci/fetch-r2025-models.sh>`), fetches them with `tools/ci/fetch-r2025-models.sh` on a miss, and saves them on main. An unreachable host leaves `RVT_R2025_DIR` unset and the target skips; an archive that no longer matches its pin fails the job. This was not asked for: the brief asked for a Measure pair with `-f r2025=true`, but no model of the CI gate has a roof drawn from these readers (the `value-sources` report of run 41891745041 shows no `partition_roof_slope`, `partition_roof_extrusion` or `family_extrusions` body on Core Interior, RE1, Einhoven or the office), and Measure does not run the test. Without these models the new parts are read by nothing. - `docs/export-diagnostics.md` (a row for each reader, the remaining list, the Revit 2025 models), `changelog.d/added/1368-value-sources-roofs.md`. - No MCP edits: the reader names in `rvt-mcp/src/schema.rs` were removed by #1378, which this branch merged (a signed merge of `origin/main`), so the contract does not move. - `docs/export-diagnostics.md`: the one size table gains three Revit 2025 rows (run 41902619175); the first four rows are unchanged. ## Still without a source (#1368 stays open) - `partition_area_boundary_lines`: waits for #1371, which rewrites the Area readers. - `family_extrusions`: drawn from the family's own document (`FormDocument`), not from an instance's native record; last. ## Testing Nothing was built or run locally (lane rule: CI and Measure are the build); the results are CI's and Measure's, read at head fff508e (CI run 41902701866) and the runs below. - [x] `cargo fmt --all -- --check`, `tools/release/changelog.py check`, `tools/ci/api-doc-ids.py` and `tools/ci/render-mcp-tools.py --check` were clean locally, also after the merge of main. `yaml.safe_load` was not available; `actionlint` parses `ci.yml` and reports only the seven existing `uses: $/.github/actions/fetch-corpus` errors, none in the new steps. - [x] Corpus health passed on its first run on this change. `r2025_value_sources_name_the_copy_the_reader_took` ran on all 24 Revit 2025 models (and the pins in `MIN_READERS`, `R2025_READERS` and the existence of the pinned models held), and every report line reads "re-read and confirmed" in full: for example 02_1Slope 13 of 13 sources and 7 of 7 records, 11_RoofByExtrusion 11 of 11 and 3 of 3, 13_Rooms_Stairs 37 of 37 and 10 of 10, which reads the 2025 stair sources of #1370 (`native_run`, `native_run_type`) for the first time. No fix was needed. - [x] Filtered Measure, 26 models (`core-interior`, `nordic-office-as-built`, 24 `r2025-*`), head fff508e against main 29a715d: flag off (run 41902614550) the IFC and `diagnostics.json` are byte-identical to main's on all 26; flag on (run 41902619175) the IFC hash equals main's on all 26. Every Revit 2025 model with a roof drawn from its slopes lists `roof_slope_edges`, `roof_line_data`, `roof_type_layers`, `roof_fascia_depth` and `roof_rafter_cut`; `11_RoofByExtrusion` lists `sketch_lines`, `roof_line_data` and `roof_type_layers`. Core Interior and the office have none, and their flag-on tables are byte-identical to main's. - **Corpus health cost.** The job took 13.9 min on this head against 7.2 (#1373) and 8.3 min (#1378) on recent green PR runs and 8.3 and 9.4 min on pushes to main, but 6.9 min of it was the existing step "Fetch the Revit 2025 oracle (Drshelden/IFC-ECS RE1, MIT)", 3 s in the other runs: a slow download unrelated to this change. What this change adds: restoring the R2025 cache and the fetch step took 1 s (a cache hit: Measure saved it on main); "Tier-two gates" took 4.4 min, the same as #1373's 4.4 min (5.8 min on the push to main that merged it); the new test took 8.4 s, in parallel with the others (the office test, 26.8 s, ends the step). So it adds no measurable time on a hit, and it stays in Corpus health. A cache miss was not measured (every run found the cache): it downloads three archives of 26 MB in all and extracts them, seconds at the runner's rate, and the cache is saved on main. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] Changelog fragment `changelog.d/added/1368-value-sources-roofs.md` - [x] Limitations documented in the PR body and in code - [x] No emojis, no private paths in committed files - [ ] Reverse-engineering finding: N/A Limitations, stated: - `roof_slope_edges` and `roof_line_data` list the sketch lines the slope was made from; the roof's box (its height and plan centre) is the element's `selected_frame`. The thickness is the type's layers, whose copies agree (a type whose copies differ is dropped by the reader). - `edge_slope`, `arrow_heights` and `type_layers` are `agreeing` because a line or type whose copies disagree is dropped by its reader; `roof_line_data` is `current` where a line's copy was chosen as the current partition's (RE-216). - The `sketch_lines` source of a roof by extrusion is `frame`: the first frame of each line by frame order, as the roof reader keeps it, without comparing the others. - A roof whose body is its box (a slope that does not reproduce its box) gets none of these sources: the sources are listed only where the final `BodySource` is drawn from them.
DrunkOnJava
added a commit
that referenced
this pull request
Nov 4, 2026
…es' own extrusions (#1368) (#1382) ## Summary Part 4 of #1368; Refs #1368 (area boundary lines, which wait for #1371, are the one body left). With `--element-provenance` and `--family-extrusions` both on, a family instance drawn from its family's own extrusions (`family_extrusions`) lists the records of the family's embedded document that its extrusions were rebuilt from (`family_forms`, `parts`): each visible extrusion (`ExtrusionElem`), its sketch plane (`SketchPlane`) and the curves of its sketch (`CurveElem`), at the place the document's group puts the record in its partition. Beside it the instance lists the `instance_transform` that places the extrusions and the `selected_frame` they are drawn at. With either flag off nothing is built or retained: the document is only read at all under `--family-extrusions`, and the places of its records and the list of the records an instance was rebuilt from are collected only while the handle records value sources (`--element-provenance`). The IFC and the default diagnostics are not changed. ## Changes - `native_family_forms::family_records_at`: `family_records_in`, also giving, when asked, where each record starts (the partition and the offset in it inflated: the group's own `inflated_offset` plus the record's position in the group). `family_records_in` is the wrapper. A group whose bytes are not the partition's own (joined from segments that are not consecutive) has no place, and its records none. - `family_extrusions`: `family_parts` also returns, only while recording, the records of the document it used; `attach_with_control` notes them for each instance it replaces (`note_forms`). If any record of an instance's family has no place, nothing is noted for the instance (it keeps its other sources): a list that left one out would not be the records the body was rebuilt from. - `element_provenance`: `body_readers` for `family_extrusions` (`selected_frame`, `instance_transform`, `family_forms`); `family_forms` in `PROFILE_FRAME_READERS`. The saved mesh the extrusions are checked against is not a source of the body. - The rule is `frame`: the family's document is read once, as it is embedded. A record the file holds in several partitions is named at one copy (see the next section); the other copies are not compared. A part's `element_id` is the family document's record id, not the model's, so it can equal another element's. - `tests/value_sources_offsets.rs`: the `family_extrusions` row is `Recorded`. A new test exports the office, RE1 Architecture and RE1 Electrical (the models #1372 measured that draw family extrusions; the terrain files are not in the test's set) with `--family-extrusions` as well, as `<model>+family-extrusions`, and `FAMILY_MIN_READERS` pins `selected_frame`, `family_forms` and `instance_transform` on each. - `docs/export-diagnostics.md` (the row, the remaining list, the test's description), `changelog.d/added/1368-value-sources-family-extrusions.md`, `changelog.d/fixed/1368-family-forms-partition-order.md`, and the older #1368 fragments, which no longer say family extrusions are without a source. - No MCP edits: the descriptions no longer list readers (#1378). ## Which copy a part names (second read) `FormDocument::insert` keeps the last copy's graph of a record, but `family_records_at` recorded the first copy's place, and `load()` took the partitions in name order, not partition-number order (the #1356 bug class). Chosen: place and geometry come from the same copy, the last, not skip-on-duplicate. - `load()` takes `RevitFile::partition_stream_names` (numeric order, the newest copy last) instead of sorting names. - The place is last-wins, matching `insert`. A later copy whose group has no place removes the earlier copy's place, so a place never belongs to a copy other than the one the geometry came from; the instance then gets no `family_forms` source, as for any record without a place. - The numeric order reaches the other readers of a family's document on the default path (the materials of a family, `instances_without_body`): they `push` or `insert` per copy, so only the order the records are read in changes, and only for a file whose partition numbers have unequal digit counts. Core Interior (46 to 65), RE1 Architecture (80 to 84) and RE1 Electrical (114 to 120) do not; the office and the terrain files are what the Measure pair below settles. ## Test fixes (second read) - A pinned model that the corpus lacks fails the family test where its directory variable is set (`RVT_PROJECT_CORPUS_DIR` for RE1 Architecture and RE1 Electrical, `RVT_NORDIC_LCA_DIR` for the office), as `check_all` does; unset, that directory is skipped. Corpus health fetches RE1 Electrical with the other RE1 files, by hash. - An extrusion roof's `roof_line_data` is compared with its `sketch_lines` by ElementId, not by count (the lists are compared sorted when both are whole; the counts when either was cut at the listing's cap). - The test reads each instance's family document again (`family_records_in`, a `FormDocument`) and requires the instance's parts to be exactly the records its visible extrusions are made of: every `ExtrusionElem`, its `SketchPlane` and its `CurveElem` curves, none left out, none extra. Each part is read from its bytes at its offset by its role: the class tag there must be the role's class, not any of the three. - Docs and fragments: an instance whose record has no place gets no `family_forms` source; "nothing is built" is now true (`family_parts` collects the record set only while recording). ## Folded in from the second read of #1379 The merge of main brought #1379 in; its fixes are in the first merge commit because they edit what the merge brings: the R2025 test skips only when `RVT_R2025_DIR` is unset and fails when a pinned model is absent (an empty or missing directory included); `roof_type_layers` is read again by `find_layers` with its window, `roof_fascia_depth` by `fascia_depth` with `EDGE_SLOPE_WINDOW`, and `roof_rafter_cut` by `scan_rafter_cuts`, all three pinned in `R2025_READERS`; a sloped roof's `roof_line_data` comes only from the slope scan's `sketch_line` notes; an extrusion roof's `roof_line_data` must have a part for each of its `sketch_lines`; the rafter-cut note is taken back only while recording; and the docs say that a roof with one arrow lists the arrow's line alone, that the reader compares decoded slopes, not bytes, and that `sketch_list` of an extrusion roof appears only when the Sketch lists its curves (`11_RoofByExtrusion` has none). ## Still without a source (#1368 stays open) - `partition_area_boundary_lines`: waits for #1371. ## Testing Nothing was built or run locally (lane rule: CI and Measure are the build); the results below are CI's and Measure's. The second-read changes below were written without a compiler: CI's first run on 216126c is their first check. - [x] `cargo fmt --all -- --check`, `tools/release/changelog.py check`, `tools/ci/api-doc-ids.py` and `tools/ci/render-mcp-tools.py --check` were clean locally, before and after the merges and the second-read changes. - [x] Corpus health passed on its first run on this change (CI run 41907417882, head dcb435e, before the second read): the family test ran on the office, RE1 Architecture and RE1 Electrical, and every report line read "re-read and confirmed" in full: RE1 Architecture 8 instances with `family_forms` (128 of 128 sources, 160 of 160 records), RE1 Electrical 8 (65 of 65, 30 of 30; all 8 in another partition than their frame), the office 129 (13,927 of 13,927, 2,482 of 2,482). It took 32.6 s then; the second read adds a document read per model (watch the time). - [x] Filtered Measure at dcb435e, `--element-provenance --family-extrusions`, run 41907345226, against main with the same flags: the IFC hash equals main's on all 7 models. Family instances with the new source: office as built and at permit 129, the terrain files 11 each, Core Interior 37, RE1 Architecture 8, RE1 Electrical 8. - [ ] The pair on the final head 216126c (the numeric order and the last-wins place are new since the last pairs, which were byte-identical at 1ea948d): no flags (run 41915552784) and `--element-provenance --family-extrusions` (run 41915557479), models `core-interior re1-architecture re1-electrical nordic-*`. Both must leave the IFC byte-identical to main's with the same flags and the first the diagnostics too. NOT MEASURED until they finish; arming waits on them. - [x] The size table (`docs/export-diagnostics.md`, "Provenance table size"): the family sources add 1.1% to the office's compact table, 10% to Core Interior's, 17% and 15% to RE1 Architecture's and Electrical's, 13% to each terrain file's (run 41907345226); the first rows are unchanged. The named copy is now the last, so an offset can have another digit count: the new pair's table sizes settle whether a figure moves. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] Changelog fragments `changelog.d/added/1368-value-sources-family-extrusions.md` and `changelog.d/fixed/1368-family-forms-partition-order.md` - [x] Limitations documented in the PR body and in code - [x] No emojis, no private paths in committed files - [ ] Reverse-engineering finding: N/A Limitations, stated: - The records listed are those the rebuild read (each visible extrusion, its plane and its curves); an extrusion hidden by its `Visible` parameter is set aside and not listed. A family with a void or an extrusion the reader does not rebuild draws nothing and has no source. - Which instance of a family the extrusions fit is checked against the instance's own saved mesh, not recorded as a source; the instance's parameter values that differ from the family's are not sources either (the checks refuse an instance they make differ). - The terrain variants of the office draw family extrusions too (#1372) but are not in the test's model set; the Measure run covers them for byte-identity and counts. - Not measured: that two copies of a family's record, where a file holds them, agree; the last is named.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The provenance table's size is stated once, in
docs/export-diagnostics.md("Provenance table size"), with the run that measured it. Every other place links to it and states no number. The MCPValueSourceOutandSourcePartOutdescriptions describe the fields and point todocs/export-diagnostics.mdfor the readers and rules, without naming a reader. Docs and doc comments only: no code changes, so no Measure is needed and the default export cannot move.Motivation
Closes #1375. Every value-source PR on 2026-11-04 (#1364, #1370, #1373) needed an extra commit and a full CI round, for two reasons that are churn rather than content: the size figures sat in seven places, and the MCP descriptions listed the readers, so each new reader drifted
docs/mcp-tools.json.Changes
docs/export-diagnostics.md: a new section, "Provenance table size", with one table (office, Core Interior, RE1 Mechanical and Plumbing: diagnostics, table and sidecar sizes and their ratios) from Measure run 41890994176. The CLI section, the export-decisions paragraph and the schema table now link to it.docs/mcp.md,docs/python.md,docs/schemas/export-diagnostics.schema.jsonand the doc comments ofsrc/ifc/element_provenance.rs,export_pipeline.rsandmod.rslink to it and state no number. Changelog fragments of unreleased work keep their own figure.rvt-mcp/src/schema.rs:ValueSourceOutandSourcePartOutdescribe each field generically and refer todocs/export-diagnostics.md, "Value sources", for the readers, the rules and what each source'spartsare.docs/schemas/export-diagnostics.schema.jsondoes the same for itsreader,parts,offset,partitionsanddiffers_from_framedescriptions (itsrulekeeps its enum).docs/mcp-tools.jsonanddocs/mcp-tools.mdneed CI'smcp-toolsartifact; I did not edit them. This is the last time a reader changes them.Testing
Nothing was built or run locally (lane rule: CI is the build).
cargo fmt --all -- --check,tools/release/changelog.py check,tools/ci/api-doc-ids.pyandtools/ci/render-mcp-tools.py --checkwere run locally and are clean; the schema JSON parses.tool_contract_is_committedfails on this head until the watcher commits the server's contract; that commit is the one expected change of the contract. NOT MEASURED until then.grepfor the table's byte counts and ratios overdocs/,src/,rvt-mcp/andpython/finds only the table.Audit-honesty checklist
Limitation: the diagnostics schema's
ruledescription still names the five rules, because the property is an enum; a new rule changes the enum and so the schema anyway.