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
1 change: 1 addition & 0 deletions changelog.d/added-pr-gate-grant-visibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The hive-posted PR-contents gate (`auto_merge.pr_gate`) now fails visibly instead of silently: the hive reads the Commit statuses permission its App installation was actually granted at startup and every 15 minutes, forces the gate off when the write grant is missing (it never promotes itself to `enforce`), and records a 403 on a status write per repository without retrying for 15 minutes. The spoke dashboard shows a banner naming the installation, what is missing, where an owner accepts it and the days left before 2026-12-02. The hub health verdict carries the cause with a remediation hint, red when a required check depends on the gate and amber otherwise. In `enforce`, a PR whose required gate context cannot be posted shows `unauthorized:post-pr-gate-status` rather than a bare `required-check-missing`. Nothing changes while the mode is `off` (refs #19038).
3 changes: 3 additions & 0 deletions src/cmd/hive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4805,6 +4805,7 @@ func (b *boot) bootHeartbeatWith(deps bootHeartbeatDeps) {
providerLimitReason, providerLimitRebuffs, providerLimitHiveWide, providerLimitAgents := spoke.ProviderLimitHeartbeatFields(agents, dashboard.InferenceBudgetExceeded)
lastWriteKickAt, kickDisposition, kickSkipReason, notWritableQueued :=
outputFreshnessHeartbeatFields(acmmLvl, govState, agents)
prGateCause, prGateDependsOn := b.dashSrv.PRGateCause()
ghAppTokenStatus, ghAppTokenLastMintAt, ghAppTokenError :=
githubAppTokenHeartbeatFields(b.cfg, b.dashSrv.GetGitHubAppPermIssue())
ghAppErrorClass, ghAppHTTPStatus := githubAppStructuredFailure(
Expand Down Expand Up @@ -4997,6 +4998,8 @@ func (b *boot) bootHeartbeatWith(deps bootHeartbeatDeps) {
GitHubAppRequired: b.dashSrv.IsGitHubAppRequired(),
GitHubAppPermIssue: b.dashSrv.GetGitHubAppPermIssue(),
GitHubAppState: b.dashSrv.GetGitHubAppState(),
PRGateCause: prGateCause,
PRGateDependsOn: prGateDependsOn,
GitHubAppTokenStatus: ghAppTokenStatus,
GitHubAppTokenLastMintAt: ghAppTokenLastMintAt,
GitHubAppTokenError: ghAppTokenError,
Expand Down
6 changes: 3 additions & 3 deletions src/docs/api-reference/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `GET` | `/api/openrouter/models` | Dashboard auth/session | Open Router Models | `pkg/dashboard/openrouter.go:47` |
| `GET` | `/api/openrouter/credit` | Dashboard auth/session | Open Router Credit | `pkg/dashboard/openrouter.go:48` |
| `GET` | `/openrouter/callback` | Public | Open Router Callback | `pkg/dashboard/openrouter.go:49` |
| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1805` |
| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1806` |
| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1807` |
| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1808` |
| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1809` |
| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1810` |
| `GET` | `/api/github-owner-identity` | Owner only | The hive owner's GitHub identity for remote repos ([#18197](https://github.com/hivecommons/hive/issues/18197)): `connected`, `login`, `scope`, `connected_at`, `usable`, `reason`, `verified_at`, `scope_required` (`public_repo`), `private_repos_supported` (false) and `file` (the token file path on the spoke). Never the token | `pkg/dashboard/api.go:567` |
| `POST` | `/api/github-owner-identity/start` | Owner only | Start the consent: a GitHub device flow with the spoke's `oauth_client_id` asking for `public_repo`, separate from the scope-free login flow. Returns `user_code`, `verification_uri`, `expires_in`, `interval`, `scope` and the `flow_id` the poll must present. 502 when GitHub refused the device-code request | `pkg/dashboard/api.go:568` |
| `POST` | `/api/github-owner-identity/poll` | Owner only | Poll the consent with `{"flow_id"}`: `status` `pending` / `slow_down` (poll again), `complete` (with `login` and the identity) or `error`. On completion the granted scope must cover `public_repo`, the token must validate and the account must be the logged-in owner's; the identity is then stored on the spoke (`/data/secrets/github-owner-token`, `HIVE_GITHUB_OWNER_TOKEN_FILE` overrides) and the reference-repo policies re-resolve. 400 without a live flow or with the wrong `flow_id`; audited as `github_owner_identity_connected` / `_rejected` | `pkg/dashboard/api.go:569` |
Expand Down
2 changes: 1 addition & 1 deletion src/docs/api-reference/dashboard-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ review are settled.
| `POST` | `/api/hives/{id}/heartbeat` | Dashboard auth/session | Hives Heartbeat | `pkg/dashboard/api_contribute.go:378` |
| `DELETE` | `/api/hives/{id}` | Owner only | Hives Delete | `pkg/dashboard/api_contribute.go:379` |
| `POST` | `/api/hives/onboard` | Dashboard auth/session | Hives Onboard | `pkg/dashboard/api_contribute.go:380` |
| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1812` |
| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1815` |
### Activity observation provenance

The CI snapshot retains real check/node IDs, head, App ID and transition times.
Expand Down
Loading
Loading