Skip to content

feat(commit): preview commit messages through Go - #828

Draft
tbhb-agent wants to merge 1 commit into
mainfrom
fix/801-20261026
Draft

tbhb-agent wants to merge 1 commit into
mainfrom
fix/801-20261026

Conversation

@tbhb-agent

Copy link
Copy Markdown
Contributor

Summary

Run commit-message previews through agentrepo commit-preview. Keep the existing helper as a capability probe with a frozen shell fallback for N-2 consumers.

Why

Move preview orchestration into Go while preserving sign-off selection, draft bytes, and the actual commit-msg gate interface. Consumers with older binaries still need the shell path.

Verification

AC Command Result
AC1 mise run test Passed on Linux: frozen-shell parity checks draft bytes on success and failure.
AC2 mise run test Passed on Linux: checks preserve the existing sign-off and trailer order.
AC3 mise run test Passed on Linux: checks verify identity precedence and empty settings across worktrees.
AC4 mise run test Passed on Linux: refused identities stop gate execution.
AC5 mise run test Passed on Linux: invalid identity policy stops gate execution.
AC6 mise run test and bats tests/devtools/lint-commit-msg.bats Passed on Linux: the gate stub validates arguments and the temporary COMMIT_EDITMSG basename. Retained checks exercise gate results and the real hook with body-width and commit-scope Vale checks.
AC7 mise run test Passed on Linux: checks verify temporary preview cleanup after success and failure.
AC8 mise run test Passed on Linux: repository behavior settings can't supply a sign-off.
AC9 bats tests/devtools/lint-commit-msg.bats Passed: wrapper checks exercise capable, absent, old, and unsupported binaries. They verify selected-binary precedence and argument forwarding, with no shell rerun after a Go failure.
AC10 mise run test Passed on Linux: frozen-shell parity compares status, stdout, stderr, and preview bytes. macOS and Windows await native CI.

mise run lint: passed, including generated-payload and script-hygiene checks.

Risk

Identity or temporary-message regressions could block previews. Revert this change to restore shell dispatch.

Compatibility: none

Related

Closes #801.

Previewing a draft must preserve its bytes and use the responsible
person's identity without changing the real commit hook. Keep the
existing gate interface and a frozen shell fallback so consumers with
older binaries can continue through the N-2 compatibility window.

Assisted-by: codex:gpt-6.1-sol
Signed-off-by: Tony Burns <tony@tonyburns.net>
@tbhb-agent tbhb-agent added change:feat PR adds or changes a feature (Conventional Commit type feat) provenance:agent-assisted PR contains commits authored with AI assistance (see Assisted-by trailers) labels Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feat PR adds or changes a feature (Conventional Commit type feat) provenance:agent-assisted PR contains commits authored with AI assistance (see Assisted-by trailers)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(commit): move commit message previews to Go

1 participant