From ddfa8544a46bbf6a3687a2e04ee2a05873bdd9a9 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Sat, 24 Oct 2026 11:30:03 -0700 Subject: [PATCH] test: remove shallow capability checks and repair boundary assertions (#33224) Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> --- ...claude-profile-activation-contract.test.ts | 19 ------------------ src/shared/file-inventory-budget.test.ts | 2 +- src/shared/machine-name.test.ts | 6 +++--- ...rchive-failure-blocking-capability.test.ts | 20 ------------------- 4 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 src/shared/claude-profile-activation-contract.test.ts delete mode 100644 src/shared/worktree/archive-failure-blocking-capability.test.ts diff --git a/src/shared/claude-profile-activation-contract.test.ts b/src/shared/claude-profile-activation-contract.test.ts deleted file mode 100644 index 1d535e22e23..00000000000 --- a/src/shared/claude-profile-activation-contract.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { expect, it } from 'vitest' -import { CLAUDE_SIGN_IN_RUNTIME_CAPABILITY } from './account-runtime-capabilities' -import { RUNTIME_CAPABILITIES } from './protocol-version' -import { - buildWslInteractiveLoginShellCommand, - buildWslLoginShellCommand -} from './wsl-login-shell-command' -import { getFishClaudeShellFunction } from './claude-shell-function' - -it('advertises the Claude sign-in the CLI needs before it starts a login', () => { - expect([...RUNTIME_CAPABILITIES]).toContain(CLAUDE_SIGN_IN_RUNTIME_CAPABILITY) -}) - -it('gives a WSL fish pane the account function, and leaves other WSL commands alone', () => { - const pane = buildWslInteractiveLoginShellCommand() - expect(pane).toContain('"$_orca_wsl_shell" -l -C') - expect(getFishClaudeShellFunction()).toContain('ORCA_CLAUDE_PROFILE_POINTER') - expect(buildWslLoginShellCommand('true')).not.toContain('fish') -}) diff --git a/src/shared/file-inventory-budget.test.ts b/src/shared/file-inventory-budget.test.ts index d54493a5016..0ec045d548c 100644 --- a/src/shared/file-inventory-budget.test.ts +++ b/src/shared/file-inventory-budget.test.ts @@ -10,7 +10,7 @@ it('accepts the retained-byte boundary and rejects the next entry', () => { it('charges serialized escaping and rejects an oversized individual path', () => { const escaped = new FileInventoryBudget(100) - expect(() => escaped.record('\u0001'.repeat(20))).toThrow(FileInventoryCapacityError) + expect(() => escaped.record('\u0001'.repeat(18))).toThrow(FileInventoryCapacityError) expect(() => new FileInventoryBudget().record('x'.repeat(65537))).toThrow( FileInventoryCapacityError ) diff --git a/src/shared/machine-name.test.ts b/src/shared/machine-name.test.ts index 0131c885edc..941ab2c2255 100644 --- a/src/shared/machine-name.test.ts +++ b/src/shared/machine-name.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { MACHINE_NAME_MAX_LENGTH, normalizeMachineName } from './machine-name' +import { normalizeMachineName } from './machine-name' describe('normalizeMachineName', () => { it('trims surrounding whitespace', () => { @@ -7,8 +7,8 @@ describe('normalizeMachineName', () => { }) it('caps the stored length after trimming', () => { - const long = ` ${'x'.repeat(MACHINE_NAME_MAX_LENGTH + 20)} ` - expect(normalizeMachineName(long)).toHaveLength(MACHINE_NAME_MAX_LENGTH) + expect(normalizeMachineName(` ${'x'.repeat(255)} `)).toBe('x'.repeat(255)) + expect(normalizeMachineName(` ${'x'.repeat(256)} `)).toBe('x'.repeat(255)) }) it('reads anything that is not a string as the detected-name default', () => { diff --git a/src/shared/worktree/archive-failure-blocking-capability.test.ts b/src/shared/worktree/archive-failure-blocking-capability.test.ts deleted file mode 100644 index be6e010fc5e..00000000000 --- a/src/shared/worktree/archive-failure-blocking-capability.test.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - RUNTIME_CAPABILITIES, - WORKTREE_ARCHIVE_FAILURE_BLOCKING_RUNTIME_CAPABILITY -} from '../protocol-version' - -// Why (#19334): the reporter's integration (Harbour) keeps its teardown ownership evidence inside -// the checkout, so it must know *before* removing anything whether this host refuses to delete on a -// failed archive hook. It cannot probe for that — probing means risking the data loss. -describe('worktree.archive-failure-blocking.v1', () => { - it('uses the id the reporting integration already codes against', () => { - expect(WORKTREE_ARCHIVE_FAILURE_BLOCKING_RUNTIME_CAPABILITY).toBe( - 'worktree.archive-failure-blocking.v1' - ) - }) - - it('is advertised by every build that carries the gate', () => { - expect(RUNTIME_CAPABILITIES).toContain(WORKTREE_ARCHIVE_FAILURE_BLOCKING_RUNTIME_CAPABILITY) - }) -})