Skip to content

Stabilize dotted child task ordering across beads trackers#337

Merged
subsy merged 1 commit intomainfrom
fix/pr336-child-id-sort-stable
Feb 24, 2026
Merged

Stabilize dotted child task ordering across beads trackers#337
subsy merged 1 commit intomainfrom
fix/pr336-child-id-sort-stable

Conversation

@subsy
Copy link
Copy Markdown
Owner

@subsy subsy commented Feb 24, 2026

Summary

  • add shared tracker utility sortDottedChildTaskIds for deterministic dotted child ordering
  • apply shared ordering in both beads and beads-rust getTasks() after filtering
  • preserve non-child task positions while numerically ordering child IDs like <prefix>.<number>
  • add mixed-list and non-child-order tests for beads, beads-rust, and beads-bv (via inherited getTasks)

Why

PR 336's comparator approach can leave child IDs unsorted in mixed lists because non-child comparisons return equality. This implementation makes ordering deterministic without moving non-child entries.

Validation

  • bun test src/plugins/trackers/builtin/beads/index.test.ts src/plugins/trackers/builtin/beads-rust/index.test.ts src/plugins/trackers/builtin/beads-bv/index.test.ts
  • bun run typecheck
  • bun run build

Summary by CodeRabbit

  • New Features
    • Enhanced task ordering for items with dotted child identifiers (e.g., epic-5.1, epic-5.2, epic-5.12)
    • Tasks with dotted child IDs are now sorted numerically by their numeric suffix, whilst non-child items retain their original positions in mixed lists
    • Ensures consistent, deterministic task ordering across tracker implementations

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 24, 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 Feb 24, 2026 3:50pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0451df2 and 17246c0.

📒 Files selected for processing (6)
  • src/plugins/trackers/builtin/beads-bv/index.test.ts
  • src/plugins/trackers/builtin/beads-rust/index.test.ts
  • src/plugins/trackers/builtin/beads-rust/index.ts
  • src/plugins/trackers/builtin/beads/index.test.ts
  • src/plugins/trackers/builtin/beads/index.ts
  • src/plugins/trackers/task-ordering.ts

Walkthrough

The PR introduces a new task-ordering module that implements deterministic sorting for dotted child task IDs (e.g., epic-5.1, epic-5.2) whilst preserving original positions of non-matching IDs. This module is integrated into the beads and beads-rust tracker plugins, with corresponding test coverage added across all three tracker variants.

Changes

Cohort / File(s) Summary
Task Ordering Module
src/plugins/trackers/task-ordering.ts
New module providing sortDottedChildTaskIds function with supporting interfaces and utilities. Implements numeric-aware sorting for dotted child IDs (prefix.number pattern) whilst maintaining original order of non-child entries.
Beads Tracker
src/plugins/trackers/builtin/beads/index.ts, src/plugins/trackers/builtin/beads/index.test.ts
Added sortDottedChildTaskIds call in getTasks pipeline post-filtering. New tests validate ordering preservation for non-matching IDs and numeric sorting of dotted child IDs in mixed lists.
Beads-Rust Tracker
src/plugins/trackers/builtin/beads-rust/index.ts, src/plugins/trackers/builtin/beads-rust/index.test.ts
Added sortDottedChildTaskIds call in getTasks pipeline post-filtering. New tests confirm original order preservation when patterns don't match and numeric sorting of dotted IDs with non-children interleaved.
Beads-BV Tracker Tests
src/plugins/trackers/builtin/beads-bv/index.test.ts
New test suite validating getTasks ordering logic with mixed epic and non-epic tasks containing dotted numeric identifiers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Stabilize dotted child task ordering across beads trackers' directly and specifically summarises the main change: adding deterministic ordering for dotted child task IDs across beads tracker implementations.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/pr336-child-id-sort-stable

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 78.04878% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.60%. Comparing base (0451df2) to head (17246c0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/trackers/task-ordering.ts 76.92% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
+ Coverage   46.46%   46.60%   +0.13%     
==========================================
  Files         102      103       +1     
  Lines       33219    33301      +82     
==========================================
+ Hits        15436    15520      +84     
+ Misses      17783    17781       -2     
Files with missing lines Coverage Δ
src/plugins/trackers/builtin/beads-rust/index.ts 68.90% <100.00%> (+0.08%) ⬆️
src/plugins/trackers/builtin/beads/index.ts 69.84% <100.00%> (+0.08%) ⬆️
src/plugins/trackers/task-ordering.ts 76.92% <76.92%> (ø)

... and 1 file with indirect coverage changes

🚀 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.

@subsy subsy merged commit 39b506e into main Feb 24, 2026
9 checks passed
@subsy subsy deleted the fix/pr336-child-id-sort-stable branch February 24, 2026 15:59
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.

1 participant