feat(metrics): Add rework rate CLI command (5th DORA metric)#381
Closed
tamirdresher wants to merge 1 commit intobradygaster:mainfrom
Closed
feat(metrics): Add rework rate CLI command (5th DORA metric)#381tamirdresher wants to merge 1 commit intobradygaster:mainfrom
tamirdresher wants to merge 1 commit intobradygaster:mainfrom
Conversation
Add 'squad rework' subcommand that analyzes PR rework rate by examining merged PRs for post-review commits, review cycles, and changes-requested patterns using the gh CLI. Changes: - lib/rework.js: Pure calculation functions for PR rework analysis - index.js: 'rework' CLI subcommand with --days, --limit, --json flags - templates/skills/rework-rate/SKILL.md: Agent skill for rework analysis - test/rework-rate.test.js: 10 unit tests for calculation logic - package.json: Include lib/ in published files The rework command outputs: - Per-PR rework rate (% of commits after first review) - Review cycle count (changes-requested → approved loops) - Aggregate rejection rate and average rework time - Color-coded health indicators (green/yellow/red) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher
added a commit
to tamirdresher/squad
that referenced
this pull request
Mar 15, 2026
…ORA metric Add PR rework rate as OTEL metrics in squad-sdk, following the exact pattern of existing metrics (bradygaster#261-bradygaster#264) in otel-metrics.ts. New modules: - runtime/rework.ts: Pure calculation module with typed interfaces (PrInfo, PrReview, PrCommit, PrReworkResult, ReworkSummary) and functions (calculatePrRework, calculateReworkSummary) - otel-metrics.ts bradygaster#265 section: Four OTEL instruments - squad.rework.rate (Gauge) — rework rate percentage - squad.rework.cycles (Histogram) — review cycles per PR - squad.rework.rejection_rate (Gauge) — rejection percentage - squad.rework.time_ms (Histogram) — time spent in rework - Export functions: recordReworkMetrics(), recordReworkSummary() Includes 19 Vitest tests (9 for calculatePrRework, 4 for calculateReworkSummary, 6 for OTEL metric recording). Replaces bradygaster#381 (CLI command approach) with proper SDK-level OTEL metrics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster
added a commit
that referenced
this pull request
Mar 15, 2026
Cherry-pick of tamirdresher's PR #381 onto dev. Adds `squad rework` CLI subcommand + lib/rework.js calculation module + skill template. Co-authored-by: Tamir Dresher <tamird@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Owner
|
Closed — cherry-picked to dev (c58640f). See comment above. |
tamirdresher
pushed a commit
to tamirdresher/squad
that referenced
this pull request
Mar 16, 2026
* chore(squad): quality review findings — 7 issues filed Quality audit complete: 5 agents assessed CLI across testing, coverage, stability, accessibility, UX. Results: 4 P0 blockers (bradygaster#365–bradygaster#368), 3 P1 items (bradygaster#369–bradygaster#371). Blocking: Waingro dead sessions, ErrorBoundary, dropped input; Marquez help text consistency. Changes: - Logged session summary to .squad/log/2026-02-24T0205-quality-review-complete.md - Updated .squad/identity/now.md with quality review findings and new issue numbers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(squad): merge decision — Marquez UX audit findings Quality assessment merged from inbox (Grade B): 11 improvements (3 P0, 4 P1, 4 P2). help text, stub commands, vocabulary, separators, roster. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: P0 quality fixes — ErrorBoundary, session eviction, input buffer, stub removal (closes bradygaster#365, closes bradygaster#366, closes bradygaster#367, closes bradygaster#371) - Add ErrorBoundary class component wrapping App in Ink render call (bradygaster#365) Shows friendly message on crash, logs error to stderr - Dead session eviction in dispatchToAgent/dispatchToCoordinator (bradygaster#366) Deletes dead session from Map on error so next attempt creates fresh one - Input buffering while disabled in InputPrompt (bradygaster#367) Buffers keystrokes via useRef, restores on re-enable, no auto-submit - Remove stub commands: loop, hire; wire triage/watch to real runWatch (bradygaster#371) Remove stub help text entries for loop and hire - 10 new tests across repl-ux and cli-shell-comprehensive Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tamirdresher
pushed a commit
to tamirdresher/squad
that referenced
this pull request
Mar 16, 2026
…l paths (bradygaster#440) * chore(squad): quality review findings — 7 issues filed Quality audit complete: 5 agents assessed CLI across testing, coverage, stability, accessibility, UX. Results: 4 P0 blockers (bradygaster#365–bradygaster#368), 3 P1 items (bradygaster#369–bradygaster#371). Blocking: Waingro dead sessions, ErrorBoundary, dropped input; Marquez help text consistency. Changes: - Logged session summary to .squad/log/2026-02-24T0205-quality-review-complete.md - Updated .squad/identity/now.md with quality review findings and new issue numbers Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(squad): merge decision — Marquez UX audit findings Quality assessment merged from inbox (Grade B): 11 improvements (3 P0, 4 P1, 4 P2). help text, stub commands, vocabulary, separators, roster. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix bradygaster#418: Add progress indicator for long operations Show 'Still working... (Xm Ys elapsed)' after 30 seconds, updating every 30 seconds during sendAndWait timeout. Prevents users from thinking the system has hung during long agent operations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix bradygaster#428/bradygaster#401: Add pending input queue for disabled→enabled transition The ref-based buffer from bradygaster#381 handles keystrokes during disabled state, but fast typing during the disabled→enabled transition could race with React's useEffect. Added pendingInputRef queue to catch characters that arrive before the effect drains bufferRef. Edge cases fixed: - Paste events (rapid character arrival) - Fast typing during transition window - Race between useInput and useEffect restoration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix bradygaster#430: Document and enhance coordinator streaming diagnostics Verified that coordinator message_delta event wiring is correct: - Both dispatchToCoordinator and dispatchToAgent use identical streaming patterns - message_delta listener registered BEFORE awaitStreamedResponse call - CopilotSessionAdapter maps 'message_delta' -> 'assistant.message_delta' correctly - Coordinator session created with streaming: true config Enhanced diagnostics: - Added session creation logging (sessionId, capabilities) - Added listener registration/removal logging - Added fallback path logging to track when sendAndWait content is used - Documented streaming architecture in function comments All 41 streaming tests pass. No functional changes, only diagnostic improvements. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Kovash history: input buffering fix bradygaster#428/bradygaster#401 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Adds a \squad rework\ CLI subcommand that measures PR rework rate — the emerging 5th DORA metric — by analyzing merged pull requests for post-review revision patterns.
What is Rework Rate?
Rework Rate measures what percentage of code changes require revision after initial review. It captures:
Changes
Usage
\\�ash
Analyze last 30 days (default)
npx github:bradygaster/squad rework
Custom period and limit
npx github:bradygaster/squad rework --days 7 --limit 50
Machine-readable JSON output
npx github:bradygaster/squad rework --json
\\
Design Decisions
Tests
All 96 tests pass (10 new + 86 existing).
Future Work
This is Phase 1 of the rework rate integration. Future phases could add: