ifctester: fix prohibited spec requirement status - #9189
Open
BIMvoice wants to merge 2 commits into
Open
Conversation
Requirements are deliberately skipped for a prohibited specification (maxOccurs=0), so a matched element never populates facet.failures. Specification.validate() then computed facet.status = not bool(facet.failures) unconditionally, so every requirement facet reported status True (passed) even when the specification itself failed because a prohibited element existed. Reporters that render per-requirement status (Json, Html, Ods) would show a green "pass" row for a requirement that was never actually checked, next to a failing specification. The sibling branch for a required specification with no applicable entities already sets facet.status = False for this exact reason; the prohibited branch was missing the same line. Generated with the assistance of an AI coding tool.
BIMvoice
added a commit
to BIMvoice/IfcOpenShell
that referenced
this pull request
Aug 1, 2026
Four minimal .ids/.ifc pairs, one per defect fixed by this branch. property_optional_mask, console_prohibited and txt_dropped_text are each verified red before the fix and green after through a plain ids.open/ifcopenshell.open/validate call, without touching a facet's __call__ or forcing any internal state. json_prohibited needs one caveat: Json.report_specification's buggy line only executes when requirement.status is False with empty failures, and on this branch alone nothing forces requirement.status False for a violated prohibition. That force is PR IfcOpenShell#9189's ids.py change, not this one's, so a natural validate() call on this branch cannot reach the buggy line by itself. The test reproduces the exact precondition IfcOpenShell#9189 produces (documented in the test) before calling the Json reporter, mirroring this branch's own reporter test. This is disclosed rather than presented as a clean natural trigger. Requested by aothms on PR IfcOpenShell#9190. Generated with the assistance of an AI coding tool.
Minimal .ids/.ifc pair: a prohibited specification (no walls allowed) violated by one wall. Requirement checks are skipped for prohibited specifications, so requirement.failures stays empty; the requirement's status must still be False. Verified red (requirement.status True) against the pre-fix code and green (False) against this branch's fix, through ids.open and ifcopenshell.open, not by calling the facet directly. Requested by aothms on PR IfcOpenShell#9203/IfcOpenShell#9205 (applies repo-wide to all ids PRs). Generated with the assistance of an AI coding tool.
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For a prohibited specification (
maxOccurs=0), requirement facets are deliberately never run against matched elements. Sofacet.failuresstays empty, andSpecification.validate()'s unconditionalmarks every requirement as passed, even when the specification itself fails because a prohibited element was found.
The Json, Html and Ods reporters then render green "pass" requirement rows directly underneath a red failing specification.
This is not a new design. The sibling branch, "required, but no applicable entities", already propagates
facet.status = Falsecorrectly. The prohibited branch was simply missing the same two lines, and the fix adds them.Regression test added, verified red before the fix and green after.
Generated with the assistance of an AI coding tool.