Skip to content

feat(ifc): value sources for roofs drawn from their slopes and from an extrusion (#1368) - #1379

Merged
DrunkOnJava merged 5 commits into
mainfrom
feat/1368-value-sources-roofs
Nov 4, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
feat/1368-value-sources-roofs

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

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 docs: one home for the provenance table's size, and MCP descriptions that do not list readers (#1375) #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)

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.

  • 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.
  • 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 feat(ifc): value sources for profiles, stair runs and landings (#1368) #1370 (native_run, native_run_type) for the first time. No fix was needed.
  • 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 (feat(ifc): value sources for room outlines, hollow and I sections and pipe axes (#1368) #1373) and 8.3 min (docs: one home for the provenance table's size, and MCP descriptions that do not list readers (#1375) #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 feat(ifc): value sources for room outlines, hollow and I sections and pipe axes (#1368) #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

  • README / docs reflect the current state after this PR
  • Changelog fragment changelog.d/added/1368-value-sources-roofs.md
  • Limitations documented in the PR body and in code
  • 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.

…n extrusion (#1368)

A roof drawn from its slopes lists the slope blocks of the sketch lines the slope was made from, those lines' data, its fascia depth and rafter cut where read, and the layers of its type; a roof drawn from an extrusion lists the first frame of each of its sketch lines, their data and its type's layers. Opt-in under --element-provenance; CI's Corpus health fetches puzzbobb's Revit 2025 models so that tests/value_sources_offsets.rs re-reads these parts on the models whose roofs are drawn this way.
@DrunkOnJava DrunkOnJava added ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes and removed ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes labels Nov 4, 2026
…n its one table (#1368)

From Measure run 41902619175 (flag on, head fff508e): the Revit 2025 roof models gain 6 to 21% in their compact table; Core Interior and the office do not move.
@DrunkOnJava DrunkOnJava added the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 4, 2026
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review November 4, 2026 20:22
@DrunkOnJava DrunkOnJava removed the ready-when-green Draft whose code is complete: marked ready for review once its fast CI passes label Nov 4, 2026
DrunkOnJava added a commit that referenced this pull request Nov 4, 2026
…rpus health (#1380) (#1381)

## Summary

Corpus health ran the tier-two gates and then the MCP server's
end-to-end test on Einhoven, one after the other. It took 8.1 to 10.2
minutes on main today, the slowest job on every PR. The Einhoven MCP
test (2.6 to 3.4 minutes) now runs as a job of its own (`corpus-mcp`)
beside it. It fetches the magnetar corpus, restores the same Rust cache
and runs the same step. `CI passed` needs it.

Closes #1380. Measured on this PR's draft run at 232d476: Corpus health
took 3.6 min (main: 8.1 to 10.2 min), the new job 2.8 min beside it, and
the whole fast run 4.0 min wall-clock (5.3 to 7.8 min before). The
longest fast job is now the Ubuntu build (3.9 min). The RE1 cache fills
on main's first run after merge, so this PR's own runs still download
it.

Second commit: Corpus health keeps the RE1 oracle (Drshelden/IFC-ECS,
eight files pinned by commit and sha256) in the Actions cache under that
commit, saved on main. Its download took 3 s on most runs and 6.9 min on
one (#1379's run on fff508e), which alone made that Corpus health 13.9
min. Every file is still checked against its hash, and only a missing or
changed one is fetched.

## Testing

CI only. The workflow parses, and actionlint reports only the existing
`fetch-corpus` references. This PR's own runs are the measurement.

## Related issues

#1380
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) November 4, 2026 20:41
@DrunkOnJava
DrunkOnJava merged commit f46116f into main Nov 4, 2026
32 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/1368-value-sources-roofs branch November 4, 2026 20:47
DrunkOnJava added a commit that referenced this pull request Nov 4, 2026
…h the second read of #1379's fixes

The merge brings in #1379 (the roofs' value sources) and #1380; the conflicts were the roof and family rows of tests/value_sources_offsets.rs and docs/export-diagnostics.md, and check_model, which now returns the readers it saw and is shared by both tests. Folded into the same commit because they edit what the merge brings in: the R2025 test skips only when RVT_R2025_DIR is unset and fails when a pinned model is absent; roof_type_layers, roof_fascia_depth and roof_rafter_cut are read again by the layers reader (with its window), fascia_depth and scan_rafter_cuts, and pinned in R2025_READERS; a sloped roof's line data comes only from the slope scan's sketch_line notes; an extrusion roof's roof_line_data has a part for each sketch line; the rafter-cut note is taken back only while recording; the docs say what the slope sources list and compare. The size table gains the family-extrusion rows of run 41907345226.
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.
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
…st, a retried SARIF upload (#1457) (#1461)

## Summary

Four speed items of #1457, all in `.github`: the CI wheels build without
fat LTO, CodeQL waits for a ready pull request, the RE1 models have one
pin list and one fetch action, and a failed SARIF upload is tried again
in a job of its own.

## Changes

**1. Wheels without LTO** (`ci.yml`, `python-wheel`)
- Job `env`: `CARGO_PROFILE_RELEASE_LTO=off`,
`CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16`, as `viewer-test.yml` does for
the WASM. `publish.yml` still builds the release wheels at fat LTO and
one codegen unit; the comment that said `--release` matched what users
get is corrected.
- The variables reach cargo in the manylinux container. Run 42075324569,
job 127413864828 (a copy of the job with cargo verbose): the `docker
run` line forwards `-e CARGO_PROFILE_RELEASE_LTO -e
CARGO_PROFILE_RELEASE_CODEGEN_UNITS`, and rustc for `rvt` and `rvt_py`
runs with `-C lto=off -C codegen-units=16 -C opt-level=3`. Cargo
finished in 1m 09s there (3m 06s in run 42067754303).
- `rust-cache` is removed from the job. Run 42067754303 restored 246 MB
on Linux and 203 MB on macOS (key `ci-release`, the `ci` profile's
`target/ci`) and still compiled every crate on both (62, 62, and 66 on
Windows, which found no cache): `--release` writes `target/release`, and
on Linux the build runs in the manylinux container, which has its own
cargo home and fetched every crate again.
- A cache of its own for the macOS and Windows legs, saved on main, was
measured with the flags above (run 42096110868, two runs of a copy of
the job, one with a warm `rust-cache` under the key `ci-wheel-proof` and
one without): Windows 155 s against 200 s of maturin, macOS 113 s
against 99 s, for an entry of 84 to 87 MB each. It saves 45 s on one leg
that is no longer the longest job of a push to `main`, so there is none.

**2. CodeQL skips drafts and documentation-only pull requests**
(`codeql.yml`, `docs/maintaining.md`)
- `pull_request` types are `opened, synchronize, reopened,
ready_for_review`; the job runs unless the pull request is a draft;
`paths-ignore` is `**.md`, `docs/**`, `reports/**`, `changelog.d/**`.
`push` to `main` and the weekly schedule are unchanged.
- Nothing else expects these checks on a draft or a documentation-only
head. The `main-protection` ruleset (live and in `.github/rulesets`)
requires `full / CI passed` only and has no code scanning rule. `arm.sh`
refuses a draft and a head with a pending or failed check, accepts
`SKIPPED`, and an absent check is not pending. `watch.py` gates readying
on the `fast / ...` jobs, and its `pending()` reads only checks present
in the rollup. Neither needs an edit.
- Code scanning: a draft head shows the Analyze jobs as one skipped
check named `Analyze (${{ matrix.language }})` (a skipped matrix job is
not expanded; run 42096123466 on a draft head: 1 job, skipped, 0
minutes). It is analysed when it is marked ready (`ready_for_review`)
and on every push after that. A documentation-only pull request has no
CodeQL check and no analysis of its head, so no alert comparison for it;
nothing under those paths is a language CodeQL analyses here (no `.py`,
`.js`, `.ts`, `.rs` or workflow file under `docs`, `reports` or
`changelog.d`), and `main` is still analysed on every push. Scorecard's
SAST check samples recent pull requests for CodeQL runs and may score a
little lower.
- A review thread that code scanning opened on an earlier head is not
updated by pushes made while the pull request is a draft (no analysis
runs); the analysis that runs when it is marked ready, and those after,
update it. Left as it is.
- NOT OBSERVED before ready: the `ready_for_review` run, and a
documentation-only pull request skipping the workflow. A draft cannot be
made to run either; the first ready run is on this pull request when it
is marked ready.

**3. One pin list, one action, one cache for the RE1 models**
- `research/re1-models.tsv`: the commit and the eight files with sha256
and byte count. Hashes are the pins the workflows carried; sizes are
`research/witness-registry.json`'s; all sixteen values were measured
again from the raw host.
- `.github/actions/fetch-re1` (`action.yml`, `fetch.sh`), inputs `files`
and `path`; Linux runners only (`sha256sum`, `timeout`). It restores one
cache entry keyed on the hash of the list, makes the requested files
good in it (present with the right size and sha256, else downloaded from
the raw host and then the media host, else the job fails), copies them
to `path` and checks them there. Only on `main` does it make all eight
good and save, so the saved entry is the whole set whichever job saves
it; any other job fetches only what it asked for. A 404 is not retried.
- Call sites: Corpus health (eight files), IfcOpenShell validates
exports (five), the wheel job (one, Linux), `viewer-test.yml` (four).
`tools/fetch-reference-models.sh` is not a fifth copy: it reads
`research/witness-registry.json`, which is, with URLs on `main`.
`tools/ci/check-re1-pins.py` (PII guard job) fails when the list and the
registry disagree on a file, a hash or a size. Measure uses the
registry's script and `measure.yml` is another lane's, so neither is
touched.
- Finding: the media host answers 404 for all eight files at the pinned
commit (plain blobs, not Git LFS objects). The wheel job tried it first
with `--retry 5 --retry-all-errors`: six 404s over 31 s, all of the
step's time in run 42067754303, then the raw host answered in 0.1 s.
- Download bounds. Run 41902701866 (#1379's head, fff508e, behind
#1380) fetched all eight files, 37,767,282 bytes, in 411 s:
Architecture.rvt (6.6 MB) took 264 s and Plumbing.rvt (3.5 MB) 146 s,
about 25 and 24 kB/s, and the other six files (27.7 MB) together under 4
s. Whether those two were slow or stalled and retried the log cannot
say. A floor of 100 kB/s for 20 s would have aborted both if they
crawled. So a transfer is abandoned only when it has stopped (under 1
kB/s for 60 s; against a server that sends 1 kB and goes quiet, curl
with these flags exits 28 after 60 s), and there is no per-attempt time
limit, because an attempt cut off by one starts again from the first
byte: the largest file, 13.4 MB, takes about 9 minutes at 25 kB/s and
would have failed a 10 minute limit at 22 kB/s. The crawl case is ended
by the step's own bound of 15 minutes, and that run would have used 411
of its 900 s. The one case left in which a slow download that keeps
moving goes red is a cold fetch of all eight files, which `main` makes
and so does Corpus health (it asks for all eight; cold only on the first
run after a pin changes): 37.8 MB inside 900 s needs about 42 kB/s, so
at 25 kB/s (about 1,510 s) it ends at 15 minutes, as the Azure mirror's
30 to 40 kB/s would. Every other job fetches only what it asked for and
has more room (one file, 6.6 MB: 7 kB/s; the viewer's four, 26.9 MB: 30
kB/s).
- A pin list with no newline after its last row is read in full; before,
`fetch.sh` dropped that row.
- The first run on `main` after merge fills the cache: up to six jobs
race to save the same key, and the losers log "Unable to reserve cache
with key ..., another job may be creating this cache", a warning, not a
failure (seen in the proof below). The old keys `re1-oracle-<commit>`
and `re1-<commit>` are no longer read.

**4. A failed SARIF upload is retried, in a job of its own**
- The retry cannot be a second step in the same job. In codeql-action at
the pinned commit, `upload-lib.ts` runs `validateUniqueCategory` before
the HTTP request and exports a sentinel with `core.exportVariable` (the
job's GITHUB_ENV); a second upload of that category in the job throws
"only one run of the codeql/analyze or codeql/upload-sarif actions is
allowed per job per tool/category". Both observed failures died after
that point (they stop at "Uploading results"), so a same-job retry would
have failed at once and hidden the real error. Control, run 42096477400
(head 74f7d87): the first upload, with a refused token and
`CODEQL_ACTION_ANALYSIS_KEY` set so that the action needs no API call
before it sends the file, logs `Uploading results`, retries for 14 s,
and fails with `Bad credentials` / `Please check that your token is
valid`; a second upload of the same category in the same job, with the
real token, fails with `Aborting upload: only one run of the
codeql/analyze or codeql/upload-sarif actions is allowed per job per
tool/category ... Category: (tmp-1457-same-job/)`. The first version of
this proof (run 42096110868, no key set) failed before the category
check, on the call that resolves the analysis key, and its same-job
second upload then succeeded: that is why it proved nothing about these
two failures.
- Scorecard: the first upload keeps its step, with `continue-on-error`,
and the job exports the step's outcome. A second job, `upload-retry`,
runs when that outcome is a failure: it downloads the
`scorecard-results` artifact and uploads it again. The SARIF's three
runs keep their categories (`supply-chain/branch-protection`, `/local`,
`/online-scm`); the retry holds the analysis key at
`.github/workflows/scorecard.yml:analysis`
(`CODEQL_ACTION_ANALYSIS_KEY`, an environment variable of the pinned
action) so a retried upload stays the same configuration in code
scanning. The retry is not in the scorecard job because, while
publishing results, scorecard-action's API accepts only its approved
actions in that job (`verify_workflow.go`: every step needs `uses`, from
checkout, upload-artifact, upload-sarif, scorecard-action,
harden-runner); other jobs are checked only for `id-token: write`.
- zizmor: the same shape. The upload is inside `zizmor-action`, and with
`advanced-security: false` it writes no SARIF at all (`action.sh`
switches the output format), so the retry job runs the whole action
again (about 6 seconds), keeping the analysis key
`.github/workflows/zizmor.yml:zizmor` and the action's own category
`zizmor`. Findings alone do not fail it (SARIF mode exits 0).
- What the attempt-1 logs show (Scorecard run 42062175110, job
127366580611; zizmor run 42061129888, job 127362856134): both end at
`Uploading results` and the step fails 20.9 and 18.7 seconds later, with
no error text in the log, the log archive or the check run's
annotations. codeql-action's client retries a failed request three times
with octokit's retry plugin (`DO_NOT_RETRY_STATUSES` is 400, 410, 422,
451) and warns first on an HTTP error, which neither log has. So the
likeliest cause is a transport failure that outlasted the action's own
retries; the error itself was not recorded and this is an inference. A
new job starts seconds after the failure, so it covers a short outage.
It does not cover a long one, or a rejected file (a 422), which fail
both and fail the run. A duplicate upload for one commit and category is
replaced, not an error.
- The retry shapes, forced to fail after the category check, run
42096477400 (head 74f7d87; copies of the two workflows' structure with
a throwaway tool and category, since neither can run on a pull request).
Scorecard shape: the first job's upload fails as above and the job stays
green (`continue-on-error`); `upload-retry` runs, warns, downloads the
artifact, and logs `Successfully uploaded results` and `Analysis upload
status is complete`; code scanning then lists the two categories of the
SARIF with analysis key `.github/workflows/scorecard.yml:analysis`.
zizmor shape: the first job's upload fails the same way under category
`zizmor`; the retry job runs the real `zizmor-action` 1.30.1 (zizmor
exited 0) and its upload completes with category `zizmor` and key
`.github/workflows/zizmor.yml:zizmor` (the variable reaches the
composite action's steps). The analyses these runs uploaded on the
branch ref were deleted afterwards.

## Testing

CI only: no Rust, no Measure, no changelog fragment (nothing
user-visible), no gates verdict (none of `arm.sh`'s gate paths changes).

| What | Before | After |
|---|---|---|
| Linux wheel job, pull request (median of 11 runs, 42059064892 to
42068363131) | 6.8 min, maturin 5.3 | not run on this head as a pull
request (it runs once ready); the same job on a push: 2.8 min, maturin
114 s (run 42075324767, f4abada) and 3.0 min, 117 s (run 42096111313,
267fa68) |
| Linux wheel job, `main` (median of 13 runs, 42025959348 to
42067754303) | 6.5 min, maturin 5.1 | as above |
| macOS wheel job, `main` | 7.3 min, maturin 6.8 | 3.5 min, 179 s
(f4abada); 3.2 min, 163 s (267fa68) |
| Windows wheel job, `main` | 9.3 min, maturin 8.5 | 3.9 min, 198 s
(f4abada); 3.8 min, 192 s (267fa68) |
| Cargo's own time in the Linux container | 3m 06s (run 42067754303) |
1m 09s (run 42075324569, job 127413864828) |
| Wheel job, RE1 fetch step | 31 s (run 42067754303) | 1 s cold, 2 s
with the cache (the two runs above) |
| One full CI as a push to `main` | 76.8 job-minutes (run 42067754303;
the issue's median is 82) | 66.1 (f4abada) and 66.6 (267fa68) |
| CodeQL on a draft push | 4 jobs, about 9 job-minutes (the issue: 185
runs and 1,630 job-minutes in a day) | 1 skipped job, 0 minutes (run
42096123466) |

The "after" runs are the full CI called from a temporary workflow as a
push event on this branch (the draft's own CI runs only the fast jobs,
with no wheel job), so the wheel matrix is the one `main` runs. They are
single runs against medians, on runners that vary (the same macOS build
took 94 s in one job and 179 s in another at the same time). The
temporary workflows and a temporary save condition are removed in
4a76afd; the tree those runs built differs from this head only by them,
by the merge of main, a docs line (87b6633), a comment (c016cf8), the
removal of curl's `--max-time` from `fetch.sh` (d88f9b2) and, for the
first run, 52cf6ba's changes to the fetch action and the two retries.

fetch-re1, run 42096110868 (a temporary job; head 267fa68): the first
call restores the entry an earlier run saved (`Cache hit`, 26 MB) and
all eight files are `in the cache and matches its pin`, with no save
step; a store file emptied by the job is the only one downloaded again
when asked for; a pin list with one wrong hash fails the step with
`matches its pin ... from neither host` and places nothing. The first
run (42075324569, job 127413864377) shows the save and the race: `Cache
saved with key re1-...`, then in a second call `Failed to save: Unable
to reserve cache with key ..., another job may be creating this cache`,
a warning. On the real call sites, run 42096111313: Corpus health 0 s,
IfcOpenShell 3 s, the wheel job 2 s, the viewer legs 1 to 3 s, all from
the cache. `fetch.sh` was also run on its own against the live hosts:
cold, warm, a truncated store file, an unknown name, a wrong hash, a
wrong size, a malformed row, a pin list with no final newline (eight
files), only the files asked for with and without `FILL_ALL`, a Git LFS
file (the raw host answers 200 with a pointer, which fails its size and
hash, then the media host serves the content), and a file on neither
host (final at once, no retries).

## Not measured

- The wheel job and the other fetch call sites as a pull request (they
run once this is ready), and the full CI of this exact head: the runs
above are of heads that differ from it only as stated.
- The `ready_for_review` CodeQL run and a documentation-only pull
request (above).
- The cache save on `main` and the first-run race on `main` (the save is
`main`-only; the race was seen on a branch).
- Scorecard's real retry: the workflow runs on `main`, not on a pull
request. The new job layout was checked against scorecard-webapp's
`verify_workflow.go` (it reads the steps of the scorecard job only, and
the other jobs only for `id-token: write`) and not run through the API.
zizmor's real retry job was not exercised either, since its real first
attempt passed here; the shape was.
- The cause of the two original upload failures (inferred above, not
read).
- Not done, by agreement: timeouts for `python-wheel` and CodeQL's
`analyze` job stay with #1462.

## Related issues

Refs #1457
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