Skip to content

Hybrid forge: Linear issue tracking with GitHub PR fallback #719

@timeleft--

Description

@timeleft--

Summary

Add first-class Linear support as a hybrid forge provider — Linear handles issue concepts (issue-view, issue-list, issue-comment, recently-closed, auth-status, user-identity), while PR concepts (pr-list, pr-exists, pr-merge, pr-diff, etc.) fall through to GitHub defaults.

Motivation

Teams using Linear for issue tracking but GitHub for code hosting currently have no way to wire codev's forge abstraction to Linear. The forge system (spec 589) was designed for pluggable providers, but the existing resolution logic has a bug: buildPresetFromScripts sets null for concepts without an on-disk script, which means "disabled" rather than "fall through to default." This blocks any hybrid provider model.

Design

Architectural fix: Change buildPresetFromScripts to omit missing concepts from the preset instead of setting them to null. This lets them fall through to the GitHub default via the existing resolution chain (override → preset → default). This fix benefits all non-GitHub providers (GitLab, Gitea) that don't implement every concept.

Linear provider: 6 POSIX shell scripts using curl + jq against the Linear GraphQL API, authenticated via LINEAR_API_KEY. Config-driven team filtering via forge.linear-teamCODEV_LINEAR_TEAM env var (generalized buildForgeEnv helper exports non-concept forge config keys as CODEV_* env vars).

Alphanumeric issue identifiers: Widen issueNumber from number to number | string across the agent-farm surface to accept identifiers like ENG-123.

Implementation

PR: #716

Tasks from review feedback

  • Migrate issue_number column from INTEGER to TEXT in db/schema.ts, db/types.ts, and migration paths in db/index.ts
  • Fix porch parseInt guard in commands/porch/prompts.ts:31-37 to pass alphanumeric IDs through to fetchIssue
  • Fix recently-closed.sh — replace orderBy: completedAt with orderBy: updatedAt (Linear's PaginationOrderBy only supports createdAt/updatedAt)
  • Guard issue-view.sh against empty nodes[] result (issue not found)
  • Add unit tests: buildPresetFromScripts omission behavior, ENG-123 CLI parsing, buildForgeEnv passthrough
  • Renumber spec/plan files from 695 to match this issue number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions