Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/added-adminmcp-auto-merge-update.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- **Admin MCP: change merge settings through preview and confirm.** The new `auto_merge.update` write operation wraps `PATCH /api/config/auto-merge`, so an owner can change `squash_only`, `require_current_base`, `human_merge_paths`, the native merge queue, trusted authors, the contributor lane and the other merge settings without opening the dashboard. Lists take `add`/`remove` and `human_merge_paths` takes one repository at a time; the preview reads the current settings and sends each changed list or map whole, so entries you did not name are kept, shows every change before and after, and says when a change lets the hive merge more on its own. `write_confirm` refuses if any of those settings changed after the preview. The operation never merges a pull request, and `human_merge_pin_only` (not on the endpoint) is still set in the configuration file.
- **Admin MCP: change merge settings through preview and confirm.** The new `auto_merge.update` write operation wraps `PATCH /api/config/auto-merge`, so an owner can change `squash_only`, `require_current_base`, `human_merge_paths`, the native merge queue, trusted authors, the contributor lane and the other merge settings without opening the dashboard. Lists take `add`/`remove` and `human_merge_paths` takes one repository at a time; the preview reads the current settings and sends each changed list or map whole, so entries you did not name are kept, shows every change before and after, and says when a change lets the hive merge more on its own. `write_confirm` refuses if any of those settings changed after the preview. The operation never merges a pull request.
1 change: 1 addition & 0 deletions changelog.d/added-automerge-pin-only-setting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **The pin-only exception can be set from the dashboard and admin MCP.** `auto_merge.human_merge_pin_only`, which lets a pull request whose only change is a version or digest pin bump on a human-merge path merge without a hand merge, is now on `PUT`/`PATCH /api/config/auto-merge` (whole map, owner only), in **Settings → Features → Auto-merge** next to the human-merge paths, and in the admin MCP `auto_merge.update` operation one repository at a time. It is validated with the same rules `hive.yaml` loads under, refused for a repository with no `human_merge_paths`, saved like the other merge settings and applied without a restart, including to the merge-request relay. The MCP preview names what turning one on or widening it lets merge. What counts as a pin bump, and every other merge gate, is unchanged.
17 changes: 12 additions & 5 deletions src/docs/admin-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,12 @@ only.
`{"squash_only": {"add": ["org/c"]}}` or
`{"contributor_lane": {"repos": {"remove": ["org/a"]}}}`. A list takes `add`
and `remove`. `human_merge_paths` takes `owner/repo` and every pattern that
repository should hold; `null` or `[]` removes the repository. An unknown
field is refused.
repository should hold; `null` or `[]` removes the repository.
`human_merge_pin_only` takes `owner/repo` and that repository's whole
pin-only exception, `{"enabled": true, "paths": [...], "kinds": [...],
"trusted_authors": [...]}`; `null` removes it. An enabled exception needs
`human_merge_paths` for the repository, set already or in the same change.
An unknown field is refused.
- **Entries you do not name are kept.** The endpoint replaces each list and
map it is sent, so the preview reads the current settings and sends the
merged whole value. It shows every change before and after.
Expand All @@ -757,9 +761,12 @@ only.
- **Widening is disclosed.** The preview says when a change lets the hive
merge more on its own: turning on the trusted-author lane, removing a
human-merge path, adding a repository to the native merge queue, emptying a
repository allow-list (empty means every repository), and the like.
- It never merges a pull request. `human_merge_pin_only` is not on this
endpoint, so it is still set in the hive configuration file.
repository allow-list (empty means every repository), and the like. Turning
a pin-only exception on, or giving it more paths, kinds or trusted authors,
is widening too, and the preview names what merges as a result, for example
"pin bumps (action-sha) to .github/workflows/*.yml in org/a by renovate[bot]
will merge without a hand merge". Removing any of those is not.
- It never merges a pull request.

The Activity monitor's row actions:

Expand Down
2 changes: 1 addition & 1 deletion src/docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ History point limits, timestamp cutoffs, incremental cost reads and ETag/304 beh
| `GET` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Get | `pkg/dashboard/api.go:263` |
| `PUT` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Set | `pkg/dashboard/api.go:264` |
| `GET` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Get | `pkg/dashboard/api.go:268` |
| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set | `pkg/dashboard/api.go:269` |
| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set; `human_merge_pin_only` replaces the whole pin-only map (`{}` clears it), and an invalid entry is a 400 with nothing changed | `pkg/dashboard/api.go:269` |
| `GET` | `/api/config/convergence` | Owner only | Convergence Config Get | `pkg/dashboard/api.go:275` |
| `PUT` | `/api/config/convergence` | Owner only | Convergence Config Set | `pkg/dashboard/api.go:277` |
| `GET` | `/api/config/governor/advisory` | Owner only | Governor Advisory Get | `pkg/dashboard/api.go:281` |
Expand Down
2 changes: 1 addition & 1 deletion src/docs/api-reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `GET` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Get | `pkg/dashboard/api.go:263` |
| `PUT` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Set | `pkg/dashboard/api.go:264` |
| `GET` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Get | `pkg/dashboard/api.go:268` |
| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set | `pkg/dashboard/api.go:269` |
| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set; `human_merge_pin_only` replaces the whole pin-only map (`{}` clears it), and an invalid entry is a 400 with nothing changed | `pkg/dashboard/api.go:269` |
| `PATCH` | `/api/config/auto-merge` | Owner only | Partially update auto-merge settings, including nested `merge_train`; omitted fields stay unchanged; returns effective settings and bot-author metadata | `pkg/dashboard/api_config_automerge.go` |
| `GET` | `/api/config/convergence` | Owner only | Convergence Config Get | `pkg/dashboard/api.go:275` |
| `PUT` | `/api/config/convergence` | Owner only | Convergence Config Set | `pkg/dashboard/api.go:277` |
Expand Down
5 changes: 3 additions & 2 deletions src/docs/design/admin-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,9 @@ Phase 5 registers the fleet-level write operations under that contract:
The preview names each change that lets the hive merge more on its own (a lane turned on, a
human-merge path removed, a repository added to an allow-list or an allow-list emptied, which
means every repository). Both the read and the write are owner only at the endpoint, and the
op merges nothing itself. `human_merge_pin_only` has no field on the endpoint, so the op
cannot reach it.
op merges nothing itself. `human_merge_pin_only` is set one repository at a time the same way
(the whole exception for that repository, or `null` to remove it); turning one on or giving
it more paths, kinds or trusted authors is named as widening.

The Activity monitor's row actions are registered as the `repository.rescan` and
`repository.item_*` operations, each sending the request the dashboard's button sends
Expand Down
9 changes: 6 additions & 3 deletions src/docs/hive-merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,12 @@ schema or classifier APIs grants permission to merge or clears a hold. Native
required checks and producer bindings, freshness, current reviews, substantive
objections, unrelated holds and configured soak must remain independent gates.

Operators stage the key in the controller's configured `hive.yaml` seed, not in
the image repository (reload behaviour is documented in the operator reference
linked above). On an image that contains #16266 and #16265, reloading the seed
Owners set the key from **Settings → Features → Auto-merge → Pin bumps that
skip the hand merge**, through `human_merge_pin_only` on `PUT`/`PATCH
/api/config/auto-merge`, or with the admin MCP operation `auto_merge.update`;
it applies without a restart. It can also be staged in the controller's
configured `hive.yaml` seed, not in the image repository (reload behaviour is
documented in the operator reference linked above). On an image that contains #16266 and #16265, reloading the seed
enables the sweep, `/approve`, and `hive-merge` relay exception at once. Non-GitHub
forge relays retain the existing fail-closed human-merge-path policy.

Expand Down
39 changes: 25 additions & 14 deletions src/docs/operator-reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Go callers keep reading `cfg.Agents`, `cfg.Governor.Gateways` and so on through
| `config.refuse_gate_regression` | `false` | Safety-gate regression guard ([#16438](https://github.com/hivecommons/hive/issues/16438)). At boot the hive compares the effective config against any previous runtime overlay still on the PVC (`/data/hive.yaml.runtime`, an operator's `hive.yaml.runtime.bak`, `/data/hive.yaml.dashboard`) for `review.require_labels`, `project.issue_filter.require_labels`, `project.paused_repos` and `writeback.per_repo` modes. A gate the overlay carried that the effective config lacks or loosens — typically a boot from the ConfigMap seed after the overlay was moved aside — is logged once per gate as `WARN safety gate dropped: <gate> (was <value>) — effective config has <value>`, listed in `/api/status` under `config.gate_regressions`, and shown as a banner at the top of Settings. `true` makes it fatal: the hive exits (code 21) with the gates named instead of running with weaker gates. Set it in the overlay itself; the ConfigMap seed is the file the regression usually comes from. Legacy `/data/hive.yaml.bak` is not consulted — it is frozen at the rename and would warn forever about gates removed on purpose. |
| `auto_merge.allow_unprotected_base` | Deprecated no-op. | Accepted so older configs keep loading. `hive-merge` now merges into any protected or unprotected branch the App can write, subject to the CI-evidence gate and GitHub's own merge rules. |
| `auto_merge.no_ci_ok` | Empty by default. | Explicit repo list whose zero-CI merge-request verdict may pass; failing or pending CI evidence is still enforced. |
| `auto_merge.human_merge_pin_only` | Unset (off); enforced by the automerge sweep lanes and `/approve` (#16266), and by the `hive-merge` relay (#16265), which additionally requires the requested head SHA to match the PR head before and after fetching files. | Per-repo schema for `enabled`, `paths`, `kinds` (`action-sha`, `image-digest`, `version-pin`) and `trusted_authors`. Enabled entries require all three lists. The sweep does not place a human-merge-path hold on a PR whose author is in `trusted_authors`, whose complete diff (every changed file, guarded or not) is pin replacements, whose every commit is authored by a `trusted_authors` login with a GitHub-verified signature, and whose every new action SHA resolves in its upstream action repository (the `# vN` tag points at it, or it is on the default branch; #16399); it never clears an existing hold. See [hive-merge.md](../hive-merge.md) for grammar, restrictions and outstanding integration/deployment requirements (#16242). |
| `auto_merge.human_merge_pin_only` | Unset (off); enforced by the automerge sweep lanes and `/approve` (#16266), and by the `hive-merge` relay (#16265), which additionally requires the requested head SHA to match the PR head before and after fetching files. | Per-repo schema for `enabled`, `paths`, `kinds` (`action-sha`, `image-digest`, `version-pin`) and `trusted_authors`. Enabled entries require all three lists. The sweep does not place a human-merge-path hold on a PR whose author is in `trusted_authors`, whose complete diff (every changed file, guarded or not) is pin replacements, whose every commit is authored by a `trusted_authors` login with a GitHub-verified signature, and whose every new action SHA resolves in its upstream action repository (the `# vN` tag points at it, or it is on the default branch; #16399); it never clears an existing hold. Owners set it per repository from **Settings → Features → Auto-merge** or with the admin MCP operation `auto_merge.update`; an enabled entry is refused for a repository with no `human_merge_paths`. See [hive-merge.md](../hive-merge.md) for grammar, restrictions and outstanding integration/deployment requirements (#16242). |
| `auto_merge.human_merge_paths` | Unset (off). | Per-repo map of `owner/repo` to glob patterns (same syntax as `intent.guardrail_path_patterns`) for paths a person must merge. Applies to every merge lane (App self-merge, trusted-author, label-queued, merge-request relay) whatever the intent tier; a matching PR is held with one comment, and an incomplete changed-file list fails closed. Details in the sweep key table below. |
| `auto_merge.human_merge_title_prefixes` | `["⚠️", "⚠"]` | Title prefixes (after trimming) that mark a PR as a breaking change a person must merge. Every auto-merge lane and the merge train skip the PR; the tracker parks it at 090 *Ready for human merge · human merge*. Set to `[]` to disable. |
| `auto_merge.human_merge_labels` | `["needs-owner-merge"]` | Labels (case-insensitive) that mark a PR a person must merge; same effect as the title prefixes. Set to `[]` to disable. |
Expand Down Expand Up @@ -562,11 +562,11 @@ advanced into the merge path.
| `auto_merge.contributor_lane.exclude_labels` | `hold`, `do-not-merge`, `needs-human`, `blocked`, `needs-rebase` | Labels that keep a PR out of contributor-lane auto-merge (`do-not-merge/*` always excluded). |

Owners can edit `auto_merge.trusted_authors.*`, `auto_merge.contributor_lane.*`,
`auto_merge.require_current_base`, `auto_merge.squash_only` and
`auto_merge.human_merge_paths` from **Settings → Features → Auto-merge** (the
last three under **Per-repository merge policy**, picking from `project.repos`
and saving each value as `owner/repo`; a repo outside `project.repos` is
refused). The dashboard writes the same
`auto_merge.require_current_base`, `auto_merge.squash_only`,
`auto_merge.human_merge_paths` and `auto_merge.human_merge_pin_only` from
**Settings → Features → Auto-merge** (the last four under **Per-repository
merge policy**, picking from `project.repos` and saving each value as
`owner/repo`; a repo outside `project.repos` is refused). The dashboard writes the same
owner-only `/api/config/auto-merge` overlay as the other auto-merge controls, so
hosted spoke changes survive restarts without editing `hive.yaml`.

Expand Down Expand Up @@ -604,14 +604,25 @@ auto_merge:
| `kinds` | Explicit subset of `action-sha`, `image-digest`, `version-pin`; unknown kinds rejected. Required when enabled. An `action-sha` pin is admitted only when the upstream repo's `tags/<version comment>` (annotated tags dereferenced) points at the new SHA, or, without a comment, the SHA is an ancestor of the upstream default branch; any lookup failure holds. |
| `trusted_authors` | Explicit author allowlist; required when enabled. Matched against the PR author login and against the author login of every commit behind the head; each commit must also be committed by GitHub (`web-flow`) or by a trusted login and carry a GitHub-verified signature, since GitHub verifies the committer, not the author (web-flow-committed bot commits qualify; human authors must commit and sign as themselves). Not permission to trust arbitrary bot-looking logins. |

Edit the controller's active `hive.yaml` seed, not the consumer image repo.
The config file watcher loads the seed plus dashboard overlay after a debounced
file change and logs `config reloaded from file`; a rejected reload logs
`config reload failed` and does not install the change. See
[config layering](../config-layering.md) for seed/overlay precedence. Do not
assume the dashboard auto-merge editor exposes this new map. Verify both relay
and sweep lookups use the reloaded configuration before relying on it; use a
controller restart on the verified image if the running version lacks live wiring.
**Setting it.** On a build that has the editor, owners set the exception from
**Settings → Features → Auto-merge → Pin bumps that skip the hand merge**, one
row per repository that has paths a person must merge: on/off, the paths, the
kinds and the trusted authors. The same value goes through `PUT`/`PATCH
/api/config/auto-merge` as `human_merge_pin_only` (the whole map, like
`human_merge_paths`; `{}` clears it) or through the admin MCP operation
`auto_merge.update`, which changes one repository and keeps the others. The
endpoint checks it with the same rules `hive.yaml` loads under and refuses an
enabled entry it adds or changes for a repository with no `human_merge_paths`,
where the exception would never apply. It saves to the dashboard overlay and
applies at once, with no restart: the sweep lanes and `/approve` read it on
every evaluation, and the write refreshes the merge-request relay's copy. A
change that cannot be saved is rolled back.

On an older build, edit the controller's active `hive.yaml` seed, not the
consumer image repo. The config file watcher loads the seed plus dashboard
overlay after a debounced file change and logs `config reloaded from file`; a
rejected reload logs `config reload failed` and does not install the change.
See [config layering](../config-layering.md) for seed/overlay precedence.

Qualification requires a complete exact-head diff and trusted author, not just
SHA-shaped text. The exception never bypasses native required checks or producer
Expand Down
2 changes: 1 addition & 1 deletion src/docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Optional capabilities, each off or inert until you turn it on. Where a feature h
- Audit publication: [Audit campaign](audit-campaign.md#publication).
- Token mint: [Token mint](token-mint.md).
- Spek stage runner: [Spektacular](spektacular.md).
- Auto-merge: [App self-merge sweep](operator-reference.md#app-self-merge-sweep-auto_merge), [Trusted bot authors](hive-merge.md#trusted-bot-authors), [Trusted-author auto-merge](hive-merge.md#trusted-author-auto-merge), and the per-repository merge policy (`auto_merge.require_current_base`, `auto_merge.squash_only`, `auto_merge.human_merge_paths`).
- Auto-merge: [App self-merge sweep](operator-reference.md#app-self-merge-sweep-auto_merge), [Trusted bot authors](hive-merge.md#trusted-bot-authors), [Trusted-author auto-merge](hive-merge.md#trusted-author-auto-merge), and the per-repository merge policy (`auto_merge.require_current_base`, `auto_merge.squash_only`, `auto_merge.human_merge_paths`, `auto_merge.human_merge_pin_only`).
- Review gate: [Review swarm](review-swarm.md#configuration), [Blocking line and backlog](review-swarm.md#blocking-line-reviewseverity-reviewbacklog), and [external review bot threads](review-bot-threads.md).
- Trajectory review: [Trajectory-Review Lane](trajectory-review.md#configuration).
- Linear agent: [Linear agent integration](linear-agent.md).
Expand Down
Loading
Loading