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/fixed-close-on-merge-refs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Close-on-merge no longer closes an issue a merged PR only references. The backfill sweep passed the configured short repository name (`utah-packages`) into the close path, and the `Refs` guard compared it with the parsed `owner/repo`, so `Refs #490` on projectbluefin/utah-packages#860 looked like no reference and #490 was closed with "Fixed by #860". References now compare as `owner/repo`. The close path reads the same non-closing decision as the coverage comment (`Refs`/`Part of`, or "#N stays open"). An issue carrying `hive/verified-open` or `hive/partially-addressed` is closed only by a PR whose own text closes it. `GET /api/close-on-merge/wrong-closes?days=N` lists issues closed the wrong way for maintainers to reopen.
110 changes: 110 additions & 0 deletions dashboard/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -36940,6 +36940,116 @@
}
}
},
"/api/close-on-merge/wrong-closes": {
"get": {
"tags": [
"Governor"
],
"summary": "List issues close-on-merge closed on a PR that left them open",
"description": "Owner only. Read-only report for maintainers (projectbluefin/utah-packages#490): issues the hive closed in the last ?days=N (default 30, 1-90) with \"Fixed by #N\" where PR #N only references the issue (Refs / Part of) or says it stays open, or where the issue carried hive/verified-open or hive/partially-addressed and the PR had no closing keyword for it. The scan reads GitHub on the installation token: it runs under a 60 s deadline, inspects at most 500 closed issues (truncated with a note past that) and caches each window's answer for 10 minutes (cached_at). GitHub's issue-list since filters on updated_at; the close time is checked locally. The hive reopens nothing; maintainers decide.",
"parameters": [
{
"name": "days",
"in": "query",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 90
},
"description": "Window in days (default 30)"
}
],
"responses": {
"200": {
"description": "Wrongly closed issues",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"since": {
"type": "string",
"format": "date-time"
},
"days": {
"type": "integer"
},
"complete": {
"type": "boolean",
"description": "false when a repository listing failed (error says which) or the scan was truncated"
},
"error": {
"type": "string"
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"repo": {
"type": "string"
},
"issue": {
"type": "integer"
},
"title": {
"type": "string"
},
"url": {
"type": "string"
},
"pr": {
"type": "integer",
"description": "The merged PR the hive's \"Fixed by #N\" comment names"
},
"closed_at": {
"type": "string",
"format": "date-time"
},
"reason": {
"type": "string",
"enum": [
"pr_leaves_issue_open",
"issue_marked_open"
]
}
}
}
},
"inspected": {
"type": "integer",
"description": "Closed issues inspected in the window"
},
"truncated": {
"type": "boolean",
"description": "The 500-issue cap stopped the scan; items covers only what was inspected"
},
"note": {
"type": "string",
"description": "Present when truncated"
},
"cached_at": {
"type": "string",
"format": "date-time",
"description": "Present when the answer came from the 10-minute cache"
}
}
}
}
}
},
"400": {
"description": "days out of range"
},
"503": {
"description": "GitHub client not configured"
},
"403": {
"description": "Not a verified owner"
}
}
}
},
"/api/sentinel": {
"get": {
"tags": [
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 @@ -318,7 +318,7 @@ Read the result from `GET /api/kick/{agent}/status`, which returns `status` of `
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/hold` | Owner or repo write/maintain/admin | Add or remove a dashboard hold chip for an issue or PR. Body `{"held": true}` adds the hive's exact-match canonical `hive-pause/<hive-id>` label; `{"held": false}` removes exactly the labels causing the hold (`hive-pause/<hive-id>` and/or generic hold labels) and never removes `hive/<hive-id>` provenance. Every toggle writes an audit-log entry; the #8851 upgrade migration writes `/data/hive-hold-migration-<hive-id>.json` with audit-backed, provenance-only, and ambiguous legacy `hive/<hive-id>` classifications. | `pkg/dashboard/api.go:364`, `pkg/dashboard/api_repo_hold.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decision` | Owner or repo write/maintain/admin, signed-in GitHub user | Record an operator decision from the activity monitor's row menu / selection bar. Body `{"decision": "approve"|"direction"|"close-superseded"|"close-wontfix", "comment": "…", "type": "issue"|"pr", "superseded_by": "#458"}`. On an issue parked at 045, `approve`/`direction` act exactly as a maintainer's `/hive approve` / `/hive decision <text>` comment would (labels, `approved-direction`, stage-engine Unparked fact, reply comment naming the operator). On a PR parked at 085 (`type: "pr"`), `approve` posts the `/lgtm` and `/approve` commands as two comments attributed to the operator, records the approval against the head as the human answer to a `requires_human` / decision-requested verdict (the lanes and the stage engine honour it like a trusted merger's Approve review), lifts `needs-human`, clears the sentinel label and acknowledges the bundle's sentinel findings for that head, re-derives the stage and drops the tracker cache β€” the response adds `released` (`approval-recorded`, `needs-human`, `sentinel-label`, `sentinel-acknowledged`) and `stage`; the merge gate decides from there (no review as the operator, no merge) β€” and `direction` records the text as a human change request against the head β€” the `/hive decision` fix lane β€” on a hive-authored PR only (409 otherwise). The close variants post a comment naming the operator (and the superseding PR when `superseded_by` is given) and close the item as not planned. Never merges. Every decision writes an audit-log entry (`repo_item_decision_*`). | `pkg/dashboard/api.go:365`, `pkg/dashboard/api_repo_item_decision.go` |
| `POST` / `GET` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated` | Same as `…/hold` (owner or repo write), signed-in GitHub user; `decisions.delegate.enabled` (403 when off) | *Let hive decide*: enqueue a delegated-decision job in which the hive decides the parked item itself as the owner's delegate under `pkg/delegatedecision.PolicyText` and records it as a human decision (`/hive decision` comment with the `<!-- hive:delegated-decision … -->` marker, park labels off, `triage/accepted`, queue approval on a PR head). Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason"}`. `POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park}, notes, error}`); 409 with the running job while one is in flight; `GET` reads it. Rails: never merges, refuses items wearing `hold`, never grants secrets/permissions (`needs-owner` + `hold` instead), recommends only on hive policy/governance questions (keeps 085). Audited as `repo_item_decision_delegated[_failed]`. See [dashboard-sections.md](dashboard-sections.md#let-hive-decide). | `pkg/dashboard/api.go:329`, `pkg/dashboard/api_repo_item_decide_delegated.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/accept-triage` | Owner or repo write/maintain/admin | Accept triage on an issue from the activity monitor's row menu β€” what a maintainer accepting triage on GitHub does by hand: adds the reporter-trust triage label (`triage/accepted`, or the first of `issue_filter.reporter_trust.untrusted_require_labels`; the label is created in the repo if missing) and removes the awaiting label (`needs-triage` / `reporter_trust.awaiting_label`) and a Hive-written `stage/015-triage-needed`. Empty body. Returns `{ok, repo, number, acceptLabel, added, removed, alreadyAccepted, minStatusSeq}`; an issue already carrying the accept label with nothing left to remove is a no-op (`alreadyAccepted: true`, no write, no audit). 404 for a pull request or an unknown item. The status snapshot's labels are patched so the next reconcile reads 010 Actionable before the engine's own 015 β†’ 010 derivation. Every write is audited as `repo_item_accept_triage` under the dashboard user. | `pkg/dashboard/api.go:576`, `pkg/dashboard/api_repo_item_accept_triage.go` |
| `POST` | `/api/repos/{owner}/{repo}/items/{number}/accept-triage` | Owner or repo write/maintain/admin | Accept triage on an issue from the activity monitor's row menu β€” what a maintainer accepting triage on GitHub does by hand: adds the reporter-trust triage label (`triage/accepted`, or the first of `issue_filter.reporter_trust.untrusted_require_labels`; the label is created in the repo if missing) and removes the awaiting label (`needs-triage` / `reporter_trust.awaiting_label`) and a Hive-written `stage/015-triage-needed`. Empty body. Returns `{ok, repo, number, acceptLabel, added, removed, alreadyAccepted, minStatusSeq}`; an issue already carrying the accept label with nothing left to remove is a no-op (`alreadyAccepted: true`, no write, no audit). 404 for a pull request or an unknown item. The status snapshot's labels are patched so the next reconcile reads 010 Actionable before the engine's own 015 β†’ 010 derivation. Every write is audited as `repo_item_accept_triage` under the dashboard user. | `pkg/dashboard/api.go:579`, `pkg/dashboard/api_repo_item_accept_triage.go` |
| `GET` | `/api/acmm/evaluation` | Dashboard auth/session | ACMMEvaluation β€” combined codebase + operational result, cached server-side for 1 hour (`acmmEvalTTL`). `?refresh=1` (the dashboard's "πŸ”„ Re-evaluate" button, #5877) bypasses the hourly TTL but is debounced server-side: requests within 1 minute of the last evaluation (`acmmRefreshDebounce`) still serve the cache, since a full refresh costs up to ~29 GitHub GetContents calls per repo. The response's `last_evaluated_at` timestamp reports when the cached evaluation was computed | `pkg/dashboard/api.go:373`, `pkg/dashboard/api_acmm_eval.go` |
| `POST` | `/api/acmm/issue` | Owner only | ACMMCreate Issue β€” files on GitHub or, with `governor.acmm.issue_tracker: work_source` / body `tracker: "work_source"` on a Linear-sourced hive, on Linear; response `tracker` says which. See [ACMM policy matrix](acmm-policy-matrix.md#where-acmm-gap-issues-are-filed) | `pkg/dashboard/api.go:374` |
| `GET` | `/api/acmm-recommendation` | Dashboard auth/session | Advisory level-up recommendation (`acmmadvisor.Recommendation`, JSON): never changes the applied level β€” see [ACMM advisor](acmm-advisor.md) | `pkg/dashboard/api.go:375` |
Expand Down
3 changes: 2 additions & 1 deletion src/docs/api-reference/dashboard-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ The monitor renders CI and Review concurrently on one shared PR row; see
| `GET` | `/api/upstream-watch` | Owner only | Upstream-watch divergence: per watched fork the upstream followed, the watermark and last-run time, surfaced/ported/dismissed/skipped counts, and the recent upstream refs with their upstream URL, diff URL, fork issue number and state. Read-only β€” it reads the config and the watch state file, never GitHub. Also carries `interval`, `project_repos` and each repo's configured entry (`config`) for the editor. | `pkg/dashboard/api.go:321` |
| `PUT` | `/api/config/upstream-watch` | Owner only | Upstream Watch Config Update: edit `upstream_watch` from the Features tab. Body `{enabled?, interval?, repos?: {<repo>: {upstream?, sources?, pr_labels?, max_issues_per_run?, label?} \| null}}` β€” absent keys are unchanged, `null` removes a repo, keys are stored as the bare repo name. Validated with the loader's rules before the config changes (400 on failure), then persisted and audited as `config_upstream_watch`. | `pkg/dashboard/api.go:322` |

| `GET` | `/api/hotspots` | Dashboard auth/session | Merge-hotspot advisor report (`?repo=owner/name` optional): files repeatedly touched by concurrent PRs over the last `governor.hotspot_window_days`, each with `prs` (distinct PRs), `pr_numbers`, `overlaps` (PR pairs open at the same time), `conflicts` (rebase conflicts blamed on the file), `lines`, `kind` (`code`/`doc`/`lock`/`generated`/`data`), `score`, `symbol_groups`, `recommendation` (`split-code`/`split-doc`/`split-source`/`report-only`/`none`), `reason`, `generated_from`, `source_files` (files under `generated_from`, when known), `issue_number`/`issue_url` of the modularize issue filed, `last_updated`; top-level `count`/`actionable`/`filed`. Derived from the merge train's own PR file lists and the rebase follow-through's conflict records β€” never lists PRs or files from GitHub. See [operator-reference.md Β§ Merge-hotspot advisor](../operator-reference.md#merge-hotspot-advisor-governorhotspot_). | `pkg/dashboard/api.go:567` |
| `GET` | `/api/hotspots` | Dashboard auth/session | Merge-hotspot advisor report (`?repo=owner/name` optional): files repeatedly touched by concurrent PRs over the last `governor.hotspot_window_days`, each with `prs` (distinct PRs), `pr_numbers`, `overlaps` (PR pairs open at the same time), `conflicts` (rebase conflicts blamed on the file), `lines`, `kind` (`code`/`doc`/`lock`/`generated`/`data`), `score`, `symbol_groups`, `recommendation` (`split-code`/`split-doc`/`split-source`/`report-only`/`none`), `reason`, `generated_from`, `source_files` (files under `generated_from`, when known), `issue_number`/`issue_url` of the modularize issue filed, `last_updated`; top-level `count`/`actionable`/`filed`. Derived from the merge train's own PR file lists and the rebase follow-through's conflict records β€” never lists PRs or files from GitHub. See [operator-reference.md Β§ Merge-hotspot advisor](../operator-reference.md#merge-hotspot-advisor-governorhotspot_). | `pkg/dashboard/api.go:570` |
| `GET` | `/api/close-on-merge/wrong-closes` | Owner (verified owner role; 403 otherwise) | Read-only report of issues close-on-merge closed on a PR that did not close them (projectbluefin/utah-packages#490): for each watched repo, issues closed in the last `?days=N` (default 30, 1–90) whose hive "Fixed by #N" comment names a merged PR that only references the issue (`Refs`/`Part of`) or says it stays open (`reason: pr_leaves_issue_open`), or that carries `hive/verified-open` / `hive/partially-addressed` and was closed by a PR with no closing keyword for it (`reason: issue_marked_open`). The scan reads GitHub on the installation token, so it runs under a 60 s deadline, inspects at most 500 closed issues (`truncated: true` with a `note` past that) and caches each window's answer for 10 minutes (`cached_at` on a cached answer; a failed scan is not cached). GitHub's issue-list `since` filters on `updated_at`, so the close time is checked locally. Returns `{since, days, items[], inspected, truncated, complete, note?, error?, cached_at?}`, each item `{repo, issue, title, url, pr, closed_at, reason}`. Maintainers reopen what they agree with; the hive reopens nothing | `pkg/dashboard/api.go:567` |
| `GET` | `/api/widget` | Dashboard auth/session | Widget | `pkg/dashboard/api.go:130` |
| `GET` | `/api/pane/{agent}` | Dashboard auth/session | Pane | `pkg/dashboard/api.go:135` |
| `GET` | `/api/role` | Dashboard auth/session | Role | `pkg/dashboard/api.go:149` |
Expand Down
Loading
Loading