You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/agents/cve-audit.agent.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ rush install
35
35
```
36
36
37
37
-**Do not create the security branch yet.** The branch name requires a CVE ID, which is only known after the audit in Step 1. Branch creation happens in Execution Flow Step 1b (after the audit).
38
-
- For multiple CVEs, use the highest-severity CVE/GHSA ID for the branch name and include others in the commit/PR text. If severity is equal, use the first ID returned by `rush audit --json`.
38
+
- For multiple CVEs, use the highest-severity CVE/GHSA ID for the branch name and include others in the commit/PR text. If severity is equal, use the first ID from the audit table output.
1. Audit — run on the starting branch before creating any branch or making any changes:
80
80
81
81
```bash
82
-
rush audit --level high
83
-
rush audit --json > /tmp/cve-audit-results.json
82
+
rush audit
84
83
```
85
84
86
-
Parse `/tmp/cve-audit-results.json` to extract CVE/GHSA IDs, severities, advisory URLs, and dependency paths. These values drive all subsequent steps (branch name, commit message, PR body, deferral issues).
85
+
**Note:**`rush audit` internally invokes `rush-pnpm audit --audit-level high`. It does **not** accept `--level` or `--json`flags directly. Parse the table output to extract CVE/GHSA IDs, severities, advisory URLs, and dependency paths. Use `rush-pnpm why <package>` to investigate transitive dependency paths when the audit output shows truncated paths.
87
86
88
87
**1b. Early exit if no High/Critical CVEs found:**
89
-
If `rush audit --level high` reports zero High or Critical vulnerabilities — **stop here**. Do not create a branch. Do not run `rush update --full`. Report all-clear to the invoker.
88
+
If `rush audit` reports zero High or Critical vulnerabilities — **stop here**. Do not create a branch. Do not run `rush update`. Report all-clear to the invoker.
90
89
91
90
**1c. Create security branch (now that CVE ID is known):**
2. Fast-path auto updates — attempt before any manual changes:
100
99
100
+
```bash
101
+
rush update
102
+
rush audit
103
+
```
104
+
105
+
Start with `rush update` (without `--full`) — it is faster and less disruptive. Re-run the audit immediately. If High/Critical vulnerabilities are cleared, proceed to Step 4 (verify).
106
+
107
+
If High/Critical remain, escalate to a full re-resolve:
108
+
101
109
```bash
102
110
rush update --full
103
-
rush audit --level high
111
+
rush audit
104
112
```
105
113
106
-
Re-run the audit immediately after `rush update --full`. If High/Critical vulnerabilities are cleared, proceed to Step 4 (verify) — no further manual changes are needed.
114
+
If still not cleared after `--full`, proceed to Step 3 for manual remediation.
107
115
108
116
3. If High/Critical remain after step 2, remediate using the fix strategy defined in the `cve-remediation` skill:
109
117
@@ -117,7 +125,12 @@ rush audit --level high
117
125
118
126
```bash
119
127
rush update
120
-
rush audit --level high
128
+
rush audit
129
+
```
130
+
131
+
After audit confirms High/Critical are resolved, run build and test validation. If the invoker prefers to validate separately (e.g., in CI), commit after audit verification and note pending validation steps in the report.
132
+
133
+
```bash
121
134
rush build
122
135
rush test
123
136
```
@@ -229,7 +242,7 @@ If not requested: stop after commit and final report (no push, no PR).
229
242
## Done Criteria
230
243
231
244
- Critical/High vulnerabilities reduced or explicitly documented with rationale.
232
-
-`rush audit --level high` rerun and reported.
245
+
-`rush audit` rerun and reported.
233
246
-`rush build` and `rush test` pass (or no new failures with clear disclosure).
234
247
-`rush change` handled non-interactively (`--verify`; blank entry via `--bulk --message "" --bump-type none` only when required).
235
248
- API impact checked with `rush extract-api` when relevant.
For each breaking change listed in the Electron docs for the new major version:
145
147
146
148
1.**Identify** whether the breaking change affects any API used in this codebase.
147
-
2.**If affected**, apply the necessary code fix:
148
-
- Search the codebase for all usages of the affected API.
149
-
- Update the code to use the new API or pattern as prescribed by the Electron breaking changes doc.
150
-
- Ensure backward compatibility with the minimum supported Electron version (currently ^35.0.0) — use feature detection or version checks when the old API is removed and a polyfill is needed.
149
+
2.**If affected**, describe the required code fix and which files need modification.
151
150
3.**If not affected**, note it and move on.
152
151
153
152
**Common breaking change categories to watch for:**
@@ -159,6 +158,24 @@ For each breaking change listed in the Electron docs for the new major version:
159
158
- New required permissions or security policy changes
160
159
- Deprecated APIs that are now removed
161
160
161
+
#### Present findings and wait for approval
162
+
163
+
After completing the analysis, present a summary table to the invoker:
164
+
165
+
| Breaking change | Affected? | Proposed fix |
166
+
| --- | --- | --- |
167
+
| (change description) | Yes / No | (fix description or "N/A") |
168
+
169
+
**STOP here and wait for the invoker's explicit go-ahead before making any file changes.** If the invoker requests modifications to the proposed approach, incorporate their feedback before proceeding.
170
+
171
+
#### Apply breaking change fixes (after approval)
172
+
173
+
Once approved, for each affected breaking change:
174
+
175
+
- Search the codebase for all usages of the affected API.
176
+
- Update the code to use the new API or pattern as prescribed by the Electron breaking changes doc.
177
+
- Ensure backward compatibility with the minimum supported Electron version documented in docs/learning/SupportedPlatforms.md — use feature detection or version checks when the old API is removed and a polyfill is needed.
178
+
162
179
If a breaking change requires a non-trivial migration (e.g., architectural changes), document the issue in the report. If triggered from a GitHub issue, add a comment to the issue describing the blocker and wait for guidance. Otherwise, ask the invoker before proceeding with the fix.
163
180
164
181
### Step 3.5: Update `@itwin/electron-authorization` if needed
@@ -290,10 +307,13 @@ gh pr create \
290
307
--head electron-<NEW_MAJOR> \
291
308
--title "Add support for Electron <NEW_MAJOR>" \
292
309
--body "$(cat <<'EOF'
293
-
Adds support for Electron <NEW_MAJOR>.
294
-
295
310
### Breaking changes review
296
-
<Include the breaking changes assessment here — list each change with "affected" / "not affected" status>
311
+
312
+
<Include the breaking changes assessment table from Step 3 here>
313
+
314
+
### Notes
315
+
316
+
<Include any relevant notes, e.g. unmet peer dependencies>
297
317
298
318
See [Electron <NEW_MAJOR> release blog](https://www.electronjs.org/blog/electron-<NEW_MAJOR>-0) for details.
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,8 @@ API changes require:
88
88
89
89
All published packages use **lockstep versioning** (`prerelease-monorepo-lockStep` policy). Versions are automatically synchronized across packages - do NOT manually edit internal dependency versions in `package.json`.
90
90
91
+
When generating a changelog non-interactively with `rush change`, always use bump type `"none"` in the generated change file. In this lockstep monorepo, version bumps are coordinated separately and changelog entries should not choose per-package bump types like `"patch"` or `"minor"`.
92
+
91
93
## Testing
92
94
93
95
### Mocha vs Vitest
@@ -183,6 +185,13 @@ Valid formats recognized by the ESLint rule:
183
185
184
186
**Critical**: Always run `rush extract-api` and `rush change` before pushing - CI will fail otherwise.
185
187
188
+
### Draft PR Descriptions
189
+
190
+
When creating or updating a draft PR, always include a `## Validation` section in the PR description. Summarize any targeted verification steps you performed beyond what CI checks cover, and note any known pre-existing failures or warnings:
191
+
192
+
-`Targeted verification:`
193
+
-`Known baseline issues:`
194
+
186
195
## Build Tools
187
196
188
197
TypeScript compilation outputs dual format: CJS in `lib/cjs/`, ESM in `lib/esm/`.
"[itwinjs] tsconfig changed - clean and rebuild to avoid stale lib/ artifacts: from the affected package directory run rushx clean && rushx build, or from the repo root use rush clean && rush build.",
"[itwinjs] Commit checklist: (1) any .ts files staged? -> rush lint from the repo root, or rushx lint from the affected package; (2) any @public/@beta symbol or TSDoc comment changed? -> rush extract-api + commit .api.md; (3) package.json dep changed? -> rush update committed; (4) changed a package with dependents? -> run downstream tests.",
0 commit comments