Skip to content

feat(issues): add issue flow and backlog health analytics - #1

Merged
yyeret merged 6 commits into
mainfrom
claude/workflows-issues-analytics-eb07e9
Oct 6, 2026
Merged

yyeret merged 6 commits into
mainfrom
claude/workflows-issues-analytics-eb07e9

Conversation

@yyeret

@yyeret yyeret commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

Analyzing a repo now also shows whether its issue backlog is healthy: how fast issues get resolved, whether arrivals outrun resolutions, how old the open backlog is, which issues have gone stale, and how many closed issues ever got a PR. Until now issues appeared only when a merged PR closed them, so demand that never got resolved was invisible.

The new "Issue Flow & Backlog Health" section sits below the existing charts in the web app. It adds five KPI cards, an arrivals-vs-resolutions chart with the open backlog overlaid, an open-issue age chart, and a stale-issues table (no comment for 90+ days). The AI coach can answer questions about it. The legacy dashboard.html is untouched. Issue data is fetched alongside the PR queries and fails soft: if it can't be fetched, the section is hidden and the PR analysis is unaffected.

Session-settled decisions carried from planning: issue flow and backlog health as the first scope (user-directed, over responsiveness, issue mix/AI impact, and issue-to-PR linkage); live web app only (user-directed, over also updating dashboard.html). Plan: docs/plans/2026-10-06-0619-feat-issues-analytics-plan.md.

Implementation deviation from the plan

On sveltejs/svelte the plan's KTD3 (reuse the CFD weekly bins) capped the issue window at 9 weekly points, because 600 merged PRs cover only ~10 weeks there. That missed the plan's goal of at least 20 weekly points, and the sequential issue fetch added ~46s to analyze. Changes made in 1329c4a:

  • Issues use their own 52-week window, and the closed-issue query is date-bounded (closed:>= 52 weeks ago) with the cap raised from 600 to 1000.
  • The issue fetch runs in parallel with the PR queries, and its three searches run in parallel with each other.
  • Measured on sveltejs/svelte: analyze takes 56s (PR-only is ~48s), with 52 weekly points and no null fields.

The plan file was not edited during execution, so its KTD2 (600 cap, updatedAt-based window) and KTD3 text are stale relative to the code.

Validation

  • pytest tests -q: 20 passed. This adds the repo's first test suite: metrics (AE1-AE3 each have a named test), collection paging and truncation, the analyze payload, and the chat prompt.
  • Live POST /api/analyze for sveltejs/svelte: 938 open issues, 549 closed in the window, 52 weekly points.
  • Browser check on the running app: the Issues section renders (5 KPIs, 2 charts, 25-row stale table), the console is clean, and the section hides when issues is null. Legacy python analyze.py still regenerates dashboard.html.
  • Reviewed at full depth (correctness, testing, maintainability, reliability, security, adversarial). No P0/P1 findings. The cross-model peer review was deliberately not run, because it would send the diff to another model provider without authorization.

Unapplied review findings

  • P3 — index.html:718 — Dormant repo with zero recent closed issues shows a green "↓ 100% vs 2021" cycle-time badge (gate the badge on im.n > 0 as well as ib.n > 0). Confirmed by validator.
  • P3 — index.html:719 — Net backlog of exactly zero is labeled "Shrinking" in green (use a three-way Growing/Flat/Shrinking label with a neutral class for zero). Confirmed by validator.

Not applied because each had confidence 75 from a single reviewer with no cross-reviewer agreement, and one is classified manual. Review run: 20261006-063821-c19f8be2 (artifacts in /tmp/compound-engineering-501/ce-code-review/20261006-063821-c19f8be2).

Also worth a human look (residual risks, not proven defects):

  • The Search API's 1000-result cap may report hasNextPage=false at the cap, so the truncation flags would never fire.
  • The 2021 baseline is an arbitrary unsorted sample of 100 issues, so the "vs 2021" delta can look extreme (+5996% on sveltejs/svelte).
  • gh issue searches have no timeout (same as the existing PR calls), and a failed fetch is silent in the UI.
  • Stale detection counts bot comments as activity, and the stale table overflows its card by ~6px at 375px width.
  • Mutation checks showed that the net_8w slice and the modern-window filter lack tests.

Compound Engineering

🤖 Generated with Claude Code

yyeret and others added 6 commits October 6, 2026 06:26
Cycle time by era, weekly arrivals vs resolutions, open backlog, age buckets,
stale issues, and linked-PR share (U1).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fetch open, recently closed, and baseline-era issues fail-soft, cache them in
the raw bundle, and return an issues payload from compute_flow_metrics (U2, U3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add an Issue Backlog block to the chat system prompt when issue metrics exist
and a quick-question chip for it (U4).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
KPI cards, arrivals-vs-resolutions chart with open backlog, age distribution,
and a stale-issues table, hidden when issue data is absent (U5).

Issues now use their own 52-week window and a closed-date-bounded query, and
are fetched in parallel with the PR queries. Reusing the CFD weekly bins capped
the window at 9 weeks on a busy repo, and the sequential fetch added 46s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Parse issue rows once instead of id()-keyed side dicts, expose net_8w from the
payload so the UI and chat prompt stop recomputing it, and release the issue
fetch pool right after submit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Requirements and implementation plan the issues analytics feature was built from.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@yyeret
yyeret merged commit b9f29ba into main Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant