File size: 925 Bytes
a7b6a20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
# Emergency rollback to pre-PNP-refactor checkpoint
# Usage: bash scripts/rollback.sh

set -euo pipefail

echo "=== ROLLBACK to pre-pnp-refactor checkpoint ==="
cd "$(dirname "$0")/.."

if git tag -l pre-pnp-refactor | grep -q .; then
    echo "Restoring git state..."
    git reset --hard pre-pnp-refactor
    echo "Git state restored to: $(git log --oneline -1 pre-pnp-refactor)"
else
    echo "ERROR: tag 'pre-pnp-refactor' not found"
    echo "Last known good state: $(git log --oneline -1)"
    exit 1
fi

# If build was running, stop it
if systemctl --user status build-index &>/dev/null 2>&1; then
    echo "Stopping build-index service..."
    systemctl --user stop build-index 2>/dev/null || true
fi

# Clean up build artifacts
echo "Cleaning build artifacts..."
rm -f data/index.faiss data/chunks.db data/last_updated.txt

echo "=== ROLLBACK COMPLETE ==="
echo "To verify: git log --oneline -3"