chore: remove backend code nothing references

Found with knip (exports, types, class members) and confirmed by a text
search of src, test, scripts and packages before each removal.

- Per-CLI get<Cli>NotFoundMessage() (nine of them) with their message
  constants: missingCliMessage() builds that text from the registry now.
- Registry leftovers: renderCliCommand, asCliId, cliIds, isCliRunnable,
  createCliResolverForTest, profileExists, and two name lists that only
  repeated schema enums.
- A task-description cache in Session that was written on every chunk of
  terminal output (one regex pass per line) and never read since the
  subagent watcher takes descriptions from transcripts. The cache module,
  its pattern and both parse methods go with it.
- Session.parentAgentId / childAgentIds: never set by anything, so the two
  optional SessionState fields were never on the wire.
- Unreferenced methods on TmuxManager (pipe-pane pair, syncMouseMode),
  RespawnController, StateStore.recoverFromBackup (load() already falls
  back to the .bak file), TeamWatcher, SseStreamManager and the AI
  checkers' getErrorVerdict.
- updateCaseEnvVars: the settings.local.json env path that envOverrides
  replaced.
- Re-exports in the utils, cli-registry, routes and prompts barrels that
  no importer used, and unused test helpers (MockStateStore, the mobile
  throttle helpers and others).

Eight mobile tests imported the WebServer type from a path that does not
exist (../src instead of ../../src); type-only, so nothing failed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-13 13:58:22 +01:00
1 parent 60f1900081
commit f604deba3e
57 files changed
+36 -963

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ import {
assertZoomNotDisabled, getCSSProperty,
} from './helpers/assertions.js';
import { REPRESENTATIVE_DEVICES } from './devices.js';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
let baseUrl: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// Ephemeral port - Cross-device parametric tests
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import type { BrowserContext, Page } from 'playwright';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
import { createTestServer, stopTestServer } from './helpers/server.js';
import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { SELECTORS, BREAKPOINTS, BODY_CLASSES } from './helpers/constants.js';
-7
View File
@@ -321,13 +321,6 @@ export const SMALL_TABLETS: DeviceEntry[] = DEVICE_REGISTRY.filter((d) => d.cate
export const STANDARD_TABLETS: DeviceEntry[] = DEVICE_REGISTRY.filter((d) => d.category === 'standard-tablet');
export const LARGE_TABLETS: DeviceEntry[] = DEVICE_REGISTRY.filter((d) => d.category === 'large-tablet');
// ---------------------------------------------------------------------------
// Platform exports
// ---------------------------------------------------------------------------
export const IOS_DEVICES: DeviceEntry[] = DEVICE_REGISTRY.filter((d) => d.isIOS);
export const ANDROID_DEVICES: DeviceEntry[] = DEVICE_REGISTRY.filter((d) => !d.isIOS);
// ---------------------------------------------------------------------------
// Representative devices — one per category for quick smoke tests
// ---------------------------------------------------------------------------
-15
View File
@@ -156,21 +156,6 @@ export async function assertNotHasClass(page: Page, selector: string, className:
expect(has).toBe(false);
}
/** Assert element's computed transform includes a translateY value */
export async function assertTranslateY(
page: Page,
selector: string,
expectedY: number,
tolerance: number = 2,
): Promise<void> {
const transform = await getCSSProperty(page, selector, 'transform');
// transform is a matrix(...) string; extract translateY
// matrix(a, b, c, d, tx, ty) — ty is the 6th value
const match = transform.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,[^,]+,\s*([^)]+)\)/);
const ty = match ? parseFloat(match[1]) : 0;
expect(Math.abs(ty - expectedY)).toBeLessThanOrEqual(tolerance);
}
/** Check viewport meta tag doesn't disable zoom */
export async function assertZoomNotDisabled(page: Page): Promise<void> {
const meta = await page.evaluate(() => {
-3
View File
@@ -60,6 +60,3 @@ export async function closeAllBrowsers(): Promise<void> {
}
}
export function isChromium(engine: 'chromium' | 'webkit'): boolean {
return engine === 'chromium';
}
-35
View File
@@ -39,38 +39,3 @@ export async function dispatchTouchEvent(
});
}
/** Throttle CPU to simulate mobile hardware (rate = slowdown factor, e.g. 4 = 4x slower) */
export async function setCPUThrottle(cdp: CDPSession, rate: number): Promise<void> {
await cdp.send('Emulation.setCPUThrottlingRate', { rate });
}
/** Clear CPU throttling */
export async function clearCPUThrottle(cdp: CDPSession): Promise<void> {
await cdp.send('Emulation.setCPUThrottlingRate', { rate: 1 });
}
/** Emulate network conditions */
export async function setNetworkThrottle(
cdp: CDPSession,
downloadKbps: number,
uploadKbps: number,
latencyMs: number,
): Promise<void> {
await cdp.send('Network.enable');
await cdp.send('Network.emulateNetworkConditions', {
offline: false,
downloadThroughput: (downloadKbps * 1024) / 8,
uploadThroughput: (uploadKbps * 1024) / 8,
latency: latencyMs,
});
}
/** Clear network throttling */
export async function clearNetworkThrottle(cdp: CDPSession): Promise<void> {
await cdp.send('Network.emulateNetworkConditions', {
offline: false,
downloadThroughput: -1,
uploadThroughput: -1,
latency: 0,
});
}
-10
View File
@@ -1,23 +1,13 @@
import { WebServer } from '../../../src/web/server.js';
const servers = new Set<WebServer>();
/** A test server on an ephemeral port; read the port from `server.boundPort` once this resolves. */
export async function createTestServer(): Promise<WebServer> {
const server = new WebServer(0, false, true); // testMode = true
await server.start();
servers.add(server);
return server;
}
export async function stopTestServer(server: WebServer): Promise<void> {
await server.stop();
servers.delete(server);
}
export async function stopAllTestServers(): Promise<void> {
for (const server of servers) {
await server.stop();
}
servers.clear();
}
-16
View File
@@ -243,19 +243,3 @@ export async function tapViaSynthetic(page: Page, selector: string): Promise<voi
}, selector);
}
/** Tap using the best available method */
export async function tap(
page: Page,
selector: string,
options: { isChromium?: boolean } = {},
): Promise<void> {
if (options.isChromium !== false) {
try {
await tapViaCDP(page, selector);
return;
} catch {
// Fall through
}
}
await tapViaSynthetic(page, selector);
}
+1 -1
View File
@@ -24,7 +24,7 @@ import {
getCSSProperty,
} from './helpers/assertions.js';
import { REPRESENTATIVE_DEVICES } from './devices.js';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
let baseUrl: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// Ephemeral port - General mobile layout tests
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import type { BrowserContext, Page } from 'playwright';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
import { createTestServer, stopTestServer } from './helpers/server.js';
import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { SELECTORS, BREAKPOINTS, BODY_CLASSES, WAIT, MIN_TOUCH_TARGET } from './helpers/constants.js';
+1 -1
View File
@@ -7,7 +7,7 @@ import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { showKeyboard, hideKeyboard } from './helpers/keyboard-sim.js';
import { assertVisible, assertHidden, getCSSProperty, getCSSNumericValue } from './helpers/assertions.js';
import { DEVICE_REGISTRY, REPRESENTATIVE_DEVICES } from './devices.js';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
let baseUrl: string;
+1 -1
View File
@@ -7,7 +7,7 @@ import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { showKeyboard, hideKeyboard } from './helpers/keyboard-sim.js';
import { getCSSProperty, getCSSNumericValue } from './helpers/assertions.js';
import { REPRESENTATIVE_DEVICES } from './devices.js';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
let baseUrl: string;
+1 -1
View File
@@ -7,7 +7,7 @@ import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { swipe, swipeViaCDP, swipeViaSynthetic } from './helpers/touch-sim.js';
import { assertHidden, assertVisible, getCSSProperty, getCSSNumericValue } from './helpers/assertions.js';
import { REPRESENTATIVE_DEVICES } from './devices.js';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
let baseUrl: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// Ephemeral port - Screenshot comparison tests
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import type { BrowserContext, Page } from 'playwright';
import type { WebServer } from '../src/web/server.js';
import type { WebServer } from '../../src/web/server.js';
import { createTestServer, stopTestServer } from './helpers/server.js';
import { createDevicePage, closeAllBrowsers } from './helpers/browser.js';
import { SELECTORS, VISUAL, VISUAL_BREAKPOINTS, WAIT } from './helpers/constants.js';