Skip to content

Commit 598a199

Browse files
authored
Merge branch 'develop' into feat/facility-shading-apply-to-selected
2 parents 0518653 + a2af322 commit 598a199

324 files changed

Lines changed: 3746 additions & 5801 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
description: "Use when moving, renaming, or refactoring C++ classes in src/. Covers include order, git mv, shared_ptr vs raw pointer, and C++ covariance rules."
3+
applyTo: "src/**/*.cpp,src/**/*.hpp,src/**/CMakeLists.txt"
4+
---
5+
6+
# C++ Refactoring Guidelines
7+
8+
## Include Order
9+
10+
Within every `.cpp` and `.hpp`, includes must appear in this order, with a blank line between each group:
11+
12+
```cpp
13+
// 1. Own header (in .cpp only — the header this .cpp implements)
14+
#include "ThisClass.hpp"
15+
16+
// 2. Same-directory relative includes
17+
#include "Sibling.hpp"
18+
19+
// 3. Cross-directory repo includes
20+
#include "../other_module/Foo.hpp"
21+
22+
// 4. OpenStudio SDK includes
23+
#include <openstudio/model/Model.hpp>
24+
25+
// 5. Qt, Boost, and system includes
26+
#include <QWidget>
27+
#include <boost/optional.hpp>
28+
#include <memory>
29+
```
30+
31+
Do not mix groups. When adding a new include, place it in the correct group in the same edit — not as a deferred cleanup. Within each group, sort includes alphabetically by filename.
32+
33+
---
34+
35+
## Naming
36+
37+
When introducing an interface method, choose its name before writing any code:
38+
39+
- Prefer names that describe the *concept*, not the return type (`currentDocument`, not `currentBaseDocument`).
40+
- Check for name collisions with existing virtuals in the inheritance chain before committing.
41+
- A rename that touches 100+ files is expensive; settle the name at design time.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: "Use when reviewing pull requests, conducting code review, or checking a diff for correctness. Covers documentation accuracy checks for developer/doc/."
3+
---
4+
5+
# Pull Request Review Guidelines
6+
7+
On every PR review, verify documentation and comments are consistent with the code changes:
8+
9+
**`developer/doc/` docs**
10+
- `CMakeLists.txt` changed → check the corresponding `libraries/*.md` for stale dependency tables or target names; check `architecture.md` dependency graph.
11+
- Class added/moved/deleted → check library doc's Key Classes section is accurate and the header has a `/** */` doc comment.
12+
13+
**Inline comments**
14+
- Significant class added or refactored (`src/**/*.hpp`) → `/** */` comment above the class must exist, describe current responsibility, and contain no stale references.
15+
- Workflow added or modified (`.github/workflows/*.yml`) → `#` comment block at top must accurately reflect purpose, triggers, and required secrets.
16+
- CI script added or modified (`ci/*.sh`, `ci/*.py`, `ci/*.qs`) → header comment must accurately describe usage, arguments, and exit codes.
17+
18+
> Full standards: [`.github/prompts/update-docs.prompt.md`](../prompts/update-docs.prompt.md)
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
---
2+
mode: agent
3+
description: Update and maintain the OpenStudio Application developer documentation in developer/doc/
4+
tools:
5+
- read_file
6+
- grep_search
7+
- file_search
8+
- semantic_search
9+
- replace_string_in_file
10+
- create_file
11+
- multi_replace_string_in_file
12+
applyTo: |
13+
developer/doc/**/*.md
14+
src/**/*.hpp
15+
src/**/*.cpp
16+
.github/workflows/**/*.yml
17+
ci/**
18+
CMakeLists.txt
19+
src/**/CMakeLists.txt
20+
---
21+
22+
# Documentation Maintenance Agent
23+
24+
You are a senior developer on the OpenStudio Application project. Your task is to keep the documentation in `developer/doc/` accurate and complete. All documentation is written in Markdown with embedded Mermaid diagrams. The audience is the internal development team (C++/Qt background assumed).
25+
26+
---
27+
28+
## 1. Documentation Structure Map
29+
30+
Every source file has a corresponding documentation home. Consult this map before editing any doc:
31+
32+
```
33+
developer/doc/
34+
├── architecture.md ← CMakeLists.txt, README.md, all module CMakeLists.txt
35+
├── libraries/
36+
│ ├── openstudio_app.md ← src/openstudio_app/CMakeLists.txt + headers
37+
│ ├── openstudio_lib.md ← src/openstudio_lib/CMakeLists.txt + headers
38+
│ ├── shared_gui_components.md ← src/shared_gui_components/CMakeLists.txt + headers
39+
│ ├── openstudio_qt_utils.md ← src/openstudio_qt_utils/CMakeLists.txt + headers
40+
│ ├── model_editor.md ← src/model_editor/CMakeLists.txt + headers
41+
│ ├── bimserver.md ← src/bimserver/CMakeLists.txt + headers
42+
│ └── utilities.md ← src/utilities/CMakeLists.txt
43+
```
44+
45+
---
46+
47+
## 2. Trigger Conditions
48+
49+
Update documentation when ANY of the following changes occur:
50+
51+
| Change | Docs to update |
52+
|---|---|
53+
| `CMakeLists.txt` in a module changes (new deps, new targets) | Corresponding library `.md` + `architecture.md` dependency graph |
54+
| `src/openstudio_qt_utils/` file modified | `libraries/openstudio_qt_utils.md` |
55+
| Top-level `CMakeLists.txt` changes (version, new sub-project) | `architecture.md` |
56+
| `conanfile.py` dependency version changes | `architecture.md` tech stack section |
57+
58+
---
59+
60+
## 3. Document Templates
61+
62+
### 3a. Architecture Document (`architecture.md`)
63+
64+
```markdown
65+
# OpenStudio Application — Architecture
66+
67+
> Version: {version} | Tech stack: C++20, Qt {qt_version}, CMake+Conan 2
68+
69+
## 1. System Context
70+
71+
\`\`\`mermaid
72+
C4Context
73+
title System Context — OpenStudio Application
74+
Person(user, "Energy Modeler", "...")
75+
System(app, "OpenStudio Application", "...")
76+
...
77+
\`\`\`
78+
79+
## 2. Container View
80+
81+
\`\`\`mermaid
82+
C4Container
83+
...
84+
\`\`\`
85+
86+
## 3. Module Dependency Graph
87+
88+
\`\`\`mermaid
89+
flowchart LR
90+
...
91+
\`\`\`
92+
93+
## 4. Technology Stack
94+
95+
| Category | Technology | Version |
96+
|---|---|---|
97+
| ...
98+
99+
## 5. Key Design Patterns
100+
101+
...
102+
103+
## 6. CI/CD Integration
104+
105+
...
106+
107+
## 7. Module Index
108+
109+
| Module | Library | Doc |
110+
|---|---|---|
111+
| ...
112+
```
113+
114+
### 3b. Library Document (`libraries/{name}.md`)
115+
116+
```markdown
117+
# Library: `{name}`
118+
119+
> CMake target: `openstudio_{name}` | Location: `src/{name}/`
120+
121+
## Purpose
122+
One-paragraph description of responsibility.
123+
124+
## Mermaid Context
125+
\`\`\`mermaid
126+
flowchart LR
127+
{name}["**{name}**\n..."] --> dep1["dependency"]
128+
\`\`\`
129+
130+
## Key Classes
131+
| Class | Role |
132+
|---|---|
133+
134+
## Dependencies
135+
| Dependency | Usage |
136+
|---|---|
137+
138+
## Design Notes
139+
...
140+
141+
## Key Classes
142+
143+
Class-level documentation is in the corresponding header files under [`src/{name}/`](../../../src/{name}/).
144+
```
145+
146+
---
147+
148+
## 4. Mermaid Conventions
149+
150+
| Diagram type | When to use | Size limit |
151+
|---|---|---|
152+
| `flowchart TD/LR` | System-level context and container views (architecture.md) ||
153+
| `flowchart TD` / `LR` | Job step sequences (CI docs), initialization flows ||
154+
| `classDiagram` | Class inheritance and key methods | ≤12 nodes |
155+
| `sequenceDiagram` | Inter-object messaging (class docs) | ≤8 participants |
156+
157+
**Rules:**
158+
- Never use actor/entity names that contain special characters without quoting them.
159+
- Avoid placing raw C++ template syntax inside diagram nodes; use simplified names.
160+
- Always give diagrams a `title` line when C4 context/container type is used.
161+
- Prefer short, readable labels. Put full detail in prose below the diagram.
162+
163+
---
164+
165+
## 5. Cross-Linking Rules
166+
167+
- `architecture.md` module index must link to every library doc.
168+
- Use **relative Markdown links** only (e.g., `../libraries/openstudio_lib.md`, not absolute paths).
169+
170+
---
171+
172+
## 6. Step-by-Step Maintenance Procedure
173+
174+
Follow these steps whenever source code or CI configuration changes:
175+
176+
1. **Identify changed files.** Read the diff or PR description to find which `.hpp`, `.cpp`, `.yml`, `CMakeLists.txt`, or `ci/` files were modified.
177+
178+
2. **Map to documentation.** Use the Structure Map (§1) and Trigger Conditions (§2) to determine which `.md` files need updating.
179+
180+
3. **Read the changed source.** Use `read_file` to read the relevant headers and CMake files.
181+
182+
4. **Read the existing doc.** Use `read_file` on the current `.md` to understand what is already correct and what has drifted.
183+
184+
5. **Update the doc.** Use `replace_string_in_file` for targeted edits (prefer this over full rewrites). Update:
185+
- Dependency tables and module graphs if CMake targets changed
186+
- Tech stack table in `architecture.md` if versions changed
187+
188+
6. **Check for version or dependency changes.** If `CMakeLists.txt` or `conanfile.py` changed dependency versions, update the tech stack table in `architecture.md`.
189+
190+
7. **Verify Mermaid syntax.** Ensure all diagram blocks are syntactically valid Mermaid.
191+
192+
---
193+
194+
## 7. Class Documentation
195+
196+
Class-level documentation lives in `/** */` doc comments in the header files (`src/**/*.hpp`), not in separate Markdown files. When adding a new significant class (base/abstract classes, major controllers, integration points, widely reused components), add a `/** ... */` doc comment block directly above the class declaration describing its purpose.
197+
198+
---
199+
200+
## 8. Comment Correctness and Completeness Checks
201+
202+
When source files are changed, verify that inline comments remain accurate.
203+
204+
### C++ Header Class Comments (`src/**/*.hpp`)
205+
206+
For every significant class (base/abstract, major controller, integration point, widely reused component) that was added or modified:
207+
208+
1. **Presence** — a `/** */` doc comment must appear directly above the class declaration (not a forward declaration).
209+
2. **Accuracy** — the comment must reflect the class's current responsibility. Check for:
210+
- Purpose description that no longer matches the class's role after a refactor
211+
- References to removed methods, renamed signals, or deleted dependencies
212+
3. **Completeness** — if the class is one of the following types, the comment should describe what it owns, what signals it emits, and how it fits into the broader system:
213+
- Abstract base / interface classes
214+
- Tab-level controllers (`*Controller` owning a `*View`)
215+
- Classes bridging external systems (web engine, BIMserver, CLI, network)
216+
4. **What to skip** — do not add or require doc comments on:
217+
- Forward declarations
218+
- Member variables, private methods, or trivial getters/setters (unless they have non-obvious side effects)
219+
- Private implementation detail classes nested inside a `.cpp`
220+
- Thin wrappers or trivial value types with self-explanatory names
221+
222+
### GitHub Actions Workflow Comments (`.github/workflows/*.yml`)
223+
224+
For every workflow file that was added or modified, verify the file-level comment block at the top:
225+
226+
1. **Presence** — a `#`-prefixed comment block must appear before the `name:` line.
227+
2. **Accuracy** — check that the comment correctly describes:
228+
- The workflow's purpose (what it builds, tests, or enforces)
229+
- Trigger conditions (branches, tags, events, manual dispatch)
230+
- Any required secrets (add or remove as the `secrets:` block changes)
231+
- When to run it manually (for `workflow_dispatch` workflows)
232+
3. **Completeness** — the comment should be enough for a developer to understand the workflow without reading the full YAML. It does not need to enumerate every step.
233+
234+
### CI Helper Scripts (`ci/*.sh`, `ci/*.py`, `ci/*.qs`)
235+
236+
For every script that was added or modified:
237+
238+
1. **Presence** — a comment header describing the script's purpose must be present near the top of the file.
239+
2. **Accuracy** — check that usage examples, argument descriptions, and exit-code documentation still match the script's actual behaviour.
240+
241+
---
242+
243+
## 9. Scope Exclusions
244+
245+
Never document the following in `developer/doc/` (they are internal plumbing or generated code):
246+
247+
- Contents of `debug/` or `release/` build directories
248+
- Files under `signatures/`
249+
- References to BIMserver as this functionality is to be deprecated
250+
- Generated files under `src/utilities/` (these are `configure_file` outputs)
251+
- Contents of `ruby/` Ruby gems or vendored external libraries

.github/workflows/app_build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# Main build pipeline. Builds the OpenStudio Application on 5 platforms (ubuntu-22.04,
2+
# ubuntu-24.04, windows-2022, macos-15-intel, macos-15 arm64), runs CTest and benchmarks,
3+
# applies code signing on tag pushes, and uploads installers to GitHub Releases.
4+
#
5+
# Two jobs:
6+
# build - matrix over all 5 platforms
7+
# test_package_macos - downloads and verifies the signed macOS DMG (macos-15-intel + arm64)
8+
#
9+
# Caching: three independent caches keyed by OS + Conan profile + CACHE_KEY secret:
10+
# 1. ccache (compiler output cache)
11+
# 2. Conan package cache
12+
# 3. Qt + OpenStudio SDK download cache
13+
# Rotate the CACHE_KEY secret to bust all caches immediately.
14+
#
15+
# Required secrets: MACOS_DEVELOPER_ID_APPLICATION_CERTIFICATE_P12_BASE64,
16+
# MACOS_DEVELOPER_ID_INSTALLER_CERTIFICATE_P12_PASSWORD, MACOS_KEYCHAIN_PASSWORD,
17+
# NOTARIZATION_API_KEY, NOTARIZATION_API_TEAM_ID, NOTARIZATION_API_ISSUER_ID,
18+
# SIGNPATH_CI_TOKEN, ANALYTICS_API_SECRET, ANALYTICS_MEASUREMENT_ID, CACHE_KEY
119
name: C++ CI for OpenStudioApplication
220

