# Branching Strategy This repository uses a simple trunk-based model with short-lived branches and `main` as the deploy branch. For delivery workflow, see [workflow.md](workflow.md). For PR expectations, see [CONVENTIONS.md](CONVENTIONS.md#git-and-prs). ## Default Model ```mermaid gitGraph commit id: "main" branch docs-change checkout docs-change commit id: "work" commit id: "validate" checkout main merge docs-change commit id: "deploy" ``` ## Branch Types | Type | Pattern | Purpose | | --- | --- | --- | | Feature | `feature/` | New user-facing or system capability. | | Bug fix | `fix/` | Defect correction. | | Refactor | `refactor/` | Behavior-preserving structural work. | | Documentation | `docs/` | Documentation-only changes. | | Chore | `chore/` | Tooling or maintenance work. | | AI-assisted local work | `codex/` | Short-lived Codex branch when branch creation is useful. | | Hotfix | `hotfix/` | Urgent production correction. | ## Main Branch `main` should remain deployable. Minimum expectations: - required checks pass; - risky migrations and config changes are documented; - production-impacting changes include validation evidence; - direct pushes are limited to maintainers or automation. ## Feature Branches - Keep scope focused. - Rebase or merge from `main` according to reviewer preference. - Delete branches after merge. - Avoid stacking unrelated changes. - Do not include generated build output or handoff artifacts. ## Commit Messages Use short imperative subjects that describe the outcome. Examples: - `Fix team profile auth recovery` - `Refine admin risk workspace` - `Document engineering workflow` Use a longer body when context, migration notes, or validation evidence is important for future archaeology. ## Hotfixes Hotfixes should restore production safely: 1. Branch from the deployed commit or current `main`. 2. Apply the smallest safe fix. 3. Validate the failing path. 4. Deploy. 5. Merge back to `main`. 6. Add follow-up cleanup or tests when the hotfix intentionally stayed narrow.