Repository navigation
Description
Goal
Add the configuration schema and a pure, side-effect-free classifier for a bounded pin-only exception to auto_merge.human_merge_paths. No gate wiring in this child — it only provides the building blocks the relay and sweep children consume.
Config (additive, src/pkg/config/config.go)
New key auto_merge.human_merge_pin_only (map owner/repo → block), next to HumanMergePaths:
auto_merge:
human_merge_pin_only:
owner/repo:
enabled: true
paths: [".github/workflows/*.yml", "Containerfile"] # must be a subset of human_merge_paths globs' matches
kinds: [action-sha, image-digest, version-pin]
trusted_authors: [login1, login2] # explicit allowlist; empty = exception never applies- Accessor
AutoMergeConfig.HumanMergePinOnlyFor(repo) (PinOnlyException, bool)matching repo case-insensitively likeHumanMergePathsFor. - Validation: unknown
kindsrejected;enabled: truewith emptypaths,kindsortrusted_authorsrejected. - Absent /
enabled: false→ accessor returns false; nothing else changes.
Changed-file patches
intent.ChangedFile gains Patch string (and a PatchMissing bool if useful). github.ListPRChangedFiles and automerge.ListChangedFiles populate it from the files API patch field. Existing callers are unaffected.
Classifier (new file, e.g. src/pkg/intent/pin_only.go)
ClassifyPinOnly(files []ChangedFile, matches []string, ex PinOnlySpec) (ok bool, reason string):
- Every matched file must be in
ex.paths, statusmodified, and have a non-empty patch (GitHub omitspatchfor large/binary diffs → reject, fail closed). - Every hunk must be a 1:1 replacement: each
-line paired with exactly one+line, identical after masking the pinned reference of an allowed kind:action-sha:uses: owner/repo[/path]@<40-hex>(same owner/repo/path; trailing# vXcomment may change)image-digest:image@sha256:<64-hex>/FROM ...@sha256:(same image name)version-pin: a version literal in an otherwise identical line
- Reject any pure addition/removal, any line whose non-pin text differs, and anything touching
permissions,secrets.,env,run:,with:keys,id-token,cosign/attest/provenance, CODEOWNERS/owners. Unknown → reject. - Returns a short reason naming the first rejecting file/line.
Tests (table-driven, follow intent test style)
pure action-SHA bump → ok; pure digest bump → ok; pin bump + one added step line → reject; pin bump + permissions: change → reject; missing patch → reject; added file → reject; path outside paths → reject; kind not enabled → reject; config absent → accessor false; validation errors.
Docs: add the key to src/docs/hive-merge.md / src/docs/operator-reference/README.md marked "not yet enforced" until the wiring children land. Changelog fragment changelog.d/added-pin-only-human-merge-config.md.
Part of #16242
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
✨ feat(config): stage bounded human-merge pin-only policy and classifier
✨ feat(config): stage bounded human-merge pin-only policy and classif…