feat(setup): stamp installed version into .cmm-stack-version (v1.11.1)#79
feat(setup): stamp installed version into .cmm-stack-version (v1.11.1)#79halindrome wants to merge 4 commits into
Conversation
Both install_global and install_project now write a .cmm-stack-version
marker into the install target (config dir / .claude). Line 1 is the bare
version (from VERSION); extra lines carry the source commit + install date.
Users can identify which stack version they're running with a single
`cat "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.cmm-stack-version"` instead of
grepping hook internals — the gap surfaced while diagnosing a stale-install
false-positive in cmm-grep-nudge.sh. Honors --dry-run. CHECKSUMS regenerated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ships the .cmm-stack-version install stamp. 1.11.0 already shipped, so the stamp reports a fresh patch version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
QA Round 1Result: clean for blocking purposes — 0 critical, 0 major, 0 minor blocking findings. 1 minor non-blocking observation (test gap). Contract Verification (source: synthesized)
FindingsContract: none. Regression: none. Pre-existing issues discovered
Schema ChangeNone. Changed files: SAST review skippedCode scanning is not enabled on this repository (GitHub API: "no analysis found"). No SAST delta this round. QA performed by Claude Code (claude-opus-4-8) |
Closes round-1 finding F-01 (no test asserted the marker is written). tests/test-version-stamp.sh extracts write_version_stamp from setup.sh and unit-tests it standalone: marker write (line 1 = bare VERSION), DRY_RUN writes nothing, fail-safe fallback (no VERSION / no git -> unknown/nogit, rc=0 under set -euo pipefail), plus static guards that install_global and install_project both invoke the stamp. 5/5 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
QA Round 2Result: clean for blocking — 0 critical, 0 major, 0 minor blocking. 3 minor non-blocking observations. Fresh reviewer independently re-reviewed the full diff including the round-1 test. Contract Verification (source: synthesized)All 8 original criteria pass; the round-2 addition ( Reviewer confirmed the test is genuine (not a tautology): awk extraction captures the whole function (inner Findings (all minor, non-blocking)
Schema ChangeNone. SAST review skippedCode scanning is not enabled on this repository. No SAST delta this round. QA performed by Claude Code (claude-opus-4-8) |
F-02: guard mkdir/redirect in write_version_stamp so an uncreatable or unwritable target warns and returns 0 instead of aborting the installer under set -euo pipefail (matches the |\| echo guards on the value reads). F-01: make test T3 hermetic — point SCRIPT_DIR at a guaranteed-absent path so git -C -> nogit deterministically, independent of $TMPDIR placement. Add T6 asserting the fail-safe write returns 0 and writes no marker on an uncreatable target. 6/6 pass. CHECKSUMS regenerated. F-03 (no CI runner) left out of scope — pre-existing repo-wide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
QA Round 3 — clean ✅Result: 0 findings (0 contract, 0 regression, 0 observation). Fresh reviewer verified the round-2 fixes and did a full holistic pass. Round-2 fix verification
Contract VerificationAll 8 criteria satisfied with evidence (real end-to-end install + 6/6 test run + Schema ChangeNone. SAST review skippedCode scanning is not enabled on this repository. No SAST delta. QA performed by Claude Code (claude-opus-4-8) |
Summary
setup.shnow stamps the stack version into the install target so a user can tell which version of the hooks they're running with a singlecat— no more grepping hook internals.This gap surfaced while diagnosing a reported
cmm-grep-nudge.shfalse-positive (agit commitwhose message contained "larger" + a cwd containing "claudeapps/"). Root cause turned out to be a stale global install (the old unanchored substring matcher), not a source bug — the current source already anchors nav verbs to command position. There was no way for the affected user to tell what version they had installed; this fixes that.What changed
install_globalandinstall_projectwrite<target>/.cmm-stack-version:VERSION); extra lines aid diagnosing dev/unreleased installs. Honors--dry-run.VERSION/version.txt→ 1.11.1 (1.11.0 already shipped).CHECKSUMS.sha256regenerated forsetup.sh.User-facing check
Testing
Isolated end-to-end install into a temp dir:
.cmm-stack-versionwritten with1.11.1on line 1 ✓cmm-grep-nudge.shis the anchored (v2) hook ✓--dry-runreports the stamp without writing ✓bash -n setup.shclean ✓Scope / QA
Touches
setup.sh→ does not qualify for the docs-only QA skip. Standard 2–4 QA rounds apply (/pr-qa).🤖 Generated with Claude Code