Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
Merge origin/main and preserve test guard coverage
MagicLizi57b1a6e00235
diff --cc apps/desktop/src/main/plugin-usage/__tests__/current.test.tsindex 0000000000,48b482b6b5..ee27f463famode 000000,100644..100644--- a/apps/desktop/src/main/plugin-usage/__tests__/current.test.ts+++ b/apps/desktop/src/main/plugin-usage/__tests__/current.test.ts@@@ -1,0 -1,84 +1,82 @@@+ import { beforeEach, expect, it, vi } from 'vitest';+ import type { DbClient } from '../../localDb/client/DbClient';+ import type { PluginUsageIdentity } from '../../../shared/pluginUsage';++import { currentPluginUsageService, flushPluginUsageLifecycle } from '../current';+ const state = vi.hoisted(() => ({+ snapshot: null as { client: DbClient; userId: string; clientEpoch: number } | null,+ owner: 'owner1',+ key: 'owner1:1',+ boundary: false,+ }));+ vi.mock('../../localDb/client/current', () => ({+ getCurrentDbClientSnapshot: () => state.snapshot,+ }));+ vi.mock('../../appSessionState', () => ({+ activeOwnerScopeKey: () => state.key,+ getActiveAppSession: () => ({ dataOwnerId: state.owner }),+ isAppSessionBoundaryPending: () => state.boundary,+ }));+ vi.mock('../../logger', () => ({ createLogger: () => ({ warn: vi.fn() }) }));+ vi.mock('../reporting', () => ({ createPluginUsageReporting: () => undefined }));+ const identity: PluginUsageIdentity = {+ ghostId: 'plugin',+ displayName: 'Plugin',+ revision: 'revision',+ sourceKind: 'manual',+ stableKey: null,+ pluginId: null,+ organizationId: null,+ sourceKey: null,+ serverRoot: null,+ version: '1',+ releaseId: null,+ };-beforeEach(() => {- vi.resetModules();++beforeEach(async () => {+ state.owner = 'owner1';+ state.key = 'owner1:1';+ state.boundary = false;+ state.snapshot = null;++ await flushPluginUsageLifecycle();+ });+ function client() {+ return {+ tx: vi.fn(async (_name, body) =>+ body.action === 'bind'+ ? { subjectId: body.newId, historyGeneration: 0, identity: body.identity }+ : null,+ ),+ } as unknown as DbClient;+ }+ it('never treats a retained inproc client reference as proof of owner/epoch continuity', async () => {+ const db = client();+ state.snapshot = { client: db, userId: state.owner, clientEpoch: 1 };- const { currentPluginUsageService } = await import('../current');+ const old = currentPluginUsageService()!;+ await old.bind(identity);+ const h = old.captureBound('plugin', 'revision')!;+ state.owner = 'owner2';+ state.key = 'owner2:2';+ state.snapshot = { client: db, userId: 'owner2', clientEpoch: 2 };+ const next = currentPluginUsageService();+ expect(next).not.toBe(old);+ old.accept(h, 'late', 'tool', null, 1);+ await old.close();+ expect(db.tx).toHaveBeenCalledTimes(1);+ await next!.close();+ });+ it('blocks recreation throughout DB teardown/quit and only reopens for a newly attached epoch', async () => {+ const db = client();+ state.snapshot = { client: db, userId: state.owner, clientEpoch: 1 };- const { currentPluginUsageService, flushPluginUsageLifecycle } = await import('../current');+ expect(currentPluginUsageService()).not.toBeNull();+ await flushPluginUsageLifecycle();+ expect(currentPluginUsageService()).toBeNull();+ state.snapshot = { client: db, userId: state.owner, clientEpoch: 2 };+ expect(currentPluginUsageService()).not.toBeNull();+ await flushPluginUsageLifecycle();+ });+ it('does not bind a DB during a boundary or to a different account', async () => {+ state.snapshot = { client: client(), userId: 'other', clientEpoch: 1 };- const { currentPluginUsageService } = await import('../current');+ expect(currentPluginUsageService()).toBeNull();+ state.snapshot.userId = state.owner;+ state.boundary = true;+ expect(currentPluginUsageService()).toBeNull();+ });diff --cc apps/desktop/src/renderer/features/bots/__tests__/BotTaskOwnerChip.test.tsxindex 0000000000,e0e5969862..6c38fb37f3mode 000000,100644..100644--- a/apps/desktop/src/renderer/features/bots/__tests__/BotTaskOwnerChip.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/BotTaskOwnerChip.test.tsx@@@ -1,0 -1,46 +1,39 @@@+ // @vitest-environment jsdom+ import { cleanup, fireEvent, render, screen } from '@testing-library/react';-import { readFileSync } from 'node:fs';-import { resolve } from 'node:path';+ import { afterEach, beforeEach, expect, it, vi } from 'vitest';++ import { BotTaskOwnerChip } from '../BotTaskOwnerChip';++ const mocks = vi.hoisted(() => ({ navigate: vi.fn(), ensure: vi.fn(), delegators: new Map<string, unknown>() }));+ vi.mock('react-i18next', () => ({+ useTranslation: () => ({ t: (key: string, options?: Record<string, unknown>) => `${key}:${JSON.stringify(options)}` }),+ }));+ vi.mock('react-router-dom', () => ({ useNavigate: () => mocks.navigate }));+ vi.mock('../BotAvatar', () => ({ BotAvatar: ({ bot }: any) => <span data-avatar={bot.name} /> }));+ vi.mock('../botStore', () => ({ ensureBotProfilesLoaded: mocks.ensure }));+ // The delegation projection of the same follow scopes the sidebar mark reads; the chip adds no second ownership rule.+ vi.mock('../botFollowScopes', () => ({+ useSessionDelegatingBot: (session: { id: string }) => mocks.delegators.get(session.id) ?? null,+ }));++ const lizi = { id: 'bot/a', name: 'LiZi' };+ const session = (id: string) => ({ id, status: 'active', source: 'desktop' }) as any;+ beforeEach(() => {+ mocks.delegators = new Map([['task', lizi]]);+ mocks.ensure.mockReset().mockResolvedValue([]);+ mocks.navigate.mockReset();+ });+ afterEach(cleanup);++ it("names a Bot's background task in its ordinary header and leads back to that Bot", () => {+ render(<BotTaskOwnerChip session={session('task')} />);+ expect(mocks.ensure).toHaveBeenCalledTimes(1);+ expect(screen.getByText('bots.session.ownedByBot:{"name":"LiZi"}')).toBeTruthy();+ fireEvent.click(screen.getByRole('button', { name: 'bots.session.backToBot:{"name":"LiZi"}' }));+ expect(mocks.navigate).toHaveBeenCalledWith('/bots/bot%2Fa');+ });++ it('stays out of the way for a task no Bot is responsible for', () => {+ const { container } = render(<BotTaskOwnerChip session={session('plain')} />);+ expect(container.firstChild).toBeNull();+ });--it('is mounted next to the ordinary task title', () => {- const header = readFileSync(resolve(__dirname, '../../cc-agent/SessionContentHeader.tsx'), 'utf8');- expect(header).toContain('{!isEditing && <BotTaskOwnerChip session={session} />}');-});diff --cc apps/desktop/src/renderer/features/bots/__tests__/botChatSurface.test.tsindex 0000000000,aa7cd1b291..e362f33f0bmode 000000,100644..100644--- a/apps/desktop/src/renderer/features/bots/__tests__/botChatSurface.test.ts+++ b/apps/desktop/src/renderer/features/bots/__tests__/botChatSurface.test.ts@@@ -1,0 -1,134 +1,139 @@@+ /**+ * 伙伴对话皮肤的接线契约。+ *+ * 这三处判定都长在超大组件里(CCAgentSessionView 5k 行 / MessageStream 5.8k 行 /+ * ChatInput 8k 行),在 jsdom 里整棵挂起来既慢又脆。真正要锁死的是**判定条件本身**:+ * 头像与收控件只能对 Bot 会话生效,普通任务的渲染必须一字不改。所以这里锁源码契约,+ * 归属与状态稳定性由 botSessionPresentation / botChatPresentation 的行为测试覆盖。+ */+ import { readFileSync } from 'node:fs';+ import { resolve } from 'node:path';+ import { describe, expect, it } from 'vitest';++ const read = (relativePath: string): string =>+ readFileSync(resolve(__dirname, '..', '..', '..', relativePath), 'utf8').replace(/\r\n/g, '\n');++ const sessionView = read('features/cc-agent/CCAgentSessionView.tsx');++const sessionHeader = read('features/cc-agent/SessionContentHeader.tsx');+ const messageStream = read('components/chat/MessageStream.tsx');+ const messageActionBar = read('components/chat/MessageActionBar.tsx');+ const chatInput = read('components/new-chat/ChatInput.tsx');+ const botSettings = read('features/bots/BotsHomeView.tsx');++ describe('Bot 对话的判定条件', () => {++ it('is mounted next to the ordinary task title', () => {++ expect(sessionHeader).toContain('{!isEditing && <BotTaskOwnerChip session={session} />}');++ });+++ it('气泡头像只在 Bot 对话下传给消息流', () => {+ expect(sessionView).toContain('assistantAvatar={botAssistantAvatar}');+ expect(sessionView).toContain('<BotAvatar bot={botChatIdentity} size="sm" />');+ });++ it('伙伴对话换占位符并启用轻量输入框', () => {+ expect(sessionView).toContain('botComposerPlaceholderKey(botChatIdentity.name)');+ expect(sessionView).toContain('hideRuntimeControls={Boolean(botChatIdentity)}');+ // 普通任务仍走原来的占位符。+ expect(sessionView).toContain("t('ccAgent.layout.chatPlaceholder')");+ });++ it('伙伴对话换掉任务顶栏,而不是在它旁边再加一个', () => {+ expect(sessionView).toContain(+ '<BotSessionContentHeaderRegistration bot={botChatIdentity} />',+ );+ expect(sessionView).toContain('<SessionContentHeaderRegistration');+ });+ });++ describe('消息流的头像挂载', () => {+ it('没有头像时原样返回气泡,不多包一层 DOM', () => {+ const helper = messageStream.match(/function withAssistantAvatar\([\s\S]*?\n}/)?.[0];+ expect(helper).toBeTruthy();+ expect(helper).toContain('if (!avatar) return bubble;');+ });++ it('只有 assistant 分支挂头像', () => {+ expect(messageStream).toContain('return withAssistantAvatar(\n assistantAvatar,');+ // Assistant text shows the avatar; task and teammate-message cards plus the+ // work fold reserve the same space invisibly. User messages bypass it.+ expect(messageStream.match(/withAssistantAvatar\(/g)?.length).toBe(4);+ expect(messageStream).toMatch(/simplifiedBotConversation\s*&&\s*\(message\.systemCardType === 'bot-session-task'\s*\|\|\s*message\.systemCardType === 'bot-session-task-result'\s*\|\|\s*message\.systemCardType === 'bot-session-task-message'\s*\|\|\s*message\.systemCardType === 'bot-direct-message'\)\s*\? withAssistantAvatar\(/);+ expect(messageStream).toMatch(/<span aria-hidden="true" className="invisible">\s*\{assistantAvatar\}\s*<\/span>/);+ expect(messageStream).toContain('{replyColumnSpacer ? withAssistantAvatar(replyColumnSpacer, block) : block}');+ });+ });++ describe('伙伴输入框只保留对话动作', () => {+ it('伙伴保留标准权限 chip,仅隐藏模型选择器', () => {+ expect(chatInput.match(/!hideRuntimeControls \? \(/g)?.length).toBe(1);+ expect(chatInput.indexOf('<PermissionSelector')).toBeLessThan(chatInput.indexOf('!hideRuntimeControls ? ('));+ expect(chatInput).toContain('<PermissionSelector');+ expect(chatInput).toContain('<ModelSelector');+ });++ it('伙伴仍可使用权限快捷键,锁定任务不能切换', () => {+ expect(chatInput).toContain('settingsLocked || sharedGuest ? [] : (activeAgentCapabilities?.permissionModes ?? [])');+ expect(chatInput).not.toContain('settingsLocked || hideRuntimeControls');+ });++ it('伙伴不渲染任务目录、费用或压缩状态行', () => {+ expect(sessionView).toContain('{!botChatIdentity ? (');+ expect(sessionView).toContain('<TodaySpendChip');+ expect(sessionView).toContain('<ContextCapacityRing');+ });+ });++ describe('伙伴设置包含独立能力选择入口', () => {+ it('保留基本资料、按需能力选择与高级文件入口', () => {+ expect(botSettings).toContain('import { BotCapabilitySettings }');+ expect(botSettings).toContain('<BotCapabilitySettings');+ expect(botSettings).not.toContain('<BotGrowthLists');+ expect(botSettings).toContain('<BotBasicProfileFields');+ expect(botSettings).toContain("t('bots.homeFolder.title')");+ });+ });++ describe('伙伴消息流与普通任务同一套工作过程', () => {+ it('工作组按普通任务渲染,输入框上方只保留普通状态栏', () => {+ expect(sessionView).toContain('simplifiedBotConversation={Boolean(botChatIdentity)}');+ expect(messageStream).toContain('simplifyBotRenderItems(grouped, isSessionStreaming, visibleGeneratedFileKeys)');+ // Text/tool grouping is covered by botConversationPresentation behavioral tests.+ expect(messageStream).toContain("from '@/features/bots/botConversationPresentation'");+ expect(messageStream).toContain('compact={false}');+ expect(messageStream).not.toContain('compact={simplifiedBotConversation}');+ expect(messageStream).toContain('replyColumnSpacer={botReplyColumnSpacer}');+ expect(messageStream).not.toContain('data-testid="bot-thinking-indicator"');+ expect(sessionView).not.toContain('<BotWorkingStatus');+ expect(sessionView).toContain('<RunningStatusBar');+ expect(sessionView).toContain('visible={composerRuntimeVisible');+ expect(sessionView).not.toContain('botAssistantOutputStarted');+ });++ it('时间戳只挂在伙伴消息分组上', () => {+ expect(messageStream).toContain('collectBotMessageTimeGroups(');+ expect(messageStream).toContain('botMessageTimeGroups.get(msg.clientId)');+ });++ it('未读起点只挂在伙伴消息流,不会创建分支', () => {+ expect(sessionView).toContain(+ 'botUnreadBoundaryAt={botChatIdentity ? botUnreadBoundaryAt : null}',+ );+ expect(messageStream).toContain("t('bots.chat.newMessagesBoundary')");+ expect(messageStream).toContain('botUnreadBoundaryClientId === msg.clientId');+ });++ it('伙伴消息操作栏常显,外显回复,并隐藏费用与 Fork', () => {+ expect(messageStream).toContain('simplifiedBotConversation={simplifiedBotConversation}');+ expect(messageActionBar).toContain('const replyBtn = (replyAction || (simplifiedBotConversation && onAddToChat))');+ expect(messageActionBar).toContain('const forkBtn = !simplifiedBotConversation');+ expect(messageActionBar).toContain('simplifiedBotConversation ? null : costText || tokensText');+ expect(messageActionBar).toContain('simplifiedBotConversation || visible || menuOpen');+ });++ it('伙伴身份同时接通专属成果采集与成果卡,普通任务不触发', () => {+ expect(messageStream).toContain(+ 'botSessionId: simplifiedBotConversation ? sessionId : undefined',+ );+ expect(messageStream).toContain('botArtifacts={simplifiedBotConversation}');+ });+ });diff --cc apps/desktop/src/shared/__tests__/auxiliaryModelChain.test.tsindex d2d152e701,d2d152e701..459e411f7b--- a/apps/desktop/src/shared/__tests__/auxiliaryModelChain.test.ts+++ b/apps/desktop/src/shared/__tests__/auxiliaryModelChain.test.ts@@@ -1,7 -1,7 +1,3 @@@--import { readFileSync } from 'node:fs';--import path from 'node:path';--import { fileURLToPath } from 'node:url';--import { describe, expect, it } from 'vitest';import {@@@ -10,11 -10,11 +6,6 @@@parseAuxiliaryModelRef,} from '../auxiliaryModelChain.js';--const SOURCE_PATH = path.join(-- path.dirname(fileURLToPath(import.meta.url)),-- '../auxiliaryModelChain.ts',--);--describe('AUTO_AUXILIARY_MODEL_CHAIN', () => {it('is the frozen cross-tenant chain, never a live price ranking', () => {expect(AUTO_AUXILIARY_MODEL_CHAIN).toEqual([@@@ -24,10 -24,10 +15,6 @@@]);expect(AUTO_AUXILIARY_MODEL_CHAIN_I18N_KEYS).toHaveLength(AUTO_AUXILIARY_MODEL_CHAIN.length);-- const source = readFileSync(SOURCE_PATH, 'utf8');-- expect(source).not.toMatch(/\bsort\s*\(/);-- expect(source).not.toMatch(/price/i);-- expect(source).not.toMatch(/cheapest/i);});it('parses profile keys and catalog pins', () => {diff --cc docs/dev-rules/desktop-unit-test-performance.mdindex e6d6ec6c21,b12b5dc41e..0e6455e73f--- a/docs/dev-rules/desktop-unit-test-performance.md+++ b/docs/dev-rules/desktop-unit-test-performance.md@@@ -15,91 -15,6 +15,97 @@@ pnpm benchmark:desktop-workers -- --wor或分池前后必须使用同一 checkout、同一机器和同一测试范围比较;单次数据需同时保留稳定性结果,不得只挑最快的一次。+## 2026-10-16 CI 关键路径与分片调整++数据来自 main 上两次成功的 client-ci(run 38819825618、38805666371,当时为 2 个分片):++| Job | 总耗时 | 主要组成 |+| --- | --- | --- |+| Windows 分片 1/2 | 34.1–34.2 分钟 | 准备约 3;runner 自测 3.1–3.2;Desktop unit 20.9(1,253 秒);Mobile 2.5;其余包 3.4;伴侣 DB 回归 0.9 |+| Windows 分片 2/2 | 21.9–25.7 分钟 | Desktop unit 16.9(1,013 秒) |+| Linux 分片 | 13.8–23.9 分钟 | Desktop unit 547–890 秒 |+| verify-checks | 7.7–8.4 分钟 | Desktop typecheck 3.4–3.8 |++- 关键路径是 Windows 分片 1,比分片 2 多 8–12 分钟:约 4 分钟来自只在分片 1 执行的 runner 自测和+ DB 回归,其余来自 Vitest 按文件路径哈希均分(不看耗时)造成的 Desktop 不均衡。+- 每个分片里 runner 先独占跑 Desktop,再独占跑 Mobile,最后并发跑其余包;Desktop 在 4 vCPU 的+ `windows-latest` 上用 4 个 worker。+- 初始删除候选只有约 7 秒 worker time;独立审查随后恢复了必要契约(见下文),最终删除范围+ 更小。清理的目标是维护成本,不能把 CI 提速归因于减少测试条数。++2026-10-16 调整:Windows 与 Linux unit 都从 2 个分片改为 4 个;Windows runner 自测和伴侣 DB 回归+移到独立并行 job `windows-runner-checks`,由原必需检查 `Windows unit tests` 一并阻断。本仓是公开仓,+标准 runner 不计费。按上表估算,Windows 每片约为准备 3 分钟 + Desktop 9–11 分钟 + Mobile 与其余包- 2–3 分钟,整条 CI 约 17–20 分钟。**这是估算,必须用首次 4 分片 CI 的实测替换。**++2–3 分钟,整条 CI 约 17–20 分钟。++++首次四分片实测:PR #6196、head `433248f7ff` 的 client-ci run `38856774589` 全部通过。++Windows 四片为 809/1,006/812/661 秒,关键路径 16 分 46 秒,较原 34.1–34.2 分钟减少约 51%;++Linux 四片为 783/539/691/718 秒;独立 Windows runner/DB job 387 秒。此轮先于审查恢复必要++契约与同步主干,最终合并版本的 CI 还须单独核验,不能用这次结果代替。++Vitest 每片切 `ceil(文件数 / 分片数)` 个文件,分片多于 2 个时,文件少的包末尾分片可能为空(6 个文件+分 4 片是 2、2、2、0)。runner 原来只在「文件数少于分片数」时补 `--passWithNoTests`,本机 4/4 分片因此+有 6 个包报 `NO_TESTS_REQUIRED`;现已按 Vitest 的切分方式判断空分片。++### 2026-10-16 实验与落地++本机 Windows、32 CPU、Desktop 8 worker。隔离方式三组用同一分片(869 个文件)连续对照:++| 实验 | 结果 | 结论 |+| --- | --- | --- |+| 基线:forks + 逐文件隔离 | 108.3 秒,0 失败 | — |+| `--no-isolate` | 83.0 秒(−23%),150 个文件/1,283 条用例失败 | 不采用:测试之间互相污染状态。**不要在真实 checkout 里用 `--no-isolate` 跑 Desktop 单测**:这次实验中 git/HOME 的 mock 泄漏,某个 worktree 测试在真实仓库对 `apps/desktop` 执行了 checkout,把未提交改动全部还原,还生成了 `apps/desktop/unused-test-home/` |+| `--pool=vmForks` | 80.0 秒(−26%),41 个文件失败 | 不采用:要逐个修复 VM 上下文差异 |+| `codexProxyHost.test.ts`:逐用例 `vi.resetModules()` 改为生产 `disposeCodexProxy()` 加启动注入复位 | 105 秒 → 6.7 秒,285/285;3 个随机顺序全过 | 已落地。原版在随机种子 1 下就失败(logger mock 跨用例累计),一并修复 |+| `maker-core` 用 1/2/4 个 worker | 248/125/65 秒,全过 | 已落地:独占运行、用满 worker,排在 Mobile 之后 |+| 单测分片 checkout 不拉全部历史 | 静态确认单测不读仓库历史 | 已落地,CI 每片约省 0.5 分钟(待 CI 实测) |+| 声明 jsdom 但没用 DOM 的文件 | 仅约 20 个,约 10 秒 worker 时间 | 不单独处理,写进性能预算 |++每片的 worker 时间里,收集(导入模块)约 325–350 秒,执行测试 250–480 秒,环境初始化 105–127 秒,+准备约 46 秒;后三项主要来自逐文件隔离。整体切换隔离方式会破坏正确性,所以改为逐个修掉开销最大的- 文件,并用 `pnpm check:test-hygiene` 阻止新增逐用例重置、真实等待和普通单测读源码文本(基线 450 个++文件,并用 `pnpm check:test-hygiene` 阻止新增逐用例重置、真实等待和普通单测读源码文本(基线 449 个+文件,只减不增,见 engineering-conventions.md §3.2「性能预算」)。修完 `codexProxyHost` 后,最慢的+单个文件从 138 秒降到约 32 秒,不再由一个文件决定分片下限。++优化后按 CI 方式(runner、4 分片、Windows tar、无 `XDT_*`)完整重跑:门禁、`test:runner`、guard、typecheck+全部通过;4 个分片只有 `taskWorkspace.test.ts` 1 条 symlink 能力失败。各片 `maker-core` 从 71/21/54/108 秒+降到 34/5/27/55 秒;含 `codexProxyHost` 的 Desktop 分片从 144 秒降到 117 秒。代码没动的 Desktop 分片同时+慢了约 20%,说明本机(同时运行其他重负载程序)整片墙钟有 ±20% 的波动,收益以上表的同机连续对照为准,+CI 时长仍要用首次 4 分片 CI 实测确认。++后续候选(每项都要在同一 runner、同一分片配置下实测后才能声称收益):++- 按历史耗时分配分片(自定义 Vitest sequencer),拉平哈希均分造成的不均衡。+- 把 Windows checkout 与临时目录放到 Dev Drive(ReFS),降低大量小文件 IO 的开销。+- 基线中逐用例重置最多的 `newMakerDraft.test.ts`(54 处)、`modelVisibilityPrefs.test.ts`(18 处)、+ `pi-package-store-security.test.ts`(17 处)按 `codexProxyHost` 的方式改;真实 I/O 重的+ `llamaCppService`、`proxy-auth`、`updateService` 评估是否迁到专用 tier。+- PR 阶段只跑受影响的 workspace、合并队列跑全量:需要先修改上面「PR 门禁完整覆盖」的规则,由维护者决定。++## 2026-10-15 测试审计结果++对 499 个候选文件逐一审计:++- 初始删除 81 个文件(488 条用例);独立审查发现其中包含缺少等价覆盖的权限、竞态、远程路由- 和设计契约,已恢复 30 个文件,并从 `homeUsageDashboardSource.test.ts` 保留账号隔离的 3 条- 契约。最终相对原始基线删除 50 个文件,不能沿用最初的「488 条无效用例」结论。++ 和设计契约,已恢复 30 个完整文件,并从 `homeUsageDashboardSource.test.ts` 保留账号隔离的 3 条++ 契约(含同步主干时保留的 `botChatSurface.test.ts`)。最终相对原始基线删除 49 个文件,++ 不能沿用最初的「488 条无效用例」结论。+ `FileTreeView.horizontalScroll.test.tsx` 真实挂载组件并断言可见宽度,已恢复。+- 207 个 PARTIAL 文件(2,874 条用例,其中约 991 条是静态或重复接线候选)保留:它们与续跑、设备链、+ 账户切换、Pi、权限和竞速回归混在一起,只能在补上等价的生产入口测试后逐项替换,不能按字符串模式+ 批量删除。+- 最初迁移 27 个静态契约文件;审查恢复与扫描器补漏后,Desktop 和 Mobile 的跨文件安全、权限、+ 主题或文案契约统一迁到各自 `guard` allowlist,由 CI 的 `pnpm test:guard` 执行。最终名单只在- `scripts/test-workspaces.config.mjs` 维护,由 runner 从 unit 排除;++ `scripts/test-workspaces.config.mjs` 维护(Desktop 84、Mobile 28),由 runner 从 unit 排除;+ 不要在 `apps/desktop/vitest.config.ts` 的项目 exclude 里重复排除,否则 guard 层自己也收集不到这些+ 文件(2026-10-16 发现 29 个 allowlist 文件实际只跑了 2 个,已修复)。+- 缺少 timing 的文件是 `src/main/cindy-brain/__tests__/pluginModelPrefsIpc.test.ts`。++本机(Windows、32 CPU)按当时的 Desktop unit tier 实跑:3,448 个文件/53,987 条测试,53,814 通过、+168 跳过,墙钟 414.5 秒。5 条失败都是当前账户无法创建目录 symlink 的 EPERM 能力探测路径+(`taskWorkspace.test.ts` 1 条、`pluginNamespaceMigration.manager.test.ts` 4 条),需要在支持 symlink 的+Windows CI 或 Developer Mode 下复验,不能 skip 或删除。本机未分片的结果不能直接和 CI 分片耗时比较。+## 2026-07-26 Windows 基线环境:Windows x64、Node v24.15.0、32 available CPUs、63.8 GiB RAM。测试范围为diff --cc scripts/__tests__/check-test-hygiene.test.mjsindex ce27eafd3c,0000000000..bf61127f83mode 100644,000000..100644--- a/scripts/__tests__/check-test-hygiene.test.mjs+++ b/scripts/__tests__/check-test-hygiene.test.mjs@@@ -1,112 -1,0 +1,122 @@@+// Contract for scripts/check-test-hygiene.mjs: each case is the smallest source+// that flips one rule decision, so a detector regression cannot silently let+// slow or source-literal unit tests back into CI.+import assert from "node:assert/strict";+import test from "node:test";++import {+ compareWithBaseline,+ scanTestSource,+ TEST_FILE,+} from "../check-test-hygiene.mjs";++test("hygiene scans both test and spec files", () => {+ assert.equal(TEST_FILE.test("src/example.test.ts"), true);+ assert.equal(TEST_FILE.test("src/example.spec.tsx"), true);+ assert.equal(TEST_FILE.test("src/example.test.js"), true);+ assert.equal(TEST_FILE.test("src/example.spec.cjs"), true);+ assert.equal(TEST_FILE.test("src/example.integration.spec.ts"), true);+ assert.equal(TEST_FILE.test("src/example.ts"), false);+});++test("scanTestSource counts only unjustified hits for each rule", () => {+ const cases = [+ ["per-test module reset", "beforeEach(() => { vi.resetModules(); });", { resetModules: 1 }],+ [+ "justified module reset",+ "// reset-modules: auto-sync prefs are module-scoped\nvi.resetModules();",+ { resetModules: 0 },+ ],+ ["commented-out reset", "// vi.resetModules();", { resetModules: 0 }],+ ["real 250ms wait", "await new Promise((r) => setTimeout(r, 250));", { realWaits: 1 }],+ ["short wait", "await new Promise((r) => setTimeout(r, 20));", { realWaits: 0 }],+ [+ "fake-timer file",+ "vi.useFakeTimers();\nsetTimeout(tick, 5_000);",+ { realWaits: 0 },+ ],+ [+ "real wait after fake timers are restored",+ "vi.useFakeTimers();\nvi.useRealTimers();\nsetTimeout(tick, 5_000);",+ { realWaits: 1 },+ ],+ [+ "multi-line real wait",+ "await new Promise((resolve) => setTimeout(\n resolve,\n 250,\n));",+ { realWaits: 1 },+ ],+ [+ "source text in fixture string is not executable",+ "expect(output).toContain('vi.resetModules()'); expect(output).toContain('setTimeout(done, 500)');",+ { resetModules: 0, realWaits: 0 },+ ],+ [+ "source text read",+ "const src = readFileSync(resolve(__dirname, '..', 'Sidebar.tsx'), 'utf8');",+ { sourceReads: 1 },+ ],+ [+ "multi-line source text read",+ "const src = readFileSync(\n resolve(__dirname, '..', 'Sidebar.tsx'),\n 'utf8',\n);",+ { sourceReads: 1 },+ ],+ [+ "import specifiers are not reads",+ "import { x } from '../x.ts';\nvi.mock('../y.ts');\nreadFileSync(join(__dirname, 'fixtures', 'a.ts'));",+ { sourceReads: 0 },+ ],++ [++ "multi-line source path declared before the read",++ "const sourcePath = resolve(\n __dirname,\n '..',\n 'Image.tsx',\n);\nconst source = readFileSync(sourcePath, 'utf8');",++ { sourceReads: 1 },++ ],++ [++ "a separately executed test script is not a source read",++ "const script = join(\n dirname(fileURLToPath(import.meta.url)),\n '../scripts/test-share.mjs',\n);\nspawnSync(process.execPath, [script]);\nreadFileSync(template, 'utf8');",++ { sourceReads: 0 },++ ],+ [+ "source read through a typed helper",+ "const read = (relative: string): string => readFileSync(resolve(__dirname, relative), 'utf8');\nconst source = read('../ChatInput.tsx');",+ { sourceReads: 1 },+ ],+ [+ "source read through a typed function",+ "function read(relative: string): string { return readFileSync(resolve(__dirname, relative), 'utf8'); }\nconst source = read('../ChatInput.tsx');",+ { sourceReads: 1 },+ ],+ ];+ for (const [name, source, expected] of cases) {+ const result = scanTestSource(source);+ for (const [rule, count] of Object.entries(expected)) {+ assert.equal(result[rule], count, `${name}: ${rule}`);+ }+ }+ assert.equal(+ scanTestSource("readFileSync(resolve(__dirname, '../A.tsx'))", { isGuard: true }).sourceReads,+ 0,+ "guard-tier files may read source",+ );+});++test("compareWithBaseline only lets counts stay or shrink", () => {+ const baseline = { "a.test.ts": { resetModules: 2 } };+ const pass = compareWithBaseline(+ { "a.test.ts": { resetModules: 1, realWaits: 0, sourceReads: 0 } },+ baseline,+ );+ assert.deepEqual(pass.violations, []);+ assert.deepEqual(pass.tightenable, ["a.test.ts"]);++ const fail = compareWithBaseline(+ {+ "a.test.ts": { resetModules: 3, realWaits: 0, sourceReads: 0 },+ "new.test.ts": { resetModules: 0, realWaits: 1, sourceReads: 0 },+ },+ baseline,+ );+ assert.deepEqual(+ fail.violations.map((v) => `${v.file}:${v.rule}:${v.limit}`),+ ["a.test.ts:resetModules:2", "new.test.ts:realWaits:0"],+ );+});diff --cc scripts/check-test-hygiene.mjsindex 0bbd07f9bf,0000000000..cdd7fbe804mode 100644,000000..100644--- a/scripts/check-test-hygiene.mjs+++ b/scripts/check-test-hygiene.mjs@@@ -1,398 -1,0 +1,408 @@@+#!/usr/bin/env node+// check-test-hygiene.mjs — 单测性能与价值的静态门禁(engineering-conventions.md §3.2)。+//+// 跑:node scripts/check-test-hygiene.mjs 检查(CI 阻断)+// node scripts/check-test-hygiene.mjs --update 把基线收紧到当前计数(只降不升)+//+// 三条规则都只看源码文本,结果与机器快慢无关:+// reset-modules 每次 vi.resetModules() 都会让后续 import 重新求值整条模块链。+// codexProxyHost.test.ts 逐用例重置时 285 条用例耗时 105s,不重置只要 7s。+// 新增调用必须在上一行写 `// reset-modules: <被隔离的模块状态>`。+// real-wait 单测里 ≥100ms 的真实 setTimeout / sleep 既拖慢 CI 又制造时序抖动;+// 改用 vi.useFakeTimers() 或等待真实事件。确需真实等待时上一行写+// `// real-wait: <原因>`。已切换为 fake timers 的区间不计。+// source-read 普通单测读取生产源码文本做字面量断言。这类静态契约只能进对应包的+// guard tier(scripts/test-workspaces.config.mjs),不接受理由豁免。+//+// 存量计数记在 scripts/test-hygiene-baseline.json,只允许减少:某文件的计数超过基线、+// 或基线外的文件出现未豁免的命中,都会失败。`--update` 只会把基线往下收紧;确需放宽+// 只能手改 JSON,让评审在 diff 里看见。++import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';+import path from 'node:path';+import process from 'node:process';+import { fileURLToPath, pathToFileURL } from 'node:url';++const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const BASELINE_PATH = path.join(ROOT, 'scripts', 'test-hygiene-baseline.json');+const SCAN_ROOTS = ['apps', 'packages'];+const SKIP_DIRS = new Set(['node_modules', 'dist', 'out', 'build', 'coverage', '.vite', '.expo', '.turbo']);+export const TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/;+const NON_UNIT_TEST = /(?:^|[-.])(?:integration|e2e|git-integration)\.(?:test|spec)\.|\.bench\./;+export const RULES = ['resetModules', 'realWaits', 'sourceReads'];+const REAL_WAIT_MIN_MS = 100;+const REAL_WAIT_PATTERN = /\b(?:sleep|delay|wait|waitMs|pause)\s*\(\s*(\d[\d_]*)\s*\)/g;++/** Replace comments with spaces (keeping newlines) so matches ignore commented-out code. */+export function stripComments(source) {+ let out = '';+ let i = 0;+ let quote = null;+ while (i < source.length) {+ const ch = source[i];+ const next = source[i + 1];+ if (quote) {+ out += ch;+ if (ch === '\\') { out += next ?? ''; i += 2; continue; }+ if (ch === quote) quote = null;+ i += 1;+ continue;+ }+ if (ch === '/' && next === '/') {+ while (i < source.length && source[i] !== '\n') { out += ' '; i += 1; }+ continue;+ }+ if (ch === '/' && next === '*') {+ while (i < source.length && !(source[i] === '*' && source[i + 1] === '/')) {+ out += source[i] === '\n' ? '\n' : ' ';+ i += 1;+ }+ out += ' ';+ i += 2;+ continue;+ }+ if (ch === '"' || ch === "'" || ch === '`') quote = ch;+ out += ch;+ i += 1;+ }+ return out;+}++function lineOf(text, index) {+ let line = 0;+ for (let i = 0; i < index; i += 1) if (text.charCodeAt(i) === 10) line += 1;+ return line;+}++/** True when the closest non-blank line above `line` carries `// <marker>: <reason>`. */+function hasJustification(lines, line, marker) {+ for (let i = line - 1; i >= 0; i -= 1) {+ const text = lines[i].trim();+ if (text === '') continue;+ return new RegExp(`//\\s*${marker}:\\s*\\S`).test(text);+ }+ return false;+}++function countMatches(code, lines, pattern, marker, accept = () => true) {+ let count = 0;+ for (const match of code.matchAll(pattern)) {+ if (!accept(match)) continue;+ if (!hasJustification(lines, lineOf(code, match.index), marker)) count += 1;+ }+ return count;+}++/** Mask string contents while preserving line numbers and call-site punctuation. */+function maskStrings(source) {+ let out = '';+ let quote = null;+ let escaped = false;+ for (const ch of source) {+ if (quote) {+ if (escaped) {+ escaped = false;+ out += ch === '\n' ? '\n' : ' ';+ } else if (ch === '\\') {+ escaped = true;+ out += ' ';+ } else if (ch === quote) {+ quote = null;+ out += ch;+ } else {+ out += ch === '\n' ? '\n' : ' ';+ }+ continue;+ }+ if (ch === '"' || ch === "'" || ch === String.fromCharCode(96)) {+ quote = ch;+ out += ch;+ } else {+ out += ch;+ }+ }+ return out;+}++function setTimeoutCalls(code) {+ const calls = [];+ for (const match of code.matchAll(/\bsetTimeout\s*\(/g)) {+ const start = match.index + match[0].length;+ let depth = 1;+ let quote = null;+ let escaped = false;+ const commas = [];+ let end = -1;+ for (let i = start; i < code.length; i += 1) {+ const ch = code[i];+ if (quote) {+ if (escaped) escaped = false;+ else if (ch === '\\') escaped = true;+ else if (ch === quote) quote = null;+ continue;+ }+ if (ch === '"' || ch === "'" || ch === String.fromCharCode(96)) quote = ch;+ else if (ch === '(' || ch === '[' || ch === '{') depth += 1;+ else if (ch === ')' || ch === ']' || ch === '}') {+ depth -= 1;+ if (ch === ')' && depth === 0) {+ end = i;+ break;+ }+ } else if (ch === ',' && depth === 1) commas.push(i);+ }+ if (end < 0 || commas.length === 0) continue;+ const durationStart = commas[0] + 1;+ const durationEnd = commas[1] ?? end;+ const duration = code.slice(durationStart, durationEnd).trim();+ if (/^\d[\d_]*$/.test(duration)) calls.push({ index: match.index, duration });+ }+ return calls;+}++function countRealWaits(code, lines) {+ const timerEvents = [...code.matchAll(/\bvi\.(useFakeTimers|useRealTimers)\s*\(/g)];+ let timerIndex = 0;+ let fakeTimers = false;+ let count = 0;+ const waits = [+ ...setTimeoutCalls(code).map(({ index, duration }) => ({ index, duration })),+ ...[...code.matchAll(REAL_WAIT_PATTERN)].map((match) => ({+ index: match.index,+ duration: match[1] ?? match[2],+ })),+ ].sort((a, b) => a.index - b.index);+ for (const wait of waits) {+ while (timerIndex < timerEvents.length && timerEvents[timerIndex].index < wait.index) {+ fakeTimers = timerEvents[timerIndex][1] === 'useFakeTimers';+ timerIndex += 1;+ }+ if (fakeTimers) continue;+ if (Number(wait.duration.replaceAll('_', '')) < REAL_WAIT_MIN_MS) continue;+ const line = lineOf(code, wait.index);+ if (!hasJustification(lines, line, 'real-wait')) count += 1;+ }+ return count;+}++const IMPORT_CONTEXT = /(?:\bfrom|\bimport|\brequire|\.mock|\.doMock|\.unmock|\.importActual|\.importMock|\.glob)\s*\(?\s*$/;+const SOURCE_EXT = /\.(?:tsx?|mts|cts|css|mjs|cjs|jsx?)$/;+// Only anchors that point into the checkout count; generic names such as `root`+// usually hold an mkdtemp() directory whose fake source files are test input.+const REPO_ANCHOR = /__dirname|import\.meta\.(?:url|dirname)|\b(?:REPO_ROOT|repoRoot|desktopRoot)\b/;+- function findEnclosingReadCall(code, index) {- const starts = [...code.matchAll(/\breadFile(?:Sync)?\s*\(/g)];++function findEnclosingReadCall(code, index, pattern = /\breadFile(?:Sync)?\s*\(/g) {++ const starts = [...code.matchAll(pattern)];+ for (let n = starts.length - 1; n >= 0; n -= 1) {+ const start = starts[n].index;+ if (start == null || start >= index) continue;+ let depth = 1;+ let quote = null;+ let escaped = false;+ for (let i = start + starts[n][0].length; i < index; i += 1) {+ const ch = code[i];+ if (quote) {+ if (escaped) escaped = false;+ else if (ch === '\\') escaped = true;+ else if (ch === quote) quote = null;+ continue;+ }+ if (ch === '"' || ch === "'" || ch === String.fromCharCode(96)) {+ quote = ch;+ } else if (ch === '(') {+ depth += 1;+ } else if (ch === ')') {+ depth -= 1;+ if (depth === 0) break;+ }+ }+ if (depth > 0) return start;+ }+ return -1;+}++function findSourceReadHelpers(code) {+ const helpers = new Set();+ const arrowPattern = /\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=;\n]+)?=>[^;{}]{0,500}\breadFile(?:Sync)?\s*\(/g;+ for (const match of code.matchAll(arrowPattern)) helpers.add(match[1]);+ const functionPattern = /\bfunction\s+([A-Za-z_$][\w$]*)\s*\([^)]*\)\s*(?::[^{;\n]+)?\{[^{}]{0,500}\breadFile(?:Sync)?\s*\(/g;+ for (const match of code.matchAll(functionPattern)) helpers.add(match[1]);+ return helpers;+}++function isSourcePathLiteral(code, match, sourceReadHelpers = new Set()) {+ const value = match[2];+ if (!SOURCE_EXT.test(value) || /fixture|:\/\//i.test(value)) return false;+ if (IMPORT_CONTEXT.test(code.slice(Math.max(0, match.index - 24), match.index))) return false;+ const lineStart = code.lastIndexOf('\n', match.index) + 1;+ const lineEnd = code.indexOf('\n', match.index);+ const line = code.slice(lineStart, lineEnd === -1 ? undefined : lineEnd);+ // Test data under a fixtures directory is input, not production source.+ if (/fixture/i.test(line)) return false;+ const prefix = line.slice(0, match.index - lineStart);+ const helperCall = prefix.match(/\b([A-Za-z_$][\w$]*)\s*\(\s*$/)?.[1];+ if (helperCall && sourceReadHelpers.has(helperCall)) return true;+ // resolve(__dirname, '..', 'Sidebar.tsx') or new URL('../x.ts', import.meta.url).+ if (REPO_ANCHOR.test(line)) return true;++ // A separately declared sourcePath may be formatted over several lines before++ // it is passed to readFileSync. Keep that equivalent to the inline path form.++ const pathStart = findEnclosingReadCall(code, match.index, /\b(?:resolve|join)\s*\(/g);++ if (pathStart >= 0) {++ const pathContext = code.slice(pathStart, match.index + match[0].length);++ const binding = code.slice(Math.max(0, pathStart - 150), pathStart)++ .match(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:[A-Za-z_$][\w$]*\.)?$/)?.[1];++ const readBinding = binding && new RegExp('\\breadFile(?:Sync)?\\s*\\(\\s*' + binding + '\\b').test(code);++ if (readBinding && REPO_ANCHOR.test(pathContext) && !/fixture/i.test(pathContext)) return true;++ }+ // Keep the same decision for a formatted multi-line readFileSync call. The+ // current line may only contain the final path segment, while the repository+ // anchor and read call live on the preceding lines.+ const callStart = findEnclosingReadCall(code, match.index);+ if (callStart >= 0) {+ const callContext = code.slice(callStart, match.index + match[0].length);+ const previousContext = callContext.slice(0, -match[0].length);+ const hasPriorSourceLiteral = /\.(?:tsx?|mts|cts|css|mjs|cjs|jsx?)['"]/.test(previousContext);+ if (/\n/.test(callContext) && !hasPriorSourceLiteral && !/[;{}]/.test(callContext) && REPO_ANCHOR.test(callContext) && !/fixture/i.test(callContext)) return true;+ }+ // readFileSync('../x.ts') reads relative to the test process, i.e. the checkout.+ return /\breadFile(?:Sync)?\s*\(/.test(line) && (value.startsWith('./') || value.startsWith('../'));+}++/** Count unjustified rule hits in one unit test file. */+export function scanTestSource(source, { isGuard = false } = {}) {+ const code = stripComments(source);+ const lines = source.split(/\r?\n/);+ const executableCode = maskStrings(code);+ const resetModules = countMatches(executableCode, lines, /\bvi\.resetModules\s*\(/g, 'reset-modules');+ const realWaits = countRealWaits(executableCode, lines);+ let sourceReads = 0;+ if (!isGuard && /\breadFileSync\b|\breadFile\s*\(|\?raw/.test(code)) {+ const sourceReadHelpers = findSourceReadHelpers(code);+ for (const match of code.matchAll(/(['"`])([^'"`\n$]+)\1/g)) {+ if (match[2].endsWith('?raw') || isSourcePathLiteral(code, match, sourceReadHelpers)) sourceReads += 1;+ }+ }+ return { resetModules, realWaits, sourceReads };+}++function walk(dir, out) {+ let entries;+ try {+ entries = readdirSync(dir, { withFileTypes: true });+ } catch {+ return;+ }+ for (const entry of entries) {+ if (entry.isDirectory()) {+ if (!SKIP_DIRS.has(entry.name) && !entry.name.startsWith('.')) walk(path.join(dir, entry.name), out);+ } else if (TEST_FILE.test(entry.name) && !NON_UNIT_TEST.test(entry.name)) {+ out.push(path.join(dir, entry.name));+ }+ }+}++async function loadGuardFiles(root) {+ const configUrl = pathToFileURL(path.join(root, 'scripts', 'test-workspaces.config.mjs'));+ const { default: manifest } = await import(configUrl.href);+ const guard = new Set();+ for (const workspace of manifest.workspaces) {+ for (const file of workspace.tiers?.guard?.include ?? []) {+ guard.add(path.posix.join(workspace.cwd, file));+ }+ }+ return guard;+}++export async function scanRepository(root = ROOT) {+ const files = [];+ for (const scanRoot of SCAN_ROOTS) walk(path.join(root, scanRoot), files);+ const guard = await loadGuardFiles(root);+ const counts = {};+ for (const file of files.sort()) {+ const rel = path.relative(root, file).split(path.sep).join('/');+ const result = scanTestSource(readFileSync(file, 'utf8'), { isGuard: guard.has(rel) });+ if (RULES.some((rule) => result[rule] > 0)) counts[rel] = result;+ }+ return counts;+}++/** Compare current counts with the ratchet baseline. */+export function compareWithBaseline(counts, baseline) {+ const violations = [];+ const tightenable = [];+ for (const [file, current] of Object.entries(counts)) {+ const allowed = baseline[file] ?? {};+ for (const rule of RULES) {+ const limit = allowed[rule] ?? 0;+ if (current[rule] > limit) violations.push({ file, rule, current: current[rule], limit });+ }+ }+ for (const [file, allowed] of Object.entries(baseline)) {+ const current = counts[file] ?? {};+ if (RULES.some((rule) => (current[rule] ?? 0) < (allowed[rule] ?? 0))) tightenable.push(file);+ }+ return { violations, tightenable };+}++const HINTS = {+ resetModules: '只在被测的模块级状态确实需要重建的边界调用,上一行写 `// reset-modules: <原因>`;优先用生产代码的 dispose/reset 或依赖注入',+ realWaits: '改用 vi.useFakeTimers() 或等待真实事件;确需真实等待时上一行写 `// real-wait: <原因>`',+ sourceReads: '普通单测不得读取源码文本做字面量断言;改为经生产入口验证行为,纯跨文件契约移入对应包的 guard tier',+};++function readBaseline() {+ if (!existsSync(BASELINE_PATH)) return {};+ return JSON.parse(readFileSync(BASELINE_PATH, 'utf8')).files ?? {};+}++function writeBaseline(files) {+ const sorted = Object.fromEntries(Object.entries(files).sort(([a], [b]) => a.localeCompare(b)));+ const body = {+ description: 'Ratchet baseline for scripts/check-test-hygiene.mjs. Counts may only go down; see engineering-conventions.md §3.2.',+ files: sorted,+ };+ writeFileSync(BASELINE_PATH, `${JSON.stringify(body, null, 2)}\n`);+}++export async function main(args = process.argv.slice(2)) {+ const counts = await scanRepository();+ const baseline = readBaseline();+ const { violations, tightenable } = compareWithBaseline(counts, baseline);+ if (args.includes('--update')) {+ // The very first run records the existing debt; afterwards --update only tightens.+ if (violations.length > 0 && existsSync(BASELINE_PATH)) {+ for (const v of violations) console.error(`refusing to raise ${v.rule} for ${v.file}: ${v.limit} -> ${v.current}`);+ console.error('[test-hygiene] --update only tightens the baseline; fix the new hits instead.');+ return 1;+ }+ const next = {};+ for (const [file, current] of Object.entries(counts)) {+ const entry = Object.fromEntries(RULES.filter((rule) => current[rule] > 0).map((rule) => [rule, current[rule]]));+ if (Object.keys(entry).length > 0) next[file] = entry;+ }+ writeBaseline(next);+ console.log(`[test-hygiene] baseline updated: ${Object.keys(next).length} files`);+ return 0;+ }+ if (violations.length === 0) {+ if (tightenable.length > 0) {+ console.error(`[test-hygiene] FAIL — ${tightenable.length} baseline entries can be tightened; run node scripts/check-test-hygiene.mjs --update`);+ return 1;+ }+ console.log(`[test-hygiene] PASS (${Object.keys(counts).length} files within baseline)`);+ return 0;+ }+ for (const v of violations) {+ console.error(`❌ [${v.rule}] ${v.file}: ${v.current} unjustified hit(s), baseline allows ${v.limit}`);+ console.error(` ${HINTS[v.rule]}`);+ }+ console.error('[test-hygiene] FAIL — see docs/dev-rules/engineering-conventions.md §3.2');+ return 1;+}++if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {+ main().then((code) => { process.exitCode = code; }, (error) => {+ console.error(`[test-hygiene] ${error.message}`);+ process.exitCode = 2;+ });+}diff --cc scripts/test-hygiene-baseline.jsonindex a2da83c5ba,0000000000..1b99af3a23mode 100644,000000..100644--- a/scripts/test-hygiene-baseline.json+++ b/scripts/test-hygiene-baseline.json@@@ -1,1365 -1,0 +1,1362 @@@+{+ "description": "Ratchet baseline for scripts/check-test-hygiene.mjs. Counts may only go down; see engineering-conventions.md §3.2.",+ "files": {+ "apps/desktop/scripts/nsis-include-paths.test.mjs": {+ "sourceReads": 1+ },+ "apps/desktop/scripts/render-recovery/main.test.mjs": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/accessibilitySupportIpc.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/agentBinaryLinuxPrepare.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/analyticsSettingsService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/analyticsSettingsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/appBadgeService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/appearanceZoomMenu.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/authAccountsIpcSecurity.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/authCredentialLoginRecovery.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/authCredentialRecoveryWiring.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/authLoginBack.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/authPostCommitStartup.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/__tests__/cdnResponseLifecycle.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/chatAttachmentIpcOwnerBoundary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/cindyMakeGithubIpc.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/claudeAccountUsageSource.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/claudeOrphanReaper.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/codexToolTreeReaper.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/computerUsePluginIpc.test.ts": {+ "sourceReads": 11+ },+ "apps/desktop/src/main/__tests__/controlProjects.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/deviceLinkSettingsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/dialogueWorkspace.test.ts": {+ "resetModules": 3+ },+ "apps/desktop/src/main/__tests__/disableOrcaStrandedLead.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/ghostAccountBoundaryOrdering.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/__tests__/ghostSetupInteractionLifecycle.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/heartbeatService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/imageCacheStartupSweepDisabled.test.ts": {+ "sourceReads": 7+ },+ "apps/desktop/src/main/__tests__/imageCacheStoreLifecycle.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/imDefaultSettingsIpcSecurity.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/interruptedContinuationContract.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/__tests__/lifecycle.test.ts": {+ "resetModules": 2,+ "sourceReads": 3+ },+ "apps/desktop/src/main/__tests__/mainWindowBackgroundThrottling.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/__tests__/makerEventHotPathOrdering.test.ts": {+ "sourceReads": 6+ },+ "apps/desktop/src/main/__tests__/makerOrcaRoleMarking.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/__tests__/messagesAroundClientIdIpc.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/__tests__/modelPricingPrewarmOrdering.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/notificationService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/permissionInteractionPause.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/projectOrderStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/providerImportWiring.test.ts": {+ "sourceReads": 5+ },+ "apps/desktop/src/main/__tests__/queuedMessageTrustBoundary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/releaseNotesService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/resolved-app-theme.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/safeStorageCodexRestart.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/safeStorageCompanionBoundary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/sessionDragReleaseNativeHost.test.ts": {+ "resetModules": 1,+ "sourceReads": 2+ },+ "apps/desktop/src/main/__tests__/sessionRuntimeFallbackIntent.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/sessionTaskSummary.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/__tests__/setSessionsStatusInDb.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/__tests__/sidebarSettingsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/stableOwnerPostCommitStep.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/updateChannelStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/updaterUi.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/__tests__/updateService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/usageBroadcasterClaudeSubscription.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/__tests__/usageBroadcasterCodexAccount.test.ts": {+ "resetModules": 9+ },+ "apps/desktop/src/main/__tests__/usageBroadcasterXaiSubscription.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/wallpaperVideo.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/windowsDiagnosticsTrayWiring.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/windowsIconAssets.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/__tests__/windowsTaskbarNative.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/__tests__/workdirDiagnostics.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/worktreeManagerCreate.test.ts": {+ "resetModules": 1,+ "realWaits": 2+ },+ "apps/desktop/src/main/__tests__/worktreeSessionTransfer.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/__tests__/worktreeStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/agent-binaries/__tests__/startup-policy.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/agent-island/__tests__/layoutPreferenceStore.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/agent-island/__tests__/MacAgentIslandNativeHost.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/agent-island/__tests__/service.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/bot-import/__tests__/host.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/bot-import/__tests__/openclawCronWorker.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/cindy-brain/__tests__/builtinGhostProvisioner.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/cindy-brain/__tests__/byokImageChannel.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/cindy-brain/__tests__/downloadLifecycle.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/cindy-brain/__tests__/GhostManager.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/cindy-brain/__tests__/ghostUserDataRelocation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/cindy-brain/__tests__/nodeRuntimePackaging.test.ts": {+ "sourceReads": 14+ },+ "apps/desktop/src/main/cindy-brain/__tests__/pluginModelPrefsIpc.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/cindy-make/__tests__/stateBroadcast.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/cindy-make/__tests__/versionStartup.test.ts": {+ "resetModules": 1,+ "realWaits": 1+ },+ "apps/desktop/src/main/companion-cloud/__tests__/twoDevices.harness.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/computer-permission-guide/__tests__/electron-window.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/computer-permission-guide/__tests__/MacComputerPermissionGuideNativeHost.test.ts": {+ "resetModules": 1,+ "sourceReads": 1+ },+ "apps/desktop/src/main/computer-permission-guide/__tests__/switch-target.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/device-link/__tests__/crossProcessLock.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/device-link/__tests__/deviceName.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/device-link/__tests__/historyScanFallback.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/device-link/__tests__/providerShareGuestPrefs.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/device-link/__tests__/remoteInvokeSendGuard.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/device-link/__tests__/sharedTaskAccountBoundary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/doc-tools/__tests__/docsOutputWriterPackaging.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/doc-tools/__tests__/readSheetProcessPackaging.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/embedding-host/__tests__/hostLifecycle.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/file-browser/__tests__/deviceOp.test.ts": {+ "realWaits": 3+ },+ "apps/desktop/src/main/goal-host/__tests__/controller.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/localDb/__tests__/cjkSeg.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/localDb/__tests__/conversationSearch.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/localDb/__tests__/dbSlimmingUpgradeOrder.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/localDb/__tests__/schemaLeaseTakeoverWiring.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/localDb/__tests__/sessionListMessageCount.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/localDb/ipc/__tests__/ownerEnsureCoordinator.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/accountProviderReadinessWiring.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/maker-host/__tests__/authAdaptersImportPurity.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/chat-embedding-settings-store.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/codex-browser-companion.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/codexAuthTokenReaderBoundary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/codexCustomContextCatalog.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/memorySettingsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/nativeProviderAuthBinding.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/pi-package-runtime-invalidation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/pi-package-store-security.test.ts": {+ "resetModules": 17+ },+ "apps/desktop/src/main/maker-host/__tests__/piBinaryDistribution.test.ts": {+ "sourceReads": 8+ },+ "apps/desktop/src/main/maker-host/__tests__/piNativeAdapterRuntime.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/piSystemPrompt.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-host/__tests__/remoteCcQueryFactory.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-host/__tests__/runtimeConfigs.test.ts": {+ "resetModules": 3+ },+ "apps/desktop/src/main/maker-host/__tests__/runtimeConfigsRipgrep.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/session-effort-store.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-host/__tests__/sessionProviderStore.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/agent-input-coordinator.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/maker-ipc/__tests__/bootstrapDirectoryGrants.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/botCandidateRecovery.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/botDirectMessageService.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/maker-ipc/__tests__/botInvitation.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/botTaskCoordination.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/botTaskResponsibilityAuthority.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/chatInviteRevokeIpcSecurity.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/cindyMakeFeatureGate.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/deferredRestartQueueDrain.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/groupRuntimeRouteAuthorization.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/llamaCppContextOwner.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/makerSendTransaction.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaInterAgentDispatcher.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaLifecycleService.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaModelSelectionIntent.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaProviderRoutingSnapshotWiring.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaRemoteModelWindowSelection.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaTeamService.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/orcaWorkerCreationService.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginPlanHistory.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginReviewSnapshotFreshness.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginStartTeamAdmission.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginTaskAuthorshipWiring.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginTaskCreateDirectory.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginTaskService.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginTaskSnapshot.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginWorkerCompletion.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginWorkerDirectoryWindows.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginWriteAccess.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/pluginWriteAccessHost.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/promptPredictionStopLedger.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/maker-ipc/__tests__/schedulerQueuedPreparation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/sessionQueueControl.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/maker-ipc/__tests__/silentStopContinuationBinding.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/mcp-integrations/__tests__/botTaskCreationResponsibility.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/mcp-integrations/__tests__/forgeIconConversionPackaging.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/mcp-integrations/__tests__/pluginTaskHelperScope.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/mcp-integrations/__tests__/schedulerDevices.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/mcp-integrations/browser-real-profile/__tests__/snapshot.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/model-access/__tests__/gatewayKeyRotation.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/plugin-market/__tests__/install-manifest-read.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/plugin-market/__tests__/service-custom-sources.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/plugin-market/__tests__/sources-cache-lease.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/plugin-oauth/__tests__/runtimePrompt.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/main/plugin-publisher/__tests__/host.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/provider-group/__tests__/coolingStore.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/provider-group/__tests__/failoverSessionClose.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-agent/executor/__tests__/executor.test.ts": {+ "realWaits": 5+ },+ "apps/desktop/src/main/remote-desktop/__tests__/backgroundActivity.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/main/remote-desktop/__tests__/controller.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-desktop/__tests__/hostCommands.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-desktop/__tests__/linuxPackaging.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-desktop/__tests__/macosInput.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-desktop/__tests__/viewerDisplaySupport.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/remote-ssh/__tests__/agentProxy.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/remote-ssh/__tests__/agentProxyPrefsLog.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/remote-ssh/__tests__/codex-remote-mcp.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/remote-ssh/__tests__/remoteAgentReadiness.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/remote-ssh/__tests__/remoteHostMutationContract.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/remote-ssh/__tests__/silentInstallStatus.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/resource-usage-window/__tests__/windowSecurity.test.ts": {+ "sourceReads": 5+ },+ "apps/desktop/src/main/reviewer/__tests__/reviewExternalInputWiring.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/reviewer/__tests__/reviewPdfProcessPackaging.test.ts": {+ "sourceReads": 7+ },+ "apps/desktop/src/main/scheduler-host/__tests__/preRunHook.test.ts": {+ "realWaits": 1+ },+ "apps/desktop/src/main/skillhub/__tests__/activationPreferences.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/main/skillhub/__tests__/customizationScanHost.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/__tests__/identityPolicy.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/__tests__/installService.test.ts": {+ "resetModules": 4+ },+ "apps/desktop/src/main/skillhub/__tests__/publishService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/__tests__/registryReconciliation.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/__tests__/sharedMutationLease.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/registry/__tests__/manifestIO.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/skillhub/registry/__tests__/registryService.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/vision-bridge/__tests__/vision-bridge-settings-store.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/voice-input/__tests__/dictionarySyncStore.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/voice-input/__tests__/ElevenLabsScribeProvider.test.ts": {+ "realWaits": 2+ },+ "apps/desktop/src/main/voice-input/__tests__/globalShortcut.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/voice-input/__tests__/MacModifierShortcutListenerStartRace.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/voice-input/__tests__/RealtimeAsrWebSocketProvider.test.ts": {+ "realWaits": 3+ },+ "apps/desktop/src/main/voice-input/__tests__/SystemAudioMuteGuard.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/voice-input/__tests__/VolcengineSaucAsrProvider.test.ts": {+ "realWaits": 4+ },+ "apps/desktop/src/main/voice-input/__tests__/WindowsFunctionKeyShortcutListener.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/worklouder-codex/__tests__/codexMicroGuardHook.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/worklouder-codex/__tests__/settingsIpc.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/main/worklouder-codex/__tests__/WorkLouderCodexHostClient.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/main/worktree/__tests__/precreatedCancellation.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/main/xbox-gamepad/__tests__/host.test.ts": {+ "sourceReads": 5+ },+ "apps/desktop/src/main/xbox-gamepad/__tests__/index.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/preload/__tests__/appearanceSnapshot.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/preload/__tests__/browserCommentPreload.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/preload/__tests__/deepLinkIslandEntryBridge.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/preload/__tests__/ghostInspectTarget.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/preload/__tests__/ghostPanelMedia.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/preload/__tests__/skillhubFanOut.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/accountUsageSnapshot.test.ts": {+ "sourceReads": 6+ },+ "apps/desktop/src/renderer/__tests__/agentCapabilitiesDeviceCache.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/agentDeviceModelMemory.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/__tests__/agentIslandVisibleSessionRoute.test.ts": {+ "sourceReads": 5+ },+ "apps/desktop/src/renderer/__tests__/attachmentFileCard.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/attachmentTypeThumb.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/autoFollowIntent.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/renderer/__tests__/automationGeneratedSessions.test.ts": {+ "sourceReads": 25+ },+ "apps/desktop/src/renderer/__tests__/automationGroupCollapse.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/__tests__/brandLoadingMarkContract.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/ccAgentSessionViewThemeContract.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/chatAttachmentSave.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/chatInputGhostSnapshot.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/chatInputSteerShortcut.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/cindyMakeInlineEntry.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/composerChipPresentation.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/composerDraftSameOwnerGenerationBump.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/composerListIndentDecoration.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/composerStructuredLists.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/conversationSearchBox.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/renderer/__tests__/deviceLinkDeviceListLoading.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/deviceLinkDraftFlow.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/deviceLinkProjectsConcurrency.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/deviceProvidersCache.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/deviceProvidersRecovery.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/devicesProvidersRefresh.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/diffHorizontalScroll.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/diffPanelShellA11y.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/extraDirsButtonPathOverlap.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/favoriteAnchorMemory.test.ts": {+ "resetModules": 7+ },+ "apps/desktop/src/renderer/__tests__/focusScrollLifecycle.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/focusScrollSettlement.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/focusScrollWindow.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/foregroundRecoveryDiagnostics.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/foundationDefaultsFreeze.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/ghostCardFrameCanvas.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/ghostCommandDecoration.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/ghostCommandSourceLabel.dom.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/ghostUnreadStore.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/gitReviewTransport.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/globalTextSelectionColor.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/goalLearnTransportRouting.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/hiddenAnimationGate.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/historyPrefetch.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/historyTurnChangesProjection.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/historyViewportCompensation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/issueCommandAttachments.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/jumpToLatestLayout.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/localCatalogSnapshot.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/__tests__/makerExperimentalAccepted.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/makerTransportOrcaRouting.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/makerTransportRouting.test.ts": {+ "resetModules": 1,+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/markdownCjkStrongDelimiter.test.ts": {+ "sourceReads": 1+ },- "apps/desktop/src/renderer/__tests__/markdownDiffBlock.test.ts": {- "sourceReads": 2- },+ "apps/desktop/src/renderer/__tests__/markdownFencedCodeInline.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/markdownHeadingTokens.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/markdownMathRendering.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/markdownStrikethrough.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/markdownTargetRendererContract.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/memorySettingsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/menuButtonSettingsEntry.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/messageDisclosureAnchorIntegration.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/messageItemHeightCacheIntegration.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/messageRenderItemDom.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/messageViewportDeletionIntegration.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/messageViewportRestoreDom.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/mobileDownloadDialog.test.tsx": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/modelDefinitionsDefaults.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/modelDefinitionsDeviceId.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/modelEnginePrefs.test.ts": {+ "resetModules": 14+ },+ "apps/desktop/src/renderer/__tests__/modelFavorites.test.ts": {+ "resetModules": 17+ },+ "apps/desktop/src/renderer/__tests__/modelVisibilityPrefs.test.ts": {+ "resetModules": 18+ },+ "apps/desktop/src/renderer/__tests__/morphPopover.test.tsx": {+ "realWaits": 1+ },+ "apps/desktop/src/renderer/__tests__/newMakerDraft.test.ts": {+ "resetModules": 54,+ "realWaits": 1+ },+ "apps/desktop/src/renderer/__tests__/newMakerDraftRemoteHost.test.ts": {+ "resetModules": 6+ },+ "apps/desktop/src/renderer/__tests__/newMakerGenericCreatePreservesDraft.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/newMakerLocalFirstMessageSend.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/newMakerOrcaCreateOrder.test.ts": {+ "sourceReads": 4+ },+ "apps/desktop/src/renderer/__tests__/newMakerRemoteFirstMessageSend.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/newMakerWorktreeSend.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/pendingHandoffRecovery.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/__tests__/permissionSessionApproval.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/pinnedProjectSidebarIntegration.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/pluginRecommendationRecovery.test.tsx": {+ "sourceReads": 5+ },+ "apps/desktop/src/renderer/__tests__/previousQuestionPlaceholder.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/projectCollapsedAttention.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/providerModelMemory.test.ts": {+ "resetModules": 13+ },+ "apps/desktop/src/renderer/__tests__/recentWorkdirsStore.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/reducedMotionEscape.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/releaseNotesNormalize.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/__tests__/remoteBotLampFoldExemption.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/remoteCatalogSnapshot.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/remoteHistoryHandoff.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/remoteModelHooksDeviceOwnership.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/remoteSessionSyncInvariants.test.ts": {+ "sourceReads": 12+ },+ "apps/desktop/src/renderer/__tests__/restoredScrollIndicator.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/reviewCommandDispatch.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/rewindDraftAttachments.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/rolePillWorkerCountSummary.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/rolePillWorkerErrorIndicator.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/runningStatusBarSuppression.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/scheduleDefaultModel.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/selectedFavoritePersistenceRollback.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/selectedMachineOwnerState.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/selectionQuoteUserMessage.test.ts": {+ "sourceReads": 3+ },+ "apps/desktop/src/renderer/__tests__/sentInlineAtomBody.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/sentPastedTextPreview.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/sessionAgentSwitchRemoteRouting.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/sessionStartingStore.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/sidebarSessionTime.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/sidebarUpgradeDefaults.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/sidebarUpperSingleButton.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/tailWindowScrollLayout.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/tapdbConsentGate.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/__tests__/textLightbox.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/todaySpendChip.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/unifiedModelPanelRendering.test.tsx": {+ "realWaits": 1+ },+ "apps/desktop/src/renderer/__tests__/userMessageCollapse.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/__tests__/voiceInputEnterToSend.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/__tests__/worktreeRemovalWarning.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/components/chat/__tests__/embeddedSessionNavigation.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/chat/__tests__/rehypeStreamWordFade.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/layout/__tests__/WallpaperVideo.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/new-chat/__tests__/composerBlankPointerFocus.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/new-chat/__tests__/composerPromptRecommendation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/settings/__tests__/CustomProviderDialogAccessibility.test.tsx": {+ "realWaits": 2+ },+ "apps/desktop/src/renderer/components/settings/__tests__/RemoteSection.addFormOrder.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/settings/__tests__/settingsSearchCatalog.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/settings/usage/__tests__/usageHistoryDevices.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/status/__tests__/QuotaBar.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/components/ui/__tests__/dropdownMenuHighlight.test.tsx": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/components/ui/__tests__/input.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/bots/__tests__/BotGroupChatView.test.tsx": {+ "realWaits": 1+ },+ "apps/desktop/src/renderer/features/bots/__tests__/botGroupListRemoval.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/bots/__tests__/botModelChainDefaults.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/bots/__tests__/botNavigation.test.ts": {+ "sourceReads": 6+ },+ "apps/desktop/src/renderer/features/bots/__tests__/botStore.lifecycle.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/features/bots/__tests__/botStore.modelSettings.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/bots/__tests__/chatInviteBrowserHandoff.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/agentDeviceDraftMemory.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/modelWindowConfirmation.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/newMakerDraftModelPrefs.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/newMakerDraftTargetCatalog.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/splitGroupStore.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/features/cc-agent/__tests__/subagentTabDiscovery.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/cc-agent/sidebar/__tests__/sessionRowRenderIsolation.test.ts": {+ "sourceReads": 13+ },+ "apps/desktop/src/renderer/features/cc-agent/workdir-browse/__tests__/FileTreeView.horizontalScroll.test.tsx": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/remote-desktop/__tests__/viewerInput.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/__tests__/plugin.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/__tests__/subscription.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/__tests__/highlight.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/skillhub/hooks/__tests__/useCategoryList.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/skillhub/hooks/__tests__/useSkillPublishComparison.test.tsx": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/features/skillhub/lib/__tests__/marketRoutes.test.ts": {+ "sourceReads": 5+ },+ "apps/desktop/src/renderer/features/skillhub/lib/__tests__/publishProgressFilter.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/features/skillhub/lib/__tests__/skillhubManagementE2EScript.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/hooks/__tests__/codexAuthLogin.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/hooks/__tests__/useAvailableAgents.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/hooks/__tests__/useDingTalkBot.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/hooks/__tests__/useFeishuBot.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/hooks/__tests__/useModelPricing.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/lib/__tests__/composerDraftSessionSwitchGuard.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/lib/__tests__/providerModelEfforts.test.ts": {+ "sourceReads": 1+ },+ "apps/desktop/src/renderer/lib/__tests__/sessionService.test.ts": {+ "resetModules": 2+ },+ "apps/desktop/src/renderer/state/__tests__/agentIslandActivity.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/themes/__tests__/generatedEffortInitialization.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/voice-input/__tests__/dictionaryLearningSettings.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/voice-input/__tests__/overlayRetryGate.test.ts": {+ "sourceReads": 2+ },+ "apps/desktop/src/renderer/voice-input/__tests__/startCue.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/voice-input/__tests__/voiceInputHistory.test.ts": {+ "resetModules": 1+ },+ "apps/desktop/src/renderer/voice-input/__tests__/VoiceInputSection.recordingGate.test.ts": {+ "sourceReads": 9+ },+ "apps/desktop/src/renderer/voice-input/__tests__/WebMicAudioEngine.keepAliveIdle.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/agentCapabilitiesCache.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/cacheWriteNotice.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/chatServerEndpointDiscovery.test.tsx": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/clientEndpointStartup.test.ts": {+ "resetModules": 12+ },+ "apps/mobile/src/__tests__/codeHighlight.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/CompanionMemoryPage.test.tsx": {+ "realWaits": 2+ },+ "apps/mobile/src/__tests__/composerPlugins.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/devCacheMenu.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/deviceCatalogRefresh.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/devServerEnvironment.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/durableOutboxFiles.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/endpointManifestLoader.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/fingerprintConfig.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/incomingShareFeedbackScript.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/incomingShareNative.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/iosAppDistribution.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/messageActionDesktopFirst.test.ts": {+ "sourceReads": 3+ },+ "apps/mobile/src/__tests__/messageCacheStorage.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/mobileSpeakerFilterStorage.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/mobileTapdb.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/mobileVoiceCue.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/mobileVoiceHistoryStore.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/newSession.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/outboxHistoryCache.test.ts": {+ "realWaits": 1,+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/remoteHistoryReentry.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/remoteResourceCache.test.ts": {+ "resetModules": 2+ },+ "apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts": {+ "sourceReads": 1+ },+ "apps/mobile/src/__tests__/useBotGroupChat.test.tsx": {+ "realWaits": 2+ },+ "apps/mobile/src/__tests__/useDeviceProviders.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/__tests__/visualMock.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/auth/__tests__/loginFirstLaunchGate.test.ts": {+ "resetModules": 1+ },+ "apps/mobile/src/debug/localDiagnostics.test.ts": {+ "resetModules": 1+ },+ "packages/design-tokens/src/__tests__/classification.test.ts": {+ "sourceReads": 1+ },+ "packages/design-tokens/src/__tests__/zero-wiring.test.ts": {+ "sourceReads": 8+ },+ "packages/lizi-im/src/feishu/__tests__/outboundFile.test.ts": {+ "sourceReads": 1+ },+ "packages/lizi-mcps/src/computer/computerMcpServer.test.ts": {+ "realWaits": 1+ },+ "packages/maker-cc-manager/__tests__/kill-pending-send.test.ts": {+ "realWaits": 1+ },+ "packages/maker-cc-manager/__tests__/sdk-handlers.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/claude-code/__tests__/auto-continued-turn-in-flight.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/claude-code/__tests__/extraDirs-rebuild.test.ts": {+ "sourceReads": 1+ },+ "packages/maker-core/src/agents/claude-code/__tests__/forward-loop-crash-teardown.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/claude-code/__tests__/plan-mode.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/codex/__tests__/device-hosted-guest.native.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/codex/goal-ownership.native.test.ts": {+ "realWaits": 1+ },+ "packages/maker-core/src/agents/codex/native-auto-review-policy.native.test.ts": {+ "sourceReads": 2+ },+ "packages/maker-core/src/agents/codex/native-auto-review-policy.test.ts": {+ "sourceReads": 2+ },+ "packages/maker-core/src/agents/pi/__tests__/cindySubagentForeground.test.ts": {+ "realWaits": 2+ },+ "packages/maker-core/src/agents/pi/__tests__/cindySubagentParentWatchdog.test.ts": {+ "realWaits": 2+ },+ "packages/maker-core/src/agents/pi/__tests__/cindySubagentRunner.test.ts": {+ "realWaits": 2+ },+ "packages/maker-core/src/agents/pi/__tests__/cindySubagentSource.test.ts": {+ "sourceReads": 3+ },+ "packages/maker-core/src/agents/pi/__tests__/pi-auto-review-dispatch.test.ts": {+ "sourceReads": 1+ },+ "packages/maker-core/src/agents/pi/__tests__/pi-extra-dirs-prompt.test.ts": {+ "sourceReads": 1+ },+ "packages/maker-core/src/agents/pi/__tests__/pi-startsession-cleanup.test.ts": {+ "realWaits": 21,+ "sourceReads": 3+ },+ "packages/maker-core/src/agents/pi/__tests__/pi-subagent-runs.test.ts": {+ "realWaits": 3,+ "sourceReads": 2+ },+ "packages/maker-core/src/agents/shared/token-speed.test.ts": {+ "realWaits": 6+ },+ "packages/maker-core/src/session.origin.test.ts": {+ "realWaits": 3+ },+ "packages/maker-core/src/session.vision-bridge.test.ts": {+ "realWaits": 2+ },+ "packages/maker-pi-manager/src/__tests__/concurrency.test.ts": {+ "realWaits": 2+ },+ "packages/maker-pi-manager/src/__tests__/server.test.ts": {+ "realWaits": 5+ },+ "packages/maker-shared/src/__tests__/remoteDesktopViewerSource.test.ts": {+ "sourceReads": 1+ },+ "packages/model-providers/src/__tests__/piNativeCatalog.test.ts": {+ "resetModules": 2+ },+ "packages/remote-file-service/src/__tests__/rpc.test.ts": {+ "realWaits": 2+ }+ }+}diff --cc scripts/test-workspaces.config.mjsindex 36dc4040ed,eaae4f510c..894544794e--- a/scripts/test-workspaces.config.mjs+++ b/scripts/test-workspaces.config.mjs@@@ -95,124 -95,6 +95,126 @@@ const makerPiManagerIntegrationIncludeconst desktopE2eInclude = ['src/main/maker-host/__tests__/*.e2e.test.ts',];+const mobileGuardInclude = [+ 'src/auth/__tests__/loginHandoffState.test.ts',+ 'src/__tests__/accountDeletion.test.ts',+ 'src/__tests__/androidSessionInteractionParity.test.tsx',+ 'src/__tests__/chatQuoteCrossDevice.test.ts',+ 'src/__tests__/edgeBlurMask.test.ts',+ 'src/__tests__/filePreviewPagerWiring.test.ts',+ 'src/__tests__/forcedUpdateGate.test.ts',+ 'src/__tests__/historyWindowBackfillWiring.test.ts',+ 'src/__tests__/homeChromeMenusAndroid.test.ts',+ 'src/__tests__/homeDesktopFirst.test.ts',+ 'src/__tests__/inactiveSessionListSubscriptions.test.ts',+ 'src/__tests__/mobileGoalCommands.test.ts',+ 'src/__tests__/mobilePiRosterSessionBinding.test.ts',+ 'src/__tests__/mobilePresentationRefresh.test.ts',+ 'src/__tests__/mobileProviderLogo.test.ts',+ 'src/__tests__/optimisticSessionComposer.test.ts',+ 'src/__tests__/orcaCollabScreenWiring.test.ts',+ 'src/__tests__/orphanSessionActions.test.ts',+ 'src/__tests__/pastedImageAttachment.test.ts',+ 'src/__tests__/sessionSwipe.test.ts',+ 'src/__tests__/sendingQueueBadge.test.ts',+ 'src/__tests__/sessionAgentSwitchWiring.test.ts',+ 'src/__tests__/sessionListRemoteAgentMark.test.ts',+ 'src/__tests__/sessionMessageMemoryWiring.test.ts',+ 'src/__tests__/sessionSendHiddenModelSheet.test.ts',+ 'src/__tests__/sessionTitleProjection.test.ts',+ 'src/__tests__/startupSplashOverlay.test.ts',+ 'src/__tests__/statusBarVcMigration.test.ts',+];+// Static source-contract checks (security, permission, and design rules) run+// in the explicit guard tier. Keeping an exact allowlist makes it impossible+// for a new source scan to silently become part of the ordinary unit gate.+const desktopGuardInclude = [+ 'src/main/__tests__/authCaptchaIpcSecurity.test.ts',+ 'src/main/__tests__/appearanceUtilityWindowRegistration.test.ts',+ 'src/main/__tests__/authSameOwnerRefreshUi.test.ts',+ 'src/main/__tests__/browserRuntimeDirStartup.test.ts',+ 'src/main/__tests__/clearSessionHandoffOrdering.test.ts',+ 'src/main/__tests__/dbSlimmingIpcSecurity.test.ts',+ 'src/main/__tests__/deviceLinkAutoTitleWiring.test.ts',+ 'src/main/__tests__/deviceLinkInputSteerDedupeWiring.test.ts',+ 'src/main/__tests__/endpointEnvUsageGuard.test.ts',+ 'src/main/__tests__/gitContextIpcSecurity.test.ts',+ 'src/main/__tests__/isolatedOnProductionProfileStartup.test.ts',+ 'src/main/__tests__/invokeCaptureHealthOrdering.test.ts',+ 'src/main/__tests__/modelVisibilityOwnerClaimOrdering.test.ts',+ 'src/main/__tests__/piSubagentQuitEscalation.test.ts',+ 'src/main/__tests__/piSubagentUpdateRelaunchGate.test.ts',+ 'src/main/__tests__/remoteAgentSetModelWiring.test.ts',+ 'src/main/__tests__/writableDirectoryGrantWiring.test.ts',+ 'src/main/__tests__/windowThemeVibrancyIpcSecurity.test.ts',+ // This contract executes the exported close-generation functions in isolation because importing+ // the full device-link singleton would start Electron runtime wiring. Keep it in the explicit+ // guard tier rather than letting its source extraction enter ordinary unit tests.+ 'src/main/mcp-apps/__tests__/remoteViews.test.ts',+ 'src/renderer/features/cc-agent/sidebar/__tests__/sessionCardReviewRegressions.test.ts',+ 'src/renderer/__tests__/orcaModelWindowSelection.test.ts',+ 'src/renderer/__tests__/markdownRendererXdtAudio.test.ts',++ 'src/renderer/__tests__/markdownDiffBlock.test.ts',+ 'src/renderer/__tests__/bulkSessionStatusRouting.test.ts',+ 'src/renderer/__tests__/homeUsageDashboardSource.test.ts',+ 'src/renderer/features/plugin/__tests__/unreadDotMotion.test.ts',+ 'src/renderer/__tests__/workdirBrowseRemoteSafety.test.ts',+ 'src/renderer/__tests__/remoteAgentRelocationWiring.test.ts',+ 'src/renderer/features/bots/__tests__/botPermissionSwitch.test.ts',++ 'src/renderer/features/bots/__tests__/botChatSurface.test.ts',+ 'src/main/cindy-brain/__tests__/forgeOidcInstallEntry.test.ts',+ 'src/main/cindy-brain/__tests__/forge.connection.test.ts',+ 'src/main/cindy-brain/__tests__/forge.oauth.test.ts',+ 'src/main/cindy-brain/__tests__/sessionFocusRetryContract.test.ts',+ 'src/main/cindy-brain/__tests__/ghostDevRuntimeContract.test.ts',+ 'src/main/cindy-brain/__tests__/ghostIpcMutationLease.test.ts',+ 'src/main/cindy-brain/__tests__/ghostIpcSenderTrust.test.ts',+ 'src/main/cindy-brain/__tests__/ghostLocalUpdateSource.wiring.test.ts',+ 'src/main/cindy-brain/__tests__/librarySaveAsDialogParent.test.ts',+ 'src/main/cindy-brain/__tests__/marketGhostSessionBoundary.test.ts',+ 'src/main/cindy-media/__tests__/ccAgentWriteGuard.test.ts',+ 'src/main/im/telegram/__tests__/uiText.test.ts',+ 'src/main/maker-ipc/__tests__/botMainDependencies.test.ts',+ 'src/main/maker-ipc/__tests__/botCompactContinuity.test.ts',+ 'src/main/maker-ipc/__tests__/remoteSessionMakerMemory.test.ts',+ 'src/main/maker-ipc/__tests__/scheduleProviderDiscoveryWiring.test.ts',+ 'src/main/maker-ipc/__tests__/sendToSessionLazyResumePermission.test.ts',+ 'src/main/maker-ipc/__tests__/sessionTreeProviderResume.test.ts',+ 'src/main/device-link/__tests__/ownershipAccountSource.test.ts',+ 'src/main/maker-host/__tests__/codexModelBackfillWiring.test.ts',+ 'src/main/maker-ipc/__tests__/orcaUiAssignmentWiring.test.ts',+ 'src/main/remote-ssh/__tests__/ccManagerInstallSource.test.ts',+ 'src/main/utility-model/__tests__/auxiliaryCustomNoAgentFallback.test.ts',+ 'src/main/workdir-probe-host/__tests__/WorkdirProbeHostPackaging.test.ts',+ 'src/main/embedding-host/__tests__/hostLifecycle.test.ts',+ 'src/main/maker-ipc/__tests__/messageSourceNote.test.ts',+ 'src/main/usage/__tests__/accountUsageLimit.test.ts',+ 'src/renderer/__tests__/compactComposerTypography.test.ts',+ 'src/renderer/__tests__/chatInputModelSelectorRouting.test.ts',+ 'src/renderer/__tests__/chatInputSessionFocus.test.ts',+ 'src/renderer/__tests__/chatClickabilitySignal.test.ts',+ 'src/renderer/__tests__/controlledBannerPlacement.test.ts',+ 'src/renderer/__tests__/controlledDraftRemoteAgentWiring.test.ts',+ 'src/renderer/__tests__/deviceLinkInteractionScenarios.test.ts',+ 'src/renderer/__tests__/dialogueSidebarSection.test.ts',+ 'src/renderer/__tests__/dialogScrimDismissal.test.ts',+ 'src/renderer/__tests__/disabledCursorVisualContract.test.ts',+ 'src/renderer/__tests__/makerExperimentalThemeContract.test.ts',+ 'src/renderer/__tests__/iconButtonTooltips.test.ts',+ 'src/renderer/__tests__/modalSurfaceContract.test.ts',+ 'src/renderer/__tests__/orcaWorkflowRoute.test.ts',+ 'src/renderer/__tests__/projectsSidebarSection.test.ts',+ 'src/renderer/__tests__/remoteWorkerCreationContext.test.ts',+ 'src/renderer/__tests__/remoteAgentModelMemoryWiring.test.ts',+ 'src/renderer/__tests__/orcaRemoteRoutingInvariants.test.ts',+ 'src/renderer/__tests__/sidebarCollapseResetSource.test.ts',+ 'src/renderer/__tests__/sessionContentHeaderDragRegion.test.ts',+ 'src/renderer/__tests__/sessionTitleProjectionOutlets.test.ts',+ 'src/renderer/__tests__/shareSelectionContainment.test.ts',+ 'src/renderer/__tests__/toastZIndex.test.ts',+ 'src/renderer/__tests__/unsupportedTextPreview.test.ts',+ 'src/renderer/hooks/__tests__/useCCAgentChatHiddenFreeze.test.tsx',+];export function desktopUnitWorkerCount(availableParallelism = os.availableParallelism(),