This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 921e87ded06d8cfe03261a6d2a9afc7cdef18ed3
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Aug 7 17:46:44 2026 -0400

    Walk the subtree level by level in beads-report
    
    bd children recurses in its text output but not under --json, which returns
    direct children only. The merge-scope report therefore saw depth 1 and 
stopped:
    a four-level tree reported as two beads. It now descends until the frontier 
is
    empty.
    
    Assisted-by: Claude Code:claude-opus-5
---
 bin/beads-report.py | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/bin/beads-report.py b/bin/beads-report.py
index 466c937936..5675ec39cd 100755
--- a/bin/beads-report.py
+++ b/bin/beads-report.py
@@ -89,12 +89,28 @@ def load_export():
 
 
 def load_subtree(root):
-    """One root's subtree. `bd children` recurses, but the records it returns
-    carry no `design` field -- only comment_count. Rationale-at-risk detection
-    is correspondingly weaker in this scope."""
-    beads = {b["id"]: b for b in as_list(bd("children", root))}
+    """One root's subtree, gathered by descending one level at a time.
+
+    `bd children` recurses in its text output but NOT under `--json`, which
+    returns direct children only -- so a single call silently truncates the
+    subtree to depth 1. Verified against a four-level tree at bd 1.1.2.
+
+    The records returned carry no `design` field, only comment_count, so
+    rationale-at-risk detection is weaker in this scope than at release 
scope."""
+    beads = {}
     for record in as_list(bd("show", root)):
         beads.setdefault(record["id"], record)
+
+    frontier = [root]
+    seen = {root}
+    while frontier:
+        node = frontier.pop()
+        for child in as_list(bd("children", node)):
+            cid = child["id"]
+            beads.setdefault(cid, child)
+            if cid not in seen:
+                seen.add(cid)
+                frontier.append(cid)
     return beads
 
 

Reply via email to