321
on:

.github/workflows/check_osm_versions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Ensures all .osm template files bundled in src/openstudio_app/Resources/ have been
2+
# version-translated to the current OpenStudio SDK version before a PR merges to master.
3+
# Runs developer/ruby/CheckOSMVersions.rb which verifies each file's OS:Version object.
4+
#
5+
# On failure: run the export_standards_data workflow to regenerate the OSM files, or run
6+
# developer/ruby/UpdateOSMVersions.rb locally and commit the result.
17
name: Check OSM Versions
28

39
on:

.github/workflows/cla.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Enforces the Contributor License Agreement for all external contributors.
2+
# Uses pull_request_target (runs in base branch context) so it has write access
3+
# even from fork PRs. Signatures are stored in signatures/version1/cla.json on the
4+
# develop branch. Contributors sign by commenting the magic phrase on their PR.
5+
# Organization members and bots are automatically excluded.
6+
# Required secret: CLA_SECRET (GitHub PAT with repo scope)
17
name: "CLA Assistant"
28
on:
39
issue_comment:
@@ -33,4 +39,4 @@ jobs:
3339
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
3440
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
3541
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
36-
#use-dco-flag: true - If you are using DCO instead of CLA
42+
#use-dco-flag: true - If you are using DCO instead of CLA

.github/workflows/clangformat.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Enforces .clang-format style on all C/C++ files changed in a PR.
2+
# Runs ci/clang-format.sh which diffs HEAD against the base branch, formats only
3+
# changed files, and exits 1 if any changes were needed.
4+
# On failure: download the clang_format.patch artifact and apply with 'git apply clang_format.patch'.
5+
# Install ci/pre-commit.sh as a git pre-commit hook to catch violations locally.
16
name: Clang Format
27

38
on:

.github/workflows/cppcheck.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Runs cppcheck static analysis on the entire src/ tree.
2+
# Builds cppcheck 2.9 from source (the Ubuntu package is too old) to ensure
3+
# consistent results. Uses --enable=all --library=qt --std=c++20 --inconclusive
4+
# and suppresses useStlAlgorithm.
5+
# Output is colorized by ci/colorize_cppcheck_results.py and uploaded as an artifact.
16
name: cppcheck
27

38
on:
@@ -43,7 +48,6 @@ jobs:
4348
--library=qt \
4449
--template='[{file}:{line}]:({severity}),[{id}],{message}' \
4550
--force -q -j $(nproc) \
46-
-i ./src/qtwinmigrate \
4751
./src 2>&1 | tee cppcheck.txt
4852
4953
- name: Parse and colorize cppcheck

0 commit comments

Comments
 (0)