Merge commit '05380955d3d59a536c6c4f12def7c1586daaa613' into auto-review-per-call

# Conflicts:
#	docs/subsystems/session-projection.i18n.yaml
#	docs/subsystems/session-projection.md
#	docs/subsystems/session-projection.zh.md
#	packages/client/ui-conversation/tests/input-bar.client.spec.tsx
#	packages/client/ui-permission-presets/README.i18n.yaml
#	packages/client/ui-permission-presets/README.md
#	packages/client/ui-permission-presets/README.zh.md
#	packages/client/ui-permission-presets/tests/browser-plugin.client.spec.ts
#	packages/client/ui-tool/README.i18n.yaml
#	packages/client/ui-tool/README.md
#	packages/client/ui-tool/README.zh.md
#	packages/client/ui-tool/src/client/tool/components/ToolRow.tsx
#	packages/client/ui-tool/src/client/tool/toolviews/bash-sample.tsx
#	packages/client/ui-tool/tests/tool-row.client.spec.tsx
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/session/session-projection/README.i18n.yaml
#	packages/session/session-projection/README.md
#	packages/session/session-projection/README.zh.md
#	packages/session/session-projection/src/index.ts
#	packages/session/session-projection/tests/registry.spec.ts
This commit is contained in:
pku-xht committed 2026-08-31 22:07:28 +08:00
commit 3f610869b6
212 files changed
+5214 -769

No files matched your search

