diff --git a/packages/vscode/AGENTS.md b/packages/vscode/AGENTS.md index 140d12b..0df73ad 100644 --- a/packages/vscode/AGENTS.md +++ b/packages/vscode/AGENTS.md @@ -7,7 +7,7 @@ One extension replacing the standalone `rstack.rslint` and `rstack.rstest` exten - `stacks/lint` and `stacks/test` are deliberate near-verbatim copies of the upstream extensions, kept close to upstream so changes can be synced by diffing. Do NOT deduplicate or refactor across the two stacks — the duplication is the point; consolidation is a later, explicit phase. - The copies diverge from upstream in exactly nine ways (the "adaptations" below). When syncing upstream, preserve them. A tenth divergence is either a bug or must be added to this list. - **Tracked upstream state.** `stacks/lint` is synced to web-infra-dev/rslint `packages/vscode-extension` at **39536fd6** (#1617 — per-document core resolution, `CoreResolver` + `RuntimeManager`, `corePath`, PnP removed) and **892482e0** (#1630 — `configPath` on `rslint/configRefresh`). Targeted later ports are **84f9c9b5** (#1967 — languageclient-owned live LSP tracing) and **b7176723** (#1951 — remove legacy JSON config watching); the Unicode BOM E2E comes from **5fc197a5** (#1560), with its native-config fixture shape from **b7176723**. `CoreResolver.ts` / `RuntimeManager.ts` / `WorkspaceDocumentRouter.ts` / `Rslint.ts` are the files to diff when syncing further; record the new commits here when you do. -- **Ahead of upstream — offer these back when syncing** (bug fixes, not adaptations): (1) `RuntimeManager.reconcile` resolves the document's core **before** sweeping pending uses (`planDocumentCore`), so a reconcile landing on the key a pending start is already producing adopts that start instead of tearing it down mid-`initialize` — the teardown made vscode-languageclient force-notify ("couldn't create connection to server") whenever the register-time pass, a detection change and `didOpen` landed inside one worker startup window (`tests/stacks/lint/runtimeManager.test.ts`). (2) `Rslint.close()` gives a still-Starting language client a bounded chance to settle before tearing down its transport, so a legitimate mid-start close (document closed during start, core key changed) stops cleanly instead of triggering the same force-notified toasts. +- **Ahead of upstream — offer these back when syncing** (bug fixes, not adaptations): (1) `RuntimeManager.reconcile` resolves the document's core **before** sweeping pending uses (`planDocumentCore`), so a reconcile landing on the key a pending start is already producing adopts that start instead of tearing it down mid-`initialize` — the teardown made vscode-languageclient force-notify ("couldn't create connection to server") whenever the register-time pass, a detection change and `didOpen` landed inside one worker startup window (`tests/stacks/lint/runtimeManager.test.ts`). (2) `Rslint.close()` gives a still-Starting language client a bounded chance to settle before tearing down its transport, so a legitimate mid-start close (document closed during start, core key changed) stops cleanly instead of triggering the same force-notified toasts. (3) The registry-harness E2E gives its never-settling startup operation 500ms to begin and accepts only the in-flight timeout message, so a stalled runner cannot satisfy the assertion through the already-expired path (`e2e/lint/suite/registry-harness.test.ts`). ## The nine adaptations diff --git a/packages/vscode/e2e/lint/suite/registry-harness.test.ts b/packages/vscode/e2e/lint/suite/registry-harness.test.ts index edc3f05..e6536d9 100644 --- a/packages/vscode/e2e/lint/suite/registry-harness.test.ts +++ b/packages/vscode/e2e/lint/suite/registry-harness.test.ts @@ -1,5 +1,6 @@ -// Ported verbatim from web-infra-dev/rslint -// `packages/vscode-extension/__tests__/suite/registry-harness.test.ts` (origin/main). +// Ported from web-infra-dev/rslint +// `packages/vscode-extension/__tests__/suite/registry-harness.test.ts` (origin/main), +// with startup-deadline hardening documented inline. import * as assert from 'assert'; import { randomUUID } from 'node:crypto'; import * as vscode from 'vscode'; @@ -125,10 +126,12 @@ suite('VS Code test harness fail-closed guards', function () { attempts += 1; return new Promise(() => {}); }, - Date.now() + 50, + // Deviation from upstream (50ms): leave enough headroom for a stalled + // CI runner to start the operation before its shared deadline. + Date.now() + 500, 'the injected startup operation', ), - /Timed out waiting for the injected startup operation.*shared startup deadline/, + /Timed out waiting for the injected startup operation before the shared startup deadline/, ); assert.strictEqual( attempts,