Files
wehub-resource-sync 23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:02:19 +08:00

223 lines
7.6 KiB
Bash
Executable File

#!/bin/bash
#
# V3 Repository Cleanup Script
# Removes build artifacts, backup files, and cleans up .gitignore
# Part of claude-flow v3 migration cleanup (Master Plan Section 5)
#
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Track cleanup stats
TOTAL_SAVED=0
FILES_REMOVED=0
echo -e "${BLUE}╔════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ Claude Flow V3 Repository Cleanup Script ║${NC}"
echo -e "${BLUE}║ Master Plan Section 5: Repository Cleanup ║${NC}"
echo -e "${BLUE}╚════════════════════════════════════════════════════════╝${NC}"
echo ""
# Function to calculate size
get_size() {
if [ -e "$1" ]; then
du -sh "$1" 2>/dev/null | awk '{print $1}'
else
echo "0"
fi
}
# Function to remove tracked files from git
remove_from_git() {
local path="$1"
local description="$2"
echo -e "${YELLOW}Processing: ${description}${NC}"
if git ls-files --error-unmatch "$path" > /dev/null 2>&1; then
local size=$(get_size "$path")
echo " Found tracked: $path (Size: $size)"
if [ "$DRY_RUN" = true ]; then
echo " [DRY RUN] Would remove from git: $path"
else
git rm -r --cached "$path" 2>/dev/null || true
echo -e " ${GREEN}✓ Removed from git tracking${NC}"
FILES_REMOVED=$((FILES_REMOVED + 1))
fi
else
echo " Not tracked in git (will be ignored by .gitignore)"
fi
}
# Function to delete files
delete_files() {
local pattern="$1"
local description="$2"
echo -e "${YELLOW}Deleting: ${description}${NC}"
local files=$(find . -type f -path "$pattern" ! -path "*/node_modules/*" ! -path "*/.git/*" 2>/dev/null)
if [ -z "$files" ]; then
echo " No files found matching pattern"
return
fi
while IFS= read -r file; do
if [ -f "$file" ]; then
local size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null || echo "0")
TOTAL_SAVED=$((TOTAL_SAVED + size))
if [ "$DRY_RUN" = true ]; then
echo " [DRY RUN] Would delete: $file"
else
rm -f "$file"
echo " ${GREEN}✓ Deleted: $file${NC}"
FILES_REMOVED=$((FILES_REMOVED + 1))
fi
fi
done <<< "$files"
}
# Parse arguments
DRY_RUN=false
if [ "$1" = "--dry-run" ]; then
DRY_RUN=true
echo -e "${YELLOW}Running in DRY RUN mode - no changes will be made${NC}"
echo ""
fi
echo -e "${BLUE}Step 1: Remove tracked build artifacts (dist-cjs/)${NC}"
echo "----------------------------------------"
if [ -d "v2/dist-cjs" ]; then
remove_from_git "v2/dist-cjs" "CommonJS build artifacts (v2/dist-cjs/)"
if [ "$DRY_RUN" = false ]; then
echo " Ensuring dist-cjs is in .gitignore..."
if ! grep -q "^dist-cjs/" .gitignore; then
echo "dist-cjs/" >> .gitignore
echo -e " ${GREEN}✓ Added dist-cjs/ to .gitignore${NC}"
fi
fi
else
echo " No dist-cjs directory found"
fi
echo ""
echo -e "${BLUE}Step 2: Delete backup files in bin/${NC}"
echo "----------------------------------------"
delete_files "*/bin/*-old.js" "Old JavaScript files (*-old.js)"
delete_files "*/bin/*.backup.js" "Backup JavaScript files (*.backup.js)"
delete_files "*/bin/*.bak" "Backup files (*.bak)"
echo ""
echo -e "${BLUE}Step 3: Delete backup files in docs/reasoningbank/models/${NC}"
echo "----------------------------------------"
delete_files "*/docs/reasoningbank/models/*.backup" "Model backup files (*.backup)"
echo ""
echo -e "${BLUE}Step 4: Delete other backup files${NC}"
echo "----------------------------------------"
delete_files "*/src/**/*-old.*" "Old source files (*-old.*)"
delete_files "*/src/**/*.backup" "Source backup files (*.backup)"
delete_files "*/dist-cjs/**/*-old.*" "Old build files in dist-cjs"
echo ""
echo -e "${BLUE}Step 5: Clean up .gitignore duplicates${NC}"
echo "----------------------------------------"
if [ "$DRY_RUN" = true ]; then
echo "[DRY RUN] Would check for duplicate entries in .gitignore"
else
# Create temporary file with unique entries
sort .gitignore | uniq > .gitignore.tmp
# Count duplicates
ORIG_LINES=$(wc -l < .gitignore)
NEW_LINES=$(wc -l < .gitignore.tmp)
DUPLICATES=$((ORIG_LINES - NEW_LINES))
if [ $DUPLICATES -gt 0 ]; then
mv .gitignore.tmp .gitignore
echo -e " ${GREEN}✓ Removed $DUPLICATES duplicate entries from .gitignore${NC}"
else
rm .gitignore.tmp
echo " No duplicate entries found in .gitignore"
fi
# Check for specific known duplicates
DIST_COUNT=$(grep -c "^dist/$" .gitignore || echo "0")
DS_STORE_COUNT=$(grep -c "^\.DS_Store$" .gitignore || echo "0")
LOG_COUNT=$(grep -c "^\*\.log$\|^yarn-debug\.log\*$\|^yarn-error\.log\*$\|^lerna-debug\.log\*$" .gitignore | head -1)
echo " Duplicate pattern check:"
echo " - dist/ entries: $DIST_COUNT"
echo " - .DS_Store entries: $DS_STORE_COUNT"
echo " - Log file patterns: $LOG_COUNT"
fi
echo ""
echo -e "${BLUE}Step 6: Verify lock file status${NC}"
echo "----------------------------------------"
LOCK_FILES=$(ls -1 package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null | wc -l)
if [ "$LOCK_FILES" -eq 1 ]; then
LOCK_FILE=$(ls -1 package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null)
echo -e " ${GREEN}✓ Single lock file found: $LOCK_FILE${NC}"
elif [ "$LOCK_FILES" -gt 1 ]; then
echo -e " ${RED}⚠ WARNING: Multiple lock files found:${NC}"
ls -1 package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null
echo " Recommendation: Choose one package manager and remove other lock files"
else
echo -e " ${RED}⚠ WARNING: No lock file found${NC}"
fi
echo ""
# Calculate and display savings
echo -e "${BLUE}╔════════════════════════════════════════════════════════╗${NC}"
echo -e "${BLUE}║ Cleanup Summary ║${NC}"
echo -e "${BLUE}╚════════════════════════════════════════════════════════╝${NC}"
echo ""
if [ "$DRY_RUN" = true ]; then
echo -e "${YELLOW}DRY RUN COMPLETE - No changes were made${NC}"
echo ""
fi
echo "Files processed: $FILES_REMOVED"
# Convert bytes to human readable
if [ $TOTAL_SAVED -gt 1073741824 ]; then
SAVED_GB=$(awk "BEGIN {printf \"%.2f\", $TOTAL_SAVED/1073741824}")
echo "Total space saved: ${SAVED_GB} GB"
elif [ $TOTAL_SAVED -gt 1048576 ]; then
SAVED_MB=$(awk "BEGIN {printf \"%.2f\", $TOTAL_SAVED/1048576}")
echo "Total space saved: ${SAVED_MB} MB"
elif [ $TOTAL_SAVED -gt 1024 ]; then
SAVED_KB=$(awk "BEGIN {printf \"%.2f\", $TOTAL_SAVED/1024}")
echo "Total space saved: ${SAVED_KB} KB"
else
echo "Total space saved: ${TOTAL_SAVED} bytes"
fi
echo ""
echo -e "${GREEN}Repository cleanup completed!${NC}"
echo ""
if [ "$DRY_RUN" = false ]; then
echo "Next steps:"
echo " 1. Review changes: git status"
echo " 2. Commit cleanup: git add .gitignore && git commit -m 'chore: v3 repository cleanup'"
echo " 3. Verify build: npm run build (or pnpm/yarn)"
echo " 4. Update documentation if needed"
else
echo "To apply these changes, run:"
echo " bash scripts/cleanup-v3.sh"
fi
echo ""