+17
View File
@@ -156,6 +156,14 @@ describe('CI workflow', () => {
isRecord(step) && typeof step.run === 'string'
))
expect(coverageCommands.map(step => step.run)).toContain('pnpm run check:ci:coverage')
// Windows coverage runs zero-build like the Linux lane: workspace imports
// resolve to src through the tsconfig paths map, and the lib-consuming
// suites (webworker-packer image-loadable, webworker-runtime
// transform-corpus, client ui-trajectory client-bundle) self-skip on
// unbuilt checkouts. The regex catches a regression spelled as
// 'corepack pnpm run build' or folded into a multi-line run block, which
// an exact string match would miss.
expect(coverageCommands.every(step => !/\bpnpm\s+run\s+build(?:\s|$)/.test(step.run))).toBe(true)
// windows-native-tests runs the Windows-specific specs.
expect(windowsNativeTests.name).toBe('windows node 24 / native tests')
@@ -201,6 +209,14 @@ describe('CI workflow', () => {
expect(serialInstall!.run.split('\n').map(line => line.trim())).toContain('} else {')
expect(serialInstall!.run.split('\n').map(line => line.trim())).toContain('pnpm install --frozen-lockfile')
expect(serialInstall!.run).not.toContain('$cloneFlag')
// The unsharded reference runs the whole coverage inventory at the same
// per-test budget the PR coverage lane grants; the default 5000ms times
// out load-sensitive store scans (e.g. gen-third-party-notices).
const serialGate = serialSteps.find((step): step is Record<string, unknown> & { env?: Record<string, unknown> } => (
isRecord(step) && step.name === 'Run complete unsharded Windows gate inventory serially'
))
expect(serialGate).toBeDefined()
expect(serialGate!.env).toMatchObject({ DSH_COVERAGE_TEST_TIMEOUT_MS: '90000' })
// Aggregate: Wine and the required split native jobs are needed;
// windows-coverage is temporarily non-blocking while Windows ACP
@@ -652,6 +668,7 @@ describe('Issue lifecycle workflow', () => {
// review events.
const lifecyclePullRequest = workflowEvent(lifecycle, 'pull_request')
const lifecycleReview = workflowEvent(lifecycle, 'pull_request_review')
expect(lifecyclePullRequest.types).toContain('opened')
expect(lifecyclePullRequest.types).not.toContain('ready_for_review')
expect(lifecyclePullRequest.types).toContain('review_requested')
expect(lifecycleReview.types).toEqual(['submitted'])
+3 -2
View File
@@ -50,8 +50,9 @@ export const coverageExemptHeavySuites: readonly CoverageExemptSuite[] = [
{ filter: 'scripts/change-scope.spec.ts', exclude: 'scripts/change-scope.spec.ts' },
{ filter: 'scripts/translation-pairing-merge.spec.ts', exclude: 'scripts/translation-pairing-merge.spec.ts' },
// Built-artifact proof. Packer/runtime src is threshold-excluded, and the
// native Windows aggregate makes this uninstrumented gate wait for build so
// the suite never observes a partially emitted workspace closure.
// suite self-skips on unbuilt checkouts; the serial-windows complete
// reference still starts this uninstrumented gate after its build gate, so
// the assertions execute against complete real artifacts there.
{
filter: 'packages/experimental/webworker-packer/tests/image-loadable.spec.ts',
exclude: 'packages/experimental/webworker-packer/tests/image-loadable.spec.ts',
+19 -14
View File
@@ -279,11 +279,13 @@ const workspaceLinkedManifestCache = new Map<string, VirtualManifest | undefined
* Resolve the package version selected for a declaring workspace instead of an
* unrelated historical version that still occupies the shared virtual store.
* @param name - external package identity.
* @param manifests - workspace manifests already loaded by the caller, so one
* load serves every dependency instead of a full re-read per name.
* @returns the first current workspace link for that package, when installed.
*/
function workspaceLinkedManifest(name: string): VirtualManifest | undefined {
function workspaceLinkedManifest(name: string, manifests: Map<string, Manifest>): VirtualManifest | undefined {
if (workspaceLinkedManifestCache.has(name)) return workspaceLinkedManifestCache.get(name)
for (const [path, manifest] of loadWorkspaceManifests().manifests) {
for (const [path, manifest] of manifests) {
if (!ALL_KINDS.some(kind => name in (manifest[kind] ?? {}))) continue
const linked = resolve(root, dirname(path), 'node_modules', name, 'package.json')
if (!existsSync(linked)) continue
@@ -296,8 +298,8 @@ function workspaceLinkedManifest(name: string): VirtualManifest | undefined {
}
/** Resolve one installed external package manifest from either pnpm store. */
function installedManifest(name: string, expectedVersion?: string): VirtualManifest | undefined {
const linked = workspaceLinkedManifest(name)
function installedManifest(name: string, manifests: Map<string, Manifest>, expectedVersion?: string): VirtualManifest | undefined {
const linked = workspaceLinkedManifest(name, manifests)
if (linked !== undefined && (expectedVersion === undefined || linked.version === expectedVersion)) return linked
let manifest: (Manifest & { license?: string; repository?: string | { url?: string }; homepage?: string }) | undefined
// Workspace-local link farms can expose a dependency that is not linked at
@@ -320,9 +322,9 @@ function installedManifest(name: string, expectedVersion?: string): VirtualManif
}
/** License and repository URL for an installed external package, from the pnpm store. */
function installedMetadata(name: string): { license: string; repo: string } {
function installedMetadata(name: string, manifests: Map<string, Manifest>): { license: string; repo: string } {
const override = OVERRIDES[name]
const manifest = installedManifest(name)
const manifest = installedManifest(name, manifests)
const license = override?.license ?? manifest?.license
const rawRepo = typeof manifest?.repository === 'string' ? manifest.repository : manifest?.repository?.url ?? manifest?.homepage
const repo = override?.repo ?? normalizeRepo(rawRepo)
@@ -332,8 +334,8 @@ function installedMetadata(name: string): { license: string; repo: string } {
return { license, repo }
}
function collectClaudeDistribution(): ClaudeDistribution {
const manifest = installedManifest(CLAUDE_AGENT_SDK_PACKAGE)
function collectClaudeDistribution(manifests: Map<string, Manifest>): ClaudeDistribution {
const manifest = installedManifest(CLAUDE_AGENT_SDK_PACKAGE, manifests)
if (manifest === undefined) {
throw new Error(
`gen-third-party-notices: cannot resolve ${CLAUDE_AGENT_SDK_PACKAGE}; run \`pnpm install\`.`,
@@ -342,7 +344,7 @@ function collectClaudeDistribution(): ClaudeDistribution {
const distribution = claudeDistributionFromManifest(manifest)
let installedPayloads = 0
for (const payload of distribution.payloads) {
const installed = installedManifest(payload.name, payload.version)
const installed = installedManifest(payload.name, manifests, payload.version)
if (installed === undefined) continue
installedPayloads += 1
if (
@@ -383,12 +385,11 @@ function normalizeRepo(raw: string | undefined): string | undefined {
* by tooling, test infrastructure, the website, or the demo leaves — whatever
* the declaring section is called — is development-only.
*/
function collectNpmDeps(): ExternalDep[] {
const { manifests, names } = loadWorkspaceManifests()
function collectNpmDeps(manifests: Map<string, Manifest>, names: Set<string>): ExternalDep[] {
return [...tierExternalDeps(manifests, names)]
.filter(([name]) => !FIRST_PARTY.has(name))
.sort(([a], [b]) => a.localeCompare(b))
.map(([name, runtime]) => ({ name, ...installedMetadata(name), runtime }))
.map(([name, runtime]) => ({ name, ...installedMetadata(name, manifests), runtime }))
}
/**
@@ -692,7 +693,11 @@ ${rows.join('\n')}
*/
export function render(): string {
verifyBuildTimePins()
const npm = collectNpmDeps()
// The linked-manifest cache is keyed by name only, so it must not outlive
// the manifests map it was resolved from; render() owns that single load.
workspaceLinkedManifestCache.clear()
const { manifests, names } = loadWorkspaceManifests()
const npm = collectNpmDeps(manifests, names)
const runtimeDeps = npm.filter(dep => dep.runtime)
const devDeps = npm.filter(dep => !dep.runtime)
const vendored = collectVendored()
@@ -701,7 +706,7 @@ export function render(): string {
const claudeDistribution = runtimeDeps.some(
dep => dep.name === CLAUDE_AGENT_SDK_PACKAGE,
)
? collectClaudeDistribution()
? collectClaudeDistribution(manifests)
: undefined
const nonPermissiveDev = devDeps.filter(dep => !isPermissive(dep.license))
// A copyleft license reaching a shipped surface is a distribution decision,
@@ -141,6 +141,7 @@ const SENTENCE_MODEL_EXPERIENCE: Readonly<Record<string, SentenceContract>> = {
'packages/session/session-projection': { kind: 'none', reason: 'The projection registry serves client-facing read models of already-logged session state and registers nothing model-facing.' },
'packages/session/session-projection-cache': { kind: 'none', reason: 'The persisted cache accelerates host-side cold reads of projection state and registers nothing model-facing.' },
'packages/session/session-stats': { kind: 'none', reason: 'The sessionStats unit folds already-logged step boundaries into a client-facing read model and registers nothing model-facing.' },
'packages/session/session-turn-outline': { kind: 'none', reason: 'The turnOutline unit folds already-logged turn boundaries into a client-facing read model and registers nothing model-facing.' },
'packages/session-query/session-query': { kind: 'none', reason: 'The trusted query service exposes cloned records only to callers and registers nothing model-facing.' },
'packages/session-query/session-query-sqlite': { kind: 'none', reason: 'The search backend returns hits only to callers and registers nothing model-facing.' },
'packages/settings/settings': { kind: 'indirect', reason: 'The seam stores and resolves user settings; consumer plugins own any model-facing content fed by a value.' },