Skip to content

feat(ifc): an element's shared parameter Serial Number in Revit's SerialNumber sets (#35) - #608

Merged
DrunkOnJava merged 4 commits into
mainfrom
feat/serial-numbers
Oct 3, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
feat/serial-numbers

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

RE-156 (#606) found Revit's SerialNumber stored as a text entry whose id is the shared parameter Serial Number's ElementId, inside the element's own data object, and the parameter's definition as a data object holding its group, name and GUID. This reads it.

  • partition_room_parameters: find_parameter_definitions (parameter name -> ElementId, from the definitions' strings) and scan_text_parameter, RE-153's scan for any element set and parameter id; scan_room_text_parameter now calls it.
  • partition_schema_mvp: m_serial_number on every element with a value.
  • export_content: Pset_ManufacturerOccurrence.SerialNumber (IfcIdentifier), and on a building-element proxy Pset_PrecastConcreteElementGeneral.SerialNumber too, as Revit's RE1 Electrical (12 flow terminals, 19 proxies) and Plumbing (1 flow terminal) exports write them.

Test: tests/serial_number.rs (real target). Red on main: draft #607, run 37142425779, 50 of 50 values missing on RE1 Electrical; the output is in the test commit's message.


Note

Medium Risk
Adds heuristic partition binary parsing and changes IFC property-set output for elements with Serial Number; export fidelity impact but no security or auth surface.

Overview
RE-156 wires Revit’s shared parameter Serial Number from partition data through to IFC export so values match Revit’s own exports.

Partition scanning is generalized: scan_text_parameter reads any element’s text parameter by id inside its data object; find_parameter_definitions maps project/shared parameter names to ElementIds from definition blobs. Room floor-finish scanning now delegates to the shared helper. During MVP decode, attach_serial_numbers sets m_serial_number on walls, columns, doors, windows, slabs, and generic products when the parameter exists.

IFC export adds serial_number_property_sets: Pset_ManufacturerOccurrence.SerialNumber (IfcIdentifier), and the same on Pset_PrecastConcreteElementGeneral for IFCBUILDINGELEMENTPROXY, emitted alongside existing Reference property sets.

A new tests/serial_number.rs corpus test (RE1 Electrical/Plumbing vs reference IFC) and CI serial_number real target guard parity.

Reviewed by Cursor Bugbot for commit 80adbc2. Configure here.

tests/serial_number.rs: on RE1 Electrical (31 elements) and Plumbing (1),
every Pset_ManufacturerOccurrence and Pset_PrecastConcreteElementGeneral
SerialNumber Revit writes on an element rvt-rs writes must be rvt-rs's.

Red on main (draft #607, run 37142425779, Corpus health tier 2):

---- re1_serial_numbers_are_revits stdout ----
thread 're1_serial_numbers_are_revits' panicked at tests/serial_number.rs:178:9:
RE1 Electrical: 50 of Revit's 50 SerialNumber values are not rvt-rs's
((tag, set), Revit's, rvt-rs's); first:
[(("441149", "Pset_ManufacturerOccurrence"), "IFCIDENTIFIER('G2342')", None),
 (("441150", "Pset_ManufacturerOccurrence"), "IFCIDENTIFIER('G2342')", None),
 (("441151", "Pset_ManufacturerOccurrence"), "IFCIDENTIFIER('G2342')", None), ...
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.65s
…ialNumber sets (#35)

RE-156 found SerialNumber stored as a text entry whose id is the shared
parameter Serial Number's ElementId, in the element's own data object, and
the parameter's definition as a data object holding its group, name and
GUID. This reads it.

- partition_room_parameters: find_parameter_definitions (name -> id, from
  the definitions' strings); scan_text_parameter, RE-153's scan for any
  element set and parameter id (scan_room_text_parameter now calls it).
- partition_schema_mvp: m_serial_number on every element with a value.
- export_content: Pset_ManufacturerOccurrence.SerialNumber (IfcIdentifier),
  and on a building-element proxy Pset_PrecastConcreteElementGeneral too,
  as Revit's RE1 Electrical and Plumbing exports write them.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 3, 2026 18:07
@DrunkOnJava
DrunkOnJava merged commit 49ca997 into main Oct 3, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/serial-numbers branch October 3, 2026 18:18
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
Phase 0 of session 2: repository state, test inventory, the property-set
gap after #603/#605/#608, RE-157's finding, and ranked items B26 to B43
with the 16 committed for this session. Also records #601 to #608 in
B21's progress and corrects the B23 table's stale statuses.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only maintainer backlog updates; no runtime, CI config,
or application code changes in this diff.
> 
> **Overview**
> Updates **`BACKLOG.md`** for maintainer **session 2 (2026-10-03)**:
session settings now record test policy **(a)** (leave remaining suites
untouched after B23), the **ordered committed queue** (B27→B33 and
related ids), and a fresh **Phase 0** snapshot (git/CI, unit-test
inventory post-mirror deletion, `psets_vs_ifc` gaps, RE-157 pipe inner
diameter).
> 
> Adds a **session-2 work table** for **B26–B43** (16 items committed,
B42/B43 blocked on models), extends the **B21 progress log** with
**#601–#608** and reframes still-open parameter/property-set work toward
the new items, logs **four session findings** (witness CI cycles/B27,
duct segment quirk, etc.), and **marks B23 mirror-deletion areas** as
done in **#574–#577** with Python kept under **B25**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
502bb34. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
… own export (B40, #35) (#633)

B40 evidence (#35, #85). A Measure probe scorer listing every property
set Revit's export relates to an object, Pset_ and other.

Measure run 37149211122: Revit's RE1 exports write no property sets
other than Pset_ ones (0 values on Architecture, Mechanical, Plumbing
and Electrical; Pset_ values 255, 298, 612, 153). Every project or
shared parameter value they carry is mapped to a standard set:
SerialNumber (done, #608) and NumberOfPoles (blocked, RE-158). So B40,
writing every project and shared parameter, has no reference values
beyond those, and is blocked on a model whose export writes Revit's
parameter-group sets.

Reproduce: gh workflow run measure.yml --ref tools/b40-reference-sets -f
base=none -f probe=probe_re157_pipe_inner_diameter -f
probe_scorer=reference_property_sets

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Adds a standalone offline research script with no changes to export,
auth, or runtime paths.
> 
> **Overview**
> Adds **`tools/re/reference_property_sets.py`**, a B40 research script
(#35, #85) that inspects Revit’s native IFC export via IfcOpenShell.
> 
> It walks **`IfcRelDefinesByProperties`** links, aggregates every
**`IfcPropertySet`** property by `(set name, property name)`, and prints
how many values appear on how many objects, including nominal value
types for single-value properties. Output splits **standard `Pset_`
sets** from **Revit parameter-group sets** so Measure runs can see
whether project/shared parameters show up outside standard psets.
> 
> The CLI matches other **`tools/re`** probe scorers: **`probe.txt`**
plus **`revit-export.ifc`** (the probe file is ignored); it exits with
usage on bad args.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a2c561d. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
…Id 3 (#35) (#635)

Marks B33 (#631) and B39 (#630) done now that they have merged, and #608
done. Corrects B39's line: RE-161 narrowed the leading 3 to ElementId 3
but did not attribute it, so #228 stays open on that element's class
(RE-161 report status: narrowed; not attributed). Docs only.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog and progress-log edits with no runtime or
test impact.
> 
> **Overview**
> Updates **BACKLOG.md** only to match merged work: **B33** (#631) and
**#608** are marked fully **done** (removing “in the queue”), and
**B39** (#630) is **done** with clarified wording.
> 
> **B39** no longer reads as closing **#228**. RE-161 is recorded as
**narrowing** the reference-list leading `3` to **ElementId 3**
(internal, no name entry; not a workset or parameter value) but **not
attributing** it—**#228** stays open on which element/class ElementId 3
is.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5d48139. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant