Project a bead's body so the MCP can return it - #340
Merged
Merged
Conversation
The bead detail carried the title, the outcome, the agent's last comment, the
pull requests and the cost -- but never the bead's own body: the description
that says what to do and the acceptance criteria that say what "done" means.
So "fetch the content of this bead" through workgraph_bead had no answer, and a
bead's own brief was unreadable from any MCP client.
work_refs is a projection of the Beads graph and simply did not carry these two
fields, though `bd list` has returned both all along. This projects them:
- dispatcher readBeads maps description and acceptance_criteria from the same
`bd list` output it already reads (no extra bd show), and beadRow carries them
up, omitempty so an older control plane sees the payload it always saw;
- POST /v1/node/work/project accepts them and calls a new
system_project_bead_body, a small updater alongside system_project_bead
(mirroring system_project_bead_blockers) so the big upsert's signature and
body are untouched;
- migration 0105 adds description/acceptance columns to work_refs and adds the
two fields to system_bead_detail's result;
- the workgraph_bead tool description now advertises the brief.
Body is projected, like last_comment, with COALESCE so a pass carrying none
never erases one an earlier pass recorded.
Command run:
go build ./... && go vet ./cmd/dispatcher/ ./cmd/control-api/ ./internal/mcp/ \
&& go test ./internal/mcp/ ./cmd/migrate/
Output:
ok github.com/datopian/openbases/internal/mcp 0.398s
ok github.com/datopian/openbases/cmd/migrate 0.606s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 52 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
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. Comment |
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.
The gap
Aleksandra couldn't fetch a bead's content (description, acceptance) from the MCP. Confirmed root cause:
workgraph_bead→/v1/work/{bead}→system_bead_detailreadswork_refs, a projection of the Beads graph that carriestitle,statusand the last comment — but not the bead's own body. Those fields live only in the canonical Dolt graph on the node, so the detail had the outcome but never the brief.What this does
bd list(which the node already reads every pass) returnsdescriptionandacceptance_criteriafor every bead. This projects them:readBeadsmaps both from the existingbd listoutput (no extrabd show);beadRowcarries them up,omitempty.POST /v1/node/work/projectaccepts them and calls a newsystem_project_bead_body— a small updater alongsidesystem_project_bead, mirroringsystem_project_bead_blockers, so the big upsert's signature/body are untouched.description/acceptancecolumns towork_refsand the two fields tosystem_bead_detail's result (reproduced from 0104 with only those keys inserted).workgraph_beadtool description now advertises the brief.Projected with
COALESCE(likelast_comment) so a pass carrying no body never erases one an earlier pass recorded;omitemptykeeps the payload backward-compatible with an older control plane.Scope note
This surfaces
description+acceptance(the "body"). The full comment thread beyond the last comment is a larger change (onlylast_commentis projected today) and is left as a follow-up.Command run
Migration applies in CI's
databasejob.🤖 Generated with Claude Code