Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pnpm-worktree-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.npmrc'
- '.pnpmfile.mjs'
- 'package.json'
- 'package-lock.json'
- 'packages/*/package.json'
- '!packages/desktop-shell/package.json'
- '!packages/live-host/package.json'
Expand All @@ -33,6 +34,7 @@ on:
- '.npmrc'
- '.pnpmfile.mjs'
- 'package.json'
- 'package-lock.json'
- 'packages/*/package.json'
- '!packages/desktop-shell/package.json'
- '!packages/live-host/package.json'
Expand Down
15 changes: 9 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ npm run build
**pnpm worktree bootstrap (opt-in):** an additional Git worktree can install
dependencies with `node scripts/setup-worktree.js`, which runs the pinned
pnpm with `--frozen-lockfile` (warm store ≈ 99 MiB on copy-on-write
filesystems such as APFS, btrfs, and XFS with reflink; without reflink it is
≈ 1.2 GiB). npm remains the authoritative path for build, CI, packaging, and
release; the pnpm layout is install-only for now. When dependencies change,
regenerate the pnpm lockfile with
`corepack pnpm install --lockfile-only --no-frozen-lockfile` and commit both
lockfiles together.
filesystems such as APFS, btrfs, and XFS with reflink; without reflink, as on
ext4, it is ≈ 1.2 GiB, close to a plain npm install). The bootstrap skips the
`prepare` build, so run `npm run build` before package tests. npm remains the
authoritative path for build, CI, packaging, and release; the pnpm layout is
install-only for now. When dependencies change, update `package-lock.json`
with npm first, then regenerate the pnpm lockfile from it with
`corepack pnpm import` and commit both lockfiles together;
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
`npm run check:lockfile` fails when pnpm resolves a version npm has not
locked.

**Run individual test files** (always preferred):

Expand Down
96 changes: 96 additions & 0 deletions docs/verification/pnpm-stage2-evidence/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# pnpm Stage 2 go/no-go evidence

The post-Stage 1 review on
[#10444](https://github.com/QwenLM/qwen-code/issues/10444#issuecomment-5630188013)
recommends holding Stage 2 (pnpm for development and CI) until two
measurements exist. Neither could run on the machine that wrote this brief,
because it does not run builds or test suites. Every number below that is not
marked as measured comes from #10444 and has not been reproduced here.

Report results as a comment on #10444, then add a `results.md` next to this
file.

## Already measured

On `main` at `642d36e`, Linux, Node 22.23.2, pnpm 11.24.0:

- Two consecutive `corepack pnpm import` runs produced byte-identical
`pnpm-lock.yaml` output, about 51 s each with a cold metadata cache.
`corepack pnpm install --frozen-lockfile --lockfile-only` accepts the
result.
- After the import, every `name@version` in `pnpm-lock.yaml` is also locked
in `package-lock.json`, except `mime-db@1.52.0`. That exception is a gap in
the npm lockfile; `scripts/check-lockfile.js` explains it.

## 1. Per-worktree disk on the hosts that run worktrees

**Premise under test:** pnpm's 93% disk saving (1,472 → 99 MiB per worktree)
depends on a copy-on-write filesystem, because `packageImportMethod` is
`clone-or-copy`. On ext4 the saving should shrink to roughly 1.47 → 1.2 GiB.
A reflink clone of the primary checkout's `node_modules` should match pnpm on
CoW filesystems without pnpm.

Run this on every host class that creates worktrees: the ECS runner hosts and
developer Macs.

1. Record the filesystem. On Linux, run `df -T <repo>`. On macOS, run
`diskutil info / | grep Personality`.
Comment thread
yiliang114 marked this conversation as resolved.
Resolved

2. Prepare three fresh worktrees of the same commit from the primary
checkout. The primary checkout must already have a completed `npm ci`.
Warm the pnpm store once, in a throwaway worktree, before measuring.

3. For each method below, record the change in the `df` used column and the
wall time. Use `df`, not `du`: `du` counts cloned files at full size.
Comment thread
yiliang114 marked this conversation as resolved.
Resolved

| Method | Command in the new worktree |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| npm | `QWEN_SKIP_PREPARE=1 npm ci --prefer-offline` |
| pnpm | `node scripts/setup-worktree.js` |
| reflink copy | copy the primary's `node_modules` and each `packages/*/node_modules`, using `cp -c -R` on APFS or `cp -R --reflink=always` on btrfs/XFS reflink |

4. For the reflink copy, confirm the workspace links point into the new
worktree:
- `readlink node_modules/@qwen-code/qwen-code-core` prints
`../../packages/core`.
- `node -p "require.resolve('@qwen-code/qwen-code-core/package.json')"`,
run in the worktree, prints a path inside that worktree.

5. Record the peak number of concurrent worktrees per host over a week, for
example by sampling `git worktree list | wc -l` daily.

**Report:** a table of host, filesystem, method, `df` delta and wall time;
the peak concurrent worktree count; and free disk per host.

**Decision this feeds:** disk alone justifies Stage 2 only if the peak count
times the npm delta exceeds the host's disk budget, and the reflink copy is
not an option on that filesystem.

## 2. Hoisted parity: the CI matrix on a pnpm-installed tree

**Premise under test:** with `nodeLinker: hoisted`, the existing npm scripts
run unchanged on a pnpm-installed tree. Stage 2 would then need almost no
script changes.

1. On a scratch branch, add these steps to the `ubuntu-latest` job of
`.github/workflows/pnpm-worktree-smoke.yml`, after the install step:
`npm run build`, `npm run typecheck`, `npm run lint:ci`, `npm run test:ci`,
`npm run bundle`, and `npm run check:serve-fast-path-bundle`.
2. Run the job with
`gh workflow run pnpm-worktree-smoke.yml --ref <branch>`.
3. Repeat the run with the install step replaced by `npm ci`. This is the
npm baseline on the same runner class.

**Report:** pass or fail and duration for each step under both installers,
the first failure's log for any step that fails only under pnpm, and the
install step duration for each installer.

**Decision this feeds:** the real Stage 2 change surface, and the CI time
benefit. Do not extrapolate that benefit from the worktree benchmark.

## Claims these results may contradict

- The ext4 per-worktree estimate of about 1.2 GiB, which comes from the
AGENTS.md note.
- "npm scripts run unchanged on a hoisted pnpm tree."
- The recommendation to freeze at Stage 1.
48 changes: 48 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ const generalRestrictedSyntaxSelectors = [
},
];

