Boost in-progress items and their ancestors in sort scoring#786
Merged
rgardler-msft merged 2 commits intomainfrom Mar 2, 2026
Merged
Boost in-progress items and their ancestors in sort scoring#786rgardler-msft merged 2 commits intomainfrom
rgardler-msft merged 2 commits intomainfrom
Conversation
Co-authored-by: rgardler-msft <108765066+rgardler-msft@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add score multiplier for in-progress items in sorting algorithm
Boost in-progress items and their ancestors in sort scoring
Mar 2, 2026
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.
Items with
in-progressstatus and their ancestor epics were sorted at base priority, burying active work beneath unstarted items of equal or lower priority. This adds score multiplier boosts incomputeScore()so active work surfaces higher in allsortIndex-based views.Changes
src/database.tssortItemsByScore(): Before sorting, pre-computes aSet<string>of IDs that are ancestors of anyin-progressitem by walking each in-progress item's parent chain. Max-depth guard of 50 prevents infinite loops on circular refs. O(1) lookup per item during sort.computeScore(): Accepts the pre-computed ancestor set and applies two hardcoded multipliers as a final step:IN_PROGRESS_BOOST = 1.5— item is itselfin-progressPARENT_IN_PROGRESS_BOOST = 1.25— item is an ancestor of anin-progressitem-10000penalty dominatesStored
priorityfield is never modified — boost is a transient scoring adjustment only.tests/database.test.tsSeven new tests under
in-progress boost in computeScore / reSort:priorityfield unchanged afterreSort()Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/graphql/usr/bin/gh gh issue create --repo owner/name --title Item without GitHub mapping --body-file - --verify g/tests/cli/mockworktree bash -bin�� rev-parse g/tmp-worktree-8r9gNT/wt -bin/git -C /tmp/wl-wt-err-rrev-parse /bin/sh bash(http block)/usr/bin/gh gh issue create --repo owner/name --title Item 1 --body-file - g/tmp-worktree-8--import(http block)/usr/bin/gh gh issue create --repo owner/name --title Item 2 --body-file - --allow-empty bin/bash bash -bin�� ls-remote --exit-code bin/bash refs/worklog/datbash r5QQ6/wt bin/bash bash(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Boost in-progress items in sorting algorithm</issue_title>
<issue_description>
Boost in-progress items in sorting algorithm
Apply score multiplier boosts in
computeScore()for in-progress items (1.5x) and their ancestors (1.25x) so that epics with active work are not buried in sortIndex-based views.Problem statement
When a child work item is marked
in_progress, its parent (and ancestors) remain at their base priority in sort ordering. This means epics and parent items with active work can be buried below unstarted items of equal or lower priority, reducing visibility of active work across all sortIndex consumers (wl list, TUI, and any future views).Users
Success criteria
in_progressreceive a score multiplier boost (e.g. 1.5x) incomputeScore()duringreSort().in_progressitem receive a score multiplier boost (e.g. 1.25x) incomputeScore()duringreSort(), applied at a flat rate regardless of depth.in_progress, only the direct in-progress boost applies (not the ancestor boost on top of it).blockedstatus do not receive any in-progress boost (the existing -10000 blocked penalty remains dominant).priorityfield is never modified — boosts apply only to the computed score used for sortIndex assignment.Constraints
computeScore()/reSort(). Thewl nextselection pipeline (findNextWorkItemFromItems) continues to filter out in-progress items as before. The indirect effect of changed sortIndex values onwl nextordering is acceptable.Existing state
The scoring algorithm lives in
src/database.ts:computeScore()(lines 1065-1138) computes a numeric score as a weighted sum of priority (1000/level), blocks-high-priority boost (500), age (10/day), effort (20), recency (100), and blocked penalty (-10000). There is currently no status-based boost for in-progress items.reSort()(lines 280-288) callscomputeScore()for all active items and reassignssortIndexvalues.computeEffectivePriority()(lines 840-906) computes effective priority via inheritance from dependency edges and parent-child relationships. This is used by thewl nextselection pipeline but not bycomputeScore().The
wl nextcommand (src/commands/next.ts) auto-callsreSort()before selection, so score changes will indirectly affectwl nextrecommendations.Desired change
Modify
computeScore()insrc/database.tsto apply two new score multipliers:in_progress(and notblocked), multiply the final score by a hardcoded constant (e.g.IN_PROGRESS_BOOST = 1.5).in_progress, and the item itself is notin_progressand notblocked, multiply the final score by a constant (e.g.PARENT_IN_PROGRESS_BOOST = 1.25). Apply the same multiplier regardless of ancestor depth.The descendant check will need to traverse children (and their children) to detect any in-progress descendant. This may require access to the item store within
computeScore()or a pre-computed lookup of items with in-progress descendants.Key files likely affected:
src/database.ts—computeScore(), possibly n...✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.