[factory] p7: scope single|workflow|team driven by issue labels

Merged
KH
6mo ago
+1141-70

Summary

Three-value scope knob bound to agent:single/workflow/team labels, with tiered inference + Slack clarification fallback. Emits specs into cloud's existing execution paths.

Factory issue p7 (label-scope). Built autonomously via the relayflows factory squad loop (standard review).

Spec: factory/planning/linear-issue-factory-cloud-p7-label-scope.md

Review

  • single-pass implement (impl-codex)
  • Claude fresh-eyes review/fix loop
  • deterministic acceptance: npm run build --if-present 2>&1 | tail -40 && npm test --if-present 2>&1 | tail -40

Summary by cubic

Adds label-driven scope selection for issues with agent:single, agent:workflow, or agent:team, making scope deterministic (Linear p7) and enabling a single workflow:run spawn in dispatch. Adds workflow:run support to the CLI/fleet path.

  • New Features

    • Map agent:single|workflow|team labels to scope; explicit labels override inference and are ignored for repo routing.
    • workflow scope emits one workflow agent (role workflow, capability workflow:run) with route-derived inputs; dispatch passes workflow and inputs through and updates the summary comment.
    • Relax the “too many labels” check only for team; single/workflow proceed even if repo labels exceed the cap, with tests added to pin both cases.
    • Wire workflow:run into fleet/CLI (advertised capability, relayflows command, safe default names); types/schema/LLM prompt updated for the workflow role.
  • Migration

    • To opt in, add one of: agent:single, agent:workflow, agent:team on the Linear issue.
    • Ensure workflows/factory/linear-issue.ts exists (or remap downstream).
    • No config changes required; repo label routing and triage.maxImplementers are unchanged.