Repository navigation
✨ Governor PRs by model: per-repository breakdown and weekly trend - #18779
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@Danathar this PR is back in your court ( Review asks:
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. Your relay session received this as a |
Each /api/governor/pr-models bucket gains repos[] (canonical owner/repo via effectivePRRepo, PRs descending) and weeks[] (ISO week starting Monday UTC by created_at, oldest first; omitted for window=7d). Rework figures in both cover merged PRs only, as the bucket's do. The Governor card shows both in the model row's tooltip. Existing fields unchanged. Refs hivecommons#18716 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
…test pr_models_header_once.test.js lifts the card's functions out of static/index.html by name; the new tooltip helper was not lifted, so renderGovernorPRModelsTile threw. Lift it, and assert the repo and weekly lines render only for a bucket that has them. Refs hivecommons#18716 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
dceb2ea to
3d4bcad
Compare
There was a problem hiding this comment.
Style review: the change follows the existing sources/efforts slice pattern, and docs, changelog fragment and the generated index.html are updated together. One advisory note: governorPRModelWeekBucket omits open/closed_unmerged, which governorPRModelRepoBucket includes, with no comment saying why. Either add them or note the omission in the type comment. Not blocking.
— hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.326
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review follow-ups: 1 open of 1 (below
|
The PRs by model card gives one set of numbers per model for the whole window, so you cannot tell whether a model's rework comes from one hard repository, or whether the model is getting better or worse.
This PR splits each model's numbers by repository and by week, from data the hive already holds. Hover a model row on the Governor card to see both. No new GitHub calls, no new columns, and existing response fields are unchanged.
Refs #18716
Part of #18723
What this changes
GET /api/governor/pr-models: each bucket gainsrepos[]andweeks[].repos[]: one entry perowner/repo, most PRs first. A short configured repo name and the full name count as one repository.weeks[]: one entry per week (Monday, UTC, by PR created date), oldest first. Empty weeks are left out. Present for30dandall, absent for7d(a single week adds nothing).Why
A model that mostly works in a hard repository looks worse than it is, and the only way to see a trend today is to diff the 7d, 30d and all-time views by hand.
How it works
The same pass that builds each bucket also adds every PR to a repository slice and a week slice. Each slice counts outcomes the way the bucket does, and keeps its own rework figures (first-pass rate, average review rounds, average fix attempts) from merged PRs only, as the bucket does. The repository comes from the PR URL when it has one. So the repository and week totals add back to the bucket's PRs, merged and first-pass-merged counts.
Example tooltip lines for one model in the 30d view:
Files
src/pkg/dashboard/api_governor_pr_models.go:aggregateGovernorPRModelsfills the slices; newgovernorPRModelRepoBucket,governorPRModelWeekBucket,governorPRModelSliceState,governorPRModelWeekStart,governorPRModelRepoSlices,governorPRModelWeekSlices.src/pkg/dashboard/static-src/js/governor-view.jsand the generatedstatic/index.html:governorPRModelSliceDetail, appended to the row tooltip.src/docs/dashboard-sections/overview-and-metrics.md: the new tooltip blocks and API fields.changelog.d/added-18716-pr-models-repos-weekly.md.Tests
TestAggregateGovernorPRModelsReposAndWeeks: two repositories (one PR given by short name with a full URL), PRs over three weeks with one exactly on Monday 00:00 UTC and one a second before it, per-repo and per-week figures, the sum invariants for 7d/30d/all, and noweekskey in the 7d JSON.governor-pr-models-ui.test.js: the tooltip detail renders repos and weeks when present, repos only for a 7d bucket, and nothing for a bucket with neither.governor_pr_models_ui_test.go: the new key names.CI: this PR's own v2 Tests and v2 CI checks. Only
gofmt -lwas run locally, as AGENTS.md requires.🤖 Generated with Claude Code
https://claude.ai/code/session_01WcWm7qFmFJp26r9LPdmi3t