feat: select issue states by name and allow listed relations - #21
Merged
Conversation
…back issue unrelate uses the same org, team, and --allowed-project boundary as relate. A state write that reads back the wrong workflow state returns STATE_MISMATCH even when the mutation already failed. Refs: https://linear.app/linctl/issue/LIT-171/support-hive-coding-job-workflow-states-and-cross-project-relations
issue import now passes each row's state through StateSelector, matching issue create --state. Dry-run JSON emits state, not state_type. Refs: https://linear.app/linctl/issue/LIT-171/support-hive-coding-job-workflow-states-and-cross-project-relations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Guarded writes now pick a workflow state by exact name. They can also relate two same-team issues in projects the caller lists. State and relation writes fail closed on Target Mismatch. They read the result back before reporting success. Ambiguous writes read observed state and do not replay.
Refs: https://linear.app/linctl/issue/LIT-171/support-hive-coding-job-workflow-states-and-cross-project-relations
Why
Hive coding jobs need a named started state such as In Review. A type-only pick can land on the wrong started state. They also need a related link across two named projects on the same team, without moving either issue.
Important changes
--stateon create and update matches an exact team state name first, then a type.STATE_MISMATCH.issue relate --allowed-projectnames every project those issues may occupy.CROSS_ORGANIZATION_RELATIONbefore mutation.issueRelationCreateand state assignment arereconcile-before-retry. Linear has no stable idempotency key unless the caller suppliesIssueRelationCreateInput.id.Safety
The Target Mismatch hard stop is unchanged. No bypass flag. No implicit project widening. One organization, one team, and explicit allowed projects remain the relation boundary.
internal/client/internal/gql/generated.goregenerated and committedDocumentation
e8ec39d:teams/configuring-workflows.md(several started states on one team)issue-properties/issue-relations.md(related,blocks,duplicate)internal/client/schema.graphql:WorkflowState,IssueUpdateInput.stateId,IssueRelationCreateInput(optional UUID v4id).linear-sdk-refa3480b14b31a0d92447224143ececa7698ac0625Observed checks
Candidate SHA
df8bc5811f87c6d3d189f7d5d0cb2c6110372733on worktree.slim/worktrees/lit-171, 21-08-2026.go tool task ci: pass, exit 0go tool task coverage: 100.0% hand-written statements, no zero-count blockgit diff --check: cleanIndependent Matt review, then thermo review, should run on this SHA. This session does not approve the candidate. Leave the pull request unmerged until Omer authorizes merge.