Skip to content

fix(tasks): native br --parent edges, fix cancelled/output round-trips, add task_ready tool#3

Merged
mabry1985 merged 4 commits into
mainfrom
feat/task-management-improvements
Apr 2, 2026
Merged

fix(tasks): native br --parent edges, fix cancelled/output round-trips, add task_ready tool#3
mabry1985 merged 4 commits into
mainfrom
feat/task-management-improvements

Conversation

@mabry1985

@mabry1985 mabry1985 commented Apr 2, 2026

Copy link
Copy Markdown

Summary

  • Fix blocked status mapping: proto blocked now maps to br blocked (was incorrectly using deferred); deferred still maps back to proto blocked for backward compat
  • Fix cancelled round-trip: read close_reason from br so cancelled tasks are not reported as completed after fetch
  • Fix task_get output: comments from br show are now surfaced as task.output; previously task_output was write-only
  • Native parent-child dep edges: task_create now passes --parent to br, enabling br epic, br dep tree, and br ready --parent to see the hierarchy (label still written for client-side filtering)
  • New task_ready tool: exposes br ready --json — returns unblocked, highest-priority tasks sorted by priority
  • harbor agent: installs br (beads_rust v0.1.35) during environment setup
  • docs/beads-reference.md: comprehensive br CLI reference + proto integration notes + best practices for long-horizon task management

Test plan

  • CI passes
  • task_create with parentTaskIdbr dep tree <parent> shows child
  • task_update { status: "cancelled" }task_get returns status: "cancelled" (not completed)
  • task_outputtask_get returns output field populated
  • task_ready tool returns unblocked tasks in priority order
  • task_update { status: "blocked" }br list --status blocked shows the task

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added a comprehensive beads workflow reference covering commands, schema, mappings, limitations, and best practices.
  • New Features

    • Introduced a Task Ready tool to surface and prioritize actionable tasks.
    • Added OpenAI-gateway support for agent configuration and improved agent setup behavior.
    • Workspace auto-initialization when needed.
  • Bug Fixes

    • Fixed blocked/deferred status translation.
    • Task output now populated from issue comments.
  • Fallback / Reliability

    • Graceful fallback when the CLI is unavailable.
  • Chores

    • Relaxed YAML linting rule for quoted strings.

…und-trips, add task_ready tool

- Switch blocked status mapping from br `deferred` to br `blocked` (correct semantics)
- Add br `deferred` → proto `blocked` reverse mapping (backward compat)
- Use `--parent` flag in br create for native dep edges (enables br epic/dep tree/ready --parent)
- Keep parent label for client-side list() filtering
- Add close_reason to BrIssue so cancelled tasks round-trip correctly
- Add comments to BrIssue so task_get returns output written via task_output
- Add task_ready tool exposing `br ready --json` (highest-priority, unblocked tasks)
- Add br beads_rust install step to harbor agent setup
- Add docs/beads-reference.md: full br CLI reference + best practices

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • packages/cli/src/ui/components/views/__snapshots__/ToolsList.test.tsx.snap is excluded by !**/*.snap

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 184e4937-9daf-4a18-914c-e0335eb0dc4b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Adds a TaskReady tool and name, registers it in the core tool registry; flips blocked/deferred beads status mapping; enriches BR→Task conversion (close_reason, comments → output) and br create --parent; adds docs/beads-reference.md; proto agent installs br and supports OpenAI-gateway auth; minor YAML lint and docs workflow changes.

Changes

Cohort / File(s) Summary
Documentation
docs/beads-reference.md
New comprehensive reference for beads_rust (br) workflow, CLI, issue schema, proto-agent tool sequences, integration notes, limitations, and usage guidance.
TaskReady tool + names + registry
packages/core/src/tools/task-ready.ts, packages/core/src/tools/tool-names.ts, packages/core/src/config/config.ts
Added TaskReadyTool and TaskReadyParams; added TASK_READY name/display; registered the tool in the core tool registry.
Task store / BR mapping
packages/core/src/services/task-store.ts
Reversed mapping between blocked and deferred; extended BR typing with close_reason and comments; map closed-with-cancelledcancelled else completed; populate Task.output from latest comment; include --parent <id> in br create when parent provided.
Proto agent runtime & install
tools/harbor_agent/proto_agent.py
ProtoAgent now installs beads_rust CLI; run() adds OpenAI-gateway path that writes settings/team files and uses --auth-type openai; preserves Anthropic path otherwise.
Lint / CI tweaks
.yamllint.yml, .github/workflows/docs-page-action.yml
Relaxed quoted-strings rule in .yamllint.yml; removed retired docs workflow comment/file.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Agent
participant TaskReadyTool
participant BR as "beads_rust CLI (br)"
participant Parser
Agent->>TaskReadyTool: invoke TaskReady(limit,parent,priority)
TaskReadyTool->>BR: run br ready --json with flags (--limit/--parent/--priority)
BR-->>TaskReadyTool: returns JSON (todo_list or empty)
TaskReadyTool->>Parser: parse JSON output
Parser-->>TaskReadyTool: parsed tasks or none
TaskReadyTool-->>Agent: return llmContent + todo_list or "no actionable tasks" (fallback on error)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title accurately summarizes the three main changes: fixing blocked status mapping, fixing cancelled/output round-trips, and adding the task_ready tool.
Description check ✅ Passed The PR description covers TLDR and Dive Deeper sections with clear explanations, includes a detailed test plan with checkboxes, but is missing Screenshots, Reviewer Test Plan, Testing Matrix, and Linked issues sections from the template.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/task-management-improvements

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
docs/beads-reference.md (1)

757-762: Minor: Add language specifiers to fenced code blocks.

The hierarchy examples and quick reference card lack language specifiers, triggering markdownlint MD040 warnings. Consider adding text or plaintext for better accessibility and syntax highlighting support.

Also applies to: 766-772, 840-878

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/beads-reference.md` around lines 757 - 762, The fenced code blocks that
show the task hierarchy (the block starting with "root task (in_progress)" and
similar quick-reference examples) are missing language specifiers and trigger
markdownlint MD040; update each triple-backtick fence for these examples
(including the hierarchy blocks and the quick reference card examples) to use a
neutral specifier such as ```text or ```plaintext so they are explicitly flagged
as plain text for syntax highlighting and accessibility.
tools/harbor_agent/proto_agent.py (1)

116-124: Consider adding checksum verification for the downloaded binary.

The installation fetches a pre-built binary from GitHub without verifying its integrity. While the version is pinned, adding a SHA256 checksum verification would improve supply chain security.

🔒 Proposed fix with checksum verification
         await self.exec_as_root(
             environment,
             command=(
                 "BR_VERSION=v0.1.35 && "
+                "BR_SHA256=<expected-sha256-here> && "
                 "curl -fsSL https://github.com/Dicklesworthstone/beads_rust/releases/download/${BR_VERSION}/"
-                "br-${BR_VERSION}-linux_amd64.tar.gz | tar -xz -C /usr/local/bin && "
+                "br-${BR_VERSION}-linux_amd64.tar.gz -o /tmp/br.tar.gz && "
+                "echo \"${BR_SHA256}  /tmp/br.tar.gz\" | sha256sum -c - && "
+                "tar -xzf /tmp/br.tar.gz -C /usr/local/bin && "
+                "rm /tmp/br.tar.gz && "
                 "chmod +x /usr/local/bin/br && br --version || echo 'beads_rust install failed (non-fatal)'"
             ),
         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/harbor_agent/proto_agent.py` around lines 116 - 124, The install
command invoked via exec_as_root should verify the downloaded archive's SHA256
before extraction: fetch the release tarball and the expected checksum (or
include a pinned SHA256 value) and run sha256sum (or openssl dgst -sha256) to
compare the computed digest against the expected one, failing the install if
they don't match; update the command string passed to exec_as_root (the command
in proto_agent.py that uses BR_VERSION to curl the tarball) to first download
the checksum or embed the pinned checksum, verify the file, then extract and
chmod only if verification succeeds, and ensure any temporary files are removed
on success/failure.
packages/core/src/tools/task-ready.ts (1)

44-53: Consider extracting shared priority mapping constant.

The priority mapping duplicates PRIORITY_TO_BR from task-store.ts. While the duplication is minor and unlikely to diverge, consider extracting to a shared location if this mapping is needed elsewhere.

♻️ Potential shared constant

Create a shared constants file or export from task-store.ts:

// In a shared location (e.g., task-constants.ts)
export const PROTO_PRIORITY_TO_BR: Record<string, string> = {
  critical: '0',
  high: '1', 
  medium: '2',
  low: '3',
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/tools/task-ready.ts` around lines 44 - 53, Extract the
duplicated priority mapping from task-ready.ts (the local priorityMap used with
this.params.priority and args.push('--priority', p)) into a shared exported
constant (e.g., PROTO_PRIORITY_TO_BR) and import that constant instead of
redefining it, aligning it with the existing PRIORITY_TO_BR in task-store.ts so
both task-ready.ts and task-store.ts reference the same shared symbol to avoid
duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/beads-reference.md`:
- Line 4: The docs header currently pins `br` version 0.1.23 but the PR installs
0.1.35; update the version string in docs/beads-reference.md to match the
installed version (replace "0.1.23" with "0.1.35") so the documentation reflects
the actual `br` version used by proto_agent.py.

---

Nitpick comments:
In `@docs/beads-reference.md`:
- Around line 757-762: The fenced code blocks that show the task hierarchy (the
block starting with "root task (in_progress)" and similar quick-reference
examples) are missing language specifiers and trigger markdownlint MD040; update
each triple-backtick fence for these examples (including the hierarchy blocks
and the quick reference card examples) to use a neutral specifier such as
```text or ```plaintext so they are explicitly flagged as plain text for syntax
highlighting and accessibility.

In `@packages/core/src/tools/task-ready.ts`:
- Around line 44-53: Extract the duplicated priority mapping from task-ready.ts
(the local priorityMap used with this.params.priority and
args.push('--priority', p)) into a shared exported constant (e.g.,
PROTO_PRIORITY_TO_BR) and import that constant instead of redefining it,
aligning it with the existing PRIORITY_TO_BR in task-store.ts so both
task-ready.ts and task-store.ts reference the same shared symbol to avoid
duplication.

In `@tools/harbor_agent/proto_agent.py`:
- Around line 116-124: The install command invoked via exec_as_root should
verify the downloaded archive's SHA256 before extraction: fetch the release
tarball and the expected checksum (or include a pinned SHA256 value) and run
sha256sum (or openssl dgst -sha256) to compare the computed digest against the
expected one, failing the install if they don't match; update the command string
passed to exec_as_root (the command in proto_agent.py that uses BR_VERSION to
curl the tarball) to first download the checksum or embed the pinned checksum,
verify the file, then extract and chmod only if verification succeeds, and
ensure any temporary files are removed on success/failure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b018a4ef-f52b-4de4-8f78-7ab5e731cef1

📥 Commits

Reviewing files that changed from the base of the PR and between a6cd875 and c57ec97.

📒 Files selected for processing (6)
  • docs/beads-reference.md
  • packages/core/src/config/config.ts
  • packages/core/src/services/task-store.ts
  • packages/core/src/tools/task-ready.ts
  • packages/core/src/tools/tool-names.ts
  • tools/harbor_agent/proto_agent.py

Comment thread docs/beads-reference.md
# beads_rust (`br`) + proto Agent — Comprehensive Reference

Generated: 2026-04-02
`br` version: 0.1.23

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Version mismatch: docs say 0.1.23 but PR installs 0.1.35.

The documentation header references br version 0.1.23, but proto_agent.py installs version 0.1.35. Update to match the installed version.

📝 Proposed fix
-`br` version: 0.1.23  
+`br` version: 0.1.35  
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`br` version: 0.1.23
`br` version: 0.1.35
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/beads-reference.md` at line 4, The docs header currently pins `br`
version 0.1.23 but the PR installs 0.1.35; update the version string in
docs/beads-reference.md to match the installed version (replace "0.1.23" with
"0.1.35") so the documentation reflects the actual `br` version used by
proto_agent.py.

GitHub CI and others added 2 commits April 2, 2026 01:10
File was empty (just comments) causing actionlint to fail with
"workflow is empty". Workflow was already replaced by docs-deploy.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ed:false

required:true mandates single quotes on every string value — incompatible
with GitHub Actions convention and the existing workflow files. required:false
allows any quoting style; single quotes are still enforced when strings ARE
quoted. This unblocks CI which was failing on main and all branches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown

Code Coverage Summary

Package Lines Statements Functions Branches
CLI N/A% N/A% N/A% N/A%
Core N/A% N/A% N/A% N/A%
CLI Package - Full Text Report
CLI full-text-summary.txt not found at: coverage_artifact/cli/coverage/full-text-summary.txt
Core Package - Full Text Report
Core full-text-summary.txt not found at: coverage_artifact/core/coverage/full-text-summary.txt

For detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mabry1985 mabry1985 merged commit c349475 into main Apr 2, 2026
4 of 13 checks passed
@mabry1985 mabry1985 deleted the feat/task-management-improvements branch April 14, 2026 23:18
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