feat: beads-backed dev-loop information surfacing - #140
Conversation
Drive /cairn-loop once and it falls out of cairn into bd/grep/handoff at exactly the moments it needs to know what to work on next, what a task touches, the provenance for an area, and where to resume. This wires cairn to surface that information directly, in both the text CLI and the structured json/MCP interface. - decisions --grep <kw>: keyword search over decision id/body/nodes (no node arg) - src/state/backlog.rs: read-only loader of the beads export (.beads/issues.jsonl); beads stays the single source of truth, cairn only reads it - cairn next: recommends the top ready bead when the graph is clean - cairn context: 'Backlog: N ready' section - cairn get <bead>: resolves a task id to status/priority/type/linked-node + full description (a bd show substitute); cairn-node:<id> link is forward-compatible - cairn status: 'Next recommended' continuity line - json/MCP parity via query_api handlers (status/context/get) + next --json fixed - blocker-aware ready(): excludes beads blocked by open work (bd-ready parity) Tests: backlog reader + blocker logic + query_api parity handlers. All gates green (clippy -D warnings, cargo test, cairn scan clean, cairn hook all).
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSummary by CodeRabbit
WalkthroughA new read-only ChangesBacklog integration and decisions grep
Sequence Diagram(s)sequenceDiagram
participant Client
participant CLI_or_QueryAPI as CLI / Query API
participant state_backlog as state::backlog
participant issues_jsonl as .beads/issues.jsonl
Client->>CLI_or_QueryAPI: get <bead-id>
CLI_or_QueryAPI->>CLI_or_QueryAPI: query::get (graph lookup) → fails
CLI_or_QueryAPI->>state_backlog: find(root, bead-id)
state_backlog->>issues_jsonl: read JSONL lines
issues_jsonl-->>state_backlog: raw records
state_backlog-->>CLI_or_QueryAPI: BacklogItem
CLI_or_QueryAPI-->>Client: rendered backlog item
Client->>CLI_or_QueryAPI: context / status / next
CLI_or_QueryAPI->>state_backlog: read(root) + ready(items)
state_backlog->>issues_jsonl: read JSONL lines
issues_jsonl-->>state_backlog: raw records
state_backlog-->>CLI_or_QueryAPI: sorted ready BacklogItems
CLI_or_QueryAPI-->>Client: response with backlog/next_recommended fields
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Why
Driving
/cairn-looponce shows it repeatedly falls out of cairn intobd/grep/session-handoff.mdat exactly the moments it needs to know what to work on next, what a task touches, the provenance for an area, and where to resume. Those are cairn's job. This wires cairn to surface them directly, in both the text CLI and the structured JSON/MCP interface.Since this repo uses bd as cairn's task layer, cairn reads the beads export to surface ready work (read-only; beads stays the single source of truth).
What
bd readycairn next/contextBacklog /statusNext recommendedbd show <id>cairn get <bead>(status/priority/type/node + full description)grep meta/decisionscairn decisions --grep <kw>session-handoff.mdcairn statusNext recommended + recent logsrc/state/backlog.rs: read-only loader of.beads/issues.jsonl.ready(): excludes beads blocked by open work (bd readyparity); a closed/absent blocker does not block;parent-childis not a blocker.cairn-node:<id>link label is parsed (forward-compatible; none set yet).query_apihandlers; fixedcairn next --json(wasCAIRN_QUERY_UNKNOWN_TOOL).Tests / gates
New unit tests: backlog reader, blocker logic, query_api parity handlers. All green:
cargo clippy --all-targets --all-features -- -D warnings,cargo test(1359 pass / 5 ignored),cairn scan(0 findings),cairn hook all(pass).Notes
The autoresearch benchmark harness (
autoresearch.sh) that grounded this work is intentionally not included; it lives on theautoresearch/...branch. Happy to land it separately as a dogfood regression guard if wanted.