feat: sd triage — PageRank + betweenness + critical path ranking#7
Open
RogerNavelsaker wants to merge 2 commits intojayminwest:mainfrom
Open
feat: sd triage — PageRank + betweenness + critical path ranking#7RogerNavelsaker wants to merge 2 commits intojayminwest:mainfrom
RogerNavelsaker wants to merge 2 commits intojayminwest:mainfrom
Conversation
Adds two new modules:
- src/graph.ts: pure graph algorithms over the issue dependency graph
- PageRank (reversed graph): authority flows from dependents back to
their blockers; nodes that unblock the most work rank highest
- Betweenness centrality (Brandes): identifies coordination bottlenecks
— nodes on many shortest paths between other nodes
- Critical path length: longest forward chain of blocks edges; nodes
with long forward chains should start earliest
- Composite score: 0.5*pagerank + 0.3*betweenness + 0.2*criticalPath
- src/commands/triage.ts: sd triage command
- Same eligibility as sd ready (open + all blockers closed)
- Ranked by composite graph score descending, then priority ascending
- --json emits structured output for agent consumption
- --limit <n> returns top N issues only
- Human output shows score, critical path length, betweenness per issue
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
src/graph.tswith pure graph algorithms: reversed PageRank, Brandes betweenness centrality, and critical path DFSsrc/commands/triage.ts—sd triagecommand that ranks ready issues by composite graph scoretriageinsrc/index.tssrc/graph.test.ts(6 cases: empty, single node, linear chain, diamond bottleneck, score bounds, external edge filtering)How it works
sd triageapplies the same eligibility filter assd ready(open issues with all blockers closed), then ranks them by:blocksedges via DFSHuman output shows score (pts), critical path depth, and betweenness per issue.
--jsonemits a structured envelope for agent consumption.Test plan
bun test src/graph.test.ts— all 6 graph algorithm tests passsd triagein a repo with a dependency graph returns issues ranked by scoresd triage --limit 3returns top 3sd triage --jsonemits valid JSON withsuccess,issues,countsd readybehaviour is unchangedCloses #6
🤖 Generated with Claude Code