Skip to content

Commit 375e255

Browse files
Merge upstream/main (e943530) into vps2/f1b-getstate-merge
Merge base 3ee042d. The merge brings main's 113 changed paths; exactly one conflicted and was resolved by hand: src/core/webview/ClineProvider.ts, three hunks. Imports: both sides kept - main's withoutInvalidDisplaySettings import beside this branch's ProviderSettingsNotFoundError import, which the unit's invalid-mode handling needs. getStateToPostToWebview field list: main added timeFormat, dateFormat and showRelativeTimes read from stateValues; this branch renamed that binding to mergedStateValues because it merges the view-local buffer over the shared values. Our naming is kept and main's three fields are read from the merged source, in main's position, with main's defaults. setValues: main replaced the body with one filtered write. This branch carries the invalid-mode guard, the view-local half of the write, and the rollback of both halves when a write fails. Main's filter is applied first and its result is what the rest of the body writes, so an invalid display value still never reaches ContextProxy, and everything this unit added is kept beside the filter rather than replaced by it. Fidelity, measured rather than inferred from a green build: - 104 paths main changed that this branch never touched: 0 differ from main in the merged tree. - 15 paths only this branch changed: 0 differ from the pre-merge head. - describe/it/test titles main added on test files main modified: 185 added, 185 present. - substantive lines main added in the 5 shared non-test code files: 73 added, 68 present verbatim. The 5 are main's three display entries, re-expressed against this branch's binding name, and main's filter call, which survives bound into sanitizedValues in prettier's multiline shape. - substantive lines this branch added in the 9 shared files: 3795 added, 3794 present. The 1 is the spread of values that main's filter replaced on purpose. - the four lines main deleted from ContextProxy that still appear in the merged file appear in main's own blob at the same counts, so they are main's re-introduced lines and not leftovers of an older shape. Suppression totals: merge base 3305, main 3301, pre-merge head 3302, merged 3298. No file or rule increased against either side.
2 parents 73a1c9b + e943530 commit 375e255

113 files changed

Lines changed: 8633 additions & 331 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.

‎.github/workflows/code-qa.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
merge_group:
1010
types: [checks_requested]
1111

12+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
13+
# unique groups, so main, merge-queue, and manual runs are never cancelled.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
1218
# Least privilege: every job below escalates only where it needs to.
1319
permissions:
1420
contents: read

‎.github/workflows/codeql.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
schedule:
88
- cron: "24 19 * * 3"
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so main pushes and scheduled scans are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
# Least privilege: the analyze job escalates to security-events: write via its
1117
# own job-level permissions block.
1218
permissions:

‎.github/workflows/e2e.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
merge_group:
88
types: [checks_requested]
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so merge-queue and manual runs are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
permissions:
1117
contents: read
1218

‎.github/workflows/mutation-pr-comment.yml‎

Lines changed: 428 additions & 0 deletions
Large diffs are not rendered by default.

‎.github/workflows/mutation-testing.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
if: github.event_name == 'pull_request'
5151
env:
5252
HEAD_SHA: ${{ github.sha }}
53+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
5354
run: |
5455
BASE_SHA="$(git rev-parse "$HEAD_SHA^1")"
5556
node scripts/stryker-diff.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA"

‎.github/workflows/release-validation.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
- "releases/**"
1717
- ".github/workflows/release-validation.yml"
1818

19+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
20+
# unique groups, so manual runs are never cancelled.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1925
permissions:
2026
contents: read
2127

‎apps/vscode-e2e/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"lint": "eslint src --ext=ts --max-warnings=0",
66
"check-types": "tsc -p tsconfig.esm.json --noEmit",
77
"format": "prettier --write src",
8-
"test:ci": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && pnpm test:run",
9-
"test:ci:mock": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && USE_MOCK=true pnpm test:run",
8+
"test:ci": "pnpm -w bundle && pnpm test:run",
9+
"test:ci:mock": "pnpm -w bundle && USE_MOCK=true pnpm test:run",
1010
"test:record": "AIMOCK_RECORD=true pnpm test:ci",
1111
"test:run": "rimraf out && tsc -p tsconfig.json && dotenv -e .env.local -- node ./out/runTest.js",
12-
"themes:build": "pnpm -w bundle && pnpm --filter @roo-code/vscode-webview build && rimraf out && tsc -p tsconfig.json",
12+
"themes:build": "pnpm -w bundle && rimraf out && tsc -p tsconfig.json",
1313
"themes:update": "pnpm themes:build && node ./out/theme-fixtures/generate.js update",
1414
"themes:check": "pnpm themes:build && node ./out/theme-fixtures/generate.js check",
1515
"themes:test": "pnpm --filter @roo-code/types build && rimraf out && tsc -p tsconfig.json && node --test ./out/theme-fixtures/fixtures.test.js",
-898 Bytes
Loading

‎apps/vscode-e2e/src/visual/electron.visual.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,21 @@ for (const scenario of scenarios) {
8989
const tokenCountMask = webviewFrame
9090
.frameLocator("iframe")
9191
.locator('[data-testid="context-tokens-count"],[data-testid="context-window-size"]')
92+
// The time under each message is the real send time, so it changes on every run, and so does the length
93+
// of its text ("Today 9:05 AM" and "Yesterday 12:36 PM" are not equally long). A mask covers the
94+
// element's box, so that box needs a fixed size as well: without it the masked area differs between
95+
// runs, in width and, when the text wraps onto a second line, in height.
96+
await contentFrame.evaluate(() => {
97+
document.querySelectorAll<HTMLElement>('[data-testid="message-timestamp"]').forEach((time) => {
98+
time.style.setProperty("width", "160px", "important")
99+
time.style.setProperty("white-space", "nowrap", "important")
100+
time.style.setProperty("overflow", "hidden", "important")
101+
})
102+
})
103+
// Mask it, as the token counters above, and keep the rest of the scene byte-stable.
104+
const messageTimeMask = webviewFrame.frameLocator("iframe").locator('[data-testid="message-timestamp"]')
92105
await expect(sidebar).toHaveScreenshot(`electron-${scenario.name}-sidebar.png`, {
93-
mask: [tokenCountMask],
106+
mask: [tokenCountMask, messageTimeMask],
94107
})
95108

96109
if (scenario.webviewSnapshot) {

‎docs/mutation-testing.md‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Mutation report PR comments
2+
3+
Changed-code mutation testing analyzes the pull request merge commit. Its report
4+
keeps that merge SHA in the reproduction command, but uses the PR head SHA in the
5+
comment marker. The trusted comment workflow checks that marker against the
6+
completed run's head SHA and the PR's current head before posting.
7+
8+
The workflow maintains one advisory comment per PR. Reports from older heads and
9+
closed PRs are ignored. Counts remain visible; a section collapsed by default
10+
contains the full report, mutant details, guidance, and reproduction steps.
11+
The renderer supports headings, paragraphs, lists, emphasis, inline code, fenced
12+
code blocks, and tables using trusted HTML structure with escaped text. Table
13+
cells, URLs, mentions, issue references, commit SHAs, and emoji shortcodes remain
14+
literal code. Commands and code examples use
15+
code blocks; guidance renders as prose. Artifact text cannot introduce active
16+
links, images, HTML, or mentions.
17+
18+
Focused test names come from Stryker's report or the selected-test fallback. An
19+
empty list means the names were not recorded; it does not establish that the run
20+
failed. The summary identifies incomplete runs from their result and reports
21+
zero-mutant packages separately.
22+
23+
A missing, unreadable, oversized, or invalid report deliberately leaves the last
24+
valid comment unchanged. This includes failed runs that exit before producing a
25+
report. The visible head SHA identifies which commit the comment describes; it
26+
does not certify that later runs completed. A valid clean report updates an
27+
existing comment to an all-clear result, but does not create a new comment.
28+
29+
Run `pnpm test:mutation-ci` to check report generation and execute the trusted
30+
inline comment script with mocked GitHub and filesystem APIs. The tests cover
31+
SHA matching, stale heads, invalid artifacts, table rendering, hostile cell escaping, truncation, and
32+
comment creation and updates.
33+
34+
## Validate the GitHub workflow before merge
35+
36+
Use private disposable repositories with the consumer workflow on the base
37+
repository's default branch. Copy the consumer and formatter unchanged. A minimal
38+
producer can call the real formatter with deterministic survivor, clean, invalid,
39+
and delayed reports while retaining the production SHA environment variables,
40+
merge checkout, workflow name, and artifact upload action.
41+
42+
Exercise a same-repository PR and a genuine cross-owner fork PR. Check comment
43+
creation and updates, clean results with and without an existing comment, invalid
44+
or missing report retention, rendered HTML, and an old run finishing after a new
45+
head. Download the artifact to verify that its PR head marker differs from the
46+
analyzed merge SHA. Keep fork jobs read-only with no forwarded secrets.
47+
48+
This checks real triggers, token permissions, artifact downloads, and comment
49+
writes before merge. It does not rerun mutation analysis or establish the target
50+
repository's own Actions policy; verify that policy after deployment.

0 commit comments

Comments
 (0)