Skip to content

perf(pr-management-stats): build the whole dashboard as code - #1572

Merged
potiuk merged 1 commit into
mainfrom
perf/pr-mgmt-3-stats
Oct 10, 2026
Merged

potiuk merged 1 commit into
mainfrom
perf/pr-mgmt-3-stats

Conversation

@potiuk

@potiuk potiuk commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • The stats skill had the agent fetch, classify, aggregate and render the dashboard by hand from ~2,500 lines, while tools/pr-management-stats sat unused and had drifted from the spec. It moves into tools/pr-management as pr_management.stats; pr-management stats build produces the HTML (or Markdown), the summary and the exact gist-publish command.
  • Triage markers, bots and maintainers come from the same modules as pr-management-triage, so the two skills agree on "triaged".
  • Drift fixed against the spec: health-rating points and bands, recommendation command names, the pressure weight, the missing legend panel, the 1000-result cap annotation, the Markdown fallback, fold-aware Table 1.

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

  • Skill change — eval fixtures updated below
  • Python package

Test plan

  • prek run --all-files passes
  • tools/pr-management: pytest (stats tests moved in from tools/pr-management-stats) / ruff / mypy
  • New build-loop eval suite: 6/6 pass
  • Retired the model-graded classify (6) and pressure-weight (7) suites; mirrored one-to-one in tests/stats/test_eval_cases.py

Notes for reviewers

  • A folded confirmation request is not a triage marker (shared rule), so a PR mid-confirmation shows as untriaged in stats — worth a look.
  • --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?
  • Yes — Claude Code (Opus 5). I reviewed the diff and the test results; commits carry Generated-by:.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FTTd3HMcMsj7FwkhPPQcSx

@potiuk
potiuk added this pull request to stack #1573 October 9, 2026 18:51
@potiuk potiuk added family:pr-management pr-management-* skills family:tools tools/* capability:stats Read-only dashboards, metrics, governance evidence substrate:analytics Tool substrate: read-only metrics / dashboards / renderers labels Oct 9, 2026
@github-actions github-actions Bot added family:docs Docs, MISSION.md, READMEs family:ci .github workflows, prek, validators substrate:framework-dev Tool substrate: build / validate / eval the framework itself labels Oct 9, 2026
@potiuk
potiuk force-pushed the perf/pr-mgmt-3-stats branch from d2f20e4 to f9f6d6b Compare October 10, 2026 00:08
Base automatically changed from perf/pr-mgmt-2-triage to main October 10, 2026 00:22
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
potiuk force-pushed the perf/pr-mgmt-3-stats branch from f9f6d6b to 5500cc3 Compare October 10, 2026 00:22
@potiuk
potiuk merged commit 6d49f0d into main Oct 10, 2026
58 checks passed
@potiuk
potiuk deleted the perf/pr-mgmt-3-stats branch October 10, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:stats Read-only dashboards, metrics, governance evidence family:ci .github workflows, prek, validators family:docs Docs, MISSION.md, READMEs family:pr-management pr-management-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers substrate:framework-dev Tool substrate: build / validate / eval the framework itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant