Skip to content

feat: let projects take tickets from several Linear teams - #331

Merged
kalaspuff merged 4 commits into
mainfrom
fctl/485-it-should-be-possible-to-add-multiple-li
Oct 29, 2026
Merged

kalaspuff merged 4 commits into
mainfrom
fctl/485-it-should-be-possible-to-add-multiple-li

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A project whose tracker is Linear now takes tickets from one team or several of its Linear workspace (at most 20), each of all its issues or of one of its Linear projects. Delegating an issue of any of them to fctl, or mentioning fctl on one, starts a session of the project. Agents' fctl ticket calls list and view the tickets of all of them, file new ones in the first team unless they name another (fctl ticket create --in DES; a sub-ticket goes to its parent's team), and take each ticket's states and labels from its own team, saying which team when one lacks what they asked for.

  • Tickets tab: the team and "Issues of" selects became a list of teams, each with its own "Issues of". A team added since the last save is marked New, one taken off stays struck through with Undo until you save, and with several teams a line under the list chooses where agents file new tickets (that team goes first). The ticket-state switches name the states each team's workflow has ("In Review or Code review"). Viewers see the teams as saved, and the workspace's Linear tab shows every team a project takes.
  • CLI: fctl projects set --linear-team ENG,DES, and --linear-project takes DES:Website (or a name that only one of the teams has, or DES:all), repeatable.
  • Compatibility: the first team stays in today's LinearTickets fields and the others go in a new optional more_teams, so older hosts, CLIs and control planes read a project of several teams as one of its first team. An update that leaves more_teams out keeps the stored teams, so an older CLI or a tab opened before the deploy can't drop them; [] clears them. Saving asks Linear only about teams that changed. ADR 0065 (docs/adr/0065-projects-take-tickets-from-several-linear-teams.md) records the design.

I verified it with new unit tests (domain, CLI, web) and cargo xtask check. I also ran it end to end in cargo xtask dev with the Linear stand-in: delegating DES-1 started a Playground session and moved the issue to In Progress; agent calls listed both teams' tickets, filed tickets in each team (by --in, by parent, by default), refused a ticket outside a team's Linear project, and named the team for a missing label or state; settings updates sent as an older client and as a newer one behaved as described. cargo xtask linear check confirms that Linear's schema takes the new queries (or filters, teams(filter: { id: { in } })).

This touches the same functions as #328 (tickets.rs, the Tickets tab, check_linear), so whichever of the two merges second needs main merged in. A matching sentence in fctl.sh's privacy policy changes in:

Screenshots

At 0beb37e, from cargo xtask dev with the Linear stand-in's Acme workspace, 1280 px wide unless noted.

One team, as most projects have, before and after:

Before After
Before: the Team and Issues of selects, dark After: a list with one team and Add a team, dark
Before: the Team and Issues of selects, light After: a list with one team and Add a team, light

Two teams, Design narrowed to its Brand refresh project, with where agents file new tickets:

After: Engineering and Design in the list, light

Editing before a save: Platform added (New), Design taken off (Undo), and the states Platform's workflow adds ("Code review"):

After: an edit in progress, dark

The Add a team list, and a phone at 390 px:

Adding a team Phone
After: the Add a team list open, dark After: two teams at 390 px, dark

Worth confirming

  • Decision: the switches that move tickets (In Progress, In Review, Done) and the explore label stay one per project, for all its teams; each move goes to the ticket's own team's states. A team whose Linear GitHub integration moves tickets differently would need a project of its own.
  • Decision: agents file new tickets in the first team unless they pass --in; the Tickets tab's "Agents file new tickets in" makes the chosen team the first.
  • Decision: a project's teams all come from its one Linear workspace, each team once (one Linear project per team at most), and at most 20 teams.
  • Decision: an older client that changes a project's team keeps its other teams (less the one it makes first) rather than replacing them all.

fctl session

fctl-sh Bot added 3 commits October 29, 2026 14:19
A project's Linear choice keeps its first team where it was and the
others in more_teams. Delegations of any of them start its sessions,
agents' ticket calls reach all of them, and the Tickets tab lists them.
…team list

With several teams, a label or a state that only another team has is
refused naming the ticket's team and what it has. The scope names a
team's Linear project without nested parentheses, the Add a team list
shows a plus, and the hint is shorter.
A ticket filed with a parent now has its title and description checked
before fctl asks Linear for the parent, and a place that names no team
of the project's is refused naming them as a choice.
@fctl-sh

fctl-sh Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Partly addressed as of 8915e05. Later commits fixed 2 of the 4 issues this review found.


fctl reviewed 0beb37e and found 4 issues.

Three independent reviews found no high-severity bugs; stored single-team settings, older clients and the generated types all hold up. The findings below are low-severity.

On lines the diff doesn't show:

  • Copy still says one team · Low severity · web/src/components/workspace/linear.tsx line 304: OnceConnected still reads "Each project chooses the Linear team it takes tickets from", while the matching sentences in linear.tsx and lib/tickets.ts now say "teams".

Reviewed by fctl · Review agent settings

.transpose()?;
let parent = match parent.as_deref() {
Some(p) => Some(linear_issue(client, l, p).await?),
None => None,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--in now fails on one-team Linear projects

Low severity. TicketRequest::Create used to ignore place for Linear (place: _). Now tk::linear_place rejects anything that isn't the team's key or name, so an agent or script that passes fctl ticket create --in owner/name to a single-team Linear project starts failing with "isn't a team of this project's".

Found by fctl review in 0beb37e.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended, so no change. A place that names no team of the project is refused rather than ignored so that a ticket never lands somewhere other than the agent asked: with one team, ignoring --in DES would file it in ENG without a word. Agents are told about --in only where it chooses something (GitHub Issues of several repositories, Linear of several teams), fctl ticket exists only in sandboxes, and the refusal says where to file instead ("OPS isn't a team of this project's: file the ticket in ENG"), so an agent that passes it anyway recovers in its next call.

Comment thread web/src/components/project/tickets.tsx Resolved
Comment thread crates/fctl/src/cmd/projects.rs Resolved
…e KEY: …

Undoing teams taken off puts each back after the teams that came before
it as saved, so that undoing every change gives the saved list in any
order, and the Save bar counts only which team comes first. The CLI
tries --linear-project's whole text as a project's name when the KEY:
reading finds none, and the workspace's Linear tab says teams.
@fctl-sh

fctl-sh Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

On the review's fourth finding (the copy in the workspace's Linear tab, which has no thread): fixed in 8915e05, which says "Each project chooses the Linear teams it takes tickets from".

@kalaspuff
kalaspuff merged commit 5d36b33 into main Oct 29, 2026
10 checks passed
@kalaspuff
kalaspuff deleted the fctl/485-it-should-be-possible-to-add-multiple-li branch October 29, 2026 15:04
kalaspuff pushed a commit to hyperstructure/fctl-site that referenced this pull request Oct 29, 2026
…88)

## Summary

The privacy policy's Linear entry now says what fctl does there as it
works today: it moves a ticket on through its team's workflow as its
session works (to In Progress, In Review and Done, as the project lets
it), which it has done since hyperstructure/fctl#322, rather than only
to its first started state. It also says agents reach "the tickets their
project takes from Linear" instead of "the tickets of their project's
team", which stays true once a project can take tickets from several
teams (hyperstructure/fctl#331), so this can merge before, with or after
that pull request. What fctl stores and who receives it don't change;
`updated` moves to today.

- hyperstructure/fctl#331

[fctl session](https://app.fctl.sh/s/ses_01M63YR66H5WGRSBA13X57VW9B)

---------

Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
kalaspuff pushed a commit that referenced this pull request Oct 29, 2026
…328)

## Summary

The Linear integration showed and let through more than people and
agents should reach:

- The workspace's Linear tab and a project's Tickets tab listed every
project that takes a Linear workspace's tickets, with its name and
address, to members who can't see those projects. They now list the ones
the person sees, within an access token's places.
- Any member could list a connected Linear workspace's teams, workflows
and open projects, at a cost of thousands of points against an API that
every fctl workspace connected to it shares. Now only the workspace's
admins and its projects' maintainers, who choose teams, can; the web app
asks only for them.
- A Linear team kept while the tracker was GitHub's, and never checked,
was taken unchecked when only the tracker turned to Linear
(`fctl_domain::tickets::linear_changed`).
- A ticket call that failed gave its place within its limit back, though
it had asked Linear or GitHub all the same, so a sandbox could loop
failing writes without end and use up a shared Linear API. Failed writes
now count against a limit of their own, 60 an hour, which every write
needs room in, and a call names at most 20 labels, since GitHub takes
each label removed in a request of its own.
- A comment's `reply_to` went to Linear unchecked; it now has to be one
of the ticket's own comments. A delivery for a Linear agent session also
moves on only a thread of its own Linear workspace.

Verified in `cargo xtask dev` with its Linear stand-in: a member without
a role in a project doesn't see it in the lists, and only admins and
maintainers list teams; turning only the tracker to Linear checks the
team; the 61st failing update in an hour is refused while reads go on; a
reply under another comment and a 25-label update are refused; and a
viewer's Tickets tab shows the saved team, and names the states as what
they are, without asking for the teams. New tests cover the tracker
check, the label limit and what a viewer sees. With `main` merged in,
the checks and limits hold for projects of several Linear teams (#331),
whose Tickets tab already lists the teams only for those who choose
them; the domain, CLI and web tests pass on the merge.

The other fixes from the same security pass:

- #325
- #326
- #327
- #329

## Worth confirming

- **Decision:** members who neither administer the workspace nor
maintain one of its projects can no longer list a connected Linear
workspace's teams; they see their projects' saved teams instead.
- **Decision:** a session's agent writes nothing more to its tracker
after 60 writes that failed in an hour, and a call names at most 20
labels.

[fctl session](https://app.fctl.sh/s/ses_01M62HVCXZDZV6GJJP8DDQGDFF)

---------

Co-authored-by: fctl-sh[bot] <343971779+fctl-sh[bot]@users.noreply.github.com>
Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant