3.1 KiB
3.1 KiB
PR merge squash message field
- Charter:
/home/hermes/agent-work/CHARTER-PRMERGE-MESSAGE-FIELD.md - Owner:
be-coder-08 - Branch:
fix/pr-merge-message-field - Base: remote
main/ localorigin/mainat85d2108e4ed15c744ad3b87a5b629e7b2d39405a - Estate: HOMELAB tooling shared by HOMELAB and USC
Objective
Add an optional, identity-checked Gitea squash message to pr-merge.sh so genuine multi-author PRs retain non-poster branch authors without weakening hardcoded squash behavior.
Binding requirements
Doremains hardcoded tosquash; no provider/repository default may select merge style.- A verified trailer uses a PR commit's linked
author.loginand that same commit's author email. No/users/{login}primary-email lookup occurs. Recorded rationale: this asks only what the provider can answer. - A commit with
author.loginnull blocks before merge, prints both the null provider fact and commit email fact, and names the escalation principal. - The BLOCK arm must be observed firing; a normal single-author API payload remains exactly
{ "Do": "squash" }. - Every provider mutation is read back from the provider; no real PR is merged during tests.
Derived interface decisions
- Add
--co-author-trailersrather than accepting arbitrary message text. The wrapper enumerates PR commits and constructs trailers, making an uncheckedCo-authored-byline unexpressible. - Require
--escalate-to PRINCIPALwith--co-author-trailers, so the BLOCK diagnostic always names a principal rather than a generic role. - Do not expose
MergeTitleFieldseparately. When trailers exist, set it from the provider PR title and setMergeMessageFieldonly to construction-generated trailers. This preserves one provider source for the title and avoids an unrelated caller-controlled degree of freedom. - Preserve first-commit order and emit one trailer per distinct non-poster
author.login, using that first linked commit's own email.
Plan
- Version the currently deployed wrapper byte-for-byte under
infra/fleet/tools/git/pr-merge.sh. - Pre-register verified, null-login BLOCK, unchanged single-author, and hardcoded-squash tests; observe RED before implementation.
- Implement authenticated commit enumeration, construction-only trailers, message fields on REST, and force REST when trailers are requested.
- Copy the exact final versioned bytes to the deployed wrapper; verify hashes match.
- Run focused and baseline checks, static/security review, identity-bound commit, queue guard plus direct Woodpecker terminal enumeration, push, self-post PR, and provider poster read-back. Stop at push/PR; do not merge.
Evidence
- RED against the byte-identical deployed baseline (
sha256 08a65e8584c5…): rc 1 with eight named failures. The wrapper rejected--co-author-trailers; the null-login path emitted none of the required BLOCK facts/principal; and both verified/ordinary API paths failed the stdin-config credential assertion (ordinary path exposed the fixture token through curl argv). Log:/home/hermes/agent-work/be-coder-08/evidence/prmerge-message-field-red.log.