Repository navigation
perf(pr-management-stats): build the whole dashboard as code - #1572
Merged
Merged
Conversation
potiuk
added this pull request to stack #1573
October 9, 2026 18:51
potiuk
force-pushed
the
perf/pr-mgmt-3-stats
branch
from
October 10, 2026 00:08
d2f20e4 to
f9f6d6b
Compare
The skill told the agent to fetch, classify, aggregate and render the dashboard by hand from ~2,500 lines of instructions, while a reference implementation sat beside it unused and had drifted from the spec. The implementation moves into the shared tools/pr-management as `pr_management.stats`, reads the sweep saved with `vetted-op-read --save`, and `pr-management stats build` produces the HTML (or Markdown), the summary and the exact gist-publish command. The skill is a router plus one `panels.md` read only when a maintainer asks what a panel means. Triage markers, bot detection and maintainer detection now come from the same modules pr-management-triage uses, so both skills agree on what "triaged" means. Drift fixed against the spec: the health rating points and bands, recommendation command names, the pressure weight, the missing legend panel, the 1000-result cap annotation, the Markdown fallback, and fold-aware Table 1. The model-graded classify and pressure-weight suites are mirrored one-to-one as pytest cases. The gist-publish command `stats build` prints for the agent to run is assembled with `shlex.join`, and the gist id — read from the agent-writable session state — must be hex, so no stored value can smuggle shell syntax into it. Generated-by: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01FTTd3HMcMsj7FwkhPPQcSx
potiuk
force-pushed
the
perf/pr-mgmt-3-stats
branch
from
October 10, 2026 00:22
f9f6d6b to
5500cc3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/pr-management-statssat unused and had drifted from the spec. It moves intotools/pr-managementaspr_management.stats;pr-management stats buildproduces the HTML (or Markdown), the summary and the exact gist-publish command.pr-management-triage, so the two skills agree on "triaged".Depends on the triage PR below it in the stack.
Security notes
The publish command the tool prints for the agent to run is built with
shlex.join, and the gist id — read from the agent-writable session state — must be hex; a hostile stored id is ignored with a warning (tested).Type of change
Test plan
prek run --all-filespassestools/pr-management: pytest (stats tests moved in fromtools/pr-management-stats) / ruff / mypybuild-loopeval suite: 6/6 passclassify(6) andpressure-weight(7) suites; mirrored one-to-one intests/stats/test_eval_cases.pyNotes for reviewers
--fetch-with-gh(CI mode) still uses the search path for closed PRs and marks the dashboard accordingly.Was generative AI tooling used to co-author this PR?
Generated-by:.🤖 Generated with Claude Code
https://claude.ai/code/session_01FTTd3HMcMsj7FwkhPPQcSx