Skip to content

feat(ifc): value sources for Areas and for floors drawn along their shape-edited top (#1368) - #1403

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/1368-area-line-sources
Nov 5, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/1368-area-line-sources

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

The last two bodies with no value source (#1368) get one, under --element-provenance only:

  • Areas drawn from their area boundary lines (partition_area_boundary_lines): area_boundary_lines lists the frame of each line that bounds the Area's region (its holes' too), the first copy by frame order, and area_point names the element data that gave the Area's point, which picks the region among the lines (the data object on Revit 2024, the 01 00 00 00 · ElementId header on 2015 to 2023).
  • Floors drawn along their shape-edited top (native_slab_shape_edit, Footings Revit draws sloped: the BIM4LCA office's Basement walls stand on footings rvt-rs draws as their boxes (RE-335) #1384), which had no value source: they now list their selected_frame, the sketch_lines and sketch_list of their outline, and native_slab_shape, the floor's current native record whose SlabShapeEditGStep gives the plane.

With this, every BodySource on the gate's models has a reader that notes its copy, so tests/value_sources_offsets.rs drops its NotYet coverage. An Area's Levels (its base and height) have no source, and the docs say so.

Changes

  • src/research/partition_area_records.rs:
    • The boundary-line scan keeps each line's first frame, only while the handle records value sources.
    • The point readers keep where the point's first copy starts.
    • note_area_sources notes both for each drawn Area. A redundant or refused Area gets nothing.
    • A line list with one line missing a frame is not noted, since a partial list would not be the lines the region was drawn from.
  • src/research/partition_schema_mvp/slabs.rs: the plate pass that reads SlabShapeEditGStep sets value_source, so extract_graphs notes the current record. No new pass.
  • src/ifc/element_provenance.rs: body_readers maps:
    • partition_area_boundary_lines to area_boundary_lines and area_point;
    • native_slab_shape_edit to selected_frame and native_slab_shape.
  • tests/value_sources_offsets.rs:
    • Both bodies are Recorded.
    • area_point is re-read: the data object's ElementId, or the element-data header and id, and a finite point after it.
    • The office must have sources from all three readers.
    • NotYet is gone.
  • docs/export-diagnostics.md: three rows, and the paragraph on what has no source.

Testing

  • No local build (policy).
  • Corpus health on 779ee16 (job 126980412397) re-read every new part, 2,721 of 2,721 confirmed. On the BIM4LCA office as built, all 30 Areas have area_boundary_lines and area_point, and all 8 shape-edited floors have native_slab_shape. None is in another partition than its frame.
    • The office's compact diagnostics with the table grow from 6,236,391 to 6,291,246 bytes (0.9%; main at 77d71cb, run 41944703690).
    • Without the table the office is unchanged at 13,021 entities and 38,751 bytes of diagnostics.
  • Since review: the area_point check no longer only checks that two floats are finite. It now requires the point to lie inside the outline the export drew for that Area, since the point is what picks the region (652b4e9). CI on that head pending.
  • Measure 41946238440 (779ee16 against main, default models): ifc.sha256 identical on all 6 models and an empty scorer diff. The notes are taken only while the provenance table is built.
  • Not exercised in CI: the Revit 2015 to 2023 path of area_point and of the lines. No 32-bit model in the gate draws Areas.

Audit-honesty checklist

  • Rules are stated as the readers apply them:
    • agreeing for lines, whose conflicting copies refuse the group;
    • frame for the point, since copies outside the record's partition are not compared;
    • native for the slab record.
  • What stays without a source is listed (an Area's Levels; a wall's layers and the others already named).

Legal and contribution hygiene

  • Apache-2.0; no Autodesk proprietary source, decompiled internals or NDA'd SDK content.

Breaking changes

None. New reader names appear in decoded.element_provenance.value_sources and value_source_counts only with --element-provenance.

Related issues

Refs #1368, #1384, #1360.

@DrunkOnJava DrunkOnJava added the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 5, 2026 01:10
@DrunkOnJava DrunkOnJava removed the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 5, 2026
@DrunkOnJava
DrunkOnJava merged commit 3861cc3 into main Nov 5, 2026
33 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/1368-area-line-sources branch November 5, 2026 01:57
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
## Summary

Release 0.15.0:
- Where each decoded element was read from, down to the byte, on
request: `rvt-ifc --element-provenance` (#1325), with the copy each
body, profile and outline reader took its value from (#1360, #1368).
- Why an element, body, opening or outline was left out, one entry per
element, on request: `rvt-ifc --export-decisions` (#1326), and the MCP
server's `explain_element`.
- Where a Revit 2008 to 2023 project's element records stop, in every
export's diagnostics (#1389, for #421).
- Rooms take off the round columns their stored solid holds (#1354,
RE-334).
- Areas whose boundary lines name each other are drawn to their joins
(#1261, RE-330).
- Shape-edited floors drawn along their sloped top, and the walls on
them cut at it (#1384, RE-336).
- `rvt-ifc --family-extrusions`, opt-in, draws a family instance from
its family's own extrusions, arcs as true arcs (#156, RE-327, #1366).
- Partition streams in number order (#1356); the viewer's browser tests
in `CI passed` (#1394).
- Value sources for Areas and shaped floors (#1403), the shaped floors'
slab quantities and the GLB layer colour kept (#1405), floor voids
tagged as Revit tags them (#1402), Measure's scorer for the MCP server's
answers (#1404), and the MCP server's element names and type objects
taken from the IFC writer (#1406).

## Changes

- Version 0.14.0 -> 0.15.0 in:
  - Cargo.toml;
  - rvt-py/Cargo.toml and its `=` pin;
  - rvt-mcp/Cargo.toml and its `=` pin;
  - rvt-wasm/Cargo.toml;
  - tools/stream_evidence/Cargo.toml;
  - viewer/package.json;
  - CITATION.cff (version and date);
  - Cargo.lock and fuzz/Cargo.lock.
- `python3 tools/release/changelog.py assemble`: 23 fragments go into
`[0.15.0]`, with an introduction, a "Not measured" list, credits and
"Upgrading from 0.14". The 21 from the first assembly come in first,
then #1403's and #1405's after `main` was merged. #1405's fix is folded
into #1384's entry, since the slab quantities it restores never left a
release.
- README: the latest release and the "Upgrading from" pointer.

## Testing

- **Measure 41944962415.** It ran `main` at 77d71cb against v0.14.0
with timing, on the reference models, the samples, the held-out models
and Revit 2025, with no families.
- It found two losses from #1388 on the offices: 16 slab quantities went
from equal to missing on each file, and 14 (16) walls lost their GLB
layers.
- #1405 restores both. Measure 41949652150 shows them back to v0.14.0's
values, with 32 other models byte-identical.
  - The intro's timing figures come from this run.
- **Final Measure 41965523134.** It ran this branch at 1e56972 (with
#1402 to #1406, #1413 and #1414) against v0.14.0, with the reference
models, Revit 2025, the samples, the held-out models and the families.
  - Every figure in the introduction comes from it.
- Apart from the MCP scorer #1404 adds, every scorer output on every
model is identical to run 41963115180 (5b1a371): the held-out counts
only gain `mcp answers:` lines. #1406's writer refactor therefore moves
no export, on the samples and held-out models too.
  - Since 1e56972 the branch adds only changelog text.
- **Witness and fixtures.** The Core Interior witness observations and
verdicts (both artifacts) and the two synthetic fixtures are taken from
this PR's CI run 41954452074 on ce0b2d8. Only `witness_version`, the
verdict hashes and the version strings changed.
- **Release review.** A second read found these, all fixed on the
branch:
  - a false "and the families" for the first run;
  - #1405's missing entry;
  - an offsets claim that overreached for the decisions log;
  - stale sentences in three entries;
  - missing caveats, credits and upgrade notes;
- an MCP output schema that listed four optional fields as required.
#1414 fixes that and lands first.

## Audit-honesty checklist

- [x] The introduction keeps each entry's caveats, and adds a "Not
measured" list:
- the offsets unmeasured on Revit 2008 to 2022, and the decisions log's
before 2024;
  - the values with no recorded source;
  - the in-sample Area join rule (#1261);
- the refusal markers on Snowdon and `rac_advanced` with no IFC4 export
to score them;
  - the family-extrusions release range.
- [x] No emojis, private paths or internal jargon.

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk proprietary source, decompiled internals
or NDA'd SDK content.

## Breaking changes

None in the stable API: `ExportOptions`, `ExportNote`,
`ExportDiagnostics`, `DecodedExportDiagnostics` and
`ExportedModelDiagnostics` gain fields and variants, and all are
`#[non_exhaustive]`; the provenance, decisions and stage types are new.
`--family-extrusions` is new in this release (the `arcs` field #1366
removed never shipped). Behaviour changes are listed under "Upgrading
from 0.14".

The `rvt-rs-mcp` tool output changes, as #1406 states and "Upgrading
from 0.14" lists:
- an element's `name` can be absent, where it would be a room's
`<class>-<ElementId>` placeholder;
- `element_type` is absent where the IFC export writes no type object;
- `element_type`'s `element_id` is the type object's `Tag`.

The output schemas in `docs/mcp-tools.json` say so.

## Related issues

Refs #1325, #1326, #1360, #1368, #1389, #421, #1354, #1261, #1384, #156,
#1366, #1356, #1394, #1374, #1402, #1403, #1404, #1405, #1406, #1413,
#1414.
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
…dumps and Jev scores the diff (#1334) (#1419)

## Summary

The advisory semantic merge check of #1334. Measure diffs the two sides'
MCP dumps for each openly licensed model, and a `workflow_run` workflow
gives the diff to Jev `jev-1.13.0` beside the pull request's own `##
Summary` and `## Testing` and asks whether the export moves in a way
they do not state specifically (Griffin, 2026-11-05: a described,
intended change passes, an unexplained move fails; the main session,
2026-11-05: a move that only a general description such as "improves how
walls are exported" covers fails too). The verdict is the check run
`semantic diff (advisory)` on the commit Measure measured: not in the
ruleset, no pull request comment, and a `fail` is a red check. Only a
Measure run of every open model with a base on main writes it, it is
written on the commit Measure measured and no other, and it cannot be a
pass unless all 34 open models are compared in full and a
same-repository pull request has that commit as its head.

## Motivation

Measure is the byte-level oracle. A pull request that moves meaning
should say so, specifically, before it is armed, not only show that
bytes moved. The agent that makes a change also writes its Summary, so a
sweeping Summary must not cover a change. Refs #1334.

## Changes

- `tools/re/semantic_diff.py`: a pure function of two dumps. Elements
added, removed and changed with the value before and after; byte offsets
inside `provenance` dropped; order ignored; values compared to the
dump's six decimals; an empty object or list the same as no field;
identical changes collapsed by the whole (path, before, after) triple.
Its `measure` mode is what the compare job runs: it fails the job on a
dump in a model that is restricted or on neither list, and records in
the manifest the open models no diff covers (`OPEN_MODEL_NAMES`, 34),
each skipped model with its own reason, the groups dropped for size, and
whether the run was asked for every open model (`--requested-all`). The
measured commit and the base are the ones the compare job passes from
the plan job's resolved refs (`--head-sha`, `--base-sha`); the
`commit.txt` of a result folder is written by a shard job that runs the
measured code and is read only when none is passed.
- `tools/re/test_semantic_diff.py` and `tools/ci/test_jev_check.py`:
failure-first tests of pure helpers, run in the PII guard job. The diff:
0.35 vs 0.3500001, a reorder with moved offsets, a bulk collapse that
hides a different value, an uncovered model. The verdict logic: a model
with no dump, a diff that failed, a dropped group, an unscored chunk or
partial coverage never reads as a pass; an answer whose probabilities do
not add up is refused; a chunk of non-ASCII text is never sent over the
16,000-character cap; a head commit that is not a 40-character SHA, a
manifest with a non-string model, HTML and invisible characters in the
pull request's text, and control characters in printed text. Each was
checked to fail under the mutation it guards against.
- `.github/workflows/measure.yml`: the compare job checks out the
script, runs `measure` when there is a base, tells it whether the run
was dispatched with no `models` filter and the office and Revit 2025
models on, and uploads `semantic-diff`. The documented command is `-f
base=main -f nordic=true -f r2025=true` with no `models` filter.
- `tools/ci/jev_check.py`: merges findings across models, chunks them
(at most 8 findings, 16,000 characters as sent), reads the
same-repository pull request whose head is the measured commit through
the API, takes its `## Summary` and `## Testing` (HTML element tags and
invisible characters removed, each cut at 2,500 characters as sent, all
of it shown in the check's summary; text in angle brackets that is not
an HTML element, such as `<set>.<property>`, stays), and asks Jev blind
(labels A and B randomised per chunk; no model name, pull request
number, title or branch in the state). Per finding Jev chooses: stated
specifically / follows from a specific change they state / covered only
by a general description / unstated / only rounding, a reordering or a
spelling; "general" plus "unstated" is the finding's score, and the
probabilities must add up to 1. A finding at 0.85 or more is a fail in a
chunk rated 1.5 or more and a warn in one rated 1.0 or more. NOT
MEASURED, never a pass, for no key, no same-repository pull request
whose head is the measured commit (a fork's included, and an empty diff
does not excuse it: the lookup is first), a check asked for on a commit
other than the measured one (both commits in the title), a base that is
missing or could not be checked, a pull request with no `## Summary`
where the diff has findings, HTTP 402, a refused key, another model's
reply, a time-out, an error (named by its type), no model compared, any
open model not compared in full, a dropped group or a missing count,
sampled property sets that one of a model's dumps alone holds too often
(none held by both while either holds any, or more than a tenth of
them), or an unscored chunk. A run whose base is not main or an ancestor
of main writes no check, and names the base. The Jev call does not
follow a redirect. An empty diff passes without a call and needs no
Summary, but only on a complete run.
- `.github/workflows/semantic-check.yml`: `workflow_run` on Measure
(environment `jev`, main only), `workflow_dispatch` with a run id, and a
keyless run on a pull request that changes the check. It scores only a
Measure run whose event is `workflow_dispatch` and whose head repository
is this repository, from `measure.yml` at that path; any other run posts
nothing, with a notice. It writes the check on the commit the artifact
names as measured, not on a pull request's live head. actionlint reports
nothing on it and zizmor 1.32.0 reports nothing on it, `measure.yml` and
`ci.yml` (the one `dangerous-triggers` finding, on `workflow_run`, is
ignored inline with its reason).
- `docs/maintaining.md` (where to find the verdict: it is on the
measured commit, not necessarily the head, which the pull request page
does not show, so look it up with `gh api
repos/<repo>/commits/<sha>/check-runs?check_name=...`; a later commit
does not clear a fail, only a new score of the same pull request does; a
filtered Measure run writes no verdict, so a pull request that changes
output needs its final unfiltered run; the Summary must state each
change specifically: which classes, which property or geometry, how many
where measured; a fail is fixed by changing the code or by stating the
change in the Summary; a warn is answered in the body; the complete
command; what a pass means: the dumps agree, not that the exports are
identical, since the dump samples five elements per entity; what is
sent, including element names and values that can hold an ElementId), a
changelog fragment.

## Testing

No local build (the lane runs no cargo); the tests above are the
pure-helper exception and run in CI's PII guard job. End to end on real
dumps:

- [x] N/A for `tools/check-local.sh`: no Rust changed.
- [x] Verified end to end on real Measure runs: see "Output samples".
The keyed path (main's `workflow_run` job with the secret) is not yet
exercised.

## Audit-honesty checklist

- The keyed path cannot run before the workflow is on main:
`environment: jev` takes only main, and a `workflow_run` workflow runs
from the default branch. After the merge: `gh workflow run
semantic-check.yml --ref main -f run_id=<a complete Measure run with a
base>`.
- The keyless path is exercised by this pull request's own run of the
workflow, and it can only say NOT MEASURED: it writes on the pull
request's head, which is never the commit Measure measured. At c36b71f
(before the delta review) it did so with the wrong reason: Measure run
41987903774 (dispatched from this branch for #1425's head c8e55f5
against main 182ed21, `-f nordic=true -f r2025=true -f
scorers=mcp_answers_vs_ifc`, no `models` filter) compared all 34 open
models (0 skipped, 0 uncovered, `requested_all` true; findings only in
the two office files, 7 each), and this workflow's run 41987854258
(attempt 2) wrote check run 127117767677 on c36b71f through
`GITHUB_TOKEN` saying only "no Jev key", a check on a commit Measure had
not measured. At b4d1932 such a check says "this check is for <the
head>, but Measure measured <the other commit>" in its title (local
scenario below; the CI proof is Measure run 41993282068 on #1425's head
722244e against main a4044dc, and this workflow's pull-request run
after it: not yet measured on this head). Measure's own pull-request run
41987854320 covered 6 of 34 models and its compare step says "the
semantic check writes no check run (this run was not asked for every
open model)", the filtered path in a real run. An earlier pass of the
keyless path (run 41966963563, attempt 2, on fd90cdc: no semantic
difference in 6 models) predates the coverage rule and the commit check.
- A pass means the dumps agree, not that the exports are identical: the
dump samples five elements per entity, and a mesh vertex or a profile
point is not in it.
- The thresholds and the wording of the per-finding question were set on
the in-sample cases below, so those cases are in-sample for them. The
held-out round is the second table. Jev's answers move by about 0.02
between two calls with the same request (#1412's own Summary passes at
0.84 and fails at 0.86 on byte-identical requests, against a gate of
0.85), so a verdict within 0.05 of the gate is not stable.
- B3 (a fork's run) and the redirect behaviour are tested by reading the
code and the unit helpers, not by a fork's run: no fork pull request was
opened.

## Breaking changes

None.

## Output samples

Everything below was scored with `tools/ci/jev_check.py` and
`tools/re/semantic_diff.py` as committed at 49d5378, and the
delta-review block below as committed at b4d1932 (which changes who may
write a check, the gaps, and the stripping of HTML and invisible
characters in the pull request's text; no prompt, threshold or
chunking), and the key from the Keychain on this Mac, from the
`semantic-diff` and `measure-*` artifacts of the Measure runs named.
Nothing was scored with a threshold or a prompt other than the committed
ones.

**Ground truth is `ifc.sha256` per model**, not a pull request's title.
Of 13 pull requests in the in-sample set (Core Interior, Einhoven, RE1
and the Revit 2025 models in every run; 34 models with the BIM4LCA
office where `nordic` was on, 30 for #1402 and #1403 and 6 for #1398),
the IFC differs on the two office files for #1388, #1400, #1401 and
#1405 and on no model measured for the other nine. The semantic diff has
findings on exactly those two models in each of those four runs, and
none on any model whose IFC is identical, except the dump-only changes
of #1373, #1379 and #1412. The documented command (no `models` filter)
is what finds them: the earlier documented command, which filtered to
Core Interior, Einhoven and RE1, reads "pass" on all four.

**In-sample: the 7 pull requests whose diff is not empty** (runs
41972569847 #1388, 41972650013 #1400, 41972664107 #1401, 41972583508
#1405, 41972597118 #1373, 41972610208 #1379, 41972636527 #1412; each 34
models). "Own" is the pull request's real Summary and Testing.
"Sweeping" is a one-line Summary that names an area and no kind of
change ("Improves how walls and floors are exported." for #1388,
"Improves how openings are written in the export." #1400, "Improves how
walls are drawn in the export." #1401, "Improves how floors and walls
are exported." #1405, "Improves how rooms, profiles and pipes are
exported." #1373, "Improves how roofs are exported." #1379, "Improves
the MCP server's answers." #1412), alone and beside the pull request's
real Testing. "Wrong" is another pull request's full body: #1329 (a
memory change that states the output does not change) and one other. The
number in parentheses is the highest probability that Jev gave a finding
as not stated specifically.

| Pull request | Findings | Own | Sweeping alone | Sweeping + its
Testing | Wrong: #1329 | Wrong: other |
| --- | --- | --- | --- | --- | --- | --- |
| #1388 | 7 | pass (0.31) | fail (0.99) | pass (0.74) | fail (0.99) |
#1412: fail (0.95) |
| #1400 | 14 | **fail (0.94)** | fail (0.99) | fail (0.98) | fail (0.98)
| #1373: fail (1.00) |
| #1401 | 12 | pass (0.63) | fail (1.00) | pass (0.77) | fail (0.96) |
#1379: fail (1.00) |
| #1405 | 2 | pass (0.51) | warn (0.99) | warn (0.90) | warn (0.96) |
#1379: **pass (0.78)** |
| #1373 | 88 | pass (0.63) | fail (1.00) | fail (0.99) | warn (0.97) |
#1400: fail (1.00) |
| #1379 | 94 | pass (0.24) | fail (0.99) | warn (0.90) | fail (0.96) |
#1401: fail (1.00) |
| #1412 | 23 | pass (0.84) | fail (1.00) | fail (0.89) | fail (0.99) |
#1388: fail (1.00) |

- **No sweeping Summary alone passes (0 of 7): 6 fail, 1 warns.** Beside
the pull request's own Testing two pass (#1388 and #1401), because their
Testing states the figures: that is the rule working, since a measured
figure in Testing counts as stated.
- **False positives: 1 of 22 expected passes, a fail.** The 22 are the 7
own Summaries, 6 jitter controls, 6 reordered controls and 3 empty-diff
pull requests on complete runs (#1329, #1377, #1382: no finding on any
model, IFC identical, each a pass without a call to Jev). #1402 and
#1403 ran without the office, so under the new rule they write no check
and are not counted. #1400 is a diff of 14 counters of the diagnostics,
and the figure its Summary and Testing leave unstated is
`parameter_value_count` +188 (office as built) and +174 (permit); its
Motivation, which Jev is not given, gives 182. #1412's own Summary sits
at the gate: the same request scored 0.84 (pass) at 4e81a95, 0.86
(fail) in one rescoring on this head's code and 0.84 (pass) in the table
above, so it is a verdict the gate cannot hold; it could as well be
counted a second false positive.
- **False negatives: 1 of 21 expected non-passes** (7 sweeping alone, 7
with #1329's body, 7 with another's): #1405's whole diff is
`total_entities` +8 on each office file, which a roofs Summary does not
state (0.78, below the gate).
- **Controls, complete** (all 34 models on both sides, one model
changed; built from the dumps of run 41972569847): six jitter controls
pass, a move of 1e-6 in every measurement of the sampled elements, the
rooms' areas and the levels' elevations in Core Interior, RE1
architecture and mechanical, Einhoven, the office as built and a Revit
2025 model, scored beside #1329's body: highest probability 0.73 to
0.79, highest chunk rating 0.6 to 0.7, below the 1.0 rating gate; 412
findings in 65 chunks on the office. Six reordered controls (every row,
set and room in another order, every byte offset shifted) are empty
diffs.
- **Coverage, on #1401's stored diff** (run 41972664107, own Summary),
changing only the manifest: complete, **pass**; one model with no dump
on the head side, **NOT MEASURED** naming it; one model whose diff
failed, **NOT MEASURED** with that reason; a dropped group, **NOT
MEASURED**; the same missing model with a run not asked for every open
model, **no check run**; a manifest with a non-string model, an error
and no check run.
- **Unchanged by the review fixes:** 34 of 35 verdicts of the in-sample
matrix are as scored at 4e81a95 (the one that moved is #1373 with
#1329's body, fail to warn; both are non-passes), and #1401 and #1405
(the two the review asked for, runs 41972664107 and 41972583508) are
unchanged in all five bodies. 18 of the 35 requests are byte-identical
to the earlier scoring; the other 17 carry a Summary or Testing that is
now cut by its length as sent (a newline or a quote in the text counts
two, so a section over the cap is cut about 20 characters earlier),
which is the review's cap fix and not a change of method.

**Delta review (b4d1932).** Run on stored complete runs, with the key
from the Keychain and real GitHub lookups, nothing posted:

- Run 41972569847 (#1388's merge commit, base 240c7d7): the pull
request is found through the API from the measured commit, the base is
on main, Jev is asked with #1388's real Summary and Testing: **pass (7
findings in 34 models)**, as before. Run 41972583508 (#1405's merge
commit): **pass (2 findings)**, as before. Run 41972664107 (#1401's head
2a35ede, which has since moved): NOT MEASURED, "no pull request of this
repository has this commit as its head", the head-moved case in a real
run; scored offline with #1401's real body the verdict is **pass**, and
all five of its bodies give the verdicts of the table above (pass, fail,
pass, fail, fail). #1388's five bodies and #1405's five are the same
verdicts as the table, except #1405 with #1329's body, warn to fail (a
non-pass either way, at a rating of 1.5).
- Run 41987903774 (PR #1425's head c8e55f5 when measured): its head has
since moved to 722244e, so the real-lookup scenario reads NOT MEASURED,
"no pull request ... has this commit as its head". Asked to write on
another commit (c36b71f), the same run reads NOT MEASURED with "this
check is for c36b71f, but Measure measured c8e55f5". An empty diff
on a merged pull request's commit (run 41980023307, #1358) is a pass;
the same empty diff with a commit no pull request has is NOT MEASURED; a
base that is the pull request's own head writes no check and names the
base.
- **Property sets held by one dump only** (`details_one_side`) are a gap
per model only when none is held by both while either holds any, or when
more than a tenth of all of them are held by one dump only (exactly a
tenth is not a gap; main session, 2026-11-05). The dump samples the five
lowest ElementIds of each entity, so a change that adds or removes
elements of an entity moves the sample and a few are held by one dump
only: that is not a defect, and the literal rule (any non-zero count)
would have turned #1412's pass into NOT MEASURED. The defect it guards
against is a head that lost its details. The check's summary says how
many are held by one dump only, gap or not. On run 41972636527 (#1412, 1
of 115 sampled elements held by one dump only in each office file, no
gap), scored offline with #1412's body three times: pass (0.84), fail
(0.85), pass (0.83), all with no gap and the same chunk (a finding at
the 0.85 gate, in a chunk rated 3.6), so its own Summary is a pass
again, at the gate, and not a stable one. No other stored complete run
has a non-zero count.

**Held-out, thresholds and wording unchanged since they were set
above.** Ten merged pull requests that were not used to set them, run
with the same 34 models (`nordic` and `r2025` on):

- #1337, #1352, #1356, #1372, #1341 and #1344 (Measure runs 41973688732,
41973701739, 41973714367, 41973727101, 41973740400, 41973754042): the
IFC is identical on all 34 models and the dumps agree, so each has an
empty diff and passes without a call to Jev, with its own Summary, a
sweeping one, #1329's or another's alike. **They test the empty-diff
path and nothing else**: none of their changes lands on an open model.
- #1350, #1358, #1364 and #1370 (provenance and diagnostics additions;
the IFC is identical on all 34 models in each, so these are dump-only
changes), Measure runs 41980008692, 41980023307, 41980037727 and
41980053223, scored with the same four bodies per pull request (own
Summary and Testing, a sweeping one-liner written before the runs
finished, that line beside the real Testing, #1329's body, and another
pull request's body). Scored first with `jev_check.py` as it was at
4e81a95 and again with the code of this head; nothing was changed after
seeing a result, and the 20 verdicts are the same in both.

| Pull request (run) | Findings | Own | Sweeping alone | Sweeping + its
Testing | Wrong: #1329 | Wrong: other |
| --- | --- | --- | --- | --- | --- | --- |
| #1350 (41980008692) | 1034 in 142 chunks | **warn** (0.86, one chunk,
rated 1.13) | fail (1.00) | fail (0.88) | fail (0.99) | #1358: **pass
(0.84)** |
| #1358 (41980023307) | 0 | pass, empty diff | pass, empty diff | pass,
empty diff | pass, empty diff | pass, empty diff |
| #1364 (41980037727) | 159 in 37 chunks | pass (0.14) | fail (1.00) |
pass (0.60) | fail (0.97) | #1370: fail (0.92) |
| #1370 (41980053223) | 98 in 16 chunks | **warn** (0.90, one chunk,
rated 1.33) | fail (1.00) | fail (0.95) | fail (0.97) | #1350: **pass
(0.21)** |

The sweeping lines were "Improves what the export records about
elements." (#1350), "Improves the diagnostics of the export." (#1358),
"Improves what the export records about bodies." (#1364) and "Improves
what the export records about profiles and stairs." (#1370).

- **The held-out result is weaker than the in-sample one.** Real
Summaries: 1 of 3 non-empty pull requests passes, 2 warn and none fail.
Sweeping alone: 0 of 3 pass (all fail). #1329's body: 0 of 3 pass.
Another pull request's body: 2 of 3 pass. With the empty diff counted,
false positives are 2 warns (no fail) of 4 expected passes, and false
negatives 2 of 9 expected non-passes.
- **Why the two warns.** #1350 added fields to the dump's `summary.file`
block (`layout_release`, `omitted_entries`, `partition_count`), which
its Summary and Testing do not name: one chunk of 0.86 at a rating of
1.13, where a warn needs 0.85 and 1.0. #1370's warn is one chunk of
`value_sources` parts of Core Interior's shading devices at 0.90, rated
1.33; a fail needs 1.5. Both are near their gates.
- **The two cross-body passes are neighbours, not strangers.** #1350
(the provenance of every decoded element), #1358 (why an element was
left out) and #1370 (value sources for profiles, stair runs and
landings) all add provenance and diagnostics, so another's Summary
covers part of the diff. They are counted as false negatives as defined.
- **Run-to-run movement.** Jev's answers move by about 0.02 between two
calls with the same request, and by more in the maximum of very many
findings: with #1358's body on #1350 (1,034 findings) the highest scored
0.83, 0.97 and 0.84 in three scorings, only the middle one on a
different grouping of the chunks (since reverted: a chunk is packed at
full context). A verdict near a gate (0.85) is not stable.
- **What it says about the thresholds.** On provenance and diagnostics
additions Jev's probabilities for a change the pull request states sit
near 0.9 where in-sample they sat at 0.2 to 0.8, so the 0.85 gate is
close to the edge for real Summaries. A recalibration follow-up is
warranted.

#1314, #1316 and #1328 cannot be calibrated: their parents predate the
server crate (71c0677), so Measure builds no `rvt-rs-mcp` there.

## Related issues

Refs #1334
DrunkOnJava added a commit that referenced this pull request Nov 5, 2026
#1261, #1194) (#1428)

## Summary

This reopens #1371 by puzzbobb on a branch of this repository, as
puzzbobb agreed on that pull request ("it can be reopened on a branch
here"). puzzbobb's two commits are cherry-picked in order and keep them
as author (`fec15008`, `c4889e7f`, signed by the committer, as
`main-protection` requires); the maintainer's five commits that followed
on #1371's branch come after them, with the archived head
`refs/archive/2026-11-04/pr1371-area-plan-topology` (`e5b1c8be`) as the
source. Their reader is the substance: an Area that the arrangement of
its lines leaves without a region takes the loop of Revit's own plan
topology, checked against the area Revit saves for it, and the Areas of
Revit 2025 to 2027 are read.

It supersedes the wall-line rule of #1367, which was worked out from the
same IFC2X3 export it is scored against; #1367 becomes research notes
only once this lands (Griffin, 2026-11-04).

## The gate (Griffin, 2026-11-05, "Ship, labelled", then "Same-project
gate")

The Areas of Revit 2025 to 2027 and the 108 Area spaces of the recorded
Autodesk 2024 Snowdon Towers samples are written by default. They are
**not measured against any Revit export**; RE-333 section 9, the
changelog fragments and `docs/rooms.md`, `status.md`, `evidence.md` and
`supported-profile.md` say so and name the evidence: the drawn loop
equals the area Revit saves in the file for it and holds the Area's
point, and on 2025 to 2027 the same project's 2024 save gives the same
Areas.

**The marker (Griffin, 2026-11-05, "Mark 2025 to 2027 in the file").**
His earlier "their own outline source value" had two readings, and the
docs-only one was mine; he wants the file to show it. Areas read from
Revit 2025, 2026 and 2027 now get `SpaceOutlineSource`
`area_plan_topology_unchecked`, wherever the marker shows: the IFC
property, `list_rooms` (`space_outline_source`), the schedule CSV's
outline source column, and the MCP field's description (the watcher
syncs the contract). Snowdon Towers 2024 and every other 2024 file keep
`area_plan_topology`, because they share a release and a code path with
the office and a release is not split; 2015 to 2023 keep it too (they
are the Areas with the IFC2X3 check). It is decided by release in one
place, `partition_area_records::area_release_unchecked`
(`AREA_UNCHECKED_RELEASES`, 2025 to 2027), which sets a field of the
decoded Area that `export_content` reads. `BodySource` and
`exported.body_sources` do not split: the body is read by the same code,
and the marker says how far it is checked, not how it was read.
`tools/re/areas_across_saves.py` expects exactly that per release: a
2025 Area reading `area_plan_topology` and a 2024 Area reading the
unchecked value are failures. Consumers checked: `export_content`
(marker, `contain_in_spaces`), `schedule_csv` and
`element_record_plan_profiles` (keyed on `ProfileSource`, which does not
split), `element_provenance` and the COVERAGE rows (keyed on
`BodySource`, unchanged), `rvt-mcp` (passes the text through;
descriptions updated), `space_profiles_vs_ifc.py` (knows the value).
`#1439`'s `SpaceKind` scorer has its own list of Area values, and that
lane adds the new one.

**The first gate tested nothing, and I recommended it.** It was "no Area
written that Revit's export lacks (`only in rvt-rs` 0) on every held-out
Revit 2025 to 2027 model with Areas". None of the seven held-out Revit
2025 to 2027 models writes an Area, and all seven exports are
byte-identical to main's (Measure run 42003913780 on `bcb02107`), so
`only in rvt-rs` 0 could not have failed. I did not count what it would
count before recommending it.

**The gate now (Griffin's "Same-project gate"): this lands only if
rac_advanced's 25 Areas on its 2025, 2026 and 2027 saves equal its 2024
save's, Area by Area.** The fields are GlobalId, number, name, storey,
outline source (the value each release gets, above), body area (1e-6
relative), top surface (the symmetric difference of the two top
surfaces, 1e-6 relative), height (1e-5 ft) and lowest vertex (1e-5 ft);
Griffin's list is the first six and the rest are a floor raised, so that
a translation, a rotation, a shear that keeps the area, a raised base or
another outline source is a difference. `tools/re/areas_across_saves.py`
compares them. `tools/ci/measure-reference-models.sh` runs it on the
head side of any Measure run of the samples that holds the four
rac_advanced samples (whatever `sample_years` says, as long as it
includes 2024 to 2027), once every export is done and before any
sample's IFC is deleted; with fewer than the four it checks nothing and
prints a notice. The job "The Areas agree across rac_advanced's saves"
in `measure.yml` turns the run red unless the output ends `exit 0` and
has the scorer's `passed` line. It fails on a missing or unreadable
save, on other than 25 Areas or other than 25 Areas with a body on any
save (so 26 fails the same way the workflow's grep does), on an Area
with no storey, and on any difference, missing or extra Area; a pass on
nothing is impossible. **Measure is not a required check, so "blocks
landing" means by the landing rule: the result is read before merging.**
It prints counts by field and the number of Areas compared on each save,
nothing else.

**What the first two passes got wrong, found by the second review.**
Runs 42008539696 and 42010805118 read "storey 25 equal" on `None` equal
to `None`: the first version of the scorer read the storey with
`get_container`, and rvt-rs writes a space under its storey with
`IfcRelAggregates`, so the storey was never compared; and it pinned 25
Areas but not 25 bodies, so all four saves losing their bodies stayed
green. Both are fixed (`get_aggregate`, a missing storey, other than 25
bodies and a missing body are failures). The real storeys of the four
saves are `01 - Entry Level` (9), `02 - Floor` (9) and `03 - Floor` (7)
with 0 differences, so the fix cannot turn a correct head red.

**The proof, run through `read_areas` on written IFC and not through
`compare()` on dictionaries.** The reviewer's generator (IfcOpenShell)
writes the four saves, each Area an `IfcSpace` aggregated under an
`IfcBuildingStorey` with its `SpaceOutlineSource` and an extruded body,
and the fixed scorer reads them as it reads an export, then the
workflow's own check reads its output file. 23 cases, 0 wrong. Green:
the control (25 Areas, 25 with a body, every field equal) and a height
5e-6 ft off (within the tolerance). Red: (1) no body on any save; (2)
one body on every save; (3) later saves that lose their bodies; (4) one
Area moved to another storey; (5) storeys renamed on a later save; (6)
no storey on any save; (7) every body of a later save moved 100 ft; (8)
every body turned a quarter turn; (9) one body sheared to the same area;
(10) the base of every body raised 5 ft; (11) a different outline source
on a later save; (11b) one 2025 Area reading `area_plan_topology`; (11c)
one 2024 Area reading `area_plan_topology_unchecked`; (11d) every later
Area reading `area_plan_topology`, the release rule not applied; (11e) a
lines value on 2027; (12) 26 Areas on every save; (13) 24 on every save;
(14) one Area missing from the last save; (15) a save missing; (16) a
height 2e-4 ft off; (17) a body area 1e-4 relative off. The harness is
in the lane's scratch directory (it needs IfcOpenShell to write files),
not in the repository.

**Tried on real data.** Run 42008535484, main's exports of the four
saves (this branch's scorer and workflow, main's binaries at `ce0b2398`,
no #1428): 2024 has 25 Areas, 16 with a body, and 2025, 2026 and 2027
have 0, so each later save fails and the job turned red. Run 42008539696
and run 42010805118 (the pushed head `401f5244`, finished green): 25
Areas on each of the four saves, the gate passed, and the 58 sample
exports' hashes are identical to run 42003913780's (I read the second
run's myself). Both ran the scorer before the fix above, so their
"storey equal" counts were `None` against `None`; the final run below is
the first with the fixed scorer on real files.

**What it cannot catch:** an error that the 2024 read shares with the
later reads (the same wrong region, number, name or height on all four
saves), and an error in how the saves are exported that is the same in
all of them. It compares rvt-rs with itself, on one project of 25 Areas.

## The 2021 save does not move (a measured residual)

Autodesk's `rac_advanced` 2021 save keeps its 25 Areas as
`area_without_proven_body` (22 `boundary_lines_not_readable`, 3
`named_lines_not_in_scheme_and_level`), as on main, although RE-333
section 4 says the topology has a region for all 25 on it. From the
code: the save holds both states of the model (RE-324 section 4), so 16
area boundary lines have two disagreeing copies; `group_arrangement`
returns `Group::Unreadable` for a group that holds one, and `locate`
returns that before the plan topology is asked; `draw_area` refuses the
3 Areas that name such a line. That order is the refusal about safety
that the review of #1371 asked for (no fallback to the topology after
conflicting copies, stray heights or a design option), so it is not
changed here. Measured (probe run 42008543772): the topology's 25
regions on the 2021 save equal the 2022 save's and the 2023 save's, Area
by Area, in vertex count, holes, arcs and area, so its current native
copy holds the later state; no Revit export of that state exists. It
gets its own issue.

## Motivation

#1261: BIM Whale's 2021 Areas were not written, and on Autodesk's
`rac_advanced` main writes 16 of the 25 Areas (the 9 it leaves out are
the ones the plan topology draws; #1367's "18 of the 25 drawn" is not on
main). #1194: Areas were read on Revit 2015 to 2024 only. RE-333 has the
measurements and the reasons.

## Changes

- **puzzbobb's reader** (`fec15008`, `c4889e7f`):
`src/research/native_area_regions.rs` (the plan topology's loops,
offsets, holes and checks) and the chain-entry count that lets Revit
2025 to 2027 records be read (`partition_area_records.rs`).
- **The maintainer's commits on #1371's branch, cherry-picked**: the
joins cross-check and RE-333 measurements, the vertex where a third line
meets, `SpaceOutlineSource` `area_plan_topology`, the warning for
dropped chain records only where an Area could be lost, arcs written as
arcs (an `IfcIndexedPolyCurve`), the Snowdon Towers 2025 figures removed
(below), `tools/re/space_profiles_vs_ifc.py` and the MCP tool
descriptions for the new value. The archive's generated contract commit
(`e5b1c8be`) is not carried: `docs/mcp-tools.json` and `.md` are never
hand-edited, and `rvt-mcp/src/schema.rs` and `server.rs` gain the new
`space_outline_source` value, so CI's `tool_contract_is_committed` needs
the watcher's contract sync before the full CI is green.
- **This branch's own commit** (`94cd0fd7`), the reconciliation with
what landed on main since the merge base (`fdff7018`), whose conflicts
git reported in `src/reader.rs`,
`src/research/partition_area_records.rs`, `docs/status.md`,
`docs/export-diagnostics.md` and `docs/format-reconnaissance.md`:
- **Value sources (#1368).** #1403 gave Areas `area_boundary_lines` and
`area_point`, noted for the lines' frames and the partition's point. An
Area drawn from the plan topology was not drawn from either, so it no
longer carries them; it carries `area_plan_topology` (rule `native`,
`parts`): the Area's own `RoomElem`, the `LevelRoomPlan` that holds its
circuit and the `CurveElem` of each line that bounds it, each at its
place in its partition (`native_area_regions.rs` `record_place`, kept
only while the handle records value sources, so the flag-off path
allocates nothing; `partition_area_records.rs` `note_topology_source`).
`tests/value_sources_offsets.rs` has the reader in `COVERAGE`, reads
each part's id at its offset, and reads the records again from their
ElementIds (`check_topology_areas`): the Area's record names a circuit
and a point, exactly one part is the plan whose topology holds that
circuit and the Area, and the other parts are the lines of that circuit
and of the circuits it encloses, all of them and no others. The office's
`MIN_READERS` pin `area_plan_topology`; `area_boundary_lines` and
`area_point` are no longer pinned on any model of the gate, because the
office's 30 Areas all take the topology first, and the test says so
beside the row.
- **Export decisions (#1326).** `exported.area_body_refusals` and
`model_decisions` both derive from the Area's `AreaBodyRefusal`
property, so the new reasons (`area_not_in_one_plan_topology`,
`area_circuit_not_found`, `area_circuit_side_not_read`,
`area_circuit_area_differs`, `area_arc_not_finite`,
`area_point_outside_circuit`) are counted by both and there is no list
to extend. The diagnostics schema and `docs/export-diagnostics.md` list
them (`area_arc_not_finite` was missing from both).
- **`SpaceOutlineSource` values and descriptions** (#1351, #1405,
#1412): auto-merged; `area_plan_topology` is in the MCP tool
descriptions and the docs.
- `src/reader.rs` keeps #1389's record stages beside the new
dropped-chain-entries note. The two merges of main that #1371's branch
carried are carried by this commit and by a signed merge of main.
- **The same-project gate** (this round):
`tools/re/areas_across_saves.py`; `tools/ci/measure-reference-models.sh`
runs it between the exports and the deletion of the samples' IFCs, on
the head side of a shard that holds the 2024 to 2027 saves of
rac_advanced; `measure.yml` turns the job red unless
`areas_across_saves.txt` ends `exit 0` and has the scorer's `passed`
line, and lists its counts in the summary. `actionlint` reports nothing
on the lines this adds (its only findings are the `uses: $/...` forms
already in main's workflows); the workflow parses with a YAML safe
loader (ruby's, no PyYAML here), and `bash -n` and `shellcheck` pass on
the script. No test target is added: `tools/ci/test-targets.txt` is
unchanged.
- **Docs and changelog** (`6dacca98`): `docs/rooms.md`,
`docs/status.md`, `docs/evidence.md`, `docs/supported-profile.md` and
`docs/support-matrix.json` say Revit 2015 to 2027 and name the plan
topology; the fragments `changelog.d/added/1261-area-plan-topology.md`
and `1194-areas-2025-2027.md` credit puzzbobb by name.

## The review findings on #1371, in code

1. **Crafted file panics.** `partition_area_records.rs:497-498`:
`buf.get(span.start..body)` and `buf.get(body +
span.entries..span.end)`; a narrow record is taken whole through
`buf.get(span.start..span.end)`, and a span that does not lie in the
partition is skipped. No raw slice of parsed spans is left in the
module.
2. **The fallback to the topology after a refusal about safety.**
`locate` returns `Group::Unreadable` (a non-primary design option, stray
heights, conflicting copies, a missing line) before the topology is
looked at (`partition_area_records.rs:1166`, from `group_arrangement` at
`:1043-1062`); the topology is asked for only where the lines are sound
but not arranged (`Group::Unarranged`) or an Area's region touches a
line off the axes (`group.blocks`). The refusals before it (no Levels,
an unaccounted line, no lines) refuse every Area as before.
3. **Arcs as chords.** Written as arcs, `IfcIndexedPolyCurve` with
three-point arcs (`src/ifc/export_content.rs`, `indexed_area_curve`);
the outline is checked as written, arcs as arcs, against the circuit's
saved area, and an arc that cannot be read finitely refuses the Area
(`area_arc_not_finite`).
4. **Unrecorded Snowdon Towers 2025 claims.** Out of the report, the
changelog and the docs (Griffin, 2026-11-04). The Snowdon Towers figures
that remain are the recorded Autodesk 2024 samples in
`research/autodesk-sample-projects.tsv` (sha256 `33271010...`,
`6dc833f9...`), quoted as counts of what rvt-rs writes. Nothing in the
tree cites the 2025 file, its Revit 2025 export or the Japanese sample
except RE-333 section 7's sentence that they await a recorded source.
5. **Behind main, RE number.** Rebuilt on main at 182ed21, then a
signed merge of `a4044dc8`; RE-333 is free on main and in the open pull
requests.
6. **Smaller.** The `REFUSED_*` reasons reach the diagnostics
(`topology.remove(&u64::from(id))` is passed whole, with no
`.and_then(Result::ok)`). `!sub` replaces `-sub - 1`
(`native_area_regions.rs:784`, `:836`). `docs/status.md` and
`docs/support-matrix.json` say 2015 to 2027.

## The second review, in code

- **Bounds against a crafted file** (`native_area_regions.rs`): a
circuit is refused before its edges are built once they pass
`MAX_CIRCUIT_SIDES` (10,000), or once its lines' offset parts pass
`MAX_CIRCUIT_OFFSET_PARTS` (20,000); the edges are no longer cloned.
- **`checked_add`** in `chain_entries`; a circuit side whose line has no
`u32` ElementId refuses the Area (`add_line_ids`); `byte_range` includes
the skipped entry bytes (`AreaRecord::skipped`).
- **Two readers, one region.** Where Revit's plan topology and the
lines' arrangement both give a region and they are not the same one (net
area to 1e-6, the same corners within 1e-4 ft, no arc in the
topology's), the Area has no body and says `area_regions_disagree` in
`exported.area_body_refusals` (and in the decisions log). Measured at
`e9124b3a`, before the check: the regions were the same on 16 of 16 and
30 of 30; with the check, not yet measured, so whether it loses an Area
is what the new run says.
- **`dropped` chain records** are counted by ElementId, not by record
and partition, and the warning says an area boundary line among them is
not among the lines an Area is checked against. The Areas of the Snowdon
Towers samples are still written.
- **`BodySource` and `ProfileSource`** of an Area drawn from the
topology are `native_area_plan_topology`, with their own `body_readers`
row and `COVERAGE` row; `schedule_csv` and the plan-profile reader
accept it. This moves `exported.body_sources` (the count of
`partition_area_boundary_lines` splits) and nothing else that is
measured.
- **Tests.** The plan records are read with `NATIVE_RELEASES`.
`area_boundary_lines` and `area_point` are pinned on no gate model: the
office's 30 Areas all take the topology first and no other gate model is
known to draw an Area from its lines, so a regression in
`note_area_sources` would pass until one does (said at `MIN_READERS`).
- **Docs.** RE-333 keeps no per-Area data of the three.js export (counts
only, #1377; the archived commits of #1371 carry the earlier version,
which is already public, and the policy is applied from here on); six
plan-topology reasons, not five; the office's vertex wording is exact (3
outlines start at another vertex and the holes of 6 come in another
order as built; 2 and 6 at permit); every figure says which run measured
it: the counts of what is written come from Measure run 42003913780 on
`bcb02107`, the vertex-level and equality figures from the archived head
`e9124b3a`.

## The third round (the second review of this PR), in code

- **Hole bound** (`native_area_regions.rs`): a hole that a plan lists
again is one hole (`plan()` keeps the first listing of each pair); more
than `MAX_REGION_HOLES` (1,000) is `area_circuit_too_large`; one
`Budget` for sides, edges and offset parts covers the outer loop and
every hole of a region, so duplicates cannot each ask for a full budget.
- **A topology read and failed is not replaced by the lines**
(`partition_area_records.rs`, `locate`): when
`area_circuit_area_differs`, `area_point_outside_circuit`,
`area_arc_not_finite` or `area_circuit_too_large` is the topology's
answer and the lines draw the Area, the Area has no body and says that
reason, counted in `exported.area_body_refusals`. Where the saved area
disagrees with the face the lines give, the rule is fail closed. Where
the topology was not read (`area_not_in_one_plan_topology`,
`area_circuit_not_found`, `area_circuit_side_not_read`) the lines draw
as before. No public model had an Area in the first case in run
42003913780: none of its refusals is one of these but Snowdon
Architectural's single `area_circuit_area_differs`, and that Area was
refused, so the lines did not draw it.
- **`area_regions_disagree`, helpers and tests** (`regions_agree`,
`same_outline`, `near_outline`, `ring_perimeter`,
`point_segment_distance`): the comparison was by corner counts, which a
step jog of a few micrometres changes and a ring over 5,000 corners
refused outright. It is now by distance: every vertex of each outline
within 1e-4 ft of the other's edges, and the area difference within 1e-6
relative plus the band that tolerance allows along the outline. The
failure-first tests (a few, next to the helpers, under the pure-helper
exception) cover a region of another area, a shifted, a sheared and a
curved one, a hole one reader lacks and two holes matched to one, an
outline that is not finite, and then the same region called the same: a
ring turned to start elsewhere, a vertex on a straight edge, a 5e-5 ft
step, a ring of 6,000 vertices, and the same holes in another order.
**Which branch has run on real data:** the agree branch (16 of 16
`rac_advanced` joins and 30 of 30 office Areas at `e9124b3a`, and no
`area_regions_disagree` refusal on any public model in run 42003913780);
the refusal branch has run on no Revit file, only in those tests. A
scheme whose lines all have one offset, where the arrangement could
close at other positions than the topology, is not found in any file
here; if it exists the Area is refused, the fail-closed side.
- **Bounds on the gate's reach and wording**: see above. `arm.sh` should
read "blocks landing by the landing rule".
- **Docs.** No per-Area figure of the three.js export is left in the
tree (RE-333 said "three four-sided Areas of under 83 ft2" and how that
export writes the curved Area; `docs/rooms.md` said "worst 2.0e-7"; now
"all 25 within 1e-6 relative", counts only). `docs/rooms.md` and
`docs/status.md` name `area_regions_disagree`, mark `area_plan_topology`
"not measured" on Revit 2025 to 2027 and the Snowdon samples, say that
it is the Areas' own outline source and not per release (a 2024 Snowdon
Towers Area and an office Area take the same path), no longer say "Areas
as on 2024" beside models that write none, and say that the office no
longer writes `area_boundary`. Snowdon's counts say which head they are
from everywhere. RE-333 section 3 reports the disagree check measured
(it said "not yet measured").

## What the evidence is, exactly

- **Revit's IFC4 export has no export of these Areas.** The
`rac_advanced` check is against the one public export of it, from the
three.js repository: IFC2X3, by a build of Revit 2021's exporter whose
string ends "IU alternativa 21.0.0.383" (publisher not established),
showing the project's 2015 to 2020 state. It is counted apart, never
used to remove a value or to settle a disagreement between exporters,
and its Measure uploads are counts only (`racadv-*`, #1377).
- **It is out of sample for this rule.** The topology's loops, and the
areas Revit saves for them (`PlanCircuit m_area`) that every loop is
checked against, are in the file; nothing was read off the export. That
is the difference from #1367's wall-line rule, whose rule was worked out
from the export it was scored on. On the 2020 save, measured on the
archived head `e9124b3a`: 25 Areas written, 25 in that export, 0 extra,
all within 0.1% in area and 0.01 ft in outline; main's 16 joined Areas
equal their topology loops.
- **Revit 2025 to 2027** are checked against the same project's 2024
save only.
- Per Griffin (2026-11-04): Areas checked against a non-IFC4 or
third-party export may ship labelled; the trust marker
`area_plan_topology` names the rule, and RE-333, the docs and the
changelog name the oracle.

## Testing

Unit tests are banned in this repository: none added. The test that
changes is a real-file one (`tests/value_sources_offsets.rs`).

- [ ] `tools/check-local.sh` passes: not run locally (no local builds on
this checkout); `cargo fmt --all -- --check` and `python3
tools/release/changelog.py check` pass here, CI's clippy, MSRV and doc
jobs and the corpus tests are the gate. No let-chains; every nested
tuple in a collection has a `type` alias.
- [x] Verified end to end on real Revit files, **on `5008247d`, the code
before the `area_plan_topology_unchecked` marker**: Measure run
42017400629 (unfiltered, base main, nordic, r2025, holdout, samples,
racadv). These are the figures of record for that code; the run after
the marker (below) replaces them where it differs:
  - 26 of 117 exports move, the same set as in run 42003913780 (below);
  - `rules:` findings 0 on 90 models and on 18 held-out;
- held-out spaces move on one model only, from (0 in both, 0 only in
rvt-rs's, 8 only in Revit's) to (6, 0, 2);
- the racadv pairs 2015 to 2020: 116 in both files, 0 only in rvt-rs's,
0 only in Revit's;
  - MCP: 0 differ on 629 lines;
- refusals: `next_storey_not_proven` 9, `area_circuit_area_differs` 1,
`point_not_read` 4, and no `area_regions_disagree` and no
`area_circuit_too_large`;
- the gate passes on the `2024 2099` shard, 25 Areas and 25 with a body
on each of the 4 saves, every field equal, and says `skipped` on the
`2008 2023` shard;
- the semantic merge check (#1334) reads a pass, with 5 findings for
#1428.
Earlier, on `bcb02107`: Measure run 42003913780 and timing run
42003917325: 25 public exports move and one held out; bodies
`native_area_plan_topology` 30 on each office, 25 on each `rac_advanced`
save above, 96 on Snowdon Towers Architectural and 2 on Structural; time
over main's at most 1.05 (`rst_basic` 2026), peak memory at most 1.03
(`rme_advanced` 2027, 559 to 573 MiB), and the lost `samples-2008-2023`
job of run 41990405944 did not recur. The vertex-level and equality
figures in RE-333 section 8 are from the archived head `e9124b3a` and
were not re-read.
The check on the earlier pushed head `401f5244`: run 42010805118, green,
with the scorer that compared the storey as `None`; its `ifc.sha256`
equal to run 42003913780's on 58 of 58.
**The final unfiltered run on this head `7188e2e8`: 42023345111** (`-f
base=main -f nordic=true -f r2025=true -f holdout=true -f samples=true
-f racadv=true`), unread when this body is written. Expected, against
run 42017400629: only the exports of `rac_advanced` 2025, 2026 and 2027
move (their Areas read `area_plan_topology_unchecked`), the gate passes
on the new expectation, nothing else changes. No timing run: what
changed since the timing run bounds crafted input, compares two regions
by distance (quadratic in one ring's vertices, tens on the files
measured) and sets a marker.
- [ ] If this touches the IFC exporter: the witness verdicts replay or
the changed observations are refreshed. Core Interior has no Areas, so
its export is expected to be unchanged; the replay is CI's.
- [ ] If this is a performance change: N/A.

**Final unfiltered Measure on the code of this head, run 42023345111
(7188e2e; the later commit is the MCP contract sync), read by the
maintainer:** against 42017400629's head exactly 3 exports move,
`rac_advanced` 2025, 2026 and 2027, by the new marker. Against main 91
of 117 are identical and 26 move, the same set as before, 1 of them held
out. The same-project gate passes on the expected values: 25 Areas with
25 bodies on each of the 4 saves, every field equal,
`area_plan_topology` on 2024 and `area_plan_topology_unchecked` on 2025
to 2027. `rules:` findings 0 on 90 models and 18 held-out, MCP 0 differ
on 629 lines, semantic check `pass: 5 findings in 34 models`.

## Audit-honesty checklist

- [x] Docs reflect the state after this PR.
- [x] A user-visible change has its fragment under `changelog.d/added/`,
not in `CHANGELOG.md`.
- [x] Limitations: the RE-333 report's "not measured" list is kept
(Revit 2026 and 2027 against a Revit export, the Snowdon Towers 2025
file, a scheme with more than one plan on a Level, an Area Revit reports
as not enclosed, the straight step where two offset curves do not cross,
Revit 2008 to 2014).
- [x] Commit messages describe what changed and why.
- [x] No emojis, no private paths in committed files.
- [x] Reverse-engineering finding:
`probes/examples/probe_re333_area_plan_topology.rs`,
`reports/element-framing/RE-333-area-plan-topology.md` and an addendum
in `docs/format-reconnaissance.md`.

## Legal and contribution hygiene

The declaration is puzzbobb's on #1371, quoted here, and the
maintainer's commits are Apache-2.0 as the rest of the repository:

> - [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] Any new test fixtures use synthetic values (`testuser`,
`111111`, `FY-20XX`, etc.) and contain no real-world PII
>
> The class and field names come from the schema each file embeds
(`Formats/Latest`), as `rvt-schema` prints them. Autodesk's samples are
fetched for the run and never stored. The office is CC BY-SA 4.0, read
by byte range and never stored.

(The last sentence of that declaration on #1371 about a local Revit 2025
export of Snowdon Towers is not repeated: those figures are out of this
pull request.)

## Breaking changes

None. `native_area_regions` is a new public module and `AreaRegion` a
new public type. Areas of Revit 2025 to 2027 files are new `IfcSpace`,
and an Area that main draws from its lines now says `area_plan_topology`
where the topology is read.

## Output samples

`SpaceOutlineSource` on `rac_advanced` (the archived head `e9124b3a`,
run 41894715743): the 6 Areas main marks `area_boundary` and the 10 it
marks `area_boundary_joined` say `area_plan_topology`, as do the 9 it
did not write.

## Related issues

Refs #1261, Refs #1194, Refs #763. Reopens #1371. Supersedes the
wall-line rule of #1367.

Co-authored-by: puzzbobb <[email protected]>

---------

Co-authored-by: puzzbobb <[email protected]>
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