Problem
cc-taskrunner reads from queue.json. CodeBeast's autonomous fix pipeline writes QUEUED-tier fix items to D1 (fix_queue table, status='pending', fix_tier='QUEUED'). These two systems are not connected — approved QUEUED fixes have no path into the taskrunner without manual intervention.
What the bridge needs to do
- Pull approved items from CodeBeast's D1
fix_queue where fix_tier='QUEUED' and status='pending' (human has reviewed the CodeBeast "AWAITING APPROVAL" comment)
- Map to queue.json schema — translate D1 row fields to cc-taskrunner task format
- Mark as in-flight — update D1 row to
status='in_progress' before running to prevent double-pickup
- Write back result — on completion, update
status='completed' + pr_url; on failure, status='failed'
D1 → queue.json field mapping
D1 fix_queue field |
queue.json task field |
Notes |
id |
id |
Use as-is |
title |
title |
|
prompt |
prompt |
Full fix prompt from holistic analyzer |
authority |
authority |
auto_safe or operator — already set by CodeBeast |
max_turns |
max_turns |
Default 20 in CodeBeast |
repo |
repo |
Stackbilt-dev/tarotscript etc |
origin_branch |
(branch base) |
Branch to cut fix/codebeast-{id[:8]} from |
issue_url |
(PR body ref) |
Link back to triggering issue |
correlation_id |
(log tag) |
Pass through for tracing |
Approval gate
CodeBeast already posts an "AWAITING APPROVAL" comment with the Fix ID when a QUEUED item lands. The approval flow is intentionally manual for now (Anthropic policy change 2026-04-05 bills programmatic claude -p at API rates).
The bridge should not auto-pull everything pending. Options:
- Label-triggered: human adds
cc-approve label to the GitHub issue → bridge pulls that specific row
- Manual pull: CLI command
cc-taskrunner pull --fix-id <uuid> fetches and enqueues one item
- Batch pull with review:
cc-taskrunner pull --repo Stackbilt-dev/tarotscript lists pending items interactively
Recommendation: start with the CLI pull command — simplest, no webhook wiring needed.
CodeBeast D1 access
CodeBeast exposes fix_queue data via MCP tool codebeast_list_fix_queue (or equivalent). Alternatively, the bridge can call the D1 REST API directly using CLOUDFLARE_API_TOKEN + database ID 49364b38-1661-4965-a7e8-9abc10feda1a.
Out of scope for this issue
- LLM provider switching (llm-providers / llm-gateway integration — separate decision)
- Automated approval (no auto-pull without human sign-off)
- CLOUD tier items (those execute inside CodeBeast's Workers runtime, never touch cc-taskrunner)
Related
- CodeBeast fix pipeline:
src/services/issue-consumer.ts — sets fix_tier='QUEUED', status='pending'
- Approval gate commit:
b99f072 (codebeast)
- llm-gateway / llm-providers alternatives: tracked separately once D1 bridge is live
Problem
cc-taskrunner reads from
queue.json. CodeBeast's autonomous fix pipeline writes QUEUED-tier fix items to D1 (fix_queuetable,status='pending',fix_tier='QUEUED'). These two systems are not connected — approved QUEUED fixes have no path into the taskrunner without manual intervention.What the bridge needs to do
fix_queuewherefix_tier='QUEUED'andstatus='pending'(human has reviewed the CodeBeast "AWAITING APPROVAL" comment)status='in_progress'before running to prevent double-pickupstatus='completed'+pr_url; on failure,status='failed'D1 → queue.json field mapping
fix_queuefieldididtitletitlepromptpromptauthorityauthorityauto_safeoroperator— already set by CodeBeastmax_turnsmax_turnsreporepoStackbilt-dev/tarotscriptetcorigin_branchfix/codebeast-{id[:8]}fromissue_urlcorrelation_idApproval gate
CodeBeast already posts an "AWAITING APPROVAL" comment with the Fix ID when a QUEUED item lands. The approval flow is intentionally manual for now (Anthropic policy change 2026-04-05 bills programmatic
claude -pat API rates).The bridge should not auto-pull everything pending. Options:
cc-approvelabel to the GitHub issue → bridge pulls that specific rowcc-taskrunner pull --fix-id <uuid>fetches and enqueues one itemcc-taskrunner pull --repo Stackbilt-dev/tarotscriptlists pending items interactivelyRecommendation: start with the CLI pull command — simplest, no webhook wiring needed.
CodeBeast D1 access
CodeBeast exposes fix_queue data via MCP tool
codebeast_list_fix_queue(or equivalent). Alternatively, the bridge can call the D1 REST API directly usingCLOUDFLARE_API_TOKEN+ database ID49364b38-1661-4965-a7e8-9abc10feda1a.Out of scope for this issue
Related
src/services/issue-consumer.ts— setsfix_tier='QUEUED',status='pending'b99f072(codebeast)