@mmerterden/multi-agent-pipeline 10.7.0 → 10.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,151 +0,0 @@
1
- #!/usr/bin/env bash
2
- # smoke-delete-flow.sh - v7.7.0 token-preserving uninstall.
3
- #
4
- # Round-trip integrity for `multi-agent uninstall`:
5
- # 1. --dry-run produces a preview without modifying the filesystem
6
- # 2. Real uninstall removes pipeline-managed files
7
- # 3. User-authored content survives (CLAUDE.md, preferences, marker-wrapped blocks)
8
- # 4. Selective targets (--cursor, --copilot-chat) only touch the requested tree
9
- # 5. Adapter `uninstall()` is invoked and its result reflects in the output
10
- # 6. (Bonus) Slash command + Copilot skill exist with byte-eq description (parity)
11
- #
12
- # We never invoke the uninstaller against $HOME - the test scaffolds an
13
- # isolated `--target` tree and exercises the adapter portion only. Claude /
14
- # Copilot uninstall paths are exercised via dry-run (which reports them).
15
-
16
- set -uo pipefail
17
-
18
- REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
19
- INSTALL="$REPO_ROOT/install.js"
20
- UNINSTALL="$REPO_ROOT/pipeline/scripts/uninstall.mjs"
21
-
22
- PASS=0
23
- FAIL=0
24
- pass() { PASS=$((PASS + 1)); echo " ✓ $1"; }
25
- fail() { FAIL=$((FAIL + 1)); echo " ✗ $1"; }
26
-
27
- cleanup() {
28
- [ -n "${TMP:-}" ] && rm -rf "$TMP"
29
- }
30
- trap cleanup EXIT
31
-
32
- # ──────────────────────────────────────────────────────────────────────────
33
- echo "→ 1. Slash command + Copilot peer exist"
34
- if [ -f "$REPO_ROOT/pipeline/commands/multi-agent/delete.md" ]; then
35
- pass "pipeline/commands/multi-agent/delete.md present"
36
- else
37
- fail "delete.md missing"
38
- fi
39
- if [ -f "$REPO_ROOT/pipeline/skills/shared/core/multi-agent-delete/SKILL.md" ]; then
40
- pass "pipeline/skills/shared/core/multi-agent-delete/SKILL.md present"
41
- else
42
- fail "multi-agent-delete SKILL.md missing"
43
- fi
44
-
45
- # ──────────────────────────────────────────────────────────────────────────
46
- echo "→ 2. --dry-run produces preview without side effects"
47
- TMP=$(mktemp -d)
48
- node "$INSTALL" --cursor --target="$TMP" >/dev/null 2>&1
49
- pre_count=$(find "$TMP" -type f | wc -l | tr -d ' ')
50
-
51
- OUTPUT=$(node "$UNINSTALL" --dry-run --yes --cursor --target="$TMP" 2>&1)
52
- post_count=$(find "$TMP" -type f | wc -l | tr -d ' ')
53
-
54
- if [ "$pre_count" = "$post_count" ] && [ "$post_count" -gt 100 ]; then
55
- pass "--dry-run preserved file tree ($post_count files)"
56
- else
57
- fail "--dry-run changed file tree (pre=$pre_count post=$post_count)"
58
- fi
59
-
60
- if echo "$OUTPUT" | grep -q "DRY-RUN"; then
61
- pass "--dry-run output mentions DRY-RUN banner"
62
- else
63
- fail "--dry-run banner missing from output"
64
- fi
65
-
66
- if echo "$OUTPUT" | grep -q "Personal access tokens were NOT touched"; then
67
- pass "--dry-run output reaffirms token preservation"
68
- else
69
- fail "token-preservation message missing from --dry-run output"
70
- fi
71
-
72
- # ──────────────────────────────────────────────────────────────────────────
73
- echo "→ 3. Real uninstall removes pipeline files"
74
- node "$UNINSTALL" --yes --cursor --target="$TMP" >/dev/null 2>&1
75
- remaining=$(find "$TMP" -type f | wc -l | tr -d ' ')
76
- if [ "$remaining" = "0" ]; then
77
- pass "real uninstall: 0 pipeline files remain (was $pre_count)"
78
- else
79
- fail "real uninstall left $remaining file(s)"
80
- fi
81
-
82
- # ──────────────────────────────────────────────────────────────────────────
83
- echo "→ 4. User content outside markers survives uninstall (copilot-chat)"
84
- rm -rf "$TMP" && TMP=$(mktemp -d)
85
- mkdir -p "$TMP/.github"
86
- USER_LINE="DO_NOT_TOUCH_$(date +%s)"
87
- echo "$USER_LINE" > "$TMP/.github/copilot-instructions.md"
88
- node "$INSTALL" --copilot-chat --target="$TMP" >/dev/null 2>&1
89
- node "$UNINSTALL" --yes --copilot-chat --target="$TMP" >/dev/null 2>&1
90
-
91
- if grep -q "$USER_LINE" "$TMP/.github/copilot-instructions.md" 2>/dev/null; then
92
- pass "user content outside markers survived uninstall"
93
- else
94
- fail "user content lost during uninstall"
95
- fi
96
-
97
- # ──────────────────────────────────────────────────────────────────────────
98
- echo "→ 5. Selective target - --copilot-chat doesn't touch cursor tree"
99
- rm -rf "$TMP" && TMP=$(mktemp -d)
100
- node "$INSTALL" --cursor --target="$TMP" >/dev/null 2>&1
101
- node "$INSTALL" --copilot-chat --target="$TMP" >/dev/null 2>&1
102
-
103
- # Now uninstall ONLY copilot-chat; cursor tree should remain
104
- node "$UNINSTALL" --yes --copilot-chat --target="$TMP" >/dev/null 2>&1
105
-
106
- cursor_remaining=$(find "$TMP/.cursor" -type f 2>/dev/null | wc -l | tr -d ' ')
107
- copilot_remaining=$(find "$TMP/.github/instructions" -name "multi-agent-*" 2>/dev/null | wc -l | tr -d ' ')
108
-
109
- if [ "$cursor_remaining" -gt 0 ]; then
110
- pass "selective uninstall: cursor tree untouched ($cursor_remaining files)"
111
- else
112
- fail "selective uninstall: cursor tree was deleted"
113
- fi
114
-
115
- if [ "$copilot_remaining" = "0" ]; then
116
- pass "selective uninstall: copilot-chat per-skill files cleaned"
117
- else
118
- fail "selective uninstall: $copilot_remaining copilot-chat file(s) remain"
119
- fi
120
-
121
- # ──────────────────────────────────────────────────────────────────────────
122
- echo "→ 6. CLI router - 'uninstall' and 'delete' both reach the script"
123
- OUT_UNINSTALL=$(node "$REPO_ROOT/index.js" uninstall --dry-run --yes --cursor --target=/tmp/fake 2>&1 || true)
124
- OUT_DELETE=$(node "$REPO_ROOT/index.js" delete --dry-run --yes --cursor --target=/tmp/fake 2>&1 || true)
125
-
126
- if echo "$OUT_UNINSTALL" | grep -q "multi-agent-pipeline uninstaller"; then
127
- pass "'index.js uninstall' invokes the uninstaller"
128
- else
129
- fail "'index.js uninstall' did not reach uninstaller"
130
- fi
131
-
132
- if echo "$OUT_DELETE" | grep -q "multi-agent-pipeline uninstaller"; then
133
- pass "'index.js delete' alias also invokes the uninstaller"
134
- else
135
- fail "'index.js delete' alias did not reach uninstaller"
136
- fi
137
-
138
- # ──────────────────────────────────────────────────────────────────────────
139
- echo "→ 7. Token preservation - uninstaller never invokes credential-store"
140
- # Static check: uninstall.mjs must not import credential-store.sh or call
141
- # `security delete-generic-password` / `cmdkey /delete` / `secret-tool clear`.
142
- if grep -qE "credential-store|delete-generic-password|cmdkey /delete|secret-tool clear|secret-tool del" "$UNINSTALL"; then
143
- fail "uninstall.mjs references credential-store deletion APIs (token leak risk)"
144
- else
145
- pass "uninstall.mjs has no credential-store deletion references"
146
- fi
147
-
148
- # ──────────────────────────────────────────────────────────────────────────
149
- echo ""
150
- echo "══ delete-flow smoke: $PASS passed, $FAIL failed ══"
151
- [ "$FAIL" -eq 0 ]