* feat(forge): let providers declare their hosts, names, sign-in, and review decisions Prepare the forge contract for a second provider: - ForgeProvider lists the hosts it serves and names itself (label, changeRequestNoun); registering a provider that lists a host another registered provider lists throws, so each URL has at most one provider. ctx.forge.describe(forge) returns the family's ForgeDescription. - ForgeReadiness carries the sign-in command, which the panel's sign-in banner shows instead of building `gh auth login` for the github family. - ForgeReviewData lists the review decisions the host lets the reader record; the review dialog offers only those instead of hardcoding the GitHub rule that a pull request's author may only comment. - ForgeReviewThread.original may name a later commit the host carried the thread to while its lines stayed unchanged. - The changes view names the code host and its word for a change request from the entry's ForgeDescription instead of hardcoding GitHub and PR. The GitHub provider declares its configured hosts, GitHub, pull requests, `gh auth login --hostname <host>`, and reads viewerDidAuthor for the review decisions. Upgrade guide: forge-provider-hosts. * feat(forge-gitlab): read GitLab merge requests through the GitLab CLI Add the experimental forge-gitlab provider. It serves the configured GitLab hosts through glab: status batches over GraphQL, head-pinned patches from merge request diff versions, commit listings, merge bases, pipeline jobs, closing issues, and review threads mapped from REST discussions, including outdated threads' hunks. The forge bundle composes the provider, disabled by default. * feat(forge-gitlab): write GitLab reviews, retry pipelines, request reviews, and rebase The GitLab provider now writes through glab as well as reading: comments start discussions at positions derived from the head's diff version, pending replies and comments are draft notes that a review publishes with its summary and review state, and approving checks the head through GitLab's sha parameter. Review reads carry the signed-in user's rights from GraphQL, their draft notes as the pending review, and the decisions GitLab lets them record. Snapshots name the head pipeline as every job's rerun, offer rebase as the branch update, and follow GitLab's permissions for reruns and review requests. updateBranch's contract now states how a provider whose host takes no expected head checks it. * feat(forge): let forge providers register the commands that bind change requests forge-session no longer recognizes gh commands by itself. A provider now registers a declarative ForgeCommandRule through ctx.forgeSession.registerCommands: its executable, creation and reference subcommands, change request page path, JSON URL members, declared options, and a pure select that maps one parsed reference command to a URL or a read-only lookup. forge-github registers gh and forge-gitlab registers glab, which adds glab mr create, view, update, and checkout, including numbers with -R: a full project URL binds directly, and other repository forms resolve through glab mr view in the call's shell. forge-session keeps the shared parts: the literal shell tokenizer, option parsing, output reading, lookups, and the projection. The forgeChangeRequests state version derives from the recognized rules, so a changed rule set refolds every Session, including commands that ran before the provider loaded. Ending a registration keeps its rule recognized until restart, so unloading providers at shutdown does not rewrite every checkpoint. * refactor(forge-gitlab): publish the GitLab provider as @deepseek-ai/dsh-forge-gitlab New experimental packages omit the experimental prefix so that promotion keeps their npm name. Register the directory in EXPERIMENTAL_PACKAGE_NAME_EXCEPTIONS instead of growing the legacy prefixed list, and rename every dependency, configuration row, path mapping, and document that names the package. * fix(forge-gitlab): keep review writes, comment positions, and reads within GitLab's facts and the limits - After GitLab refuses a publication, read the drafts again: delete them only when all remain, since GitLab can publish them before it refuses the summary, and report the outcome as unknown otherwise. A rollback that leaves drafts reports how many may remain. - Place comments on files GitLab collapsed through the diff compared from their texts, and let a file's new path name it over another file's old path after chained renames. - Keep the final newline of raw file reads. - Apply maxOutputBytes to the complete review result, and report a read whose rights stop early or skip a discussion's later notes as truncated. - Serve a version over maxCachedVersionBytes without keeping it. - Resolve uploaded avatars GitLab names by their path on the host. - Schedule bounded reads through p-limit. * fix(forge-session): run lookups only for live command rules and keep the projection registered - Reference lookups use the rules of live registrations, so a disposed provider's rule still folds but starts no gh or glab process. - A failed re-registration registers the projection again with the earlier rules, so clients keep its view; an error is logged only when that fails too. - Document the startup re-registration, test that the checkpointed state version survives a real Loader start, shutdown, and restart, and record that starting without a provider removes the bindings only its commands made. - Describe the changes view's pending review and single comment without naming GitHub, which keeps its own rule in forge-github, and render registerCommands as code in the generated service reference. * fix(forge-bundle): name GitLab merge requests in the bundle description The bundle now follows GitLab merge requests as well as GitHub pull requests, so the description's first sentence in every locale names both kinds of change request. * feat(forge): bind the change requests that gh api and glab api requests name Models often read a merge request through `glab api` or a pull request through `gh api` instead of `glab mr view` or `gh pr view`, which left the change request unbound. A command rule now declares raw API request subcommands beside its reference subcommands, each group with its own options, since `-f` is a value of `gh api` and a flag of `gh pr checkout`. An API request binds, as referenced, only the change request its REST path names, such as `projects/group%2Fapp/merge_requests/7/changes` or `repos/octo/demo/pulls/7/files`; its output is not read, since one request can list many change requests. A path whose host the command names binds directly, and one without a host, or with the current repository's placeholders, resolves through the CLI's view command in the call's shell. The gh and glab rules move to version 2. * docs(forge): add forge-gitlab and the forge-session peers to the module graph Regenerate docs/module-graph for the renamed GitLab provider and the optional forge-session peer of both providers. * test(web): refresh the forge bundle description in the recommended plugin catalog The creation recommendation recording carries every recommended plugin's description; refresh it for the forge bundle description that now names GitLab merge requests and the glab sign-in. * chore(forge-gitlab): carry the 0.2.2-rc.3 release version and move upgrade guides to v0.2.2-rc.3
447 lines
25 KiB
TypeScript
447 lines
25 KiB
TypeScript
import { spawnSync } from 'node:child_process'
|
|
import { existsSync } from 'node:fs'
|
|
import { fileURLToPath } from 'node:url'
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import { resolvePwshPath } from './packages/shell/pwsh-local/src/resolve.ts'
|
|
import { defineConfig } from 'vitest/config'
|
|
import { standardDecoratorPlugin, vitestExecArgv } from './vitest.shared.ts'
|
|
import { COVERAGE_EXEMPT_ENV, coverageExemptHeavySuites } from './scripts/coverage-exempt.ts'
|
|
import { COVERAGE_PARTITION_MODE_ENV, COVERAGE_TEST_TIMEOUT_ENV, coverageTestTimeoutOptions } from './scripts/coverage-partitions.ts'
|
|
import { LOCAL_TEST_PARALLELISM_CAP, defaultParallelism } from './scripts/parallelism.ts'
|
|
|
|
// Prints exact `path:line:col` records for every uncovered statement, branch
|
|
// path, and function when a file misses the per-file 100% gate — the built-in
|
|
// threshold ERRORs name only the file. Absolute path because istanbul-reports
|
|
// require()s custom reporters (which is also why the reporter is CJS).
|
|
const uncoveredLocationsReporter = fileURLToPath(new URL('./scripts/coverage-uncovered-locations.cjs', import.meta.url))
|
|
|
|
// Resolution facade shared by every plugin instance below: tsconfig.base.json
|
|
// has no include, which vite-tsconfig-paths treats as match-all, so its paths
|
|
// map applies to every test file. paths must win over package exports so built
|
|
// lib/ never loads a second module-singleton copy.
|
|
const pathsPlugin = (): ReturnType<typeof tsconfigPaths> => tsconfigPaths({ projects: ['./tsconfig.base.json'] })
|
|
|
|
const windowsUnsupportedPackages = process.platform === 'win32'
|
|
? [
|
|
// Bash-requiring suites (a real POSIX shell is unavailable on Windows).
|
|
// The pwsh-requiring suites (pwsh-local, tool-pwsh) deliberately stay
|
|
// INCLUDED: PowerShell ships with Windows, so they run natively here.
|
|
// This explicit list (not a 'packages/shell/*' glob) keeps
|
|
// packages/shell/shell — the Service Definition package — running on Windows.
|
|
'packages/shell/bash-local',
|
|
'packages/shell/bash-sandbox',
|
|
'packages/shell/tool-bash',
|
|
'packages/experimental/hook-protocol',
|
|
'packages/experimental/hooks-claude-code',
|
|
'packages/experimental/hooks-codex',
|
|
'packages/terminal/terminal-bash',
|
|
'packages/sandbox/sandbox-local',
|
|
// OpenSSH multiplexing and Unix-socket helper streams require POSIX endpoints.
|
|
'packages/ssh/*',
|
|
]
|
|
: []
|
|
|
|
const windowsUnsupportedTests = process.platform === 'win32'
|
|
? [
|
|
...windowsUnsupportedPackages.map(path => `${path}/tests/**/*.spec.ts`),
|
|
'packages/subprocess/subprocess/tests/**/*.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/local.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/process-inspector.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/spawn.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/terminal.spec.ts',
|
|
// Oracle-diff suites: they compare the worker's POSIX path/url faces
|
|
// against the host Node's own answers, which are win32 semantics on
|
|
// Windows. The worker always speaks POSIX; the Linux lanes hold the diff.
|
|
'packages/experimental/webworker-runtime/tests/node/path-diff.spec.ts',
|
|
'packages/experimental/webworker-runtime/tests/node/shim-diff.spec.ts',
|
|
// The subprocess ladder over the worker's child_process face: its kill
|
|
// rung reaches the in-worker process table through `process.kill`,
|
|
// which the ladder's win32 branch replaces with taskkill-by-real-pid —
|
|
// undeliverable to a table pid. The worker host always reports 'linux',
|
|
// so the Linux lanes hold the ladder.
|
|
'packages/experimental/webworker-runtime/tests/node/child-process.spec.ts',
|
|
]
|
|
: []
|
|
|
|
// These suites compare against or assemble the Worker's fixed Linux platform.
|
|
// Host-native Windows and macOS behavior is not their oracle.
|
|
const nonLinuxWebWorkerTests = process.platform === 'linux'
|
|
? []
|
|
: [
|
|
'packages/experimental/webworker-runtime/tests/node/fs-watch-stream.spec.ts',
|
|
'packages/experimental/webworker-runtime/tests/node/sandbox-stack.spec.ts',
|
|
]
|
|
|
|
const platformUnsupportedTests = [...windowsUnsupportedTests, ...nonLinuxWebWorkerTests]
|
|
|
|
const windowsUnsupportedCoveragePackages = process.platform === 'win32'
|
|
? [...windowsUnsupportedPackages, 'packages/subprocess/*']
|
|
: []
|
|
|
|
// Windows-only packages: their sources execute exclusively on win32 (koffi
|
|
// loads Win32 libraries), so the Linux coverage lane can never cover them.
|
|
// The Windows dev/CI lane exercises them through the probe/runner suites; the
|
|
// per-file 100% gate must not fail on their Linux-uncovered paths.
|
|
const windowsOnlyCoverageExclusions = process.platform !== 'win32'
|
|
? [
|
|
'packages/sandbox/sandbox-windows-acl/src/**/*.ts',
|
|
// The koffi-backed Win32 table (Toolhelp32/GetProcessTimes/taskkill)
|
|
// executes only on win32; its decision logic is unit-pinned on every
|
|
// host through the injected-internals suites.
|
|
'packages/subprocess/subprocess-local/src/windows-inspector.ts',
|
|
]
|
|
: []
|
|
|
|
// The confinement runner entry executes exclusively as a spawned child
|
|
// process (the sandbox seam's argv-prefix wrapper): its module-level main()
|
|
// would run the confinement in-process if imported, and vitest's v8 coverage
|
|
// never measures child processes. Its behavior is pinned end-to-end by
|
|
// tests/runner.spec.ts, which spawns the real entry through tsx.
|
|
const windowsRunnerCoverageExclusions = process.platform === 'win32'
|
|
? [
|
|
'packages/sandbox/sandbox-windows-acl/src/runner.ts',
|
|
// The session write lock's POSIX face (fs-ext flock plus inode
|
|
// verification) executes only off-Windows: the Linux lanes hold its
|
|
// per-file 100%, while the Windows branch is unit-pinned by
|
|
// win32.spec's injected bindings and exercised natively by every
|
|
// Windows suite through the real backend.
|
|
'packages/session/session-persistence-jsonl/src/lease.ts',
|
|
// The macOS provider transport uses Unix sockets; POSIX lanes cover its real socket lifecycle.
|
|
'packages/experimental/cua-macos/src/shared-native.ts',
|
|
// The GitHub CLI runner's suite stands in for `gh` with POSIX shell
|
|
// scripts and skips on Windows: the Linux and macOS lanes hold its
|
|
// per-file 100%, while the provider suite pins its callers everywhere.
|
|
'packages/experimental/forge-github/src/gh.ts',
|
|
// The GitLab CLI runner's suite does the same with a POSIX `glab` stand-in.
|
|
'packages/experimental/forge-gitlab/src/glab.ts',
|
|
// The panel's Git failure and environment cases stand in for `git` with
|
|
// POSIX shell scripts and skip on Windows: the Linux and macOS lanes hold
|
|
// its per-file 100%, while its real-Git cases run everywhere.
|
|
'packages/experimental/client-ui-forge/src/git.ts',
|
|
]
|
|
: []
|
|
|
|
// pwsh-local's run/start/lifecycle suites self-skip without a real pwsh
|
|
// (executor.spec.ts hasPwsh), leaving this file
|
|
// far below per-file 100% on pwsh-less hosts; the exemption keeps those hosts
|
|
// green while CI runners ship pwsh and still enforce the full bar. The probe
|
|
// runs the suites' own resolution (the dependency-free resolve.ts module),
|
|
// so the exemption is active exactly when the suites skip — a mismatched
|
|
// narrower probe could exempt the file on hosts whose suites actually run.
|
|
const pwshCoverageExclusions = spawnSync(resolvePwshPath(), ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', '$true'], { encoding: 'utf8' }).status === 0
|
|
? []
|
|
: [
|
|
'packages/shell/pwsh-local/src/index.ts',
|
|
'packages/shell/pwsh-sandbox/src/**/*.ts',
|
|
]
|
|
|
|
const testIncludes = [
|
|
'packages/*/*/tests/**/*.spec.{ts,tsx}',
|
|
'apps/*/tests/**/*.spec.{ts,tsx}',
|
|
'scripts/**/*.spec.ts',
|
|
'website/tests/**/*.spec.ts',
|
|
]
|
|
|
|
// The instrumented coverage gate sets this env; the exempt heavy suites then
|
|
// run beside it uninstrumented (membership contract in scripts/coverage-exempt.ts).
|
|
// A set-but-not-'1' value is a misconfiguration, not a silent no-op.
|
|
const coverageExemptRaw = process.env[COVERAGE_EXEMPT_ENV]
|
|
if (coverageExemptRaw !== undefined && coverageExemptRaw !== '' && coverageExemptRaw !== '1') {
|
|
throw new Error(`vitest config: ${COVERAGE_EXEMPT_ENV} must be '1' or unset, got ${JSON.stringify(coverageExemptRaw)}.`)
|
|
}
|
|
const coverageExemptExcludes = coverageExemptRaw === '1'
|
|
? coverageExemptHeavySuites.map(suite => suite.exclude)
|
|
: []
|
|
|
|
const coveragePartitionRaw = process.env[COVERAGE_PARTITION_MODE_ENV]
|
|
if (coveragePartitionRaw !== undefined && coveragePartitionRaw !== '' && coveragePartitionRaw !== '1') {
|
|
throw new Error(`vitest config: ${COVERAGE_PARTITION_MODE_ENV} must be '1' or unset, got ${JSON.stringify(coveragePartitionRaw)}.`)
|
|
}
|
|
const coveragePartitionMode = coveragePartitionRaw === '1'
|
|
|
|
// Lanes on shared hosts raise the per-test, hook, and expect.poll defaults
|
|
// together through DSH_COVERAGE_TEST_TIMEOUT_MS; it lands in each inline
|
|
// project below because CLI flags do not reach them (coverageTestTimeoutOptions
|
|
// owns the rule and its reach).
|
|
const laneTestBudget = coverageTestTimeoutOptions(process.env[COVERAGE_TEST_TIMEOUT_ENV])
|
|
// Outside CI, forks follow the local worker budget; CI keeps Vitest's own default for its runner.
|
|
const localWorkerBudget = process.env.CI === 'true' ? {} : { maxWorkers: defaultParallelism(process.env, undefined, LOCAL_TEST_PARALLELISM_CAP) }
|
|
|
|
// These suites exercise process-global state, process APIs, or timing-sensitive process I/O
|
|
// that worker threads cannot isolate reliably under aggregate gate contention.
|
|
// Keep the narrow exception in forks while the rest of the inventory avoids per-file processes.
|
|
const processBoundTests = [
|
|
'packages/session/session-persistence-jsonl/tests/jsonl.spec.ts',
|
|
'packages/subagent/subagent-acp/tests/subagent-acp.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/process-exit.spec.ts',
|
|
'packages/subprocess/subprocess-local/tests/spawn.spec.ts',
|
|
'packages/context/time-context/tests/time-context.spec.ts',
|
|
'packages/llm/llm-pi-ai/tests/adapter.spec.ts',
|
|
'packages/boot/app-boot/tests/app-boot.spec.ts',
|
|
'packages/workflow/workflow-ptc/tests/workflow-ptc.spec.ts',
|
|
'packages/ptc-runtime/ptc-runtime-node/tests/imports.spec.ts',
|
|
]
|
|
|
|
// Claude Code's test-kit module names, served by the mods bridge's test support so the example mods' tests import them unchanged.
|
|
const claudeCodeTestingAliases = {
|
|
'claude-code/testing': fileURLToPath(new URL('./packages/experimental/claude-code-mods/tests/support/claude-code-testing.ts', import.meta.url)),
|
|
'claude-code': fileURLToPath(new URL('./packages/experimental/claude-code-mods/tests/support/claude-code.ts', import.meta.url)),
|
|
}
|
|
|
|
// The LiveShare client entry statically imports its generated `./remote` contribution, which exists
|
|
// only in built `lib/` output. On a clean checkout Vite resolves that import while transforming the
|
|
// entry, before `vi.mock` can answer it, so the jsdom assembly suites need a resolvable stand-in.
|
|
const liveshareRemoteBuild = fileURLToPath(new URL('./packages/experimental/liveshare/lib/typert.remote-client.js', import.meta.url))
|
|
const chatImportRemoteBuild = fileURLToPath(new URL('./packages/experimental/deepseek-chat-import/lib/typert.remote-client.js', import.meta.url))
|
|
const generatedRemoteAliases = {
|
|
...existsSync(liveshareRemoteBuild) ? {} : {
|
|
'@deepseek-ai/dsh-experimental-liveshare/remote': fileURLToPath(new URL('./packages/experimental/liveshare/tests/generated-remote-stub.ts', import.meta.url)),
|
|
},
|
|
...existsSync(chatImportRemoteBuild) ? {} : {
|
|
'@deepseek-ai/dsh-deepseek-chat-import/remote': fileURLToPath(new URL('./packages/experimental/deepseek-chat-import/tests/generated-remote-stub.ts', import.meta.url)),
|
|
},
|
|
}
|
|
const testingAliases = { ...claudeCodeTestingAliases, ...generatedRemoteAliases }
|
|
|
|
export default defineConfig({
|
|
plugins: [pathsPlugin(), standardDecoratorPlugin()],
|
|
resolve: { alias: testingAliases },
|
|
test: {
|
|
...localWorkerBudget,
|
|
setupFiles: [
|
|
'./scripts/test-proxy-environment.ts', './scripts/test-dom-environment.ts', './scripts/test-official-listing-guard.ts',
|
|
],
|
|
// .tsx: client component specs (jsdom via per-file @vitest-environment pragma).
|
|
include: testIncludes,
|
|
exclude: platformUnsupportedTests,
|
|
// One coverage invocation aggregates both projects. Every suite forks for
|
|
// Node stability; process-bound suites stay separate for inventory control.
|
|
projects: [
|
|
{
|
|
plugins: [pathsPlugin(), standardDecoratorPlugin()],
|
|
resolve: { alias: testingAliases },
|
|
test: {
|
|
name: 'thread-safe',
|
|
execArgv: vitestExecArgv,
|
|
// Node 24 has aborted in its CJS lexer (v8::ToLocalChecked Empty
|
|
// MaybeLocal in cjs_lexer::Parse) from worker threads on macOS,
|
|
// Linux, and Windows. Forked workers avoid that shared thread path.
|
|
pool: 'forks',
|
|
...laneTestBudget,
|
|
setupFiles: [
|
|
'./scripts/test-proxy-environment.ts', './scripts/test-dom-environment.ts', './scripts/test-official-listing-guard.ts',
|
|
],
|
|
include: testIncludes,
|
|
exclude: [
|
|
...platformUnsupportedTests,
|
|
...processBoundTests,
|
|
...coverageExemptExcludes,
|
|
],
|
|
},
|
|
},
|
|
{
|
|
plugins: [pathsPlugin(), standardDecoratorPlugin()],
|
|
resolve: { alias: testingAliases },
|
|
test: {
|
|
name: 'process-bound',
|
|
// Runner import tests require VM modules; the missing-flag test stays in thread-safe.
|
|
execArgv: [...vitestExecArgv, '--experimental-vm-modules'],
|
|
pool: 'forks',
|
|
...laneTestBudget,
|
|
setupFiles: [
|
|
'./scripts/test-proxy-environment.ts', './scripts/test-dom-environment.ts', './scripts/test-official-listing-guard.ts',
|
|
],
|
|
include: processBoundTests,
|
|
exclude: [
|
|
...platformUnsupportedTests,
|
|
...coverageExemptExcludes,
|
|
],
|
|
},
|
|
},
|
|
],
|
|
coverage: {
|
|
provider: 'v8',
|
|
// Coverage measures OUR runtime source. Types-only files carry no
|
|
// executable code; vendor/ and application/config fixtures are out of scope.
|
|
// .tsx: client components are gated like everything else (jsdom lane).
|
|
include: ['packages/*/*/src/**/*.{ts,tsx}'],
|
|
// Types-only files have no runtime coverage. Importing self-executing bins/workers would boot
|
|
// them inside the unit process, so real subprocess/Worker tests cover their thin entry glue.
|
|
exclude: [
|
|
'packages/*/*/src/types.ts',
|
|
'packages/*/*/src/bin.ts',
|
|
'packages/*/*/src/worker.ts',
|
|
// The built Node entry invokes the independently covered process bootstrap through fd 7.
|
|
'packages/ptc-runtime/ptc-runtime-node/src/process-entry.ts',
|
|
'packages/ptc-runtime/ptc-runtime-node/src/persistent-process-entry.ts',
|
|
// Dynamic Host/Client composition is covered by its focused lifecycle
|
|
// tests and assembled application checks rather than per-file coverage.
|
|
'packages/self-modification/*/src/**/*.{ts,tsx}',
|
|
// A killed executable lint-contract test can leave a non-product source probe behind.
|
|
'packages/*/*/src/oxlint-contract-*.ts',
|
|
// Client/web UI files whose remaining branches need a browser-grade
|
|
// harness the jsdom lane doesn't cover yet. TODO(gui): cover and
|
|
// remove as the client test lane matures.
|
|
'packages/client/ui-trajectory/src/*',
|
|
// Electron guest integration retains its unit specs; per-file coverage
|
|
// is deferred until a native Electron harness covers guest behavior.
|
|
'packages/client/ui-sidebar-browser/src/client/electron/**',
|
|
// Trajectory's compact Markdown projection retains deferred branch coverage.
|
|
'packages/client/ui-primitives/src/markdown/plain-text.ts',
|
|
'packages/client/ui-user-questions/src/client/QuestionComposer.tsx',
|
|
'packages/client/ui-primitives/src/Menu.tsx',
|
|
'packages/client/ui-primitives/src/RiskConfirmation.tsx',
|
|
'packages/client/ui-workspace/src/client/WorkspaceBrowser.tsx',
|
|
'packages/client/ui-workspace/src/client/WorkspacePicker.tsx',
|
|
'packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.tsx',
|
|
'packages/client/ui-renderer/src/client/*',
|
|
// Session object internals retain the runtime GUI debt exemption; the
|
|
// assistant-stream reconciler, Controller entry, transport, Agent scope,
|
|
// and adapters stay gated.
|
|
'packages/api/session-controller/src/client/sessions/!(assistant-stream).ts',
|
|
'packages/api/session-controller/src/client/ordered-baseline.ts',
|
|
'packages/api/session-controller/src/client/time-zone.ts',
|
|
// Keep the browser conversation tree under its existing GUI debt
|
|
// exemption while gating the newly stateful Host half and vocabulary.
|
|
'packages/client/ui-conversation/src/client/*',
|
|
// Chat presentation and assembly retain the same GUI debt exemption;
|
|
// package wiring and the new approval-detail adapter remain gated.
|
|
'packages/client/ui-chat/src/client/chat/!(ApprovalCommand).{ts,tsx}',
|
|
'packages/client/ui-chat/src/client/conversation-nodes/*',
|
|
'packages/client/ui-chat/src/client/details/*',
|
|
'packages/client/ui-chat/src/client/model/*',
|
|
'packages/client/ui-chat/src/client/contract/snapshot.ts',
|
|
'packages/client/ui-chat/src/client/historical-images.ts',
|
|
'packages/client/ui-primitives/src/DisclosureRow.tsx',
|
|
'packages/client/ui-tool/src/*',
|
|
'packages/client/ui-slots/src/*',
|
|
'packages/client/ui-layout/src/*',
|
|
'packages/client/web/src/*',
|
|
'packages/host/webserver/src/*',
|
|
// The browser-worker runtime and its image packer: the executing
|
|
// composition is a real dedicated Worker driven by the web browser lane
|
|
// (apps/web/tests/preview-boot.e2e.ts), which unit-process V8 coverage
|
|
// cannot observe. Unit specs cover the algorithmic cores; the assembled
|
|
// evidence is that boot. TODO(webworker): revisit when a browser-grade
|
|
// coverage lane exists.
|
|
'packages/experimental/webworker-runtime/src/**',
|
|
'packages/experimental/webworker-packer/src/*',
|
|
// Inspector execution adapters run in a Node Worker, the Host native
|
|
// inspector session, or a browser realm, outside attributable parent
|
|
// Vitest coverage.
|
|
'packages/experimental/inspector/src/client/**',
|
|
'packages/experimental/inspector/src/host/bridge/**',
|
|
'packages/experimental/inspector/src/host/cdp/**',
|
|
'packages/experimental/inspector/src/worker/bridge/**',
|
|
'packages/experimental/inspector/src/worker/cdp/**',
|
|
'packages/experimental/inspector/src/worker/realms/**',
|
|
'packages/experimental/inspector/src/worker/{entry,server}.ts',
|
|
// Keep already-complete Inspector modules under the per-file gate and
|
|
// enumerate the remaining direct-test debt instead of exempting src/**.
|
|
// TODO(inspector): close these branch gaps and remove the entries.
|
|
'packages/experimental/inspector/src/shared/bridge/{control-codec,rpc}.ts',
|
|
'packages/experimental/inspector/src/shared/bridge/messages/observation.ts',
|
|
'packages/experimental/inspector/src/shared/bridge/messages/query/codec.ts',
|
|
'packages/experimental/inspector/src/shared/bridge/messages/runtime/{command-codec,console-frames,frames,value-codec}.ts',
|
|
'packages/experimental/inspector/src/shared/bridge/messages/sources/{codec,frames}.ts',
|
|
'packages/experimental/inspector/src/worker/inspection/{cordis-store,query-router,realm-store}.ts',
|
|
// Web config-tree boot round: the new host-side web-transport halves
|
|
// whose remaining branches need real-composition/process harnesses.
|
|
// TODO(gui): cover and remove with the client test lane above.
|
|
'packages/client/modules/src/index.ts',
|
|
'packages/client/modules/src/client/index.ts',
|
|
'packages/client/modules/src/client/manifest.ts',
|
|
'packages/client/hmr/src/index.ts',
|
|
'packages/client/connection/src/index.ts',
|
|
'packages/client/connection/src/http-bridge.ts',
|
|
// This assembly imports generated Host-for-Client code that exists
|
|
// only in lib; the post-build built-bin smoke executes both entries.
|
|
'packages/api/remotes/src/index.ts',
|
|
'packages/api/remotes/src/client/index.ts',
|
|
// The Team browser entry binds its source-covered mount lifecycle to
|
|
// the generated Team Remote contribution, which likewise exists only in lib.
|
|
'packages/client/ui-agent-team/src/client/index.ts',
|
|
// The speech entry also imports generated Remote definitions; voice-input.e2e.ts
|
|
// exercises the built entry, while source tests cover mountVoiceInput.
|
|
'packages/experimental/client-ui-voice-input/src/client/index.ts',
|
|
// Built Web replays cover the generated Remote wiring of the card entries; their mount modules are source-covered.
|
|
'packages/experimental/client-ui-action-cards/src/client/index.ts',
|
|
'packages/experimental/client-ui-plugin-recommendations/src/client/index.ts',
|
|
// The permission entry binds generated Remote code; cua-permissions.e2e.ts covers
|
|
// its built entry, while source tests exercise mountCuaPermissions and its UI.
|
|
'packages/experimental/cua/src/client/index.ts',
|
|
// The mods band entry imports the bridge's generated Remote contribution, which exists only in lib;
|
|
// the Web snapshot exercises the built entry, while source tests cover mountModsBand.
|
|
'packages/experimental/client-ui-claude-code-mods/src/client/index.ts',
|
|
// The access entry imports its generated Remote contribution, which exists only in lib;
|
|
// the Web snapshot exercises the built entry, while source tests cover mountAccess.
|
|
'packages/api/remote-access/src/client/index.ts',
|
|
// The forge panel entry imports its generated Remote contribution, which exists only in lib;
|
|
// forge-panel.e2e.ts exercises the built entry, while source tests cover mountForgePanel.
|
|
'packages/experimental/client-ui-forge/src/client/index.ts',
|
|
// Slash/command/input round: per-file gaps deferred with the same
|
|
// client-lane debt. TODO(gui): cover and remove with the lane above.
|
|
'packages/client/ui-commands/src/index.ts',
|
|
'packages/client/ui-skill/src/index.ts',
|
|
'packages/client/ui-input-trigger/src/index.ts',
|
|
'packages/client/ui-subagent/src/index.ts',
|
|
'packages/client/ui-commands/src/client/popup.ts',
|
|
'packages/client/ui-commands/src/client/directory.ts',
|
|
'packages/client/ui-commands/src/client/service.ts',
|
|
'packages/client/ui-commands/src/client/PopupSelectView.tsx',
|
|
'packages/client/ui-model-selection/src/index.ts',
|
|
'packages/client/ui-permission-presets/src/index.ts',
|
|
'packages/client/ui-model-selection/src/client/ModelSelect.tsx',
|
|
'packages/client/ui-model-selection/src/client/directory.ts',
|
|
'packages/client/ui-model-selection/src/client/index.ts',
|
|
'packages/client/ui-model-selection/src/client/service.ts',
|
|
'packages/client/ui-input-trigger/src/client/controller.ts',
|
|
'packages/client/ui-input-trigger/src/client/service.ts',
|
|
'packages/client/ui-input-trigger/src/core/menu.ts',
|
|
'packages/client/ui-input-trigger/src/core/detect.ts',
|
|
'packages/client/ui-sidebar/src/client/index.ts',
|
|
'packages/client/ui-skill/src/client/index.ts',
|
|
'packages/client/ui-workspace/src/client/index.ts',
|
|
'packages/test-support/client-runtime/src/translate.ts',
|
|
'packages/client/ui-primitives/src/JsonTree.tsx',
|
|
'packages/client/ui-settings-models/src/client/DeepSeekOnboardingDialog.tsx',
|
|
'packages/client/ui-settings-models/src/client/welcome-store.ts',
|
|
'packages/extensions/*/src/**/*.ts',
|
|
'packages/extensions/*/src/**/*.tsx',
|
|
// Typert correctness is checked by its uninstrumented suites,
|
|
// including compiler fixtures and byte-for-byte catalog reproduction.
|
|
'packages/typert/*/src/**/*.{ts,tsx}',
|
|
// Experimental webworker-runtime is outside the coverage requirement
|
|
// by decision: its correctness signal is its uninstrumented suite and
|
|
// the packer's end-to-end image spec.
|
|
'packages/experimental/webworker-runtime/src/**/*.ts',
|
|
// Command executor lifecycle branches need the same maturing lanes.
|
|
// TODO(gui): cover and remove with the client test lane above.
|
|
'packages/interaction/commands/src/index.ts',
|
|
...windowsUnsupportedCoveragePackages.map(path => `${path}/src/**/*.ts`),
|
|
...windowsOnlyCoverageExclusions,
|
|
...windowsRunnerCoverageExclusions,
|
|
...pwshCoverageExclusions,
|
|
],
|
|
// 100% or it doesn't merge (docs/testing.md: excessive tests are welcome).
|
|
// Per-file so a well-covered big file can't subsidize a bare one.
|
|
// Every v8 ignore comment must carry a reason — see the testing policy
|
|
// (docs/testing.md).
|
|
thresholds: coveragePartitionMode
|
|
? undefined
|
|
: {
|
|
perFile: true,
|
|
statements: 100,
|
|
branches: 100,
|
|
functions: 100,
|
|
lines: 100,
|
|
},
|
|
reporter: coveragePartitionMode
|
|
? []
|
|
: process.env.CI
|
|
? ['text', uncoveredLocationsReporter]
|
|
: ['text', 'html', uncoveredLocationsReporter],
|
|
},
|
|
},
|
|
})
|