From ee967980542b6920fa0448c514a7bd7e0882cdd0 Mon Sep 17 00:00:00 2001 From: ycpss91255 <54975526+ycpss91255@users.noreply.github.com> Date: Mon, 5 Oct 2026 18:58:54 +0800 Subject: [PATCH] fix: restore Windows checkout and prevent cleanup artifacts --- .agents/hook/remind_main_sync.sh | 4 ++-- Cleanup). | 0 doc/changelog/CHANGELOG.md | 6 ++++++ test/unit/hook/remind_main_sync_spec.bats | 24 +++++++++++++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) delete mode 100644 Cleanup). diff --git a/.agents/hook/remind_main_sync.sh b/.agents/hook/remind_main_sync.sh index eb8a5cec..762738d8 100755 --- a/.agents/hook/remind_main_sync.sh +++ b/.agents/hook/remind_main_sync.sh @@ -69,10 +69,10 @@ main() { if [[ "${cleaned}" =~ --auto([[:space:]]|$) ]]; then variant="queued" - msg="Auto-merge queued. After CI passes and GitHub completes the merge, run \`git -C \$(git rev-parse --show-toplevel 2>/dev/null) pull --ff-only origin main\` (or the same from your main checkout) to keep local main tracking origin/main HEAD. See doc/process/worktree.md ("Lifecycle > Cleanup")." + msg="Auto-merge queued. After CI passes and GitHub completes the merge, run \`git -C \$(git rev-parse --show-toplevel 2>/dev/null) pull --ff-only origin main\` (or the same from your main checkout) to keep local main tracking origin/main HEAD. See doc/process/worktree.md (\"Lifecycle > Cleanup\")." else variant="immediate" - msg="PR merged. Run \`git pull --ff-only origin main\` on your main checkout now so local main keeps tracking origin/main HEAD (don't let it freeze behind). See doc/process/worktree.md ("Lifecycle > Cleanup")." + msg="PR merged. Run \`git pull --ff-only origin main\` on your main checkout now so local main keeps tracking origin/main HEAD (don't let it freeze behind). See doc/process/worktree.md (\"Lifecycle > Cleanup\")." fi jq -n --arg m "${msg}" --arg v "${variant}" '{ diff --git a/Cleanup). b/Cleanup). deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/changelog/CHANGELOG.md b/doc/changelog/CHANGELOG.md index f3415080..5e545c24 100644 --- a/doc/changelog/CHANGELOG.md +++ b/doc/changelog/CHANGELOG.md @@ -20,6 +20,12 @@ not deferred to release. `release-tag.sh` promotes `[Unreleased]` → ## [Unreleased] +### Fixed + +- Restore Windows checkout by removing the empty tracked `Cleanup).` artifact + and escaping lifecycle-reference quotes in both merge reminders so they no + longer create a stray file (refs #409). + ### Deprecated - **Legacy `small-tools/` bundle installers marked DEPRECATED** (PRD section diff --git a/test/unit/hook/remind_main_sync_spec.bats b/test/unit/hook/remind_main_sync_spec.bats index 9a3f27e6..03c0be56 100644 --- a/test/unit/hook/remind_main_sync_spec.bats +++ b/test/unit/hook/remind_main_sync_spec.bats @@ -21,6 +21,22 @@ _run_hook() { run bash -c 'printf "%s" "$1" | "$2"' _ "$(_json "$1")" "${HOOK_SH}" } +_assert_reminder_has_no_filesystem_side_effects() { + local command="$1" variant="$2" cwd message + cwd="${INIT_UBUNTU_TEST_SCRATCH}/hook_cwd" + mkdir -p "${cwd}" + + run bash -c 'cd -- "$3" && printf "%s" "$1" | "$2"' \ + _ "$(_json "${command}")" "${HOOK_SH}" "${cwd}" + + [ "${status}" -eq 0 ] + [ -z "$(find "${cwd}" -mindepth 1 -print -quit)" ] + message="$(printf '%s' "${output}" | jq -er '.systemMessage')" + [[ "${message}" == *'See doc/process/worktree.md ("Lifecycle > Cleanup").' ]] + printf '%s' "${output}" | jq -e --arg m "${message}" --arg v "${variant}" \ + '.hookSpecificOutput.additionalContext == ($m + " [variant=" + $v + "]")' +} + # ── fires: real gh pr merge ────────────────────────────────────────────────── @test "gh pr merge --auto -> queued variant reminder" { @@ -37,6 +53,14 @@ _run_hook() { [[ "${output}" == *"pull --ff-only"* ]] } +@test "queued reminder preserves quoted lifecycle reference without creating files" { + _assert_reminder_has_no_filesystem_side_effects "gh pr merge --auto --squash 42" "queued" +} + +@test "immediate reminder preserves quoted lifecycle reference without creating files" { + _assert_reminder_has_no_filesystem_side_effects "gh pr merge --squash 42" "immediate" +} + @test "gh pr merge at a command boundary after && still fires" { _run_hook "gh pr checks 42 && gh pr merge --rebase 42" [ "${status}" -eq 0 ]