Git Workflow

Commit Signing (Required)

All commits must be GPG or EdDSA signed. Configure per-repository:

git config user.email "<your-email>"
git config user.signingkey <your-key-fingerprint>
git config commit.gpgsign true

Each contributor signs with their own key; the pre-push hook refuses an unsigned commit.

Branching

  • Branches: {type}/{description}, the type drawn from the commit vocabulary below (feat|fix|chore|refactor|docs|test) so branch and commit type agree; merge to main via MR when all checks pass.

  • Docs-only changes take the same path — branch + MR. Docs are the highest-churn class; exempting them from review inverts scrutiny.

  • Merge conflicts: rebase onto main (git rebase main), do NOT merge main into the branch.

Commit Messages

  • Imperative mood: "add gallery page" (not "added").

  • Type-prefixed: feat:, fix:, chore:, refactor:, docs:, test:.

  • Under 72 characters for the first line.

  • Co-Authored-By: trailer on every AI-assisted commit — required, naming the actual model. gadhs/pi’s commit guard appends it to an agent’s commit, with a Reflection-Review trailer recording its review; add it by hand only for an AI-assisted commit made outside pi.

  • Example: feat: add foster family resource page.

Bug Discovery

  • A pre-existing bug found during implementation: do NOT fix in the same MR. Create a new fix: issue, link with /relate, fix in a separate branch.

  • A defect this diff introduces is fixed in this MR (pre-commit R1) — it is not a discovery, it is the work.

Reverts

Create a fix: issue, revert on a feature branch, follow normal MR protocol.

Multi-MR Plans

  • Only the last MR of a plan sets its Status to Done and moves it to the archive. Earlier MRs update the project’s service docs.

  • The plan’s single Status value changes on start, completion, or deferral — not per MR (GitLab tracks per-issue state).

Work Claiming

  • Assign yourself before starting: glab issue update <N> --assignee @me.

  • Check assignee first — do not compete.

Code Review & Merge

  • CODEOWNERS approval required (self-merge acceptable for sole-developer projects until the team grows).

  • Preserve authorship on merge — merge with a regular merge commit; never squash-on-merge. Squashing rewrites the merged commit to the merging account (erasing the human author) and strips the original GPG/EdDSA signature. Keep should_remove_source_branch on and leave squash off.

  • API contract stability: after the first stable release (1.0.0+), response shapes are additive only — no field removals, type changes, or renamed endpoints. Pre-1.0, breaking changes are permitted but must be documented in CHANGELOG.adoc under Changed or Removed.

Git Hooks

Activate (and ensure the exec bit survives checkout):

git config core.hooksPath .githooks && chmod +x .githooks/*

Git silently skips a hook that is not executable, emitting only an advice.ignoredHook hint. If you see that hint — or commits/pushes sail through with no checklist — the exec bit was lost; re-run the chmod above.

Also re-verify git config core.hooksPath still returns .githooks. It can silently reset to the default .git/hooks (e.g. after certain git operations or tooling that rewrites git config), which bypasses every vendored hook with no warning. Check it before committing — especially in a long-running session where commits previously went through the gate but suddenly don’t.

Pre-Commit Hook (.githooks/pre-commit)

Mechanical checks on every commit, for every committer:

  • the SPDX header on each staged .rs file;

  • untracked debt markers (a debt-marker word with no #<issue> reference or debt-marker-ok: waiver; the word list is in the hook);

  • a release-note reminder naming changelog.d/ (non-blocking).

The judgment review is gadhs/pi’s. pi reviews an agent’s commit before git runs: J1–J8, plus CRAIG’s ## Code Review Rules in AGENTS.md. A flagged question needs a fix or a Review-Response: before the commit proceeds. pi also appends the Co-Authored-By and Reflection-Review trailers.

Commit-Msg Hook (.githooks/commit-msg)

Validates the commit subject against the type-prefix vocabulary above (feat / fix / chore / refactor / docs / test), an optional (scope), and the <72-char subject rule, with carve-outs for Merge/Revert/fixup!/squash!. Adding a type means adding it to this doc first — it is the single source of truth.

Pre-Push Hook (.githooks/pre-push)

The sole functional-correctness gate — runs the full local test battery (CI runs only security scans + release). Specific checks are documented in testing. All must pass before push; bypassing it (or a lost exec bit) merges unvalidated code.

Versioning (SemVer 2.0.0)

  • MAJOR (1.0.0): first production-ready release with stable API contracts. Incremented on breaking changes thereafter.

  • MINOR (0.2.0): new features, endpoints, or capabilities. No breaking changes.

  • PATCH (0.1.1): bug fixes, security patches, documentation-only changes.

Pre-release Labels

  • -alpha — feature-incomplete, API may change, not for production.

  • -beta — feature-complete for tagged scope, API stabilizing, suitable for evaluation.

  • -rc.N — release candidate, no known issues, final validation before stable.

Tagging Protocol

  • Tags are created on main after all CI checks pass.

  • Use signed, annotated tags: git tag -s v0.2.0 -m "v0.2.0 - <one line>" <merge SHA>, OpenPGP-signed with the maintainer’s key, on the release MR’s merge commit even if later MRs have merged.

  • Push tags explicitly: git push origin v0.2.0.

  • Every tag must have a corresponding == vX.Y.Z (date) section in CHANGELOG.adoc; an older release’s section may have moved to changelog/vX.Y.Z.adoc, with a link left in CHANGELOG.adoc.

Release procedure

CRAIG cuts a release weekly, on the day the scheduled release-build runs. A week with nothing to release cuts nothing.

Each change carries its release note as a fragment in changelog.d/ (grammar in changelog.d/README.adoc); cargo xtask changelog check holds the fragments and CHANGELOG.adoc == Unreleased to it, a gate of the pre-push hook’s validate --profile fast and a line of the merge-train car, so on every push and every train. The same check fails when an SDK manifest’s version differs from the workspace version: everything the repository ships carries one version.

  1. Branch chore/release-vX-Y-Z from fresh main and announce the release MR on its issue.

  2. Run cargo xtask changelog release --version X.Y.Z --date YYYY-MM-DD. It folds every fragment into a new == vX.Y.Z (date) section (Ops notes first, then Keep a Changelog’s groups), moves the previous release section to changelog/v<prev>.adoc unless that file already exists, sets [workspace.package] version in Cargo.toml and the SDK versions to it (sdks/python/pyproject.toml, and sdks/typescript/package.json with its package-lock.json), and deletes the fragments. It neither commits nor tags.

  3. Refresh Cargo.lock (cargo update -w --offline), review the section, run cargo xtask validate, and land the MR through the merge train.

  4. Tag the merge commit as above and push the tag. The tag pipeline’s release-notes job writes the section as Markdown (cargo xtask changelog notes), and the release job creates the GitLab Release from it, with the SBOM link.

  5. Check the Release page, then note the merge SHA and the tag on the release issue.

The v0.2.0 cut wrote its section by hand: highlights in CHANGELOG.adoc, the full notes moved verbatim to changelog/v0.2.0.adoc (plan release-v0-2-0-changelog-fragments).

Edit this page · latest