From 4bd72601145fe5772847efd67bbf44f7214160fa Mon Sep 17 00:00:00 2001 From: DreamLinx Date: Sat, 15 Aug 2026 21:42:40 +0800 Subject: [PATCH] chore(release): README_AI refresh release-time + post-commit hook retirement (#166) - release.sh step 6.5: scan-all + claude-md update between bump commit and tag - pre_release_check.sh section 1b: fail if CLAUDE.md not stamped v$VERSION or README_AI uncommitted at tag time - CLAUDE.md: post-commit not installed in this repo - product-level hook deprecation tracked in #167 --- CHANGELOG.md | 12 ++++++++++++ CLAUDE.md | 4 +++- scripts/pre_release_check.sh | 19 +++++++++++++++++++ scripts/release.sh | 8 ++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6252fbd..95322cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- **README_AI refresh moved from per-commit to release-time** (GH #166). + `scripts/release.sh` gained step 6.5 between the version-bump commit and + the tag: `codeindex scan-all` + `claude-md update` committed as + `docs: refresh README_AI for vX.Y.Z`. The post-commit hook is no longer + installed in this repo (pre-commit / pre-push unchanged); product-level + hook deprecation is tracked separately in GH #167. +- **`scripts/pre_release_check.sh` gained section 1b**: fails the release if + the CLAUDE.md codeindex section is not stamped with the version being + released, or if any `README_AI.md` is left uncommitted at tag time. + ## [0.36.0] - 2026-08-15 ### Changed diff --git a/CLAUDE.md b/CLAUDE.md index 4ec761f..95b40c5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -203,8 +203,10 @@ Reference: `src/codeindex/extractors/thinkphp.py` ### Git Hooks - pre-commit: lint + debug checks -- post-commit: auto README updates - pre-push: test validation +- post-commit: **not installed in this repo** (#166) — README_AI refresh is + release-time, not per-commit; `scripts/release.sh` step 6.5 runs + `scan-all` + `claude-md update` between version bump commit and tag Management: `codeindex hooks install/uninstall/status` Guide: `docs/guides/git-hooks-integration.md` diff --git a/scripts/pre_release_check.sh b/scripts/pre_release_check.sh index 5ba7477..50adbbf 100755 --- a/scripts/pre_release_check.sh +++ b/scripts/pre_release_check.sh @@ -67,6 +67,25 @@ else pass "git tag v$VERSION does not yet exist (good)" fi +# ── 1b. README_AI release-time refresh (#166) ───────────────────── +section "1b. README_AI refresh freshness" + +# The CLAUDE.md codeindex section is stamped with the tool version at refresh +# time (claude-md update), so it must already carry this version — external +# truth that a refresh happened after the version bump, before the tag. +if grep -q "(v$VERSION) for AI-friendly" CLAUDE.md; then + pass "CLAUDE.md codeindex section stamped v$VERSION" +else + fail "CLAUDE.md codeindex section not stamped v$VERSION — run 'codeindex scan-all && codeindex claude-md update' and commit before tagging" +fi + +DIRTY_README=$(git status --porcelain -- '*README_AI.md' | wc -l | tr -d ' ') +if [[ "$DIRTY_README" == "0" ]]; then + pass "no dirty README_AI.md files" +else + fail "$DIRTY_README uncommitted README_AI.md file(s) — commit the refresh before tagging" +fi + # ── 2. Working tree state ───────────────────────────────────────── section "2. Working tree state" diff --git a/scripts/release.sh b/scripts/release.sh index eee9b54..e898fda 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -125,6 +125,14 @@ git add pyproject.toml src/codeindex/__init__.py CHANGELOG.md git commit -m "chore: bump version to $VERSION" echo -e "${GREEN}✓ Changes committed${NC}" +# 6.5 Refresh README_AI indexes (release-time, per #166 — not per-commit) +echo "" +echo -e "${YELLOW}6️⃣.5️⃣ Refreshing README_AI indexes...${NC}" +codeindex scan-all +codeindex claude-md update +git add CLAUDE.md PROJECT_SYMBOLS.md '*README_AI.md' +git diff --cached --quiet || git commit -m "docs: refresh README_AI for v$VERSION" + # 7. Create tag echo "" echo -e "${YELLOW}7️⃣ Creating tag v$VERSION...${NC}"