Skip to content

fix(record): find the trailer block where the merge tool left it (#406) - #409

Merged
mudler merged 2 commits into
mainfrom
row/ENG-TRAILER-MERGE-ARTIFACTS
Aug 11, 2026
Merged

fix(record): find the trailer block where the merge tool left it (#406)#409
mudler merged 2 commits into
mainfrom
row/ENG-TRAILER-MERGE-ARTIFACTS

Conversation

@localai-bot

Copy link
Copy Markdown
Collaborator

Issue #406. Row ENG-TRAILER-MERGE-ARTIFACTS. Spec .agents/specs/trailer-merge-artifacts.md. Related: #274.

This is why main is red on agent-record — and one of the five failing shapes is the gate's own fault: it rejects a commit that is entirely correct.

Root cause

check-commit-trailers.py reads trailers via git interpret-trailers --parse, which treats only the final paragraph as the trailer block. GitHub appends Co-authored-by: as a separate trailing paragraph on squash merge, so a complete, correct block becomes invisible:

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

13 of the last 30 commits on main fail this check — unnoticed only because those runs were cancelled (#274). The cancellation hid the defect; it didn't cause it.

The fix

Fuse consecutive trailing trailer-shaped paragraphs before parsing. Nothing is relaxed: the block must still exist, the marker must still sit above it, each declaration must still appear exactly once, an AI co-author is still forbidden, and a prose paragraph still terminates the block.

I got this wrong first, and the reverted half matters more

My first attempt also collapsed identical duplicate trailers, to fix the multi-commit-squash shape. That relaxes the uniqueness rule — and an existing test already pins it. Rewriting that assertion to suit my change is exactly what AGENTS.md forbids.

The distinction is real: a doubled block is a genuinely malformed message, fixable at source by writing the squash body or landing a single-commit PR; the Co-authored-by case is a correct commit defeated by the parser. Reverted in full.

Scope limit — this does NOT make main green on its own

Commit Shape After this change
dbd0d51c human co-author appended PASS (was failing — the fix)
f64f2b71 bot co-author appended fails — a real violation the parse had been hiding, now surfaced
87308dea GitHub's --------- separator fails — malformed
b8293c88 squash doubled the block fails — malformed
b580452d merge button, no trailers fails — real violation

The other four are merge-method artifacts. Closing them is a process change, not a checker change, and it's the open question I'd like your call on: either always land with an author-written message (which forbids the merge button), or accept that bot co-authors and squash separators will keep redding main.

Evidence

preflight rc=0; test_check_commit_trailers 21 — the RED-BEFORE case plus four guards that keep the fusion bounded (doubled block, contradictory declarations, no-trailer merge message, prose after the block), all four green before and after; test_check_gate_commands 32. No product source touched.

🤖 Generated with Claude Code

mudler added 2 commits August 11, 2026 19:45
main is red on agent-record, and one of the five failing shapes is the gate's own
fault: it rejects a commit that is entirely correct.

check-commit-trailers.py reads trailers through `git interpret-trailers --parse`,
which by design treats ONLY the final paragraph as the trailer block. GitHub
appends `Co-authored-by:` as a SEPARATE trailing paragraph on a squash merge, so
a complete correct block becomes invisible. Piping `git show -s --format=%B
dbd0d51` into `git interpret-trailers --parse` prints nothing but that one
co-author line, and the gate duly reports trailers the commit plainly carries as
missing. 13 of the last 30 commits on main fail this check -- unnoticed only
because those runs were cancelled (#274), which HID the defect rather than
causing it.

The fix fuses consecutive trailing TRAILER-SHAPED paragraphs before parsing.
Nothing is relaxed: the block must still exist, the marker must still sit above
it, each declaration must still appear exactly once, and an AI co-author is still
forbidden. A prose paragraph still terminates the block, so trailers buried
mid-message stay invalid.

I got this wrong first and the reverted half is the more instructive one. The
first attempt ALSO collapsed identical duplicate trailers, to fix the
multi-commit-squash shape where the whole block appears twice. That relaxes the
uniqueness rule, and an existing test already pins it -- rewriting that assertion
to suit my change is exactly what AGENTS.md forbids. The distinction is real: a
doubled block is a genuinely malformed message, fixable at source by writing the
squash body or landing a single-commit PR, whereas the Co-authored-by case is a
correct commit defeated by the parser. Reverted in full; b8293c8 stays red on
purpose.

SCOPE LIMIT, stated rather than implied: this fixes ONE of five observed shapes,
and does NOT by itself make main green. Verified per commit --
  dbd0d51  human co-author appended       PASS (was failing; the fix)
  f64f2b7  BOT co-author appended         fails: a REAL violation the parse had
                                           been hiding, now correctly surfaced
  87308de  GitHub's `---------` separator fails: malformed
  b8293c8  squash doubled the block       fails: malformed
  b580452  merge button, no trailers      fails: real violation
The remaining four are merge-method artifacts. Closing them is a process change,
not a checker change, and the spec names it as follow-up.

Gates: preflight rc=0; test_check_commit_trailers 21 (the RED-BEFORE case plus
four guards that keep the fusion bounded -- doubled block, contradictory
declarations, no-trailer merge message, and prose after the block -- all green
before and after); test_check_gate_commands 32.

Issue: #406

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [Claude Code]
@mudler
mudler merged commit 157080c into main Aug 11, 2026
17 of 20 checks passed
localai-bot pushed a commit that referenced this pull request Aug 11, 2026
…418)

check-pr-size correctly refused the change: scripts/check-agent-record.py moved
without added evidence in its PAIRED suite. The bump is only a data re-pin, but
the gate does not distinguish that, and it is right not to -- a bump with no row
behind it looks exactly like a bump for a new row, which is the failure the pin
exists to catch.

Adds two cases keyed to THIS row rather than to the constant in general: the row
appears exactly once in the engine matrix, and moving the pin by one must make
the count disagree. The second is the mutation; without it the first would pass
against a decorative constant.

Not fixed here, and stated rather than left implicit: documentation-checkpoint
also reds this PR, because adding a row as ACTIVE is a lifecycle claim that owes
docs/STATUS.md and docs/BENCHMARKS.md. For a records-and-checker row those pages
are the wrong home -- STATUS is the per-capability surface and a commit-trailer
policy is not a capability -- so writing a line there to satisfy the gate would
be dishonest documentation. #409 and #416 both landed with that same gate red.
That is a real gap in the gate rather than in this change, and it deserves its
own issue instead of a paper-over here.

Gates: test_agent_record 31; check-pr-size now OK over this PR's range.

Issue: #418

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [Claude Code]
localai-bot pushed a commit that referenced this pull request Aug 11, 2026
… reproduce (#349)

Records the canonical six-point regrid: the published 27B c1 figure does not
reproduce, and the record now says so rather than carrying a number that only
held once.

The branch was red for three reasons, none of them its own measurement:

check-public-doc-tables conflicted because the branch re-pinned the STATUS
`chars` ratchet -- a key #364 deleted, because a byte count of one file stored in
another moved on every edit and coupled every PR to lines it did not own. Taking
main's version loses nothing: the re-pin existed only to pay for its own STATUS
edit.

.agents/NOW.md conflicted because the branch edited the per-row live-claims
table, which #374 deleted when the live position became derived. The measurement
itself was never in NOW.md -- it lives in docs/BENCHMARKS.md and
.agents/benchmark-record.md, both of which merged cleanly.

.agents/benchmark-record.md is genuinely append-only, so both sides were UNIONED
rather than one chosen. That is the one file where union is the correct
resolution under AGENTS.md, and taking either side alone would have silently
dropped a measurement.

Merged --no-ff rather than squashed so the individual record commits stay
inspectable, and because a squash of a multi-commit PR concatenates every
commit's trailer block and reds the gate -- the one merge-method shape #409
deliberately did not paper over.

Gate: scripts/agent-preflight.sh rc=0 on the merged tree. CI is queue-blocked
(#274), so the operator's own gate run is the authority, as AGENTS.md prescribes.
No product source is touched.

FOLLOWING_AGENTS_PROTOCOL

Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:claude-opus-5 [Claude Code]
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.

2 participants