refactor: Remove dead code and stale references (#2062)

Remove orphaned sh/test/fixtures/ directory. These shell fixture files
(_shared_agent_assertions.sh, hetzner/_env.sh, hetzner/_api_assertions.sh,
digitalocean/_env.sh, digitalocean/_api_assertions.sh) were part of a mock
test harness (mock.sh) that was removed from the repository. The fixture
files reference `assert_api_called` and `MOCK_LOG` variables that are never
defined anywhere, confirming they are unreachable dead code.

Scan results:
- Dead code (sh/test/fixtures/): 5 orphaned fixture files removed
- Dead code (sh/shared, packages/cli/src/): none found
- Stale references to non-existent files: none found
- Python usage (python3 -c / python -c): none found
- Duplicate utilities across cloud modules: loadTokenFromConfig pattern
  exists in hetzner/daytona/digitalocean but reads from different cloud-
  specific config paths — cannot be consolidated (confirmed intentional)
- Stale comments: none found beyond those already fixed in prior PRs

-- qa/code-quality

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-01 08:45:24 -08:00 committed by GitHub
parent 3fa0c82c91
commit add83bbd6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 0 additions and 63 deletions

View file

@ -1,51 +0,0 @@
#!/bin/bash
# Shared per-agent install assertions
# Verifies each agent script uses the correct install method
#
# Source this file and call assert_agent_install CLOUD AGENT. Expects:
# MOCK_LOG — path to the mock call log
# PASSED / FAILED — counters (updated in-place)
# GREEN / RED / NC — color codes
# Internal: assert a grep pattern appears in MOCK_LOG
_assert_install_pattern() {
local pattern="$1"
local msg="$2"
if grep -qE "${pattern}" "${MOCK_LOG}" 2>/dev/null; then
printf '%b\n' " ${GREEN}${NC} ${msg}"
PASSED=$((PASSED + 1))
else
printf '%b\n' " ${RED}${NC} ${msg}"
FAILED=$((FAILED + 1))
fi
}
assert_agent_install() {
local cloud="$1"
local agent="$2"
case "$agent" in
claude)
# install_claude_code finalization always runs "claude install --force"
# (mock claude binary is pre-installed, so curl installer is skipped)
_assert_install_pattern "claude.*install" "installs claude code" ;;
openclaw)
# npm install -g openclaw (Node runtime needs standard node_modules layout)
_assert_install_pattern "npm.*install.*openclaw" "installs openclaw via npm" ;;
codex)
# npm install -g @openai/codex
_assert_install_pattern "npm.*install.*codex" "installs codex via npm" ;;
opencode)
# curl to download opencode tarball (via opencode_install_cmd)
_assert_install_pattern "opencode" "installs opencode" ;;
kilocode)
# npm install -g @kilocode/cli
_assert_install_pattern "npm.*install.*kilocode" "installs kilocode via npm" ;;
zeroclaw)
# curl installer from zeroclaw-labs/zeroclaw repo
_assert_install_pattern "zeroclaw" "installs zeroclaw" ;;
*)
# Unknown agent — skip assertion (no failure)
return 0 ;;
esac
}

View file

@ -1,2 +0,0 @@
assert_api_called "GET" "/account/keys" "fetches SSH keys"
assert_api_called "POST" "/droplets" "creates droplet"

View file

@ -1,4 +0,0 @@
export DO_API_TOKEN="test-token-do"
export DO_DROPLET_NAME="test-srv"
export DO_DROPLET_SIZE="s-2vcpu-2gb"
export DO_REGION="nyc3"

View file

@ -1,2 +0,0 @@
assert_api_called "GET" "/ssh_keys" "fetches SSH keys"
assert_api_called "POST" "/servers" "creates server"

View file

@ -1,4 +0,0 @@
export HCLOUD_TOKEN="test-token-hetzner"
export HETZNER_SERVER_NAME="test-srv"
export HETZNER_SERVER_TYPE="cx23"
export HETZNER_LOCATION="fsn1"