feat(linear): add Worker-safe planner contract - #230
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. 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, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new dependency-free subpath ./planner-contract for the Linear adapter, enabling Worker-safe Nango model normalization and workflow-state path planning. The changes extract relevant functions and constants into a separate file and add tests to verify the Worker-safe import graph. The review feedback suggests using fileURLToPath from node:url instead of .pathname on new URL objects in the test file to ensure cross-platform compatibility on Windows.
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.
| import assert from 'node:assert/strict'; | ||
| import { builtinModules } from 'node:module'; | ||
| import test from 'node:test'; | ||
| import { build } from 'esbuild'; |
There was a problem hiding this comment.
To ensure cross-platform compatibility (especially on Windows), we should use fileURLToPath from node:url instead of accessing .pathname on a new URL(...) object. On Windows, .pathname can return paths starting with a leading slash (e.g., /C:/path/to/project), which can cause issues with esbuild and other path resolution tools.
| import { build } from 'esbuild'; | |
| import { fileURLToPath } from 'node:url'; | |
| import { build } from 'esbuild'; |
|
|
||
| test('planner-contract public subpath has a pure Worker transitive import graph', async () => { | ||
| const result = await build({ | ||
| absWorkingDir: new URL('../..', import.meta.url).pathname, |
There was a problem hiding this comment.
| stdin: { | ||
| contents: `export * from '@relayfile/adapter-linear/planner-contract';`, | ||
| loader: 'js', | ||
| resolveDir: new URL('../..', import.meta.url).pathname, |
There was a problem hiding this comment.
Summary
@relayfile/adapter-linear/planner-contractsubpathLINEAR_OBJECT_TYPES,normalizeNangoLinearModel,linearStatePath, andlinearStatesIndexPathLinearPathObjectTypeAPI only frompath-mapper, which re-exports the same four planner bindings for compatibilitydist/planner-contract.jsand no Node built-insfileURLToPathThe prototype-key hardening and adversarial cases incorporate the valid issue identified during comparison with the closed duplicate PR #229 (Gemini review comment: #229 (comment)).
Validation
npm ciin a dedicated worktree (no shared/symlinkednode_modules)npx turbo build— 49/49 packagesnpm run build -w @relayfile/adapter-linearnpm run typecheck -w @relayfile/adapter-linearnpm test -w @relayfile/adapter-linear— 165/165npm pack -w @relayfile/adapter-linear --dry-run --json— runtime and declaration artifacts includednpx turbo build typecheck test— 147/147 tasks on exact headnpm test— writeback discovery, digest contracts, catalog checks, and 99/99 tasks on exact headRelease / follow-up
This is PR 1 of AgentWorkforce/cloud#2556. Package versions are intentionally unchanged: after merge, the repository publish workflow must patch-publish
linear, then the real npm version must be verified installable before Cloud PR 2 starts.Cloud PR 2 will bump the registry package, narrowly allow only
@relayfile/adapter-linear/planner-contractin the B1 Worker-import gate, switch provider-write-planner to the direct subpath, and delete the #2555 generator/snapshot/helper/CI wiring. Cloud production impact will be called out in that PR body.