Fix bw ready: surface frontier in claimed-but-open epics and under deferred parents#132
Merged
Conversation
…ferred parents (bw-lm4) The ready subtree overlay only drilled past in_progress/in_review nodes. Two reachable states were left with a hidden work frontier: 1. Starting a child directly (bw start <child>) leaves the parent epic open, but work has begun inside it. The open epic stayed a display root, so its whole subtree — including open, unblocked siblings — was suppressed and ready collapsed to just the epic. Now an open node with any in_progress/in_review descendant is treated as underway: we drill past it to surface the live frontier and suppress the node itself. 2. A future-deferred epic acted as a display root and suppressed its open, unblocked children, so they vanished from the global ready frontier (scoped ready still showed them). Now we drill past a future-deferred node so its open children surface. Display-layer only; no data mutation. Adds regression tests for both states plus a guard that an unstarted epic with no claimed work still collapses as before.
iautom8things
requested changes
May 30, 2026
iautom8things
left a comment
Collaborator
There was a problem hiding this comment.
Looks good, otherwise. Just need to add tests for the recursive bit.
| t.Errorf("in_progress child B should not appear in ready, got %v", ids) | ||
| } | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Suggested change
| // When work is claimed two levels down (a grandchild started while both the | |
| // epic and the intermediate node stay open), Ready() must still recognize the | |
| // subtree as underway: suppress the open epic AND the open intermediate, and | |
| // surface the open sibling as the frontier. This exercises the recursive | |
| // descent in subtreeHasClaimedWork | |
| func TestReadyDrillsPastOpenRootWithTransitivelyClaimedChild(t *testing.T) { | |
| env := testutil.NewEnv(t) | |
| defer env.Cleanup() | |
| epic, _ := env.Store.Create("Epic", issue.CreateOpts{Type: "epic"}) | |
| mid, _ := env.Store.Create("Mid", issue.CreateOpts{Parent: epic.ID}) | |
| leaf, _ := env.Store.Create("Leaf", issue.CreateOpts{Parent: mid.ID}) | |
| sib, _ := env.Store.Create("Sib", issue.CreateOpts{Parent: epic.ID}) | |
| env.CommitIntent("setup") | |
| // Start the grandchild directly; epic and mid are left open. | |
| if _, err := env.Store.Start(leaf.ID, ""); err != nil { | |
| t.Fatalf("Start leaf: %v", err) | |
| } | |
| env.CommitIntent("start " + leaf.ID) | |
| ready, err := env.Store.Ready() | |
| if err != nil { | |
| t.Fatalf("Ready: %v", err) | |
| } | |
| ids := make(map[string]bool) | |
| for _, r := range ready { | |
| ids[r.ID] = true | |
| } | |
| if !ids[sib.ID] { | |
| t.Errorf("open sibling should surface as the frontier, got %v", ids) | |
| } | |
| if ids[epic.ID] { | |
| t.Errorf("open epic should be suppressed (transitively claimed work), got %v", ids) | |
| } | |
| if ids[mid.ID] { | |
| t.Errorf("open intermediate node should be suppressed (claimed child below it), got %v", ids) | |
| } | |
| if ids[leaf.ID] { | |
| t.Errorf("in_progress leaf should not appear in ready, got %v", | |
| } | |
| } |
Addresses review feedback on #132: exercise the recursive descent in subtreeHasClaimedWork via a grandchild started while the epic and the intermediate node both stay open. Verifies both open ancestors are suppressed and the open sibling surfaces as the frontier.
Owner
Author
|
Added |
iautom8things
approved these changes
May 31, 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.
What
bw readybuilds a subtree overlay that suppresses everything beneath a "display root." Drill-in (revealing the next-step frontier) only fired forin_progress/in_reviewnodes. Two reachable states were left with a hidden work frontier:1. Starting a child directly orphans the frontier
bw start <child>moves only that issue toin_progress— it never promotes the parent epic. So the epic staysopen, remains a display root, and its whole subtree (including open, unblocked siblings) is suppressed.bw readycollapses to just the epic.2. A deferred parent hides its open children
A future-deferred epic acted as a display root and suppressed its open, unblocked children, so they dropped off the global ready frontier (scoped
bw ready <epic>still showed them).Fix
Both fixes are in the
walkinsidebuildSubtreeOverlay(internal/issue/blocking.go) — display-layer only, no data mutation:in_progress/in_reviewdescendant is treated as underway: drill past it to surface the frontier, and mark the node itself suppressed.An open epic with no claimed work inside still collapses to itself as before — you start it to reveal its children.
Tests
TestReadyDrillsPastOpenRootWithClaimedChild— frontier surfaces after starting a child directlyTestReadyOpenRootNoClaimedWorkStillCollapses— guard: unstarted epic still collapsesTestReadyDeferredParentSurfacesOpenChildren— open children surface under a deferred epicFull suite green.
Closes bw-lm4.