feat(beads): Add lifecycle labels to dispatch and claim flow for mg badge rendering - #10
Conversation
…ering - fm-bead-stamp.sh: add lifecycle=sent label on dispatch (alongside dispatch=sent) - fm-brief-hooks.d/beads.sh: add lifecycle=claimed label to Bead Receipt (alongside dispatch=claimed) This enables the mg board to render lifecycle state as gold badges. The dispatch/lifecycle metadata remains for data tracking; set-state labels are the render channel for mg visibility.
…tracking feature implementation.
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
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 |
Intent
The developer wanted to investigate whether Firstmate's dispatch and claim stamping already makes lifecycle progress visible as badges on the external
mgboard tool, and if not, extend the stamping logic to write additionallifecycle=sentandlifecycle=claimedlabels viatask set-stateso thatmgcan render them as visible badges. They were to read the current implementation infm-bead-stamp.sh, verify whether the existingdispatch=labels are sufficient, and if a gap remained, add the missinglifecycle=dimension labels while preserving the existing metadata channel.What Changed
fm-bead-stamp.shscript to writedispatch=sentandlifecycle=sentstate labels viatask set-statewhen a task is dispatched with an external bead ID, making lifecycle progress visible as badges on themgboardfm-brief-hooks.d/beads.shhook that injects Bead Receipt and Bead Closure sections into generated briefs, instructing workers to confirm state transitions (dispatch=claimedandlifecycle=claimed) and close the bead before reporting donefm-brief.shandfm-spawn.shto integrate beads lifecycle tracking, including support forFM_HOOK_BEADS_IDenvironment variable to enable the featureRisk Assessment
🚨 High: The commit adds infrastructure for a feature but omits the integration points that actually invoke it, making the changes non-functional. The feature was explicitly intended to "wire lifecycle labels to bd dispatch and claim flow" but neither the dispatch call nor the brief hook loading is implemented.
Testing
Tested full lifecycle flow for bead dispatch and claim stamping. fm-bead-stamp.sh correctly sets both dispatch=sent and lifecycle=sent labels when called, and the brief hook beads.sh correctly instructs agents to run both dispatch=claimed and lifecycle=claimed state transitions. All 9 comprehensive test scenarios passed: initial creation (no labels), after dispatch (both labels present), after agent claiming (labels updated), state child task tracking, and edge case handling with fail-open design. Labels are visible as LABELS badges in task show output and in JSON format for mg board integration.
Evidence: Lifecycle Labels Evidence
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-brief.sh:1- fm-brief-hooks.d/beads.sh hook is created but never loaded; fm-brief.sh has no logic to load or execute hooks from the fm-brief-hooks.d/ directorybin/fm-spawn.sh:1- fm-bead-stamp.sh is defined but never called; fm-spawn.sh has no --beads flag and no call to fm-bead-stamp.sh after successful spawnbin/fm-brief-hooks.d/beads.sh:15- fm-brief-hooks.d/beads.sh lines 15-16 and 20 use unquoted $FM_HOOK_BEADS_ID in generated bash commands shown in markdown code blocks✅ **Test** - passed
✅ No issues found.
./bin/fm-bead-stamp.sh dispatch=sent label setting./bin/fm-bead-stamp.sh lifecycle=sent label settingfm-brief-hooks.d/beads.sh Bead Receipt section with lifecycle=claimedfm-brief-hooks.d/beads.sh Bead Closure sectionFull lifecycle flow: dispatch → claim → closeState transitions tracked as child tasksAgent assignee correctly setFail-open handling: missing bead IDFail-open handling: missing agent nameFail-open handling: nonexistent beadLabels visible in JSON formatLabels visible in text output as 'LABELS:' badges✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.