// Undeclared imports are checked in shipped sources only: tests resolve
// shared tooling such as vitest from the root manifest by design.
const extraneousDependencyTestFiles = [
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
'**/__tests__/**',
'**/test/**',
'**/tests/**',
];
const extraneousDependencyOptions = {
devDependencies: true,
optionalDependencies: true,
peerDependencies: true,
};

export default tseslint.config(
{
// Global ignores
Expand Down Expand Up @@ -221,6 +236,39 @@ export default tseslint.config(
'default-case': 'error',
},
},
{
// A package must declare what its own sources import. npm and the hoisted
// pnpm layout both resolve a sibling's or the root's dependency, so a
// missing declaration stays invisible until the package is installed on
// its own — the check an isolated node_modules layout would add. Type-only
// imports are exempt because they disappear at build time.
files: [
'packages/**/src/**/*.{ts,tsx}',
'integrations/**/src/**/*.{ts,tsx}',
],
ignores: extraneousDependencyTestFiles,
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
rules: {
'import/no-extraneous-dependencies': [
'error',
extraneousDependencyOptions,
],
},
},
{
// export-html and insight carry a package.json only for "type" and their
// build script; web-templates declares what they import.
files: ['packages/web-templates/src/**/*.{ts,tsx}'],
ignores: extraneousDependencyTestFiles,
rules: {
'import/no-extraneous-dependencies': [
'error',
{
...extraneousDependencyOptions,
packageDir: `${import.meta.dirname}/packages/web-templates`,
},
],
},
},
{
// The rule itself exempts tests, __tests__, and fixtures; repeating that
// here would give the exemption two sources of truth. The utils-upward
Expand Down
15 changes: 14 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
"@qwen-code/qwen-code-core": "file:../core",
"@qwen-code/sdk": "file:../sdk-typescript",
"@qwen-code/web-templates": "file:../web-templates",
"ansi-escapes": "^7.3.0",
"ansi-regex": "^6.2.2",
"chalk": "^4.1.2",
"chokidar": "^4.0.3",
"command-exists": "^1.2.9",
"diff": "^7.0.0",
Expand All @@ -77,6 +79,7 @@
"jsonc-parser": "^3.3.1",
"lowlight": "^3.3.0",
"markdown-it": "^15.0.0",
"open": "^10.2.0",
"p-limit": "^7.3.0",
"prompts": "^2.4.2",
"proper-lockfile": "^4.1.2",
Expand All @@ -88,6 +91,7 @@
"remark-math": "^6.0.0",
"remark-parse": "^11.0.0",
"remend": "^1.3.1",
"semver": "^7.7.2",
"shell-quote": "^1.9.0",
"simple-git": "^3.36.0",
"saxes": "6.0.0",
Expand Down
10 changes: 9 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"@modelcontextprotocol/core": "2.0.0",
"@modelcontextprotocol/sdk": "^1.30.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/api-logs": "^0.221.0",
"@opentelemetry/core": "^2.0.1",
"@opentelemetry/exporter-logs-otlp-grpc": "^0.221.0",
"@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
Expand All @@ -101,7 +102,13 @@
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
"@opentelemetry/instrumentation-http": "^0.221.0",
"@opentelemetry/instrumentation-undici": "^0.31.0",
"@opentelemetry/otlp-exporter-base": "^0.221.0",
"@opentelemetry/resources": "^2.10.0",
"@opentelemetry/sdk-logs": "^0.221.0",
"@opentelemetry/sdk-metrics": "^2.10.0",
"@opentelemetry/sdk-node": "^0.221.0",
"@opentelemetry/sdk-trace-node": "^2.10.0",
"@opentelemetry/semantic-conventions": "^1.36.0",
"@xterm/headless": "5.5.0",
"ajv": "^8.17.1",
"ajv-formats": "^3.0.0",
Expand Down Expand Up @@ -138,7 +145,8 @@
"web-tree-sitter": "^0.24.7",
"ws": "^8.18.0",
"yaml": "^2.8.1",
"yauzl": "^2.10.0"
"yauzl": "^2.10.0",
"zod": "^3.25.76"
},
"optionalDependencies": {
"@lydell/node-pty": "1.2.0-beta.10",
Expand Down
12 changes: 6 additions & 6 deletions packages/vscode-ide-companion/NOTICES.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/vscode-ide-companion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@
"cors": "^2.8.5",
"dotenv": "^17.1.0",
"express": "^5.1.0",
"lucide-react": "^1.24.0",
"markdown-it": "^14.1.0",
"punycode": "^2.3.1",
"react": "^19.2.4",
Expand Down
Loading
Loading