Skip to content

The trailer gate fails on how commits LAND: GitHub's Co-authored-by displaces the trailer block, and squash duplicates it #406

Description

@localai-bot

main is red on the agent-record job, at the step "Protocol prose matches the checkers that enforce it". The failing command is scripts/check-commit-trailers.py --range "$before..$head".

It is not flaky, and it is not an authoring mistake. The trailer gate fails on how commits LAND, not on how they are written.

Root cause

check-commit-trailers.py reads trailers through git interpret-trailers --parse, which by design treats only the final paragraph of a message as the trailer block. Every way GitHub composes a merge commit breaks that assumption:

$ git show -s --format=%B dbd0d51c | git interpret-trailers --parse
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>

The protocol trailers are present in that message. Git cannot see them, because GitHub appended Co-authored-by: as a separate trailing paragraph, which displaced the real block. The checker therefore counts zero and reports "must appear exactly once".

Three distinct artifacts, all confirmed by inspection:

Commit What git parses Cause
b8293c88 every trailer twice squash of a multi-commit PR concatenated both trailer blocks
dbd0d51c, 87308dea, f64f2b71 zero GitHub appended Co-authored-by: in a new paragraph
b580452d zero "Merge pull request #386" — GitHub-authored message, no trailers at all

13 of the last 30 commits on main fail this check. They did not red CI at the time only because those runs were cancelled — which is the second half of #274. The cancellation policy hid the defect; it did not cause it.

Why this is a checker change and not just a process rule

The obvious answer is "always land with a hand-written message". That is already the practice recorded in the project's own history, and 13/30 says relying on it has failed. It also forbids the GitHub merge button permanently, and regresses silently the first time anyone uses it.

More importantly, Co-authored-by: is legitimate. AGENTS.md forbids AI tools from adding Co-Authored-By; it does not forbid GitHub from recording a real human co-author. The gate is rejecting a correct commit because of paragraph placement, which is not what it exists to police.

Proposed change, and its limit

Two narrow relaxations, neither of which weakens the actual guarantee:

  1. Join consecutive trailing trailer-shaped paragraphs before parsing. A prose paragraph still terminates the block, so a message with trailers buried mid-body still fails. This fixes the Co-authored-by case.
  2. Collapse identical duplicate trailer lines, while still failing on the same key with conflicting values. This fixes the squash-concatenation case without letting AI-Assisted: true and AI-Assisted: false coexist — which is the ambiguity the "exactly once" rule actually exists to catch.

What stays red, deliberately: a GitHub-authored "Merge pull request #N" message with no trailers at all (b580452d). That is a genuine violation and must keep failing.

Note this does not retroactively green b8293c88's own run — that commit is on main and main is never rewritten. The next push's range starts after it, so the failure does not recur.

Requires a spec, red-before tests per case, and mutation evidence in tests/scripts/test_check_commit_trailers.py, per AGENTS.md §"Changing the rules or a checker".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions