Skip to content

test: fail the build on a Co-Authored-By trailer - #14

Merged
ruleofcodedev merged 1 commit into
developfrom
feature/commit-trailer-guard
Aug 8, 2026
Merged

test: fail the build on a Co-Authored-By trailer#14
ruleofcodedev merged 1 commit into
developfrom
feature/commit-trailer-guard

Conversation

@ruleofcodedev

Copy link
Copy Markdown
Contributor

The Co-Authored-By trailer belongs to the tooling some contributors run, not to this repository. It reached nine commits before anyone noticed. Discipline did not catch it, so a gate does.

What lands

  • tests/regression/commit-trailer-guard.test.ts — scans every authored commit and fails on the trailer, naming the offending SHA rather than just going red.
  • The eight already-published commits are listed by full SHA, so nothing is grandfathered vaguely. That list is a ratchet: a separate assertion fails if it ever grows, because adding a SHA to excuse a new commit is the box-ticking this project refuses to accept from anyone else.
  • CLAUDE.md (new) — the rule for automated contributors, with the other conventions learned the hard way: run the full suite rather than the files you think you touched; verify commit line lengths in a step of their own, since chaining the check to the commit means committing before reading the check.
  • CONTRIBUTING.md — the same rule for humans.

Why the eight stay

Rewriting master and develop and breaking three release tags to delete one line is not a trade worth making. The decision is recorded in the test itself, next to the SHAs it covers.

Verdict impact

None. No detector, law, threshold or default changes — this is a project-local convention gate.

Evidence

  • Proven red: a throwaway commit carrying the trailer failed the test with its own SHA in the output (Received: ["b4fae96 test: probe the trailer guard"]), then was removed.
  • Proven green: passes against this branch, whose own commit carries no trailer.

Gate

  • npm run lint — 0 errors
  • npx jest — 504 suites / 13866 tests, exit 0
  • node dist/cli.js audit — passed 35, failed 0

The trailer belongs to the tooling some contributors run, not to this
repository, and it reached nine commits before anyone noticed.
Discipline did not catch it, so a gate does now.

- a regression test scans every authored commit and fails on the
  trailer, naming the offender rather than just going red;
- the eight already-published commits are listed by full SHA, so nothing
  is grandfathered vaguely. That list is a ratchet: a separate assertion
  fails if it ever grows, because adding a SHA to excuse a new commit is
  the box-ticking this project refuses to accept from anyone else;
- CLAUDE.md states the rule for automated contributors, alongside the
  other conventions learned the hard way — including verifying commit
  line lengths in a step of their own, since chaining the check to the
  commit means committing before reading the check;
- CONTRIBUTING.md carries the same rule for humans.

Proven red: a throwaway commit carrying the trailer failed the test with
its own SHA in the output, then was removed.
@ruleofcodedev
ruleofcodedev merged commit 3f8ebd1 into develop Aug 8, 2026
2 checks passed
@ruleofcodedev
ruleofcodedev deleted the feature/commit-trailer-guard branch August 8, 2026 12:59
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