Skip to content

fix(beads-rust): use dependency_type instead of type in br show --json#308

Merged
subsy merged 1 commit intosubsy:mainfrom
thunter009:fix/beads-rust-dependency-type-field
Feb 18, 2026
Merged

fix(beads-rust): use dependency_type instead of type in br show --json#308
subsy merged 1 commit intosubsy:mainfrom
thunter009:fix/beads-rust-dependency-type-field

Conversation

@thunter009
Copy link
Contributor

@thunter009 thunter009 commented Feb 15, 2026

Summary

  • br show --json outputs dependency_type in dependencies/dependents arrays, but brTaskToTask() checked dep.type — field never matched, so dependsOn/blocks were always empty
  • Also fixed getPrdContext() which filters dependents by parent-child type
  • Updated BrTaskJson interface to match actual br output (added priority field too)

Note: br dep list --json does use type — the BrDepListItem interface was already correct. Only BrTaskJson.dependencies/dependents had the mismatch.

Repro

br show bd-xxx --json | jq '.dependencies[0]'
# → { "dependency_type": "blocks", ... }   (not "type")

Test plan

  • Verified br show --json output field name is dependency_type
  • Verified br dep list --json output field name is type (unchanged)
  • Blocked tasks should now display ⊘ instead of wrong icons in TUI

Fixes #307

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Improved task dependency handling: dependency items now include a priority value and use standardised relationship kinds (e.g. blocking vs parent/child), improving how links are recognised, counted and displayed across task and epic views.
  • Tests

    • Updated tests to match the revised dependency representation and ensure dependency-related features behave correctly.

@vercel
Copy link

vercel bot commented Feb 15, 2026

@thunter009 is attempting to deploy a commit to the plgeek Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Beads-rust tracker plugin: dependency objects now use dependency_type (values 'blocks' | 'parent-child') and include priority: number; internal code paths (brTaskToTask, getChildIds, getPrdContext) and tests updated to reference dependency_type instead of type.

Changes

Cohort / File(s) Summary
Beads-rust tracker core
src/plugins/trackers/builtin/beads-rust/index.ts
Updated parsing/filters to use dependency_type instead of type; dependency/dependent shapes now include priority: number; adjustments in brTaskToTask, getChildIds, and getPrdContext.
Beads-rust tests
src/plugins/trackers/builtin/beads-rust/index.test.ts
Test fixtures and expectations updated to replace type with dependency_type for dependencies/dependents and PRD epic dependents.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: replacing 'type' with 'dependency_type' in the beads-rust tracker's JSON handling.
Linked Issues check ✅ Passed The pull request fully addresses the requirements from issue #307: dep.type is replaced with dep.dependency_type in both dependencies and dependents loops within brTaskToTask(), and the BrTaskJson interface is updated to match actual br output.
Out of Scope Changes check ✅ Passed All changes directly address the linked issue #307; no out-of-scope modifications detected. Updates to test cases align with the production code changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/plugins/trackers/builtin/beads-rust/index.ts (1)

463-477: Confirm dep.type is intentionally kept here — different CLI command, different schema.

getChildIds parses br dep list --json output (typed as BrDepListItem), which uses type per serde rename. This is correct and distinct from the br show --json shape. A brief inline comment already exists on the interface (line 71), but consider adding a short note here too to prevent a future contributor from "fixing" this to dependency_type by mistake.

📝 Optional: add a clarifying comment
       for (const dep of deps) {
-        if (dep.type === 'parent-child') {
+        // NB: br dep list --json uses "type" (not "dependency_type" like br show --json)
+        if (dep.type === 'parent-child') {

@thunter009 thunter009 force-pushed the fix/beads-rust-dependency-type-field branch from da9014e to 60cf84f Compare February 15, 2026 22:09
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/plugins/trackers/builtin/beads-rust/index.ts (1)

46-61: Interface update correctly distinguishes br show --json from br dep list --json field names.

The dependency_type field on BrTaskJson dependencies/dependents and the retained type field on BrDepListItem accurately model the two different CLI outputs. The inline doc comments are helpful for future maintainers.

One minor note: priority is declared as required (priority: number) on both dependencies and dependents items, but the test mock data at lines 558–577 omits priority from those objects. This won't break at runtime (JSON.parse doesn't enforce the interface), but it means tests aren't exercising the full shape. Consider making priority optional here (as it is unused on these sub-objects) or adding it to the test fixtures for consistency.

br show --json outputs dependency_type for dependencies/dependents arrays,
not type. The mismatch caused dependsOn/blocks to always be empty, breaking
dependency-aware status display (blocked tasks shown as actionable).

Note: br dep list --json does use "type" (BrDepListItem is correct).
Only BrTaskJson.dependencies/dependents were wrong.

Fixes subsy#307

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thunter009 thunter009 force-pushed the fix/beads-rust-dependency-type-field branch from 60cf84f to 521d55c Compare February 15, 2026 22:15
@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.76%. Comparing base (e8fe64e) to head (521d55c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #308   +/-   ##
=======================================
  Coverage   44.76%   44.76%           
=======================================
  Files          97       97           
  Lines       30543    30543           
=======================================
  Hits        13673    13673           
  Misses      16870    16870           
Files with missing lines Coverage Δ
src/plugins/trackers/builtin/beads-rust/index.ts 69.93% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ralph-tui Ignored Ignored Preview Feb 18, 2026 7:20am

Request Review

@subsy
Copy link
Owner

subsy commented Feb 18, 2026

Thanks @thunter009 - I changed this explcitly in PR 230 so investigating.

@subsy subsy merged commit 2b171fa into subsy:main Feb 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

beads-rust tracker: dep.type should be dep.dependency_type in brTaskToTask()

2 participants

Comments