Skip to main content
Loading navigation
Back to prompt library

Build a Bonsai IFC Quality Assurance Gherkin Rule Verifier — implementation

Linked challenge: Build a Bonsai IFC Quality Assurance Gherkin Rule Verifier

Prompt source

implementation84 lines11 sectionsNo variables1 code block
## Build
Formulate automated Gherkin acceptance test scenarios for architectural IFC models using ifcbimtester principles. Validate deliverable models before client handover against contractual BIM execution plans and classification standards.

## User
BIM Quality Assurance Manager

## Workflow
1. Ingest client BIM execution plan clauses and convert requirements into Gherkin feature files.
2. Execute ifcbimtester rules against incoming architectural IFC model files.
3. Evaluate entity classifications, mandatory attributes, and geometric representations.
4. Produce an interactive HTML compliance audit dashboard with actionable remediation steps.

## Interface
QA scorecard interface displaying pass/fail step indicators, failing IFC entity IDs, and error traces.

## Data
Generate mock IFC4 architectural models paired with synthetic Gherkin feature specification scripts.
Starter examples below are synthetic. They are not downloaded records.

## Source
[IfcOpenShell](https://raw.githubusercontent.com/IfcOpenShell/IfcOpenShell/v0.8.0/README.md)
Integrates the ifcbimtester tool from the IfcOpenShell tool directory for Gherkin-based BIM testing.

## Tools
mastra-ai, ifcopenshell, behave.
Mastra AI orchestrates test execution workflows, parameter bindings, and structured evaluation logging.
API-hosted LLM capable of translating contractual BIM requirements into formal Gherkin scenarios.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parses Gherkin feature files defining IFC model acceptance criteria.
- Executes entity-level rule evaluation for IfcWall, IfcDoor, and IfcSpace entities.
- Outputs structured compliance report itemizing failing entity GlobalIds.

## Starter Examples
```json
[
  {
    "input": {
      "gherkin_rule": "Feature: Wall Classification\nScenario: All external walls must have FireRating\nGiven the model has IfcWall entities\nThen every external IfcWall must have property FireRating",
      "ifc_entities": [
        {
          "global_id": "WALL-001",
          "type": "IfcWall",
          "is_external": true,
          "properties": {
            "FireRating": "2HR"
          }
        },
        {
          "global_id": "WALL-002",
          "type": "IfcWall",
          "is_external": false,
          "properties": {}
        }
      ]
    },
    "expected_output": {
      "total_tested": 2,
      "passed": true,
      "violations": []
    }
  },
  {
    "input": {
      "gherkin_rule": "Feature: Wall Classification\nScenario: All external walls must have FireRating\nGiven the model has IfcWall entities\nThen every external IfcWall must have property FireRating",
      "ifc_entities": [
        {
          "global_id": "WALL-003",
          "type": "IfcWall",
          "is_external": true,
          "properties": {}
        }
      ]
    },
    "expected_output": {
      "total_tested": 1,
      "passed": false,
      "violations": [
        {
          "global_id": "WALL-003",
          "error": "External IfcWall lacks mandatory property 'FireRating'"
        }
      ]
    }
  }
]
```

## Safety
Ensures acceptance tests run in sandboxed read-only memory; does not modify submitted master models.
Use mock external writes. Require human review before any real deployment.