Skip to content

✨ PRs by model: list one model's pull requests - #18785

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
Danathar:feat/pr-models-list-prs
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v5from
Danathar:feat/pr-models-list-prs

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

The Governor PRs by model card shows totals per model, but the only PRs it lists are the ten most reworked across all models. This PR lets you open one model's own PRs. /api/governor/pr-models gets an optional model= parameter, and each model row gets a ▸ PRs button that opens the list. Without model=, the response is unchanged.

Refs #18722
Part of #18723

What this changes

  • GET /api/governor/pr-models?window=…&model=<id> returns the usual body plus prs[]. That is every PR in the window whose bucket is that model.
  • Each entry has the most_reworked fields plus outcome, agent, created_at, merged_at and first_pass. No PR bodies are returned.
  • The list is sorted by review rounds + fix attempts, highest first, then newest first. It holds at most 200 PRs, and sets prs_truncated: true when there are more.
  • An unknown model gets prs: [], not an error. A missing or blank model= returns the same response as today.
  • Each PRs-by-model row has a ▸ PRs button. It opens the model's PRs under the row, and each PR links to GitHub. The list is fetched when you open it and cached per window and model.

Why

To see why a model's numbers look the way they do, you need its PRs: which ones, merged or closed, and how much rework each one needed. Before this PR, nothing on the dashboard or in the API listed them per model.

How it works

The handler canonicalises model= with modelfamily.Canonical, so anthropic/claude-opus-5-5 and claude-opus-5.5 give the same list. It then makes a second pass over the same PR snapshot, with the same window and attribution filters as the aggregate. So the list length equals the bucket's prs count, and the outcome counts equal merged, closed_unmerged and open. The aggregate function, most_reworked and its cap are untouched. The new code sits in a new file, so the sibling PRs-by-model issues rebase cleanly.

Example: ?window=30d&model=gpt-6.1-terra lists that model's PRs, worst rework first, each with its outcome and a GitHub link.

Files

  • src/pkg/dashboard/api_governor_pr_models_list.go (new): governorPRModelsQueryModel, governorPRModelPRList, withGovernorPRModelPRs and the response/item types.
  • src/pkg/dashboard/api_governor_pr_models.go: handleGovernorPRModels uses the wrapped response when model= is set (4 lines).
  • src/pkg/dashboard/static-src/js/governor-view.js + static/index.html (regenerated): toggleGovernorPRModelPRs, loadGovernorPRModelPRs, governorPRModelPRsToggleHtml, governorPRModelPRListHtml.
  • src/pkg/dashboard/static-src/css/governor.css: styles for the button and the list.
  • src/docs/api-reference/agents-and-controls.md, src/docs/dashboard.md: the parameter and the button.
  • changelog.d/added-18722-governor-pr-models-list-prs.md.

Tests

  • api_governor_pr_models_list_test.go: TestHandleGovernorPRModelsModelFilterListsPRs uses two models, mixed outcomes and raw spellings. It checks that the canonical and raw queries return the same list, membership, the window, the sort and the outcome-count invariant. It also checks that an unknown model gives [], that a missing or blank model leaves the response unchanged, and that the shared fields are identical with the filter. TestGovernorPRModelPRListCapsAt200 builds 201 PRs and checks the cap, the sort and prs_truncated.
  • dashboard/test/governor-pr-models-ui.test.js: opening a row requests model=…, renders the list with GitHub links and escaped titles, and reuses the cache.
  • governor_pr_models_ui_test.go: adds the handler name and markers.
  • CI: this PR's own v2 Tests and v2 CI checks. Only gofmt -l was run locally, as AGENTS.md requires.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t

GET /api/governor/pr-models takes an optional model= (canonicalised with
modelfamily.Canonical) and then adds prs[]: every PR in the window in that
model's bucket, with the most_reworked fields plus outcome, agent,
created_at, merged_at and first_pass, sorted by review rounds + fix
attempts then newest, capped at 200 with prs_truncated. Without model the
response is unchanged. Each PRs-by-model row gets a "PRs" disclosure that
fetches the list on demand, cached per window and model.

Refs hivecommons#18722

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18783 ✨ Evidence summary: change failures (reverts, reopened issues) per model same files src/docs/api-reference/agents-and-controls.md
src/pkg/dashboard/static/index.html
#18781 ✨ Spend and contributor run stats by model: add the canonical model name same files src/pkg/dashboard/static/index.html
#18782 ✨ Governor PRs by model: split closed-unmerged PRs into superseded, duplicate and other same files src/pkg/dashboard/api_governor_pr_models.go
src/pkg/dashboard/static-src/js/governor-view.js
src/pkg/dashboard/static/index.html
#18780 ✨ Governor PRs by model: what each model's PRs cost the hive to review same files src/docs/api-reference/agents-and-controls.md
src/docs/dashboard.md
src/pkg/dashboard/api_governor_pr_models.go
src/pkg/dashboard/pr_models_header_once.test.js
src/pkg/dashboard/static-src/js/governor-view.js
src/pkg/dashboard/static/index.html

pr_models_header_once.test.js lifts renderGovernorPRModelsTile out of
index.html; the row now calls the PR-list toggle and list helpers, so lift
them (and stub the open-row state and loader) alongside it.

Refs hivecommons#18722

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Danathar this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (3 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

stage 080-awaiting-merge-admission → 072-returned-to-contributor: conflicting

Evidence bundle `#18785ed036fe` sha256:ff7e215bd9eea07aab7ae896b422f960c608b58f5cdaf49a2dd97191ac0a35f1 — download from the dashboard or `hivectl review evidence #18785`.

Both sides added to the same UI test lists; keep both.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@github-actions github-actions Bot added conflicts-with-open-pr Open PR has a merge conflict with another open PR and removed conflicts-with-open-pr Open PR has a merge conflict with another open PR labels Nov 17, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit bb85cd0 into hivecommons:v5 Nov 17, 2026
75 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant