Skip to content

Commit 06f124e

Browse files
committed
merge(2026-03-09): 4a59cd7
2 parents ea783e0 + 4a59cd7 commit 06f124e

File tree

32,278 files changed

+591050
-467961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

32,278 files changed

+591050
-467961
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json
22

3-
version: v2.7.2
3+
version: v2.10.1
44

55
destination: ./_tools
66

.devcontainer/devcontainer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "TypeScript Compiler Development",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/go:2-1.25-bookworm",
6+
"image": "mcr.microsoft.com/devcontainers/go:dev-1.26-bookworm",
77
// Features to add to the dev container. More info: https://containers.dev/features.
88
"features": {
99
"ghcr.io/devcontainers/features/node:1": {
@@ -13,8 +13,7 @@
1313
},
1414
"ghcr.io/devcontainers-extra/features/dprint-asdf:2": {
1515
"version": "latest"
16-
},
17-
"ghcr.io/devcontainers/features/rust:1": {}
16+
}
1817
},
1918

2019
// Use 'forwardPorts' to make a list of ports inside the container available locally.

.dprint.jsonc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"trailingCommas": "never"
3939
},
4040
"gofumpt": {
41-
"langVersion": "go1.25",
41+
"langVersion": "go1.26",
4242
"modulePath": "github.com/microsoft/typescript-go"
4343
},
4444
"excludes": [
@@ -56,9 +56,9 @@
5656
// Note: if adding new languages, make sure settings.template.json is updated too.
5757
// Also, if updating typescript, update the one in package.json.
5858
"plugins": [
59-
"https://plugins.dprint.dev/typescript-0.95.13.wasm",
60-
"https://plugins.dprint.dev/json-0.21.0.wasm",
61-
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
62-
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.3.wasm"
59+
"https://plugins.dprint.dev/typescript-0.95.15.wasm",
60+
"https://plugins.dprint.dev/json-0.21.1.wasm",
61+
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm",
62+
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.7.wasm"
6363
]
6464
}

.github/ISSUE_TEMPLATE/02-behavior-difference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Behavior Difference
3-
about: tsgo produces different results than TypeScript 5.9
3+
about: tsgo produces different results than TypeScript 6.0
44
title: ''
55
labels: ''
66
assignees: ''
@@ -11,6 +11,6 @@ assignees: ''
1111

1212
<!-- Share a repository link or a code sample -->
1313

14-
## Behavior with `typescript@5.9`
14+
## Behavior with `typescript@6.0`
1515

1616
## Behavior with `tsgo`

.github/actions/setup-go/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Setup Go
44
inputs:
55
go-version:
66
description: Go version to set up in go-install.ps1 format
7-
default: 'go1.25'
7+
default: 'go1.26'
88
create:
99
description: Create the cache
1010
default: 'false'
@@ -71,15 +71,15 @@ runs:
7171
7272
- if: ${{ inputs.create != 'true' }}
7373
name: Restore Go modules
74-
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
74+
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
7575
with:
7676
key: ${{ steps.cache-info.outputs.modules-key }}
7777
path: |
7878
~/go/pkg/mod
7979
8080
- if: ${{ inputs.create != 'true' }}
8181
name: Restore Go build cache
82-
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
82+
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
8383
with:
8484
key: unused-key-${{ github.run_id }}
8585
restore-keys: ${{ steps.cache-info.outputs.build-key }}-
@@ -90,7 +90,7 @@ runs:
9090
9191
- if: ${{ inputs.create != 'true' && inputs.lint-cache == 'true' }}
9292
name: Restore golangci-lint cache
93-
uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
93+
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
9494
with:
9595
key: unused-key-${{ github.run_id }}
9696
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
@@ -146,15 +146,15 @@ runs:
146146

147147
- if: ${{ inputs.create == 'true' }}
148148
name: Save Go modules
149-
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
149+
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
150150
with:
151151
key: ${{ steps.cache-info.outputs.modules-key }}
152152
path: |
153153
~/go/pkg/mod
154154
155155
- if: ${{ inputs.create == 'true' }}
156156
name: Save Go build cache
157-
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
157+
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
158158
with:
159159
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
160160
path: |
@@ -164,7 +164,7 @@ runs:
164164
165165
- if: ${{ inputs.create == 'true' }}
166166
name: Save golangci-lint cache
167-
uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
167+
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
168168
with:
169169
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
170170
path: ${{ env.GOLANGCI_LINT_CACHE }}

.github/agents/replay-minimizer.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
---
2+
name: replay-minimizer
3+
description: "Use this agent when the user asks to triage, reproduce, minimize, or analyze a crash from a replay file.\n\nTrigger phrases include:\n- 'minimize this crash'\n- 'triage this replay'\n- 'reduce this repro'\n- 'analyze this crash'\n- 'create a minimal reproduction'\n- 'build a fourslash test for this crash'\n\nExamples:\n- User provides a replay file and says 'minimize this crash' → invoke this agent to reproduce, extract signature, and reduce the replay\n- User says 'triage this replay.json' → invoke this agent to reproduce the crash and characterize the failure\n- User asks 'build a fourslash test from this crash' → invoke this agent to create a Go fourslash test that replicates the issue\n- User says 'is this crash reproducible?' → invoke this agent to run the replay and assess determinism"
4+
---
5+
6+
# replay-minimizer instructions
7+
8+
You are a crash triage and replay minimization agent.
9+
10+
## Goal
11+
12+
Given a replay file and a project directory provided by the user, you MUST use the built-in Go replay test (`TestReplay` in `internal/lsp/replay_test.go`) to:
13+
14+
1. Reproduce the crash deterministically (or characterize flakiness)
15+
2. Identify a stable crash signature (stack/exception/location)
16+
3. Reduce the replay file to a minimal form that still triggers the same crash
17+
4. Output the minimized replay file plus a short report
18+
5. Build out a fourslash test case in Go to replicate the issue
19+
20+
## Required inputs
21+
22+
The user MUST provide two things:
23+
1. **A replay file** — a newline-delimited JSON file (typically `*.replay.txt`) containing recorded LSP messages
24+
2. **A project directory** — the path to the project directory the replay was recorded against
25+
26+
If either is missing, ask the user to provide it before proceeding.
27+
28+
## How to run replays
29+
30+
Use the built-in Go test `TestReplay` located at `internal/lsp/replay_test.go`. Run it from the repository root with:
31+
32+
```bash
33+
cd <typescript-go repo root>
34+
go test ./internal/lsp/ -run ^TestReplay$ -replay <path/to/replay.txt> -testDir <path/to/project/dir> -timeout 120s 2>&1
35+
```
36+
37+
### Available flags
38+
39+
| Flag | Description |
40+
|------|-------------|
41+
| `-replay <path>` | **(Required)** Path to the replay file |
42+
| `-testDir <path>` | **(Required)** Path to the project directory the replay was recorded against |
43+
| `-simple` | Replay only file open/change/close messages plus the final request (useful for faster reduction passes) |
44+
| `-superSimple` | Replay only the last file open and the final request (most aggressive simplification) |
45+
| `-timeout <duration>` | Go test timeout (e.g., `120s`, `5m`). Use to detect hangs. |
46+
47+
### Replay file format
48+
49+
The replay file is newline-delimited JSON:
50+
- **Line 1**: metadata object with `rootDirUriPlaceholder` and/or `rootDirPlaceholder` fields, plus optional `serverArgs`
51+
- **Lines 2+**: message objects with `kind` (`"request"` or `"notification"`), `method`, and `params` fields
52+
53+
Path placeholders in the file (e.g., `@PROJECT_ROOT@`, `@PROJECT_ROOT_URI@`) are automatically replaced with the `-testDir` value at runtime.
54+
55+
### Interpreting results
56+
57+
- **Exit 0 / PASS**: The replay completed without a crash — the candidate does NOT reproduce the bug.
58+
- **Non-zero exit / FAIL**: The test failed. Check stderr/stdout for the crash signature (panic, fatal error, etc.).
59+
- **Timeout**: The replay hung. Treat separately unless the baseline also hangs.
60+
61+
## Non-negotiable constraints
62+
63+
- Do NOT guess. Every claim must be backed by running the replay test.
64+
- Do NOT "fix" the crash. Only minimize the repro.
65+
- Every candidate reduction MUST be validated by re-running the replay test.
66+
- The minimized replay MUST still crash with the SAME signature, not merely "a crash".
67+
- Keep the output file valid (newline-delimited JSON) at all times.
68+
- Prefer determinism: same inputs, same command, same environment.
69+
- If the crash is flaky, quantify it and use an "interestingness" predicate that is robust.
70+
71+
## Procedure (must follow in order)
72+
73+
### Step 0 — Baseline reproduction
74+
75+
- Run the baseline replay at least once using the command above.
76+
- Capture:
77+
- exact command used
78+
- exit status
79+
- crash output (panic, stack trace, fatal error message)
80+
- If it does NOT crash, try with `-simple` and `-superSimple` flags to see if a reduced replay still crashes.
81+
- If it still does NOT crash, stop and report "not reproducible".
82+
83+
### Step 1 — Extract a crash signature
84+
85+
- From baseline crash output, derive a signature that is:
86+
- specific enough to avoid matching unrelated crashes
87+
- stable across re-runs
88+
- Example signature fields (use what is available):
89+
- exception name/type (e.g., Go panic message)
90+
- message substring
91+
- top 3–10 stack frames (normalized)
92+
- "culprit" function/file:line if present
93+
- crash category or bucket if available
94+
- Re-run baseline 2 more times (or more if needed) to confirm stability.
95+
- If unstable, redefine signature to the stable core or treat as flaky (see Step 2b).
96+
97+
### Step 2 — Define interestingness predicate
98+
99+
- Implement the predicate as:
100+
- Run candidate replay with the Go test
101+
- Return TRUE iff:
102+
- it crashes AND
103+
- it matches the target signature (or the stable core for flaky crashes)
104+
- Timeouts:
105+
- enforce a reasonable `-timeout`; treat "hang" separately (not our target) unless baseline hangs.
106+
107+
### Step 2b — If flaky
108+
109+
- Run baseline N times (e.g., N=10) and estimate crash rate.
110+
- Define predicate TRUE iff crash rate ≥ threshold (e.g., ≥30%) AND signature matches.
111+
- Use repeated trials only when necessary; otherwise keep runs minimal.
112+
113+
### Step 3 — Try built-in simplification modes first
114+
115+
Before doing manual delta debugging, try the built-in simplification flags:
116+
117+
1. Run with `-simple` — if it still crashes with the same signature, use this as the new baseline (it strips out all messages except file open/change/close and the final request).
118+
2. Run with `-superSimple` — if it still crashes, use this as the new baseline (only the last file open and final request).
119+
120+
These can dramatically reduce the replay before manual minimization begins.
121+
122+
### Step 4 — Minimize structure (coarse ddmin)
123+
124+
- Treat the replay as a sequence of message lines (after the first metadata line).
125+
- First pass: remove large chunks (delta debugging / ddmin):
126+
- partition message lines into k chunks
127+
- try deleting each chunk
128+
- keep deletion if predicate remains TRUE
129+
- adaptively reduce chunk size until no chunk deletion works
130+
- Second pass: try removing individual message lines.
131+
- **Important**: Always preserve the first line (metadata) and ensure `initialize`/`initialized` and `shutdown`/`exit` messages remain if present.
132+
133+
### Step 5 — Minimize within units (fine-grained)
134+
135+
For each remaining message:
136+
- attempt to simplify data while preserving validity:
137+
- delete optional fields from `params`
138+
- shorten strings
139+
- reduce arrays/objects
140+
- replace numbers with smaller equivalents (0, 1, -1) where valid
141+
- normalize to minimal required shape
142+
- After EACH simplification attempt, validate via predicate.
143+
144+
### Step 6 — Canonicalize and clean up
145+
146+
- Remove irrelevant metadata not required for reproduction (timestamps, random IDs) IF predicate stays TRUE.
147+
- Ensure the minimized replay is still readable and stable:
148+
- consistent formatting
149+
- stable ordering if your harness cares
150+
151+
### Step 7 — Produce outputs
152+
153+
**Output A:** minimized replay file (the final candidate that still matches predicate)
154+
155+
**Output B:** minimization report (plain text) including:
156+
- How to run it (exact `go test` invocation with all flags)
157+
- Baseline signature and final signature (should match)
158+
- Reduction summary:
159+
- original size (bytes, message count)
160+
- minimized size
161+
- what kinds of deletions/simplifications were applied
162+
- Notes on determinism/flakiness and required config if any
163+
164+
**Output C:** Go fourslash test case
165+
- Must replicate the crash
166+
- Implement based on Go fourslash tests
167+
- Run the test to verify that it encounters the bug and fails under the current implementation
168+
169+
### Step 8 — Clean up workspace
170+
171+
- Leave only the outputs requested in the previous step

0 commit comments

Comments
 (0)