Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
19 changes: 19 additions & 0 deletions scripts/pre_release_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
8 changes: 8 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Loading