Repository navigation
feat(schedules): element and room schedules as CSV from the CLI, the viewer and Python - #289
Merged
Merged
Conversation
…viewer and Python rvt::ifc::schedule_csv writes one row per decoded building element (Revit ElementId, IFC type, level and elevation, material, placement, rectangular body size, the host wall of each door and window, body provenance) or per room (number, name, level). Feet or metres, optional UTF-8 BOM for Excel on Windows, RFC 4180 with CRLF, storey order then numeric ElementId. Unknowns are empty cells; rooms carry no area because their bodies are record bounding boxes. Cells come from an untrusted file, so formula-like text cells are prefixed with ' (OWASP CSV injection), and the older scene_graph::Schedule::to_csv gets the same guard. rvt-schedule (19th CLI) writes <input>.elements.csv / .rooms.csv, or stdout with -o -. The viewer gains Download element / room schedule (CSV) buttons through a scheduleCsv wasm binding on the main-thread instance; Python gains RevitFile.schedule_csv(). On 2024_Core_Interior.rvt: 970 element rows (360 walls, 132 hosted doors, 6 windows, 256 columns, 116 rooms) and 116 room rows, pinned by tests/rvt_schedule_cli.rs.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_5762536e-2ddf-43b7-8b46-cd820a3bbfe8) |
14 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Sep 22, 2026
…ield is set (#290) ## Summary `Global/ElemTable` layout detection no longer mis-measures the record size when a record's sentinel field is set, which on Autodesk's Snowdon Towers 2024 architectural sample left every ElementId reading 0 and disabled element recovery for the whole file. RE-30 records what the same two Snowdon files show beyond that: element recovery does not yet generalise past the recorded edge, and the support matrix now says so. ## Motivation `detect_layout` took the record size from the spacing between the first two `0xFF` runs. On the Snowdon architectural sample, records 1 and 2 hold `0x10` there, so the first two runs are 120 bytes apart, not 40. The flush check failed, and all 15,744 rows parsed at 120 bytes read ElementId 0. Element records join on the declared id set, so none could match, and the IFC export fell back to 64 plan-loop floor guesses (the heuristic's cap) with no ElementId and no geometry. ## Changes - `src/elem_table.rs`: when the measured spacing does not tile the stream flush against `record_count`, try the known 40- and 28-byte strides that divide it and do tile it. `record_origin` folds into `flush_origin`, its only remaining caller. There is a new unit test for the sparse-sentinel shape. - The run the detector anchors on is not a marker. It is an optional `u64` ElementId at record `+4`, and `FF`×8 is its unset value. Set values are declared ElementIds in 22,368 of 22,368 rows on Core Interior and 29,131 of 29,177 on Snowdon. This is documented in the module docs and in `docs/elem-table-record-layout-2026-04-21.md`. - `reports/element-framing/RE-30-snowdon-generalisation.md` (new): on both Snowdon files most element frames in every recovered category use a second prologue whose own ElementId is not at `+0x00`, not in the last reference slot, and not at any fixed offset before the record. Recovery stays fail-closed. - `docs/support-matrix.json`: `element-record-instance-recovery` stays `verified` on the recorded edge. Its `user_impact` no longer reads as if any Revit 2024 project would match. - `.gitignore`: `!corpus/**` no longer re-includes `.DS_Store`. ## Testing - [x] `tools/check-local.sh` with both corpora before the rebase: fmt, clippy -D warnings, rustdoc -D warnings, 1,337 tests passed, 0 failed - [x] After rebasing onto #289: `cargo +1.85.0 check --profile ci --all-targets` (MSRV) and the ElemTable unit tests (22) pass - [x] Corpus-gated `elem_table_corpus`, `project_count_fixtures`, `samples`: unchanged. Core Interior 26,425 records at stride 40, Einhoven 2,614 at 28, families unchanged. - [x] Local-only measurement on the Snowdon samples (not committed, not redistributable): | file | before | after | |---|---|---| | architectural, ElemTable | stride 120, 15,744 rows, distinct ids `{0}` | stride 40, 47,233 rows, 47,232 distinct ids | | architectural, `rvt-ifc` | 64 `IfcSlab` `Floor-unnamed` (no id, no body), 37 `IfcSpace` | 5 `IfcWall` + 1 `IfcSlab` with ElementIds and bodies, 37 `IfcSpace` | | structural | stride 40, unchanged | unchanged (8 walls, 3 slabs, 15 spaces) | ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR. The support-matrix user impact now states that recovery does not generalise to the Snowdon samples. - [x] If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated - [x] New limitation documented: RE-30 (A-prologue ElementId not located; structural categories unmapped) - [x] Commit messages describe WHAT changed and WHY - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files - [x] Reverse-engineering finding: RE-30 report with hashes, counts and the three ruled-out hypotheses ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 (see `CONTRIBUTING.md`) - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see `CLEANROOM.md`) - [x] Test fixtures: a synthetic 40-byte table in the unit test. The Snowdon samples are Autodesk's and stay local only. ## Breaking changes None. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes core ElemTable stride detection used for every project's declared ElementId set and element-record joins; behavior is gated by flush checks and unit tests, but wrong stride would silently break recovery on new file shapes. > > **Overview** > Fixes **`Global/ElemTable` layout detection** when early records set the optional ElementId reference at `+4` instead of the unset `FF`×8 pattern. **`detect_layout`** no longer treats the gap between the first two `0xFF` runs as stride when that spacing does not tile the stream flush against **`record_count`**; it falls back to known **40-** and **28-byte** project strides that divide the spacing and do tile. **`record_origin`** is renamed to **`flush_origin`** and returns **`Option`** so failed flush checks can trigger the fallback. > > On Autodesk's Snowdon Towers 2024 architectural sample this stops a **120-byte** misread (15,744 rows with ElementId 0), restores **47,233** declared ids, and lets partition element records join so IFC export emits **real walls and slabs** instead of **64** capped plan-loop floor guesses. Other corpus files are unchanged. > > Docs and honesty: **CHANGELOG**, **elem-table layout** notes (sentinel semantics), new **RE-30** report (Snowdon still mostly uses an alternate record prologue without a located ElementId), and **support-matrix** user impact scoped to the recorded Core Interior edge. **`.gitignore`** excludes **`corpus/**/.DS_Store`** re-included by `!corpus/**`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4028efa49fb72f6da7c018cd3b79a29ee518ba3c. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
2 of 3 tasks
DrunkOnJava
added a commit
that referenced
this pull request
Sep 22, 2026
## Summary Prepare the v0.2.0 release: the inspection-focused alpha described in `docs/release-0.2.0-plan.md`. It ships PyPI wheels, prebuilt CLI archives for 5 platforms and the multi-arch container image. **crates.io is not part of this release:** no `CARGO_REGISTRY_TOKEN` is configured, and publishing is deferred. Merging this PR is **not** the release. Nothing is published until the draft v0.2.0 GitHub Release (archives attached from a tagged-name `workflow_dispatch` run) is published, which creates the tag and runs `publish.yml`. Until then the docs on `main` say 0.2.0 is prepared and not yet published. ## Changes - Versions: `rvt` and `rvt-py` go to 0.2.0, along with the `stream_evidence` pin, both lockfiles and `.release-please-manifest.json`. - `CHANGELOG.md`: `[Unreleased]` is promoted to `[0.2.0] — 2026-09-22`, with an empty `[Unreleased]` stub. - `publish.yml`: when `CARGO_REGISTRY_TOKEN` is not configured, the crates.io job now logs a warning and exits successfully, so PyPI and the release binaries still ship. A crate the registry rejects still fails the job and blocks PyPI, which keeps the protection against publishing mismatched Rust and Python versions. - `docs/install.md`: the publication table keeps PyPI at 0.1.2 and marks the 0.2.0 archives and the container image **not yet published**. crates.io and docs.rs stay marked **not published**. - `release-binaries.yml`: a `workflow_dispatch` `tag` input names archives for a release without uploading, which is used to stage the draft. - `docs/release-0.2.0-plan.md` and the CHANGELOG heading: prepared, not yet released. ## Testing - [x] `cargo publish --dry-run -p rvt`: packages and verifies 482 files (1.7 MiB) - [x] Full local gate on the constituent PRs (#289–#297); this PR only bumps versions and changes docs and workflow configuration - [ ] CI on this PR ## Follow-up crates.io and docs.rs: add a crates.io API token as the repo secret `CARGO_REGISTRY_TOKEN`, then publish `rvt` 0.2.0 (or 0.2.1), and update `docs/install.md`. ## Breaking changes `ElemRecord` gained `owner_id` (#294); a struct literal of it now needs that field.
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
Element and room schedules as CSV — the spreadsheet people actually want from a Revit file they cannot open — from a new
rvt-scheduleCLI, the viewer's Schedule panel, and Python'sRevitFile.schedule_csv(), all backed by onervt::ifc::schedule_csvmodule.Motivation
The decoded model (walls, doors with their host wall, windows, columns, slabs, rooms with names and numbers on Revit 2024 projects) was only reachable as IFC, glTF, SVG or raw JSON. A schedule in Excel / Sheets / LibreOffice is the most common ask from people without Revit.
Changes
src/ifc/schedule_csv.rs(new):elements_csv(Revit ElementId, IFC type, predefined type, name, level + elevation, material, x/y/z, rotation, width/depth/height of the emitted rectangular body, host ElementId for doors/windows,body_source,profile_resolved) androoms_csv(ElementId, number, name, level + elevation, body source). Feet or metres; optional UTF-8 BOM for Excel on Windows; RFC 4180 with CRLF; storey order then numeric ElementId.ProfileResolved = false), and a box area is not a room area.=,+,-,@, tab or CR is prefixed with'(OWASP). The olderscene_graph::Schedule::to_csvgets the same guard.src/bin/rvt_schedule.rs(new, 19th CLI):rvt-schedule model.rvt→model.elements.csv;--schedule rooms;--metric;--excel;-o -for stdout; refuses to overwrite the input; tells you to runrvt-inspectwhen nothing decoded.scheduleCsv(model, kind, metric, excel); viewer Download element schedule (CSV) / Download room schedule (CSV) under Schedule, enabled only when the model has elements / rooms, built on the main-thread wasm instance from fix(viewer): make Export IFC and Export plan SVG work in the browser #288.RevitFile.schedule_csv(kind="elements", metric=False, excel=False)+ stubs.csv-schedulesrow (partial: coverage is exactly the decode coverage), CHANGELOG.Testing
tools/check-local.shwith both corpora: fmt, clippy -D warnings, rustdoc -D warnings, 1,276 tests passed, 0 failedcargo +1.85.0 check --profile ci --all-targets(MSRV)=HYPERLINK("x"),Lobby, East), BOM toggle, compact numberstests/rvt_schedule_cli.rs: tier-1 shape (17 columns, no ragged rows, stdout + BOM + metric header), one named error for a missing input, and on2024_Core_Interior.rvt(corpus-gated) 970 element rows — 360 IFCWALL, 132 IFCDOOR (all hosted), 6 IFCWINDOW, 256 IFCCOLUMN, 116 IFCSPACE — plus 116 room rows with number and nameValueError)wasm-pack build, typecheck, build, network-import audit PASS, Playwright 14 passed — the Einhoven test downloads the element schedule and checks the BOM + headerbinary_inventory(README "Nineteen CLIs ship"),cli_ergonomics(help examples now includervt-schedule)Audit-honesty checklist
partialand says rows equal decode coverageLegal and contribution hygiene
CONTRIBUTING.md)CLEANROOM.md)Breaking changes
None.
scene_graph::Schedule::to_csvnow prefixes formula-like cells with'.Screenshots or output samples
Related issues
Refs #90 (room boundary polygons — why the room schedule has no area).
Note
Low Risk
Mostly additive export surfaces and defensive CSV escaping; the only behavior change is formula-neutralization in existing
Schedule::to_csvoutput.Overview
Adds spreadsheet schedules for decoded building elements and rooms, shared across a new
rvt-scheduleCLI, the browser viewer, andRevitFile.schedule_csv(), all built onrvt::ifc::schedule_csv.The element CSV includes Revit ElementId, IFC type, level, material, placement, rectangular body dimensions, door/window host ids, and geometry provenance; the room CSV has number, name, and level (no area). Options cover feet vs metres, optional UTF-8 BOM for Excel, and stdout output. Rows reflect decode coverage only (empty cells for unknowns).
Security: text cells that could trigger spreadsheet formula injection are prefixed with
', including in the olderscene_graph::Schedule::to_csv.Docs, support matrix, and tests cover CLI shape, Python API, wasm
scheduleCsv, and Playwright download checks.Reviewed by Cursor Bugbot for commit 8bb1b56. Configure here.