fix(sdk): widen --on trigger grammar; write Linear closing reference

Merged
KH
1mo ago
+137-22

Summary

Companion to AgentWorkforce/cloud#3990 (deploy-page trigger filters).

  • --on grammar parity: the CLI's source-settings allowlist now accepts what Cloud's deploy-link parser and onboarding already emit — linear: team/project/labels/contains, jira: project/labels/contains, shortcut: workspace/team/labels/contains, gitlab: project/labels/contains/events.
  • Linear writeback: the software-factory flow now emits a Fixes <IDENTIFIER> closing reference in the PR body when the issue is a Linear ticket, so Linear's GitHub integration links the PR to the issue and transitions it on merge. (Assignment-triggered runs still depend on Cloud dispatching authored .on() handlers — not yet supported.)
  • README: documents that team= accepts the Linear team key or display name.

Test plan

  • vitest run tests/cloud-deploy.test.ts tests/canonical-software-factory.test.ts → Test Files 2 passed (2), Tests 51 passed (51)
  • npm run typecheck / npm run build / typecheck:tests (via scripts/test.sh) → clean

Generated with Devin


[!NOTE]
Medium Risk
Changes deploy trigger validation and PR-opening metadata gates for a widely used example flow; mis-parsed triggers or overly strict closing-reference checks could block deployments or runs, but scope is mostly SDK/docs plus deterministic validation.

Overview
Aligns CLI flows deploy --on parsing with Cloud’s deploy wizard: gitlab is a first-class provider (project, labels, contains, events with merge_request), and Linear / Jira / Shortcut / GitHub gain the extra filter keys Cloud already emits (linear: project/labels; jira: labels; shortcut: team/labels; github: boolean reviews/checks/comments opt-outs on pull-request sources). docs/CLOUD.md and the software-factory README describe the wider grammar and that Linear team= matches name or key.

Software-factory now treats Linear like GitHub for PR write-back: it requires a TEAM-123 identifier (digits in team keys OK), appends exactly Fixes <identifier>, and fails closed before push if the line is missing, duplicated, or another closing-keyword reference appears in the body (GitHub validation uses the same stricter closing-line check). The hosted runtime SHA256 pin and flow version bump track the updated catalog flow; tests cover new --on cases and Linear metadata behavior.

Reviewed by Cursor Bugbot for commit d7214ce509a9e4be232696aa61294bbd6d2afad5. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Widens the --on trigger grammar so the SDK accepts what Cloud's deploy link and onboarding already emit, and writes a Linear closing reference that connects PRs to Linear issues.

  • linear gains project/labels, jira gains labels, shortcut gains team/labels, github gains reviews/checks/comments as boolean subscription opt-outs, and gitlab becomes a provider with project/labels/contains/events (merge_request as its pull-request event).
  • Linear tickets (TECH-42) now append Fixes <identifier> to the PR body, which Linear's GitHub integration reads to link the PR and move the issue on merge; the run fails closed if that line is missing or duplicated, refuses identifiers that don't match TEAM-123 form (team keys may carry digits, e.g. PLA4-42), and stops when the body carries any other closing-keyword line. A closing keyword only counts when a ticket reference follows it, so prose like "Fixed the retry loop" no longer blocks the run.
  • docs/CLOUD.md and the software-factory README document the widened grammar; the README's deploy badge now fixes only the provider since team, project and labels are edited on the deploy page, where team= matches the team name or its key.

Agent Relay sessions

  • devin session purrfect · opened via gh pr create · last active 2026-09-25