Skip to content

docs(branch-discipline): §17+§18 + check-branch-sync + pre-commit hook#180

Merged
Halildeu merged 1 commit intomainfrom
work/branch-discipline-sync
Apr 20, 2026
Merged

docs(branch-discipline): §17+§18 + check-branch-sync + pre-commit hook#180
Halildeu merged 1 commit intomainfrom
work/branch-discipline-sync

Conversation

@Halildeu
Copy link
Copy Markdown
Owner

Summary

  • CLAUDE.md §17 Branch Discipline + §18 Pre-commit Hook (policy docs)
  • .claude/scripts/check-branch-sync.sh (session başlangıç check)
  • .claude/scripts/pre-commit-version-gate.sh (hook template)

Why

2026-04-20'de Codex Public Beta implementation'ı claude/faz-c-master-plan branch'inde yaptı (72 commits behind main, pre-v3.3.0 base). Version 3.2.0 → 4.0.0b1 bump → 11 minor release kaybı tehlikesi. Bu altyapı aynı hatayı önler.

Changes

CLAUDE.md §17 Branch Discipline

  • Session başlangıç check ZORUNLU (bash .claude/scripts/check-branch-sync.sh)
  • Uzun-ömürlü claude/*, master-plan/*, wip/* branch YASAK
  • Worktree-per-branch denkliği
  • Version bump stale base'de yasak

CLAUDE.md §18 Pre-commit Hook

  • Stale base (>24h) version bump commit-time'da BLOCK
  • Override: git commit --no-verify
  • Git worktree shared .git/ → tek hook tüm worktree'lere hizmet

Scripts

  • check-branch-sync.sh: detached HEAD → DUR, forbidden pattern (claude/, master-plan/, wip/*) → DUR, backup/ → DUR (read-only), behind>20 → DUR, behind>5 → WARN, fresh → OK
  • pre-commit-version-gate.sh: pyproject.toml / ao_kernel/__init__.py staged + merge-base yaşı >24h → BLOCK

Cleanup performed (already done, separate from this PR)

  • 95 local claude/* branches deleted
  • 61 remote claude/* branches deleted (batch via git push origin --delete)
  • Goofy worktree pruned
  • Codex Public Beta work preserved at backup/codex-pbeta-4.0.0b1-stale-base (local + origin)

Test plan

  • bash .claude/scripts/check-branch-sync.sh from fresh branch → ✓ Branch fresh
  • Scripts executable (chmod +x)
  • Pre-commit hook installed (.git/hooks/pre-commit)
  • CI 9/9 GREEN
  • Merge to main → hook + scripts available to all worktrees

🤖 Generated with Claude Code

v3.13.1 LIVE sonrası Codex Public Beta implementation'ı stale branch
(claude/faz-c-master-plan, 72 commits behind main) üstünde yapıldı.
11 minor release (v3.3-v3.13) atlanması tehlikesi doğdu. Bu disiplin
altyapısı aynı hatayı bir daha yaşamamak için kuruluyor.

- CLAUDE.md §17 Branch Discipline: session başlangıç check ZORUNLU,
  uzun-ömürlü claude/* master-plan/* wip/* branch YASAK, worktree
  per-branch denkliği, version bump freshness kuralı
- CLAUDE.md §18 Pre-commit Hook: stale base (>24h) version bump
  engellenir
- .claude/scripts/check-branch-sync.sh: session başlangıç freshness
  kontrolü (forbidden pattern check + behind>5 warn + behind>20 block)
- .claude/scripts/pre-commit-version-gate.sh: hook template,
  `.git/hooks/pre-commit` olarak install edilir

Local branch temizliği (ayrı commit gerekmez, işlem kaydı):
- 95 local claude/* branch silindi → main + work/ + backup/ kaldı
- 61 remote claude/* branch silindi
- backup/codex-pbeta-4.0.0b1-stale-base branch'inde Codex impl
  saklandı (rebase için referans)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📊 Benchmark Scorecard

Scenario Status Duration Cost (USD) Review Score
governed_bugfix ✅ pass 44ms (▼8.3%) $0.0000 —
governed_review ✅ pass 42ms (▼6.7%) $0.0000 — 0.85 (−)

Baseline: be971d2b06df1a1a5a13abc4b3c7c24d94511038 · HEAD: 567ed5106424f84dbd3d19e82eb26bfbe71b7fce · PR: #180 · No regressions.

@Halildeu Halildeu merged commit 09f234a into main Apr 20, 2026
9 checks passed
@Halildeu Halildeu deleted the work/branch-discipline-sync branch April 20, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant