muse-crew 0.7.20 → 0.8.1

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.
@@ -147,7 +147,57 @@ echo "$out" | grep -q '^MERGED: ' || fail "integrate-test: no MERGED line (no re
147
147
  echo "$out" | grep -q '^NO_REMOTE: ' || fail "integrate-test: no NO_REMOTE line: $out"
148
148
  "$CREW_LIB/merge-lock.sh" release "int2" >/dev/null || fail "integrate-test: lock release (no remote) failed"
149
149
 
150
- rm -rf "$T2" "$T3"
150
+ # Prefix resolution (task 4e1a1bba, 2026-09-17): a Build agent created the
151
+ # branch with raw git as task/<8-char id>, bypassing prepare, so the
152
+ # registry is empty. resolve-branch must find it by id-prefix enumeration;
153
+ # inspect/integrate/cleanup must operate on the real branch, never on a
154
+ # reconstructed task/<full-id>.
155
+ T4=/tmp/crew-git-prefix-test
156
+ rm -rf "$T4"
157
+ mkdir -p "$T4"
158
+ git init -q -b main "$T4/repo"
159
+ git -C "$T4/repo" config user.email test@test.t
160
+ git -C "$T4/repo" config user.name test
161
+ echo base > "$T4/repo/f.txt"
162
+ echo ".worktrees/" > "$T4/repo/.gitignore"
163
+ git -C "$T4/repo" add -A
164
+ git -C "$T4/repo" commit -qm base
165
+ export CREW_REPO="$T4/repo"
166
+
167
+ fullid="51aaa9fe-9cb5-4a4f-acfc-72092fcf0899"
168
+ shortid="51aaa9fe"
169
+ # Raw-git branch creation, like the Build agent: no registry entry.
170
+ git -C "$T4/repo" branch "task/$shortid"
171
+ [ -f "$T4/repo/.worktrees/.registry/$fullid" ] && fail "prefix-test: registry should be empty for this fixture"
172
+ out=$(bash "$LIFECYCLE" resolve-branch "$fullid") || fail "prefix-test: resolve-branch failed: $out"
173
+ [ "$out" = "task/$shortid" ] || fail "prefix-test: resolve-branch returned '$out', expected task/$shortid"
174
+
175
+ # inspect operates on the real branch (no "branch ... does not exist")
176
+ out=$(bash "$LIFECYCLE" inspect "$fullid") || fail "prefix-test: inspect failed on abbreviated branch: $out"
177
+ echo "$out" | grep -q "=== Branch: task/$shortid ===" || fail "prefix-test: inspect used the wrong branch"
178
+
179
+ # verify-merge vacuous-pass on the merged-prefix branch tip == main
180
+ out=$(bash "$LIFECYCLE" verify-merge "$fullid") || fail "prefix-test: verify-merge failed on abbreviated branch: $out"
181
+
182
+ # cleanup deletes the real abbreviated branch, not a reconstructed one
183
+ out=$(bash "$LIFECYCLE" cleanup "$fullid") || fail "prefix-test: cleanup failed: $out"
184
+ git -C "$T4/repo" rev-parse --verify "task/$shortid" >/dev/null 2>&1 && fail "prefix-test: cleanup left the abbreviated branch behind"
185
+
186
+ # Ambiguous prefixes fail closed (exit non-zero), never guess
187
+ fullid2="deadbeef-1111-2222-3333-444455556666"
188
+ git -C "$T4/repo" branch "task/deadbeef"
189
+ git -C "$T4/repo" branch "task/deadbeef-1111"
190
+ if bash "$LIFECYCLE" resolve-branch "$fullid2" >/dev/null 2>&1; then
191
+ fail "prefix-test: resolve-branch guessed on ambiguous prefix"
192
+ fi
193
+ git -C "$T4/repo" branch -D "task/deadbeef" "task/deadbeef-1111" >/dev/null
194
+
195
+ # No branch at all: resolve-branch falls back to the canonical name so
196
+ # callers keep their "branch X does not exist" failure
197
+ out=$(bash "$LIFECYCLE" resolve-branch "$fullid") || fail "prefix-test: resolve-branch failed with no branch present"
198
+ [ "$out" = "task/$fullid" ] || fail "prefix-test: resolve-branch returned '$out', expected canonical fallback task/$fullid"
199
+
200
+ rm -rf "$T2" "$T3" "$T4"
151
201
  export CREW_REPO="$T"
152
202
  rm -rf "$T"
153
203
  echo "worktree-backend: OK"