
























@@ -75,9 +75,11 @@ export const forcedUnitFastTestFiles = [
7575"src/browser-lifecycle-cleanup.test.ts",
7676"src/canvas-host/server.test.ts",
7777"src/crestodian/audit.test.ts",
78+"src/crestodian/assistant.configured.test.ts",
7879"src/crestodian/crestodian.test.ts",
7980"src/crestodian/operations.test.ts",
8081"src/crestodian/overview.test.ts",
82+"src/crestodian/rescue-policy.test.ts",
8183"src/crestodian/rescue-message.test.ts",
8284"src/crestodian/tui-backend.test.ts",
8385"src/flows/channel-setup.test.ts",
@@ -91,8 +93,11 @@ export const forcedUnitFastTestFiles = [
9193"src/docker-image-digests.test.ts",
9294"src/dockerfile.test.ts",
9395"src/entry.compile-cache.test.ts",
96+"src/entry.respawn.test.ts",
97+"src/entry.version-fast-path.test.ts",
9498"src/entry.test.ts",
9599"src/flows/doctor-startup-channel-maintenance.test.ts",
100+"src/flows/search-setup.test.ts",
96101"src/i18n/registry.test.ts",
97102"src/image-generation/openai-compatible-image-provider.test.ts",
98103"src/install-sh-version.test.ts",
@@ -103,6 +108,7 @@ export const forcedUnitFastTestFiles = [
103108"src/memory-host-sdk/host/batch-http.test.ts",
104109"src/memory-host-sdk/host/backend-config.test.ts",
105110"src/memory-host-sdk/host/embeddings-remote-fetch.test.ts",
111+"src/memory-host-sdk/host/mirror.test.ts",
106112"src/memory-host-sdk/host/post-json.test.ts",
107113"src/memory-host-sdk/host/session-files.test.ts",
108114"src/music-generation/runtime.test.ts",
@@ -118,33 +124,45 @@ export const forcedUnitFastTestFiles = [
118124"src/plugin-activation-boundary.test.ts",
119125"src/plugin-sdk/memory-host-events.test.ts",
120126"src/proxy-capture/runtime.test.ts",
127+"src/proxy-capture/proxy-server.test.ts",
121128"src/proxy-capture/store.sqlite.test.ts",
122129"src/realtime-voice/agent-consult-runtime.test.ts",
123130"src/realtime-voice/session-runtime.test.ts",
124131"src/security/audit-channel-dm-policy.test.ts",
132+"src/security/audit-channel-source-config-slack.test.ts",
125133"src/security/audit-channel-readonly-resolution.test.ts",
134+"src/security/audit-config-symlink.test.ts",
126135"src/security/audit-exec-surface.test.ts",
136+"src/security/audit-exec-sandbox-host.test.ts",
127137"src/security/audit-exec-safe-bins.test.ts",
128138"src/security/dangerous-config-flags.test.ts",
129139"src/security/audit-extra.sync.test.ts",
130140"src/security/audit-filesystem-windows.test.ts",
131141"src/security/audit-gateway-exposure.test.ts",
142+"src/security/audit-gateway-auth-selection.test.ts",
143+"src/security/audit-gateway-http-auth.test.ts",
144+"src/security/audit-gateway-tools-http.test.ts",
132145"src/security/audit-sandbox-docker-config.test.ts",
146+"src/security/audit-sandbox-browser.test.ts",
133147"src/security/safe-regex.test.ts",
134148"src/security/audit-small-model-risk.test.ts",
135149"src/security/audit-node-command-findings.test.ts",
136150"src/security/audit-extra.async.test.ts",
137151"src/security/audit-trust-model.test.ts",
138152"src/security/dm-policy-shared.test.ts",
139153"src/security/audit-plugins-trust.test.ts",
154+"src/security/audit-plugin-readonly-scope.test.ts",
155+"src/security/audit-loopback-logging.test.ts",
140156"src/security/audit-workspace-skill-escape.test.ts",
141157"src/security/external-content.test.ts",
142158"src/security/fix.test.ts",
143159"src/security/scan-paths.test.ts",
144160"src/security/skill-scanner.test.ts",
145161"src/security/audit-config-include-perms.test.ts",
146162"src/realtime-transcription/websocket-session.test.ts",
163+"src/realtime-voice/agent-consult-tool.test.ts",
147164"src/routing/resolve-route.test.ts",
165+"src/sessions/transcript-events.test.ts",
148166"src/security/windows-acl.test.ts",
149167"src/trajectory/cleanup.test.ts",
150168"src/trajectory/export.test.ts",
@@ -154,13 +172,15 @@ export const forcedUnitFastTestFiles = [
154172"src/tts/provider-registry.test.ts",
155173"src/tts/status-config.test.ts",
156174"src/tts/tts-config.test.ts",
175+"src/ui-app-settings.agents-files-refresh.test.ts",
157176"src/terminal/restore.test.ts",
158177"src/terminal/table.test.ts",
159178"src/test-helpers/state-dir-env.test.ts",
160179"src/test-utils/env.test.ts",
161180"src/test-utils/temp-home.test.ts",
162181"src/utils.test.ts",
163182"src/version.test.ts",
183+"src/video-generation/provider-registry.test.ts",
164184];
165185const forcedUnitFastTestFileSet = new Set(forcedUnitFastTestFiles);
166186const unitFastCandidateExactFiles = [...pluginSdkLightTestFiles, ...commandsLightTestFiles];
@@ -269,6 +289,21 @@ function walkFiles(directory, files = []) {
269289return files;
270290}
271291292+const walkedTestFilesByCwd = new Map();
293+294+function collectRepoTestFiles(cwd) {
295+const normalizedCwd = normalizeRepoPath(cwd);
296+const cached = walkedTestFilesByCwd.get(normalizedCwd);
297+if (cached) {
298+return cached;
299+}
300+const files = ["src", "packages", "test"]
301+.flatMap((directory) => walkFiles(path.join(cwd, directory)))
302+.map((file) => normalizeRepoPath(path.relative(cwd, file)));
303+walkedTestFilesByCwd.set(normalizedCwd, files);
304+return files;
305+}
306+272307export function classifyUnitFastTestFileContent(source) {
273308const reasons = [];
274309for (const { code, pattern } of disqualifyingPatterns) {
@@ -280,39 +315,40 @@ export function classifyUnitFastTestFileContent(source) {
280315}
281316282317export function collectUnitFastTestCandidates(cwd = process.cwd()) {
283-const discovered = ["src", "packages", "test"]
284-.flatMap((directory) => walkFiles(path.join(cwd, directory)))
285-.map((file) => normalizeRepoPath(path.relative(cwd, file)))
286-.filter(
287-(file) =>
288-matchesAnyGlob(file, unitFastCandidateGlobs) &&
289-!matchesAnyGlob(file, broadUnitFastCandidateSkipGlobs),
290-);
318+const discovered = collectRepoTestFiles(cwd).filter(
319+(file) =>
320+matchesAnyGlob(file, unitFastCandidateGlobs) &&
321+!matchesAnyGlob(file, broadUnitFastCandidateSkipGlobs),
322+);
291323return [
292324 ...new Set([...discovered, ...unitFastCandidateExactFiles, ...forcedUnitFastTestFiles]),
293325].toSorted((a, b) => a.localeCompare(b));
294326}
295327296328export function collectBroadUnitFastTestCandidates(cwd = process.cwd()) {
297-const discovered = ["src", "packages", "test"]
298-.flatMap((directory) => walkFiles(path.join(cwd, directory)))
299-.map((file) => normalizeRepoPath(path.relative(cwd, file)))
300-.filter(
301-(file) =>
302-matchesAnyGlob(file, broadUnitFastCandidateGlobs) &&
303-!matchesAnyGlob(file, broadUnitFastCandidateSkipGlobs),
304-);
329+const discovered = collectRepoTestFiles(cwd).filter(
330+(file) =>
331+matchesAnyGlob(file, broadUnitFastCandidateGlobs) &&
332+!matchesAnyGlob(file, broadUnitFastCandidateSkipGlobs),
333+);
305334return [
306335 ...new Set([...discovered, ...unitFastCandidateExactFiles, ...forcedUnitFastTestFiles]),
307336].toSorted((a, b) => a.localeCompare(b));
308337}
309338339+const unitFastAnalysisByKey = new Map();
340+310341export function collectUnitFastTestFileAnalysis(cwd = process.cwd(), options = {}) {
342+const cacheKey = `${normalizeRepoPath(cwd)}\0${options.scope ?? "default"}`;
343+const cached = unitFastAnalysisByKey.get(cacheKey);
344+if (cached) {
345+return cached;
346+}
311347const candidates =
312348options.scope === "broad"
313349 ? collectBroadUnitFastTestCandidates(cwd)
314350 : collectUnitFastTestCandidates(cwd);
315-return candidates.map((file) => {
351+const analysis = candidates.map((file) => {
316352const absolutePath = path.join(cwd, file);
317353let source = "";
318354try {
@@ -333,6 +369,8 @@ export function collectUnitFastTestFileAnalysis(cwd = process.cwd(), options = {
333369 reasons,
334370};
335371});
372+unitFastAnalysisByKey.set(cacheKey, analysis);
373+return analysis;
336374}
337375338376let cachedUnitFastTestFiles = null;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。