Skip to content

chore(factory): add linear.states role->name map to factory config#381

Closed
khaliqgant wants to merge 1 commit into
mainfrom
fix/factory-config-linear-states
Closed

chore(factory): add linear.states role->name map to factory config#381
khaliqgant wants to merge 1 commit into
mainfrom
fix/factory-config-linear-states

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 18, 2026

Copy link
Copy Markdown
Member

Adds a linear.states (role → state name) block to pear/factory.config.json, paired with the existing stateIds (role → UUID) block.

This lets the factory resolve a state by name to its role UUID when a synced Linear record carries state.name but no state.id — the sparse-sync case. It's the belt-and-suspenders fallback alongside the upstream fixes:

createFactory's fallback state resolver seeds its name→UUID map from this block (factory#10), so this config is what makes the fallback work without the /linear/states catalog. Once cloud#2284 deploys, state.id is present and this becomes pure defense-in-depth.

🤖 Generated with Claude Code

Review in cubic

Lets the factory resolve a state NAME to its role UUID when the synced record
carries state.name but no state.id — a fallback for sparse Linear sync records
(belt-and-suspenders alongside the upstream nango sync fidelity fix). Consumed
by createFactory's state resolver (seeds the name->UUID map from this block).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 5 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e3ffa824-3472-42eb-9e7f-20727490f8aa

📥 Commits

Reviewing files that changed from the base of the PR and between 6d52cdd and e6c88fb.

📒 Files selected for processing (1)
  • factory.config.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/factory-config-linear-states

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new linear configuration section to factory.config.json defining various workflow states like readyForAgent, agentImplementing, done, inPlanning, and humanReview. There are no review comments to evaluate, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6c88fba48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread factory.config.json
"humanReview": "24462e2d-9946-4dd1-a798-931cdd678498"
},
"linear": {
"states": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Scope the Linear state names to team AR

With the current factory state resolver, linear.states is resolved as a workspace-wide, unscoped name map before falling back to the explicit stateIds. In a multi-team Linear workspace where another team also has common workflow names like Done, this new global mapping can make startup fail with an ambiguous state-name error instead of using the pinned UUIDs; since this config subscribes only to team AR, these names should be placed under a team-scoped mapping rather than the global states block.

Useful? React with 👍 / 👎.

@agent-relay-code

Copy link
Copy Markdown
Contributor

Node typecheck passes clean. The change is data-only in a JSON config (no TS files touched), so this confirms no type breakage.

The PR is a minimal, schema-conformant, additive config change. My verification is complete.

Review Summary

PR #381 (fix/factory-config-linear-states) adds a linear.states role→name map to factory.config.json:

"linear": {
  "states": {
    "readyForAgent": "Ready for Agent",
    "agentImplementing": "Agent Implementing",
    "done": "Done",
    "inPlanning": "In Planning",
    "humanReview": "In Human Review"
  }
}

Verdict: Correct and safe. This is a data-only addition to a JSON config file.

Findings from tracing the change:

  • The new block matches the schema in @agent-relay/factory exactly. node_modules/@agent-relay/factory/dist/config/schema.js:88 defines linearSchema with states: linearRoleNamesSchema, and linearRoleNamesSchema (line 15) declares precisely these five optional string keys. The PR is schema-conformant — it is a recognized, intended field, not an unknown key.
  • The local node-config reader is permissive: extractNodeConfig (src/main/ipc-handlers.ts:200) only pulls known fields, and saveFactoryNodeConfig (src/main/ipc-handlers.ts:290) preserves unknown keys via { ...raw, ...parsed.config }. The linear block is read-through harmless and round-trips on save.
  • Values are strings as required; JSON is valid; it mirrors the existing stateIds UUID block as the name-based fallback documented in commit e6c88fb.

Verification run against the current checkout:

  • factory.config.json parses as valid JSON.
  • src/main/ipc-handlers.test.ts — 25/25 passed (the suite that actually parses this config).
  • npm run typecheck:node — clean.

Addressed comments

  • No bot or reviewer comments exist. .workforce/context.json contains no review/comment data, and there are no comment/review files in .workforce/. Nothing to address.

No auto-edits were made — the PR required no mechanical fixes, and the change is purely additive, schema-valid config data. No semantic or safety-critical logic was touched.

This is a clean, low-risk config change with passing local checks; the remaining merge decision is a human judgment call.

@khaliqgant

Copy link
Copy Markdown
Member Author

Superseded by AgentWorkforce/factory#11 — the factory now ships its conventional linear.states names as schema defaults, so the pear consumer config doesn't need this block.

@khaliqgant khaliqgant closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant