Skip to content

fix(close-task): resolve checkpoint.sh instead of printing it bare (#358) - #362

Closed
MendixMau wants to merge 2 commits into
masterfrom
fix/close-task-checkpoint-lookup
Closed

MendixMau wants to merge 2 commits into
masterfrom
fix/close-task-checkpoint-lookup

Conversation

@MendixMau

@MendixMau MendixMau commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Closes #358

Direct lane

What changed and why (one paragraph):
checkpoint.sh does exist. It ships at claude-hooks/bin/checkpoint.sh and reaches ~/.claude/bin only via the opt-in bin/install-claude-hooks.sh --basic. The defect was that project-bin/close-task.sh always printed checkpoint.sh --write in its "Then" block, and skills/close-the-loop.md step 4 cited it without saying where it comes from. So a project without the hooks got a step it could not run. close-task.sh now resolves the script: PATH first, then ~/.claude/bin, then $MXTK_ROOT/claude-hooks/bin (using the toolkit-root resolution the script already had). It prints the full path it found, single-quoted, so a path with spaces or a ' survives copy-paste. If none is found, it prints checkpoint.sh not installed — run '<toolkit>/bin/install-claude-hooks.sh' --basic, or skip: RESUME.md is the resume source, with the install path also quoted, and prints the rest of the block. close-task.sh only prints the step and never runs it, so a missing checkpoint.sh cannot fail it. The exit code still means only "writes owed" (1) or clean (0). close-the-loop.md step 4 gains the same note. The ~/.claude/bin copy, claude-hooks/bin/close-task.sh, also printed a bare checkpoint.sh, although ~/.claude/bin is usually not on PATH. It now prints its sibling's full path, quoted.

Field evidence: none yet from a project run of the fix. The defect comes from the reporter's existing-app field run, where the closing agent had to skip the step with no pointer. Run from a toolkit checkout with MXTK_ROOT unset, the fix prints '<clone>/claude-hooks/bin/checkpoint.sh' --write, exit 0.

  • No client data anywhere in the diff

  • Size cap: 5 files, about 50 non-fixture lines

  • Test tier reached: T1. The new fixture tests/wave2/test-close-task-checkpoint.sh project-bin/close-task.sh passes 14/14. On master it fails 11/14; the 3 that pass on master are the "carries on / exit code" cases, which must not regress. Its cases:

    • found on PATH
    • found in ~/.claude/bin (fake HOME)
    • found in the toolkit claude-hooks/bin
    • lookup order
    • not found: message, rest of the block, exit 0 when clean, exit 1 when owed
    • a space in HOME, and a space plus ' in the toolkit path; each printed line is eval'd to prove it runs
    • quoted install hint
    • the hooks copy prints its sibling path

    The existing test-pipefail-grep-q.sh also covers close-task.sh and passes 3/3.

  • For a changed instrument: it uses only command -v, [ -f ], $HOME and sed-based quoting (no ${x//}, so bash 3.2 works), so the same code runs on macOS and Git Bash. Layout does not matter, because no .mpr path is involved.

  • For a new skill: n/a

  • CHANGELOG.md line appended, credited to joshuamoesa ([bug] close-task.sh and close-the-loop.md reference checkpoint.sh / docs/progress/checkpoints.md, which init-project never installs and which do not exist in the repo #358)

  • New bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw

)

checkpoint.sh ships at claude-hooks/bin/ and reaches ~/.claude/bin only via
the opt-in install-claude-hooks.sh --basic. close-task.sh printed
`checkpoint.sh --write` unconditionally. It now looks in PATH, then
~/.claude/bin, then $MXTK_ROOT/claude-hooks/bin, and prints the full path,
or an install pointer with "skip: RESUME.md is the resume source". The exit
code is unchanged (1 only when writes are owed). close-the-loop.md step 4 is
updated to match. Fixture tests/wave2/test-close-task-checkpoint.sh: 10 cases,
7 fail on master.

Closes #358

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
…bling path (#362 review)

A HOME or toolkit path with a space broke copy-paste of the printed
`<path> --write` and install-hint commands. Both are now single-quoted,
with embedded ' escaped via sed for bash 3.2. The ~/.claude/bin copy
(claude-hooks/bin/close-task.sh) printed a bare checkpoint.sh, though
~/.claude/bin is usually not on PATH; it now prints its sibling's full
path, quoted. The fixture gains T7a-c (space in HOME, space and ' in the
toolkit path, quoted install hint; each printed line is eval'd) and T8
(hooks copy): 14/14 pass, 11 fail on master.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau pushed a commit that referenced this pull request Oct 14, 2026
…g it bare (#358)

Review: independent review MERGE-AFTER-FIX (printed paths broke on spaces; hooks copy printed a bare name with ~/.claude/bin off PATH) → shq() quoting + sibling full path in 6164bc6; confirmation MERGE: printed line executed correctly for paths with space, $HOME, backtick, !, ', ", \. Fixture 14/14 (11 fail on master). Closes community issue #358 (joshuamoesa).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
MendixMau added a commit that referenced this pull request Oct 15, 2026
…journey controls, fixes) (#385)

Lands #340 #363 #362 #355 #370 #368 #364 #365 #366 #372 #367 #371 #376 #369 #373 #377 #378 #380.

Review: each constituent PR independently reviewed by a fresh agent that did not write it; merged into integration/2026-10-15 only on a MERGE verdict with green CI (per-PR Review lines in the integration merge commits). After-fix rounds: #373 (env-var cap, rename/skip-loops freshness), #377 (inline URI fallback), #378 (full-pack double count, slice content). Stub diet (#369/#378/#380) behaviour A/B, 5 reps x 2 drafting tasks + 5 retrieval probes x 3 reps: trimmed context no worse than master on every scored metric (planted STOP refused 20/20, parse failures page 2/5 vs 3/5, probes 15/15); mdl Stage 5 56,236 -> 30,647 words, baseline 75,028 -> 73,233. Full suites on c9bc073: run-tests 33/0, wave2 111 fixtures 0 failing. Field evidence: none yet for the instruments (#355 warn-only, #373/#377 read-only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
@MendixMau

Copy link
Copy Markdown
Owner Author

Landed on master in #385 (squash 868b3cb), after its own independent review on the night integration branch. Closing this PR.


Generated by Claude Code

@MendixMau MendixMau closed this Oct 15, 2026
@MendixMau
MendixMau deleted the fix/close-task-checkpoint-lookup branch October 15, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants