Skip to content

[3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) - #3588

Merged
propr-dev[bot] merged 8 commits into
3542-epic-plugin-system-xu8from
3556/claude-opus-5-5-official-plugin-linear-st-20261116-1828-z4f
Nov 17, 2026
Merged

propr-dev[bot] merged 8 commits into
3542-epic-plugin-system-xu8from
3556/claude-opus-5-5-official-plugin-linear-st-20261116-1828-z4f

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3556

Branch: 3556/claude-opus-5-5-official-plugin-linear-st-20261116-1828-z4f
Commits: ✅ Changes committed (0fda45a)


AI Processing Completed

Execution Details:

Summary:
I've built the Linear plugin and added the optionsFrom settings data source. The tests I ran pass. I did not test against a real Linear workspace, and I did not run the full repository suite or the existing Plugins Playwright specs.

How it works

  • Hand-off: when a ticket in a mapped team or project gets the trigger label (propr by default), the plugin creates one GitHub issue. The issue has the ticket reference and title, the description quoted, a link back to the ticket, and ProPR's trigger label (AI by default) as its only label. The plugin reads the ticket back from Linear's API before deciding.
  • One issue per ticket: tickets are remembered by id. A retried webhook, a replayed delivery or re-adding the label creates nothing.
  • Untrusted text: ticket text only becomes the issue's title and body. HTML, <!-- --> markers and @mentions are made harmless.
  • Sync-back: a comment for each of the six events, each switchable, plus optional state moves when the pull request opens and when it merges. Each comment and each move happens once per ticket. Comments contain only ProPR's own sentence, numbers, coded values and GitHub links.
  • Missing state name: if the ticket's team has no state of that name, the plugin logs a warning in Activity and skips the move; the comment and later events still go ahead.
  • Agent context: Linear's MCP server at its read-only endpoint (/mcp/readonly), plus a linear-ticket skill.
  • Shared helper: the ticket-to-issue creation, de-duplication and sync-back logic is in packages/plugins/_shared/ (trackerIssue.ts, trackerRecords.ts, trackerSync.ts) so the Jira plugin can reuse it.

Platform changes

  • optionsFrom: a text setting or a repository map can name a handler that loads its choices from the service. The new route GET /api/instance/plugins/v1/:pluginId/settings/:settingKey/options is for administrators only. The handler runs even while the plugin is disabled, can make outbound requests but gets no ProPR permissions. The OpenAPI spec and client types are regenerated.
  • Raw API key header: Linear's personal API keys must be sent without Bearer, which ctx.http couldn't do. A token connection can now declare "authorization": "raw".
  • Form: settings with optionsFrom become dropdowns with Reload choices. Before the key is set, the field shows "Linear is not connected yet…" and stays a text box.

Tests and checks

  • Plugins package: 73 pass, 12 of them new Linear tests. I broke the de-duplication, the HTML escaping and the redelivery tracking on purpose, and the tests failed each time.
  • New core test through ProPR's real webhook receiver: passes. The existing core plugin suites (159) also pass.
  • API: the new options route test and the 7 existing plugin, OpenAPI and authorization suites pass.
  • Also passing: shared (23), Plugins page UI (69), plugins:check (6 plugins), the docs build, the OpenAPI check, typechecks, and zero-warning lint on the changed files.
  • Changed existing tests: the registry tests list linear now, and the core test helper pluginHandlerFixture can set connections before enabling.

Things to know

  • Linear's MCP docs don't publish tool names, so the read-tool allow-list in the manifest is based on third-party listings. A name the server doesn't have is just never offered.
  • I found no published sample of a label-change webhook payload, so the plugin doesn't rely on it: it only uses it to spot that labels changed, then reads the ticket from the API.
  • The API key permission names in the docs (Read, Write, Create comments) are from memory, not checked against Linear's docs.
  • The plugin remembers roughly 800 tickets at a time, each for a year. If one is forgotten, re-adding its label creates a new issue (documented).
  • Two webhook deliveries for the same ticket arriving at the same moment could in theory both create an issue, the same race the Slack plugin accepts.

I captured four previews of the Configure step (desktop and phone; loaded choices and the not-connected error) from the real manifest with mocked API data. I used a temporary Playwright spec and deleted it afterwards.

Sources: Linear GraphQL, Linear webhooks, Linear MCP, Hookdeck Linear guide, Cotera Linear reference, Composio Linear MCP

Acceptance criteria

  • AC1: met — packages/plugins/test/linear.test.ts (one issue with the link and trigger label; repeated and replayed deliveries create nothing; unmapped tickets, other label changes, removed labels and other updates do nothing) and packages/core/test/linearPluginEvents.test.ts (forged, missing or tampered signatures get 401 before any plugin code runs; a repeated Linear-Delivery gets 409)
  • AC2: met — linear.test.ts ("each sync-back event posts its comment and state change when switched on, once, and nothing when off" and "a state name the ticket's team lacks is reported in Activity and does not block…")
  • AC3: met — propr-ui/src/pages/PluginsPage/PluginSettingOptions.test.tsx (dropdowns plus the not-connected error), linear.test.ts (teams, projects and states loaders), packages/api/test/pluginSettingOptionsRoutes.test.ts (members, non-durable admins and signed-out users refused before Linear is called)
  • AC4: met — linear.test.ts ("ticket text cannot affect the repository, the labels or the model (injection)")
  • AC5: met — linear.test.ts (sentinel test: ticket text and task output never reach Linear requests or logs; ticket text appears only in the created issue) and linearPluginEvents.test.ts (no ticket text or key in Activity)
  • AC6: met — packages/plugins/linear/README.md (setup, permissions and scopes, manual smoke-test checklist, vendor links) and docs/docs/plugins/linear.md

Review digest

Acceptance criteria (6 of 6 met, as stated by the agent)

  • ✅ AC1 (met): Fixture-based handler tests: trigger label added on a mapped ticket creates exactly one GitHub issue with link and trigger label; repeated or replayed webhooks create no second issue; unmapped tickets and other label changes do nothing; invalid signature is rejected before plugin code runs. — `packages/plugins/test/linear.test.ts` (one issue with the link and trigger label; repeated and replayed deliveries create nothing; unmapped tickets, other label changes, removed labels and other updates do nothing) and `packages/core/test/linearPluginEvents.test.ts` (forged, missing or tampered si…
  • ✅ AC2 (met): Each sync-back event posts the expected comment or state change when switched on and nothing when off; a missing state name is reported in Activity and does not block other events. — `linear.test.ts` ("each sync-back event posts its comment and state change when switched on, once, and nothing when off" and "a state name the ticket's team lacks is reported in Activity and does not block…")
  • ✅ AC3 (met): The configure form loads teams and workflow states through `optionsFrom`, with a clear error when not connected; the options route refuses non-administrators. — `propr-ui/src/pages/PluginsPage/PluginSettingOptions.test.tsx` (dropdowns plus the not-connected error), `linear.test.ts` (teams, projects and states loaders), `packages/api/test/pluginSettingOptionsRoutes.test.ts` (members, non-durable admins and signed-out users refused before Linear is called)
  • ✅ AC4 (met): Ticket text cannot affect repository, labels or model (injection test). — `linear.test.ts` ("ticket text cannot affect the repository, the labels or the model (injection)")
  • ✅ AC5 (met): No ticket text is sent anywhere except into the created GitHub issue; no code or logs are posted to tickets. — `linear.test.ts` (sentinel test: ticket text and task output never reach Linear requests or logs; ticket text appears only in the created issue) and `linearPluginEvents.test.ts` (no ticket text or key in Activity)
  • ✅ AC6 (met): README with setup steps, required permissions or scopes, and a manual smoke-test checklist; `docs/docs/plugins/linear.md`. — `packages/plugins/linear/README.md` (setup, permissions and scopes, manual smoke-test checklist, vendor links) and `docs/docs/plugins/linear.md`

Risk-tiered paths

  • High risk: none
  • Normal risk (27 files)
    • packages/api/openapi/routeDocsPlugins.ts (+6/−0)
    • packages/api/openapi/schemasPlugins.ts (+6/−1)
    • packages/api/pluginRouteRegistry.ts (+1/−0)
    • packages/api/routes/pluginRoutes.ts (+5/−1)
    • packages/client/src/generated/apiTypes.ts (+17/−2)
    • packages/core/src/plugins/pluginContext.ts (+19/−10)
    • packages/core/src/plugins/pluginHandlerRunner.ts (+3/−3)
    • packages/core/src/plugins/pluginHttp.ts (+9/−6)
    • packages/core/src/plugins/pluginSettingOptions.ts (added, +33/−0)
    • packages/plugins/_shared/trackerIssue.ts (added, +118/−0)
    • packages/plugins/_shared/trackerRecords.ts (added, +120/−0)
    • packages/plugins/_shared/trackerSync.ts (added, +157/−0)
    • packages/plugins/linear/api.ts (added, +122/−0)
    • packages/plugins/linear/handlers.ts (added, +22/−0)
    • packages/plugins/linear/icon.svg (added, +1/−0)
    • packages/plugins/linear/intake.ts (added, +99/−0)
    • packages/plugins/linear/manifest.json (added, +174/−0)
    • packages/plugins/linear/settings.ts (added, +89/−0)
    • packages/plugins/linear/sync.ts (added, +84/−0)
    • packages/plugins/registry.json (+1/−0)
    • packages/shared/src/pluginSdk.ts (+42/−2)
    • packages/shared/src/plugins.ts (+26/−0)
    • propr-ui/src/api/pluginsApi.ts (+3/−0)
    • propr-ui/src/pages/PluginsPage/PluginSettingFields.tsx (+43/−4)
    • propr-ui/src/pages/PluginsPage/PluginSettingOptions.tsx (added, +30/−0)
    • propr-ui/src/pages/PluginsPage/PluginSettingsForm.tsx (+1/−1)
    • propr-ui/src/pages/PluginsPage/usePluginSettingChoices.ts (added, +31/−0)
  • Low risk (16 files)
    • docs/docs/architecture/plugin-runtime.md (+16/−0)
    • docs/docs/features/plugins.md (+26/−2)
    • docs/docs/plugins/linear.md (added, +164/−0)
    • docs/sidebars.ts (+1/−0)
    • docs/static/openapi/propr-api.yaml (+81/−4)
    • packages/api/test/pluginSettingOptionsRoutes.test.ts (added, +110/−0)
    • packages/core/test/helpers/pluginHandlerFixture.ts (+4/−2)
    • packages/core/test/linearPluginEvents.test.ts (added, +127/−0)
    • packages/plugins/linear/README.md (added, +126/−0)
    • packages/plugins/linear/fixtures/graphql.json (added, +259/−0)
    • packages/plugins/linear/fixtures/webhooks.json (added, +70/−0)
    • packages/plugins/linear/skills/linear-ticket/SKILL.md (added, +26/−0)
    • packages/plugins/test/linear.test.ts (added, +317/−0)
    • packages/plugins/test/registry.test.ts (+16/−4)
    • packages/shared/test/plugins.test.ts (+35/−0)
    • propr-ui/src/pages/PluginsPage/PluginSettingOptions.test.tsx (added, +79/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 43 files changed, +2,719/−42 lines

Detailed Logs:

  • Conversation: 38 messages
  • Session: 7c181e2b-bbdd-43f1-9294-c6630ecfab7d

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3556-2026-11-16T18-58-55-932Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3556-2026-11-16T18-58-55-932Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've built the Linear plugin and added the `optionsFrom` settings data source. The tests I ran pass. I did not test against a real Linear workspace, and I did not run the full repository suite or the ...


This PR was created automatically by ProPR after processing issue #3556.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Not connected yet (desktop)

Not connected yet (desktop)

Before the Linear API key is set, each optionsFrom field shows the plugin's message and keeps a text box.

Full-size original

Workflow states loaded from Linear (desktop)

Workflow states loaded from Linear (desktop)

The state-move settings as selects of Linear workflow state names, each labelled with the teams that have it.

Full-size original

Repository teams loaded from Linear (desktop)

Repository teams loaded from Linear (desktop)

The Linear plugin's Configure step: Repository teams and Repository projects load their choices through optionsFrom, with a select per repository, the choice count and Reload choices. API data is mocked; the manifest is the real one.

Full-size original

Repository teams at phone width

Repository teams at phone width

The same loaded-choices field at 390 px wide.

Full-size original

…a source. The tests I ran pass. I did not test against a real Linear workspace, and I did not run the full repository suite or the existing Plugins Playwright specs.

How it works
- Hand-off: when a ticket in a mapped team or project gets the trigger label (`propr` by default), the plugin creates one GitHub issue. The issue has the ticket reference and title, the description quoted, a link back to the ticket, and ProPR's trigger label (`AI` by default) as its only label. The plugin reads the ticket back from Linear's API before deciding.
- One issue per ticket: tickets are remembered by id. A retried webhook, a replayed delivery or re-adding the label creates nothing.
- Untrusted text: ticket text only becomes the issue's title and body. HTML, `<!-- -->` markers and `@mentions` are made harmless.
- Sync-back: a comment for each of the six events, each switchable, plus optional state moves when the pull request opens and when it merges. Each comment and each move happens once per ticket. Comments contain only ProPR's own sentence, numbers, coded values and GitHub links.
- Missing state name: if the ticket's team has no state of that name, the plugin logs a warning in Activity and skips the move; the comment and later events still go ahead.
- Agent context: Linear's MCP server at its read-only endpoint (`/mcp/readonly`), plus a `linear-ticket` skill.
- Shared helper: the ticket-to-issue creation, de-duplication and sync-back logic is in `packages/plugins/_shared/` (`trackerIssue.ts`, `trackerRecords.ts`, `trackerSync.ts`) so the Jira plugin can reuse it.

Platform changes
- `optionsFrom`: a text setting or a repository map can name a handler that loads its choices from the service. The new route `GET /api/instance/plugins/v1/:pluginId/settings/:settingKey/options` is for administrators only. The handler runs even while the plugin is disabled, can make outbound requests but gets no ProPR permissions. The OpenAPI spec and client types are regenerated.
- Raw API key header: Linear's personal API keys must be sent without `Bearer`, which `ctx.http` couldn't do. A token connection can now declare `"authorization": "raw"`.
- Form: settings with `optionsFrom` become dropdowns with Reload choices. Before the key is set, the field shows "Linear is not connected yet…" and stays a text box.

Tests and checks
- Plugins package: 73 pass, 12 of them new Linear tests. I broke the de-duplication, the HTML escaping and the redelivery tracking on purpose, and the tests failed each time.
- New core test through ProPR's real webhook receiver: passes. The existing core plugin suites (159) also pass.
- API: the new options route test and the 7 existing plugin, OpenAPI and authorization suites pass.
- Also passing: shared (23), Plugins page UI (69), `plugins:check` (6 plugins), the docs build, the OpenAPI check, typechecks, and zero-warning lint on the changed files.
- Changed existing tests: the registry tests list `linear` now, and the core test helper `pluginHandlerFixture` can set connections before enabling.

Things to know
- Linear's MCP docs don't publish tool names, so the read-tool allow-list in the manifest is based on third-party listings. A name the server doesn't have is just never offered.
- I found no published sample of a label-change webhook payload, so the plugin doesn't rely on it: it only uses it to spot that labels changed, then reads the ticket from the API.
- The API key permission names in the docs (Read, Write, Create comments) are from memory, not checked against Linear's docs.
- The plugin remembers roughly 800 tickets at a time, each for a year. If one is forgotten, re-adding its label creates a new issue (documented).
- Two webhook deliveries for the same ticket arriving at the same moment could in theory both create an issue, the same race the Slack plugin accepts.

I captured four previews of the Configure step (desktop and phone; loaded choices and the not-connected error) from the real manifest with mocked API data. I used a temporary Playwright spec and deleted it afterwards.

Sources: [Linear GraphQL](https://linear.app/developers/graphql), [Linear webhooks](https://linear.app/developers/webhooks), [Linear MCP](https://linear.app/docs/mcp), [Hookdeck Linear guide](https://hookdeck.com/webhooks/skills/linear-webhooks), [Cotera Linear reference](https://cotera.co/docs/reference/webhooks/linear), [Composio Linear MCP](https://composio.dev/toolkits/linear_mcp)

Acceptance criteria
- AC1: met — `packages/plugins/test/linear.test.ts` (one issue with the link and trigger label; repeated and replayed deliveries create nothing; unmapped tickets, other label changes, removed labels and other updates do nothing) and `packages/core/test/linearPluginEvents.test.ts` (forged, missing or tampered signatures get 401 before any plugin code runs; a repeated `Linear-Delivery` gets 409)
- AC2: met — `linear.test.ts` ("each sync-back event posts its comment and state change when switched on, once, and nothing when off" and "a state name the ticket's team lacks is reported in Activity and does not block…")
- AC3: met — `propr-ui/src/pages/PluginsPage/PluginSettingOptions.test.tsx` (dropdowns plus the not-connected error), `linear.test.ts` (teams, projects and states loaders), `packages/api/test/pluginSettingOptionsRoutes.test.ts` (members, non-durable admins and signed-out users refused before Linear is called)
- AC4: met — `linear.test.ts` ("ticket text cannot affect the repository, the labels or the model (injection)")
- AC5: met — `linear.test.ts` (sentinel test: ticket text and task output never reach Linear requests or logs; ticket text appears only in the created issue) and `linearPluginEvents.test.ts` (no ticket text or key in Activity)
- AC6: met — `packages/plugins/linear/README.md` (setup, permissions and scopes, manual smoke-test checklist, vendor links) and `docs/docs/plugins/linear.md`
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 16, 2026
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR implements Linear intake, sync-back, and service-loaded settings choices with substantial test coverage. It needs changes before merge: concurrent intake can lose tracking records, and two valid input sizes exceed downstream limits.

✅ Scoped settings access — The options route checks durable administrator authority and removes ProPR permissions from the handler context.

✅ Controlled outbound content — Sync comments use explicit templates rather than copying ticket descriptions or task output.

✅ Passing current checks — The supplied authoritative status reports 35 passed checks, no failures, and no pending checks.

This review used static analysis of the supplied code; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Concurrent intake loses ticket records

  • Category: correctness

  • Required behavior: AC1 requires one GitHub issue per ticket across repeated deliveries; sync-back also requires retaining the ticket-to-issue association.

  • Evidence: packages/plugins/_shared/trackerRecords.ts:writeTicket, packages/plugins/_shared/trackerIssue.ts:handOffTicket

    1. Two API processes accept distinct webhook deliveries for different tickets whose IDs hash to the same ticket shard.
    2. Both handlers reach writeTicket. At the awaited loadList operation, each reads the same existing shard before either writes its replacement.
    3. Each subsequently calls ctx.state.set with its independently constructed list. The second replacement removes the first handler’s record. The same interleaving can occur when both replace their pending records with created records.
    4. Both GitHub issues exist, but one ticket’s association is missing. Its sync events cannot find it, and a later label re-addition creates another GitHub issue.

    static trace: The supplied state-store implementation transactions protect individual reads and writes, not this read-modify-write sequence. Webhook reservations distinguish delivery IDs; they do not lock ticket shards across processes. The sequential 120-ticket test does not exercise this interleaving. Concurrent deliveries of the same ticket also pass the separate readTicket checks before either reservation is written.

  • Minimum fix: Make ticket reservation and shard updates atomic across webhook workers, using a transactional update or equivalent cross-process serialization. Cover both different tickets sharing a shard and duplicate deliveries for one ticket.

F2: 🔴 Supported choice lists exceed runner limits

  • Category: correctness

  • Required behavior: The new options interface must load valid service choices within its advertised 250-choice contract.

  • Evidence: packages/core/src/plugins/pluginSettingOptions.ts:loadPluginSettingOptions, packages/plugins/linear/settings.ts:teamOptions

    1. Linear returns 250 teams with UUID values and labels averaging 40 characters.
    2. teamOptions returns approximately 25 KB of JSON, within the new option count and individual string limits.
    3. loadPluginSettingOptions passes that result through runPluginHandler, whose supplied runtime contract rejects results larger than 16 KiB.
    4. The route returns 409 instead of choices, and the configuration form falls back to an error and text inputs.

    static trace: parsePluginSettingOptions runs only after the runner succeeds, so its limits cannot prevent this rejection. Projects and workflow-state choices use the same affected path. Existing tests return only a few choices.

  • Minimum fix: Align the options result budget with the supported response contract, or bound results before runner serialization with an explicit usable truncation strategy. Add a route-level regression covering a valid large list.

F3: 🔴 Escaping can exceed issue-body limits

  • Category: correctness

  • Required behavior: A mapped ticket with a supported description must create its GitHub issue; sanitization must respect the downstream body-size limit.

  • Evidence: packages/plugins/_shared/trackerIssue.ts:inertQuote, packages/plugins/_shared/trackerIssue.ts:handOffTicket

    1. A mapped ticket receives the trigger label and has a description containing 14,000 ampersands, below the declared 20,000-character description limit.
    2. inertQuote caps the original text, then expands each ampersand to &amp;, producing over 70,000 bytes before the surrounding body text.
    3. handOffTicket sends that body to ctx.propr.createIssue, whose supplied contract limits bodies to 64 KiB.
    4. The client rejects the input; the handler deletes the pending record and permanently fails the delivery. No issue is created.

    static trace: The limit is applied before escaping and quoting, so it does not bound the actual submitted body. The injection tests cover escaping but not expansion at the size boundary.

  • Minimum fix: Bound the final escaped body by UTF-8 bytes, reserving space for the wrapper and plugin attribution, while preserving complete escape sequences. Test expansion-heavy and multibyte descriptions.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Correct Activity troubleshooting guidance

The new Linear documentation promises specific intake errors and warnings in Activity, but the supplied webhookDiagnostics contract replaces webhook messages with fixed placeholders. Update the troubleshooting guidance to describe what administrators can actually observe. This documentation follow-up does not require weakening the existing request-content protections.

Score

The implementation has substantial coverage and passing checks, but the tracking race and size-limit mismatches leave core intake and configuration behavior incorrect for reachable cases.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 11s
  • Tokens: 109,817 (108,075 in / 1,742 out)
  • Cost: $1.04

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit aef7111

Addressed 1 AI review comment (IDs: 6926686247)

Addressed findings F1, F2, F3

Summary of Changes

I fixed F1, F2 and F3, and each new regression test fails when its fix is removed. The one thing not tested is the Postgres locking path for F1, because there is no Postgres in this container; every database test ran on SQLite.

F1: concurrent intake loses ticket records

  • Platform change: plugins get a new ctx.state.update(key, change), which reads and replaces one key atomically. On Postgres it first locks the installation row with FOR UPDATE, before the existing shared-lock check, because two transactions both upgrading a shared lock would deadlock. On SQLite, write transactions already run one at a time. The change function must not await anything, and returning undefined leaves the value as it is. Without this, plugins only had separate get and set calls.
  • Tracker records (trackerRecords.ts, trackerIssue.ts): checking whether a ticket was already handed over and reserving it is now one atomic step (reserveTicket). Writing the created record and deleting a failed one also use update. So of two deliveries for the same ticket, only one creates an issue, and tickets sharing a shard no longer overwrite each other.
  • Same defect in sync-back progress: linking a pull request and marking an action done were also separate read-then-write steps on shared shards, so a lost record could repeat a comment. Both now go through a new atomic updateProgress.
  • Tests:
    • packages/core/test/pluginStateUpdate.test.ts uses the real store, with one store per simulated process. It covers 40 concurrent updates to one key, and four tickets sharing a shard, each delivered twice: every record is kept and exactly one issue is created per ticket.
    • packages/plugins/test/trackerShared.test.ts covers the same cases through the test kit, plus concurrent progress writes.

F2: large choice lists rejected by the runner

  • A setting_options run now gets a result budget of PLUGIN_SETTING_OPTIONS_LIMITS.resultBytes (about 1 MB). That is enough for 250 choices at their full value and label lengths, even if every character is JSON-escaped. Other handlers keep the 16 KiB limit.
  • The Linear loaders now trim their results to the contract: at most 250 choices, labels cut to 200 characters on whole characters.
  • Test: pluginSettingOptionsRoutes.test.ts now asks for 250 teams with long multibyte labels (over 16 KiB) and gets 200 with all 250. A list of 500 teams comes back cut to 250.

F3: escaping can push the issue body past its limit

  • inertQuote now takes a byte budget and applies it after escaping and quoting. It cuts only between whole entities, whole characters, and an @ with its word joiner. ticketIssueBody gives the description whatever the wrapper text leaves of ISSUE_BODY_BYTES (the 65,536 limit minus 1 KiB kept free for the attribution marker ProPR appends).
  • Tests: 14,000 &, 19,999 < and mixed &<> descriptions are created against a stand-in for createIssue that enforces the limit including the marker. CJK, emoji and accented descriptions are cut with no split characters or entities and no mention left live.

I also updated the plugin docs (plugins.md, plugin-runtime.md) and the Linear README for update and the larger options result.

Checks run: plugins suite (78 pass), all core plugin* suites plus the Linear webhook suite (164 pass; six of them need --experimental-test-module-mocks), shared (136 pass), the options route test, plugins:check (6 plugins), typechecks of shared, plugins, core and api, and zero-warning lint on the changed files. I did not run the full repository suite, the docs build or Playwright.

Found separately, not changed: the Slack plugin's mentionRecords.ts (an earlier commit on this branch) has the same read-then-write pattern on its shards. It could now use ctx.state.update too.

The PR description still says that two simultaneous deliveries for one ticket could both create an issue. That is no longer true and should be removed from it.

There's no visual change, so I made no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (8 files)
    • packages/core/src/plugins/pluginHandlerRunner.ts (+6/−4)
    • packages/core/src/plugins/pluginStateStore.ts (+37/−15)
    • packages/plugins/_shared/trackerIssue.ts (+44/−17)
    • packages/plugins/_shared/trackerRecords.ts (+56/−24)
    • packages/plugins/_shared/trackerSync.ts (+3/−5)
    • packages/plugins/linear/settings.ts (+8/−2)
    • packages/plugins/testing/index.ts (+14/−7)
    • packages/shared/src/pluginSdk.ts (+20/−2)
  • Low risk (6 files)
    • docs/docs/architecture/plugin-runtime.md (+10/−1)
    • docs/docs/features/plugins.md (+11/−4)
    • packages/api/test/pluginSettingOptionsRoutes.test.ts (+21/−1)
    • packages/core/test/pluginStateUpdate.test.ts (added, +71/−0)
    • packages/plugins/linear/README.md (+3/−1)
    • packages/plugins/test/trackerShared.test.ts (added, +125/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 14 files changed, +429/−83 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 14m 21s
  • Tokens: 6,674,290 (6,634,185 in / 40,105 out)
  • Cost: $2.78
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…hen its fix is removed. The one thing not tested is the Postgres locking path for F1, because there is no Postgres in this container; every database test ran on SQLite.

I fixed F1, F2 and F3, and each new regression test fails when its fix is removed. The one thing not tested is the Postgres locking path for F1, because there is no Postgres in this container; every database test ran on SQLite.

**F1: concurrent intake loses ticket records**
- **Platform change:** plugins get a new `ctx.state.update(key, change)`, which reads and replaces one key atomically. On Postgres it first locks the installation row with `FOR UPDATE`, before the existing shared-lock check, because two transactions both upgrading a shared lock would deadlock. On SQLite, write transactions already run one at a time. The `change` function must not await anything, and returning `undefined` leaves the value as it is. Without this, plugins only had separate `get` and `set` calls.
- **Tracker records** (`trackerRecords.ts`, `trackerIssue.ts`): checking whether a ticket was already handed over and reserving it is now one atomic step (`reserveTicket`). Writing the created record and deleting a failed one also use `update`. So of two deliveries for the same ticket, only one creates an issue, and tickets sharing a shard no longer overwrite each other.
- **Same defect in sync-back progress:** linking a pull request and marking an action done were also separate read-then-write steps on shared shards, so a lost record could repeat a comment. Both now go through a new atomic `updateProgress`.
- **Tests:**
  - `packages/core/test/pluginStateUpdate.test.ts` uses the real store, with one store per simulated process. It covers 40 concurrent updates to one key, and four tickets sharing a shard, each delivered twice: every record is kept and exactly one issue is created per ticket.
  - `packages/plugins/test/trackerShared.test.ts` covers the same cases through the test kit, plus concurrent progress writes.

**F2: large choice lists rejected by the runner**
- A `setting_options` run now gets a result budget of `PLUGIN_SETTING_OPTIONS_LIMITS.resultBytes` (about 1 MB). That is enough for 250 choices at their full value and label lengths, even if every character is JSON-escaped. Other handlers keep the 16 KiB limit.
- The Linear loaders now trim their results to the contract: at most 250 choices, labels cut to 200 characters on whole characters.
- **Test:** `pluginSettingOptionsRoutes.test.ts` now asks for 250 teams with long multibyte labels (over 16 KiB) and gets 200 with all 250. A list of 500 teams comes back cut to 250.

**F3: escaping can push the issue body past its limit**
- `inertQuote` now takes a byte budget and applies it after escaping and quoting. It cuts only between whole entities, whole characters, and an `@` with its word joiner. `ticketIssueBody` gives the description whatever the wrapper text leaves of `ISSUE_BODY_BYTES` (the 65,536 limit minus 1 KiB kept free for the attribution marker ProPR appends).
- **Tests:** 14,000 `&`, 19,999 `<` and mixed `&<>` descriptions are created against a stand-in for `createIssue` that enforces the limit including the marker. CJK, emoji and accented descriptions are cut with no split characters or entities and no mention left live.

I also updated the plugin docs (`plugins.md`, `plugin-runtime.md`) and the Linear README for `update` and the larger options result.

**Checks run:** plugins suite (78 pass), all core `plugin*` suites plus the Linear webhook suite (164 pass; six of them need `--experimental-test-module-mocks`), shared (136 pass), the options route test, `plugins:check` (6 plugins), typechecks of shared, plugins, core and api, and zero-warning lint on the changed files. I did not run the full repository suite, the docs build or Playwright.

**Found separately, not changed:** the Slack plugin's `mentionRecords.ts` (an earlier commit on this branch) has the same read-then-write pattern on its shards. It could now use `ctx.state.update` too.

The PR description still says that two simultaneous deliveries for one ticket could both create an issue. That is no longer true and should be removed from it.

There's no visual change, so I made no previews.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements Linear intake, sync-back, and service-backed settings choices with substantial fixture coverage. It needs a localized correctness fix before merge: a transient GitHub lookup failure can permanently discard a pull request’s ticket association.

✅ Scoped settings access — The options route checks durable administrator authority and runs handlers with an empty ProPR permission grant.

✅ Atomic intake reservation — Ticket reservation uses ctx.state.update, preventing concurrent deliveries from independently reserving the same ticket.

✅ Bounded issue content — Description escaping accounts for UTF-8 size and preserves complete entities and characters when truncating.

The supplied current-head status shows 31 passed checks, three pending, and no failures. This review used static analysis only; no commands or tests were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Retry failed pull request association lookups

  • Category: correctness

  • Required behavior: Sync-back must associate supported pull request events with handed-over tickets; transient lookup failures must not permanently discard that association and its subsequent updates.

  • Evidence: packages/plugins/_shared/trackerSync.ts:63, ticketOfPullRequest, and packages/plugins/_shared/trackerSync.ts:134, planSync.

    1. A tracked ticket’s pull request produces an opened event with an issue-prefixed branch, without a corresponding task-completed event. This supported association path is explicitly covered by the new “without the task event” test.
    2. await ctx.propr.getPullRequest(event.repository, pr) fails transiently. The catch returns undefined, converting the failed lookup into an apparently untracked pull request.
    3. planSync returns not_tracked, and syncLinearTicket returns successfully. The dispatcher therefore finishes this delivery and advances its cursor instead of retrying.
    4. Later review or merge events cannot recover the association: ticketOfPullRequest returns immediately for every non-opened event when no stored link exists. The ticket receives neither the opening update nor subsequent review/merge comments and state moves.

    The dispatcher’s ordering and retries do not prevent this: the handler reports success. Atomic progress updates protect a link once written, but no link is written here. static trace: verified against the changed association/planning functions, the new branch-association test, and the supplied dispatcher success/cursor handling.

  • Minimum fix: Propagate transient association lookup failures so the delivery is retried; reserve not_tracked for a successful lookup that establishes no matching ticket. Add a regression covering a failed first lookup followed by successful association and merge sync.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Align troubleshooting with retained diagnostics

The new Linear documentation promises specific webhook errors and mapping explanations in Activity, but webhookDiagnostics deliberately replaces webhook error text and log messages. Update those troubleshooting instructions to describe what administrators can actually observe. This documentation correction is optional and should preserve the existing request-content privacy boundary.

Score

The implementation has strong scope controls and useful boundary tests, but the association failure path can silently disable sync-back for an otherwise supported ticket. The remaining checks are pending, not failed.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 2s
  • Tokens: 116,219 (115,001 in / 1,218 out)
  • Cost: $1.08

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a100ff8

Addressed 1 AI review comment (IDs: 6927558818)

Addressed finding F4

Summary of Changes

I fixed F4. If the pull request lookup fails while linking a pull request to its ticket, the delivery now fails and is retried, instead of being reported as not_tracked and dropped.

The change is in packages/plugins/_shared/trackerSync.ts, in ticketOfPullRequest.

  • A failed ctx.propr.getPullRequest call is now thrown as a PluginDeliveryError that names the pull request.
  • If ProPR or GitHub is unavailable (unavailable), or the error is unexpected, the delivery is retried on the dispatcher's normal schedule.
  • A refusal (permission_denied, repository_not_allowed, other SDK codes) fails the delivery for good. Retrying cannot fix a missing permission.
  • not_tracked now only means the lookup worked and the branch matches no ticket this plugin handed over.

Regression test in packages/plugins/test/linear.test.ts: "a failed pull request lookup fails the delivery to be retried, and the retry links the ticket for the merge".

  • The first opened delivery fails while ProPR is unavailable: it throws a retryable error and posts no comment.
  • The retry links the ticket and posts the opening comment.
  • A later merged event, with the lookup failing again, still reaches ENG-123 through the stored link: it posts the comment and moves the ticket to Done.
  • A permission refusal gives a permanent error.

To support this, the test kit has a new pullRequestLookup option.

Verification

  • With the fix removed, the new test fails; with it, it passes.
  • The plugins suite passes (79 of 79), and the plugins typecheck and zero-warning lint on both changed files are clean.
  • I did not run the full repository suite.

Siblings checked

  • taskStep and the stored-record lookups (findTicketByIssue, findTicketByPullRequest) already let failures through.
  • issueLink and pullLink still catch lookup failures, on purpose. A failure there only leaves the GitHub link out of a comment; it never decides whether the ticket is found.

Separate discovery, not changed: a later review or merge event still cannot find the ticket on its own, because only opened events look at the branch. If every retry of the opened delivery fails, those later events are reported as not_tracked. Fixing that means looking up the branch on every pull request event, which is a larger change than F4 asked for.

No previews were made, since nothing visible changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/plugins/_shared/trackerSync.ts (+13/−2)
  • Low risk (1 file)
    • packages/plugins/test/linear.test.ts (+22/−3)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +35/−5 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 57s
  • Tokens: 1,023,942 (1,016,506 in / 7,436 out)
  • Cost: $0.66

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…a pull request to its ticket, the delivery now fails and is retried, instead of being reported as `not_tracked` and dropped.

I fixed F4. If the pull request lookup fails while linking a pull request to its ticket, the delivery now fails and is retried, instead of being reported as `not_tracked` and dropped.

**The change** is in `packages/plugins/_shared/trackerSync.ts`, in `ticketOfPullRequest`.
- A failed `ctx.propr.getPullRequest` call is now thrown as a `PluginDeliveryError` that names the pull request.
- If ProPR or GitHub is unavailable (`unavailable`), or the error is unexpected, the delivery is retried on the dispatcher's normal schedule.
- A refusal (`permission_denied`, `repository_not_allowed`, other SDK codes) fails the delivery for good. Retrying cannot fix a missing permission.
- `not_tracked` now only means the lookup worked and the branch matches no ticket this plugin handed over.

**Regression test** in `packages/plugins/test/linear.test.ts`: "a failed pull request lookup fails the delivery to be retried, and the retry links the ticket for the merge".
- The first `opened` delivery fails while ProPR is unavailable: it throws a retryable error and posts no comment.
- The retry links the ticket and posts the opening comment.
- A later `merged` event, with the lookup failing again, still reaches ENG-123 through the stored link: it posts the comment and moves the ticket to Done.
- A permission refusal gives a permanent error.

To support this, the test kit has a new `pullRequestLookup` option.

**Verification**
- With the fix removed, the new test fails; with it, it passes.
- The plugins suite passes (79 of 79), and the plugins typecheck and zero-warning lint on both changed files are clean.
- I did not run the full repository suite.

**Siblings checked**
- `taskStep` and the stored-record lookups (`findTicketByIssue`, `findTicketByPullRequest`) already let failures through.
- `issueLink` and `pullLink` still catch lookup failures, on purpose. A failure there only leaves the GitHub link out of a comment; it never decides whether the ticket is found.

**Separate discovery, not changed:** a later review or merge event still cannot find the ticket on its own, because only `opened` events look at the branch. If every retry of the `opened` delivery fails, those later events are reported as `not_tracked`. Fixing that means looking up the branch on every pull request event, which is a larger change than F4 asked for.

No previews were made, since nothing visible changed.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on a100ff8 are holding the loop back:

  • Classify changed surfaces — not finished
  • Full Test Suite Shard 2/4 — not finished
  • Full Test Suite Shard 3/4 — not finished
  • Full Test Suite Shard 1/4 — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Classify changed surfaces — not finished
  • Validate Changes — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Linear intake, sync-back, and service-backed settings choices with substantial fixture coverage. It needs a localized correctness fix before merge: retrying an older failed state move can undo a completed merge transition.

✅ Restricted settings access — The options route checks durable administrator authority, and its handler receives no ProPR permissions.

✅ Bounded issue content — Description escaping accounts for UTF-8 expansion and preserves whole entities, mentions, and characters when truncating.

✅ Atomic ticket reservation — Intake uses ctx.state.update to reserve a ticket before creating its GitHub issue, with dedicated concurrent-delivery tests.

This review used the supplied code only; no commands or tests were run. The authoritative checks show 30 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F5: 🔴 Retried opening move can reverse completion

  • Category: correctness

  • Required behavior: Sync-back state transitions must preserve completed work; retrying an older failed delivery must not move a merged ticket back to its pull-request-opened state.

  • Evidence: packages/plugins/_shared/trackerSync.ts:planSync, packages/plugins/linear/sync.ts:run

    1. Configure openedState as “In Review” and mergedState as “Done”. A tracked ticket’s opening event links its pull request, but Linear rejects the opening state move with a transient error.
    2. The opening delivery exhausts its retries and becomes failed. Its opened:<pr>:move marker remains absent. The dispatcher can now process later events.
    3. The pull request merges. Its delivery successfully moves the ticket to “Done” and records merged:<pr>:move.
    4. An administrator uses the existing Activity retry operation on the failed opening delivery.
    5. planSync checks only whether opened:<pr>:move exists. It ignores the completed merge marker and schedules the opening move. run sends issueUpdate, moving the merged ticket back to “In Review”.

    The incorrect state persists because the merge delivery has already succeeded. Atomic progress updates prevent lost records, but do not reject obsolete transitions. Dispatcher ordering also does not prevent this: manual retries intentionally revisit finalized failures after later events have run.

    static trace: verified against the changed planner and mutation path, together with the supplied dispatcher retry contract. Existing sync tests cover sequential redelivery and partial failure, but not an opening retry after successful merge synchronization.

    proposed regression: exhaust an opening move’s retries, process a successful merge move, then manually retry the opening delivery and assert that no opening-state mutation occurs.

  • Minimum fix: Suppress an opening-state move when progress already records the later merge transition for the same pull request. Add regression coverage for the manual-retry sequence while preserving retries of independently failed comments.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Align troubleshooting with stored diagnostics

The new Linear documentation says Activity shows specific intake errors and mapping explanations, but the supplied runtime documentation states that webhook diagnostics discard handler messages and retain generic failures. Adjusting those troubleshooting instructions would help administrators find usable evidence. This is documentation cleanup rather than a blocker to the integration’s core behavior.

S4: 🟢 Capture a real integration smoke test

The fixtures exercise many important cases, but the implementation summary acknowledges that no real Linear workspace was tested and that webhook examples and MCP tool names were partly inferred. Running the documented smoke test and retaining sanitized payload shapes would improve confidence in vendor compatibility. No concrete incompatibility is established by the supplied code, so this remains optional validation.

Score

The implementation is substantial and well covered by targeted tests, but the demonstrated retry sequence can reverse a completed ticket’s workflow state. A localized transition guard and regression test are needed before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 21s
  • Tokens: 118,945 (117,337 in / 1,608 out)
  • Cost: $1.15

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F5 S3 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit beaf5ea

Addressed 1 AI review comment (IDs: 6928319093)

Addressed finding F5

Summary of Changes

I fixed F5. Retrying a failed opening delivery after its pull request has been merged no longer moves the ticket back to "In Review". Any opening comment that failed is still posted on that retry.

The fix

  • Planner (packages/plugins/_shared/trackerSync.ts): a move can now name a later move that replaces it. The opening move of PR n is replaced by merged:<n>:move. If that merge marker is already recorded, planSync no longer plans the opening move. The comment is planned as before, so a failed comment is still retried.
  • Just before the move is sent (packages/plugins/linear/sync.ts): run reads the progress again right before it sends issueUpdate, using a new shared helper moveSuperseded. The check runs after the comment is posted and the team's states are read. Without it, a merge recorded while the opening delivery was posting its comment would still be undone. If the move is skipped, Activity gets an info line ("Did not move ENG-123 back: its pull request was merged already"). The move is not marked as done, because it never happened.
  • What still can't be prevented: a merge that lands between that last read and Linear applying the update. That's a race between two outside systems, so I didn't try to make it atomic, and the code comment says so.
  • Scope: the check is per pull request. If the same ticket gets a new pull request after the merge, that pull request's opening move still happens.

Regression tests (packages/plugins/test/linear.test.ts)

  1. The sequence from the finding: Linear rejects the opening move on three attempts, the merge moves the ticket to "Done", then the opening delivery is retried by hand. No move is sent. This runs twice:

    • with the opening comment already posted: the retry does nothing and isn't reposted.
    • with the opening comment also failed: the retry posts only the comment.

    The test also checks that a second pull request opened after the merge still moves the ticket.

  2. The merge marker is written while the opening delivery is reading the team's states. The move is not sent, and the info line is logged.

Each test fails when its fix is removed. With the planner check removed, test 1 still sends no move, because the second check catches it. It fails on its "nothing left to do" assertion instead.

Checks run: all 81 plugins tests pass, as do the 3 Linear core webhook tests and plugins:check (6 plugins). The plugins typecheck passes, and lint on the changed files gives zero warnings. I didn't run the docs build.

Docs: I added a sentence each to docs/docs/plugins/linear.md and the Linear README about this behaviour.

The change has no visible UI, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/plugins/_shared/trackerSync.ts (+20/−4)
    • packages/plugins/linear/sync.ts (+5/−1)
  • Low risk (3 files)
    • docs/docs/plugins/linear.md (+3/−1)
    • packages/plugins/linear/README.md (+4/−2)
    • packages/plugins/test/linear.test.ts (+49/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 5 files changed, +81/−8 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 5m 7s
  • Tokens: 1,246,821 (1,236,169 in / 10,652 out)
  • Cost: $0.79

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ll request has been merged no longer moves the ticket back to "In Review". Any opening comment that failed is still posted on that retry.

I fixed F5. Retrying a failed opening delivery after its pull request has been merged no longer moves the ticket back to "In Review". Any opening comment that failed is still posted on that retry.

**The fix**
- **Planner** (`packages/plugins/_shared/trackerSync.ts`): a move can now name a later move that replaces it. The opening move of PR *n* is replaced by `merged:<n>:move`. If that merge marker is already recorded, `planSync` no longer plans the opening move. The comment is planned as before, so a failed comment is still retried.
- **Just before the move is sent** (`packages/plugins/linear/sync.ts`): `run` reads the progress again right before it sends `issueUpdate`, using a new shared helper `moveSuperseded`. The check runs after the comment is posted and the team's states are read. Without it, a merge recorded while the opening delivery was posting its comment would still be undone. If the move is skipped, Activity gets an info line ("Did not move ENG-123 back: its pull request was merged already"). The move is not marked as done, because it never happened.
- **What still can't be prevented:** a merge that lands between that last read and Linear applying the update. That's a race between two outside systems, so I didn't try to make it atomic, and the code comment says so.
- **Scope:** the check is per pull request. If the same ticket gets a new pull request after the merge, that pull request's opening move still happens.

**Regression tests** (`packages/plugins/test/linear.test.ts`)
1. The sequence from the finding: Linear rejects the opening move on three attempts, the merge moves the ticket to "Done", then the opening delivery is retried by hand. No move is sent. This runs twice:
   - with the opening comment already posted: the retry does nothing and isn't reposted.
   - with the opening comment also failed: the retry posts only the comment.

   The test also checks that a second pull request opened after the merge still moves the ticket.
2. The merge marker is written while the opening delivery is reading the team's states. The move is not sent, and the info line is logged.

Each test fails when its fix is removed. With the planner check removed, test 1 still sends no move, because the second check catches it. It fails on its "nothing left to do" assertion instead.

**Checks run:** all 81 plugins tests pass, as do the 3 Linear core webhook tests and `plugins:check` (6 plugins). The plugins typecheck passes, and lint on the changed files gives zero warnings. I didn't run the docs build.

**Docs:** I added a sentence each to `docs/docs/plugins/linear.md` and the Linear README about this behaviour.

The change has no visible UI, so there are no previews.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Linear intake, sync-back, and service-backed settings choices with substantial focused coverage. It needs changes before merge: ticket bookkeeping can lose sync associations and leave successfully created issues permanently marked pending.

✅ Scoped configuration access — The options route checks durable administrator access and runs handlers without ProPR permissions.

✅ Controlled issue creation — Repository and label selection come from settings; description escaping neutralizes HTML markers and mentions.

✅ Atomic ticket reservation — Shard updates prevent concurrent deliveries from independently reserving the same ticket.

This review used the supplied code only; no commands or tests were run. Current checks show 31 passed, three pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F6: 🔴 Preserve links to earlier pull requests

F7: 🔴 Reserve room for completed ticket records

  • Category: correctness

  • Required behavior: A successful hand-off must retain the created GitHub issue number so later events can sync back to its ticket.

  • Evidence: packages/plugins/_shared/trackerRecords.ts, withTicket and reserveTicket; packages/plugins/_shared/trackerIssue.ts, handOffTicket

    1. Concurrent webhook deliveries reserve distinct tickets sharing a shard. Each reservation commits before awaiting ctx.propr.createIssue, allowing the shard to fill with pending records while GitHub requests are outstanding.
    2. Reservations fit just below SHARD_BYTES, but changing a record from pending to created and adding n requires additional bytes.
    3. A GitHub creation succeeds. Its subsequent writeTicket exceeds the shard limit. Because every other record is pending, withTicket finds no eligible record to evict and throws.
    4. The GitHub issue exists, but its stored record remains pending without its issue number. Retrying encounters that reservation and returns duplicate; sync lookup excludes pending records.

    static trace: Reservation checks only the smaller pending representation. Atomic shard updates prevent overwrites but do not reserve completion capacity. This interleaving is allowed because the database transaction ends before the awaited GitHub request; the webhook runner permits concurrent deliveries. Existing concurrency tests use only a few records and never fill a shard.

  • Minimum fix: Budget sufficient completion space when admitting every pending reservation, so recording the returned issue number cannot fail solely because the shard filled. Add a near-capacity concurrent hand-off regression.

Suggestions

These are optional follow-ups and are not sent to /fix.

S5: 🟢 Align troubleshooting with retained diagnostics

The new Linear documentation says Activity displays specific intake errors and warnings, but the supplied webhookDiagnostics implementation replaces webhook messages and errors with fixed text. Update the troubleshooting guidance to reflect what administrators can actually see. This is an optional documentation correction; it does not require weakening diagnostic redaction.

Score

The implementation has strong authorization boundaries and focused tests, but two bookkeeping defects can permanently suppress expected sync-back. Both appear addressable with localized changes.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 1s
  • Tokens: 120,130 (118,687 in / 1,443 out)
  • Cost: $1.15

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F6 F7 S5

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b49f263

Addressed 1 AI review comment (IDs: 6928997529)

Addressed findings F6, F7

Summary of Changes

I fixed F6 and F7. All 85 plugin tests pass and so does the core Linear webhook test. I removed each fix in turn and its new regression test failed every time. Typecheck and zero-warning lint on the plugin package are clean.

F6: earlier pull requests stay linked to their ticket

F7: room to finish every pending hand-off

  • The bug: a reservation only checked that the smaller pending record fit. Many hand-offs reserved at once could fill a shard, and then saving a created issue's number failed with nothing left to drop.
  • The fix: the shard's size is now measured as if every pending record had already finished with the largest possible issue number. A new reservation that doesn't fit by that measure is refused before its GitHub issue is created, with the existing "retried later" error. Finishing a pending record never makes the shard bigger than that measure, so saving the issue number can't run out of room.
  • Test: trackerShared.test.ts starts 260 hand-offs in one shard and lets them all reserve before any GitHub request answers. It checks that:
    • some reservations are refused, and those are retryable and created no issue.
    • every issue created is saved with its number, and none is left pending.
    • the shard stays within its byte limit.
    • a refused ticket retried later is created.

The ticket and progress shards are still updated atomically, so the concurrent cases are guarded by that, not by a new lock. The one remaining race is between a GitHub request and the state update that follows it; reserving room removes the only way that update could fail for lack of space. As before, there is no real Postgres or Linear workspace test.

I found nothing else outside F6 and F7. There are no previews because nothing visible changed.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/plugins/_shared/trackerRecords.ts (+62/−13)
    • packages/plugins/_shared/trackerSync.ts (+6/−2)
  • Low risk (2 files)
    • packages/plugins/test/linear.test.ts (+15/−0)
    • packages/plugins/test/trackerShared.test.ts (+73/−4)

Validation evidence

  • No repository validation commands ran.

Diff size: 4 files changed, +156/−19 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 6m 39s
  • Tokens: 1,760,066 (1,742,569 in / 17,497 out)
  • Cost: $1.13

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… core Linear webhook test. I removed each fix in turn and its new regression test failed every time. Typecheck and zero-warning lint on the plugin package are clean.

I fixed F6 and F7. All 85 plugin tests pass and so does the core Linear webhook test. I removed each fix in turn and its new regression test failed every time. Typecheck and zero-warning lint on the plugin package are clean.

**F6: earlier pull requests stay linked to their ticket**
- **The bug:** a ticket's progress record stored one pull request number, so linking #56 replaced #55. When #55 later merged or closed, the event was dropped as `not_tracked`.
- **The fix:** the record now keeps a list of the ticket's pull requests, oldest first, and linking adds to it (`withPullRequest` in `trackerRecords.ts`, used by `linkPullRequest` in `trackerSync.ts`). Looking up a ticket by pull request searches the whole list.
- **List limit:** at most 10 pull requests per ticket. Past that, ones already merged or closed are dropped first, then the oldest.
- **Same mistake in a second place:** when a progress shard is full, records of "finished" tickets are forgotten first. A ticket counted as finished as soon as any one of its pull requests merged or closed. A ticket whose #55 closed while #56 was still open was therefore dropped early, losing the #56 link. A ticket now counts as finished only once all its linked pull requests have.
- **Tests:**
  - `linear.test.ts`: opens #55, then #56, then merges #55 and closes #56. The ticket gets both comments and the "Done" move.
  - `trackerShared.test.ts`: covers the 10-link limit and the full-shard eviction.

**F7: room to finish every pending hand-off**
- **The bug:** a reservation only checked that the smaller pending record fit. Many hand-offs reserved at once could fill a shard, and then saving a created issue's number failed with nothing left to drop.
- **The fix:** the shard's size is now measured as if every pending record had already finished with the largest possible issue number. A new reservation that doesn't fit by that measure is refused before its GitHub issue is created, with the existing "retried later" error. Finishing a pending record never makes the shard bigger than that measure, so saving the issue number can't run out of room.
- **Test:** `trackerShared.test.ts` starts 260 hand-offs in one shard and lets them all reserve before any GitHub request answers. It checks that:
  - some reservations are refused, and those are retryable and created no issue.
  - every issue created is saved with its number, and none is left pending.
  - the shard stays within its byte limit.
  - a refused ticket retried later is created.

The ticket and progress shards are still updated atomically, so the concurrent cases are guarded by that, not by a new lock. The one remaining race is between a GitHub request and the state update that follows it; reserving room removes the only way that update could fail for lack of space. As before, there is no real Postgres or Linear workspace test.

I found nothing else outside F6 and F7. There are no previews because nothing visible changed.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: unknown. CI did not settle: blocking checks were still not passing after 2 hours. Blocking checks: CLI Agent Skill (Linux x64, glibc 2.31, Node 22). Fix or re-run those checks, then re-arm the loop with /ultrafix.

@propr-dev propr-dev Bot changed the title 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) ⚠️⑥ [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 16, 2026
@integry

integry commented Nov 16, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev propr-dev Bot changed the title ⚠️⑥ [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 16, 2026
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds Linear intake, sync-back, dynamic settings choices, and shared tracker helpers. It needs a localized correctness fix before merge: a failed opening-event delivery can permanently prevent subsequent merge and close events from reaching the ticket.

✅ Restricted settings loader — The options route checks durable administrator access, and the handler receives no ProPR permissions.

✅ Atomic intake reservation — Ticket reservation uses ctx.state.update before issue creation, preventing concurrent deliveries from creating separate issues for the same ticket.

✅ Focused boundary coverage — Added tests cover signature rejection, repository mapping, escaped issue bodies, concurrent reservations, and settings-option response limits.

This review is a static trace of the supplied code; no commands or tests were run. The authoritative checks show 33 passed, none failed, and one pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F8: 🔴 Recover ticket links after opening failures

  • Category: correctness

  • Required behavior: Sync-back must match a tracked ticket’s pull request and deliver enabled merge and close updates; a recoverable opening-event failure must not permanently disconnect later events.

  • Evidence: packages/plugins/_shared/trackerSync.ts:ticketOfPullRequest — specifically if (linked || event.type !== 'opened') return linked.

    static trace:

    1. A tracked ticket’s pull request reaches pull_request.opened without an earlier task event linking it. This is an explicitly supported path, covered by the new branch-based association test.
    2. await ctx.propr.getPullRequest(...) fails with unavailable throughout the opening delivery’s retry budget. lookupFailure correctly requests retries, but no link is written.
    3. The supplied dispatcher contract marks the exhausted delivery failed and advances to subsequent events.
    4. GitHub access recovers and the pull request merges or closes. findTicketByPullRequest still finds nothing, and the quoted condition returns before attempting the now-working branch lookup.
    5. planSync reports not_tracked; the delivery succeeds without its comment or configured merge-state move. Subsequent retries of that terminal event follow the same path.

    The dispatcher’s ordering and lease do not repair a missing association after retry exhaustion. The new lookup-failure test restores access before retrying the opening event, so it does not cover this recovery path. No assumption of concurrent delivery or lost ownership is needed.

  • Minimum fix: When a merge, close, or qualifying review event has no stored association, attempt the same validated branch-to-tracked-issue lookup and persist the association. Preserve retryable lookup failures rather than acknowledging them as untracked. Add a regression covering exhausted opening retries followed by a terminal event after access recovers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S6: 🟢 Document progress retention limits

trackerRecords.ts retains only 24 action markers and ten linked pull requests per ticket, independently of ticket retention. Explain these limits alongside the existing ticket-capacity documentation: sufficiently old actions can become eligible again after their markers are discarded. This is an optional clarification of the intentionally bounded storage design.

Score

The implementation has substantial targeted coverage and passing current checks, but the missing recovery path can silently lose terminal sync-back updates. A localized association fallback should resolve the blocker.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 0s
  • Tokens: 122,291 (120,897 in / 1,394 out)
  • Cost: $1.15

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F8 S6

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title ⚠️⑥ [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 16, 2026
@propr-dev

propr-dev Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 925616d

Addressed 1 AI review comment (IDs: 6932852359)

Addressed finding F8

Summary of Changes

I fixed F8. When a merge, close or goal-reached review arrives for a pull request that was never linked to its ticket, the plugin now reads the pull request's branch to find the ticket and saves the link, the same way the opening event does. Before, only the opening event did this. So if the opening delivery used up all its retries without saving a link, the merge or close was reported as not_tracked and its comment and "Done" move were silently dropped.

What changed (packages/plugins/_shared/trackerSync.ts)

  • Branch lookup on every sync-back event: ticketOfPullRequest now tries the branch lookup whenever no link is stored, not only for opened.
  • Failed lookups are retried: if reading the pull request fails, the delivery fails and is retried, using the existing lookupFailure. It is no longer accepted as untracked. Permission or repository refusals are still not retried.
  • No lookup for events that do nothing: the pull request is only read for events that sync something back. A review short of its goal, or any other pull request event, ends before any read.

Tests (packages/plugins/test/linear.test.ts)

  • New regression: the opening delivery fails on all three attempts. The merge then arrives while ProPR is still unavailable, and its delivery fails to be retried rather than being dropped. Once access is back, the retried merge finds ENG-123 from the branch and posts its comment and the "Done" move. A close and a goal-reached review of two other pull requests also find the ticket from their branches. A review short of its goal does nothing and reads no pull request.
  • Checked against the old code: with the old opening-only condition put back, the new test fails; with the fix it passes.
  • Changed test helper: I added an optional headRefs setting to the fake pull request lookup. It was needed because the existing "pull request of an issue no ticket created" case relied on merges never reading the branch, and the fake branch always pointed to issue 101. That case now uses a branch for issue 202 and still expects not_tracked.

Results: all 86 plugin tests pass, as do the 3 core Linear webhook tests. Typecheck and zero-warning lint on the plugin package are clean.

Similar code: task events (taskStep) find the ticket by issue number first. They only use a stored pull request link when the event has no issue number, and they have no branch to read, so this defect doesn't apply there and I left them unchanged.

There's nothing visual in this change, so no preview.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/plugins/_shared/trackerSync.ts (+28/−18)
  • Low risk (1 file)
    • packages/plugins/test/linear.test.ts (+28/−3)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +56/−21 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 28s
  • Tokens: 559,255 (553,334 in / 5,921 out)
  • Cost: $0.51

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6932990290✓

…ves for a pull request that was never linked to its ticket, the plugin now reads the pull request's branch to find the ticket and saves the link, the same way the opening event does. Before, only the opening event did this. So if the opening delivery used up all its retries without saving a link, the merge or close was reported as `not_tracked` and its comment and "Done" move were silently dropped.

I fixed F8. When a merge, close or goal-reached review arrives for a pull request that was never linked to its ticket, the plugin now reads the pull request's branch to find the ticket and saves the link, the same way the opening event does. Before, only the opening event did this. So if the opening delivery used up all its retries without saving a link, the merge or close was reported as `not_tracked` and its comment and "Done" move were silently dropped.

**What changed** (`packages/plugins/_shared/trackerSync.ts`)
- **Branch lookup on every sync-back event:** `ticketOfPullRequest` now tries the branch lookup whenever no link is stored, not only for `opened`.
- **Failed lookups are retried:** if reading the pull request fails, the delivery fails and is retried, using the existing `lookupFailure`. It is no longer accepted as untracked. Permission or repository refusals are still not retried.
- **No lookup for events that do nothing:** the pull request is only read for events that sync something back. A review short of its goal, or any other pull request event, ends before any read.

**Tests** (`packages/plugins/test/linear.test.ts`)
- **New regression:** the opening delivery fails on all three attempts. The merge then arrives while ProPR is still unavailable, and its delivery fails to be retried rather than being dropped. Once access is back, the retried merge finds ENG-123 from the branch and posts its comment and the "Done" move. A close and a goal-reached review of two other pull requests also find the ticket from their branches. A review short of its goal does nothing and reads no pull request.
- **Checked against the old code:** with the old opening-only condition put back, the new test fails; with the fix it passes.
- **Changed test helper:** I added an optional `headRefs` setting to the fake pull request lookup. It was needed because the existing "pull request of an issue no ticket created" case relied on merges never reading the branch, and the fake branch always pointed to issue 101. That case now uses a branch for issue 202 and still expects `not_tracked`.

**Results:** all 86 plugin tests pass, as do the 3 core Linear webhook tests. Typecheck and zero-warning lint on the plugin package are clean.

**Similar code:** task events (`taskStep`) find the ticket by issue number first. They only use a stored pull request link when the event has no issue number, and they have no branch to read, so this defect doesn't apply there and I left them unchanged.

There's nothing visual in this change, so no preview.

PR: #3588
Comment by: @integry (ID: 6932990290)
Model: Claude Opus 5.5
@propr-dev propr-dev Bot changed the title 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) ⚠️⑥ [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 16, 2026
@integry

integry commented Nov 17, 2026

Copy link
Copy Markdown
Owner

/ultrafix

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev propr-dev Bot changed the title ⚠️⑥ [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR adds Linear intake, sync-back, service-loaded settings, and shared tracker helpers. The implementation is substantial and generally careful, but needs a correction before merge: sync-back can permanently skip events while the initial issue creation is still being recorded.

✅ Scoped configuration access — The options route checks durable administrator authority, and its handler receives no ProPR permissions.

✅ Bounded issue content — Description escaping and byte-budget enforcement preserve the issue wrapper and avoid splitting entities or Unicode characters.

✅ Concurrent intake protection — Ticket reservation uses an atomic state update before creating the GitHub issue.

This review used static analysis of the supplied code; no commands or tests were run. Current checks report 32 passed, 10 neutral/skipped, and two pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F9: 🔴 Retry events arriving during intake

  • Category: correctness

  • Required behavior: AC2 requires sync-back for task lifecycle events; a tracked ticket’s events must not be permanently acknowledged before its issue association becomes available.

  • Evidence: packages/plugins/_shared/trackerIssue.ts:124-142, packages/plugins/_shared/trackerRecords.ts:159-165, and packages/plugins/_shared/trackerSync.ts:103-110,166-169.

    1. A mapped ticket is reserved as pending, and the webhook handler awaits ctx.propr.createIssue.
    2. GitHub creates the issue with the trigger label. Its ordinary label-triggered intake starts the task while the API response or the subsequent writeTicket transaction is still outstanding.
    3. The event dispatcher delivers task.started. findTicketByIssue accepts only created records with a matching issue number, so it cannot find the pending ticket.
    4. taskStep returns null; planSync returns not_tracked; the sync handler succeeds. The dispatcher consequently advances its cursor.
    5. Intake finishes recording the issue association. Nothing revisits the already-successful start event, so Linear never receives its start comment.

    static trace: The awaited creation and association write are separate operations. The supplied dispatcher processes events independently of the webhook runner; its lease orders event deliveries but does not wait for intake completion. Atomic reservation prevents duplicate issue creation, but provides no readiness coordination for readers. The supplied tests always finish handedOver() before delivering events, so they exclude this sequence.

    proposed regression: Pause intake after the issue has been created but before its association is saved, deliver the corresponding start event, then finish intake and verify that the start comment is eventually posted exactly once.

  • Minimum fix: Make potentially relevant unmatched events retry while an intake association is pending, or reconcile those events after recording the association. Preserve successful skipping for genuinely unrelated events once no pending association can explain the miss.

Suggestions

These are optional follow-ups and are not sent to /fix.

S7: 🟢 Align troubleshooting with stored diagnostics

The new Linear documentation promises webhook-specific Activity messages, including instructions to check the repository after uncertain creation. The supplied webhook runner contract strips handler messages and error text, retaining generic failure diagnostics. Update the troubleshooting guidance to describe what users can actually inspect. This documentation follow-up does not require weakening the existing privacy boundary.

Score

The permission boundaries, intake deduplication, and focused tests are strong. The intake-to-event ordering gap still permits a required notification to disappear permanently, so the PR is not yet merge-ready.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 23s
  • Tokens: 123,707 (121,917 in / 1,790 out)
  • Cost: $1.20

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F9 S7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 7b1e489

Addressed 1 AI review comment (IDs: 6933611764)

Addressed finding F9

Summary of Changes

I fixed F9. A start event that arrives before Linear's hand-off has saved the new issue number is now retried instead of being acknowledged and dropped. Once the hand-off saves the number, the retry posts the start comment once.

What changed

  • One read per lookup (_shared/trackerRecords.ts): findTicketByIssue reads each ticket shard once. It returns either the matching created ticket or the repository's tickets that are still pending. A ticket lives in one shard, so a record that finishes during the lookup is seen as pending or as created, never missed by both.
  • Retry on a likely match (_shared/trackerSync.ts, new ticketOfIssue): if no ticket matches but a pending one in the same repository was reserved less than 90 seconds ago, the plugin reads the GitHub issue. If the issue's title starts with that ticket's reference (as the hand-off writes it), or the issue can't be read, the delivery fails and is retried. The wait is 30 seconds or the time left in the 90 seconds, whichever is shorter.
    • 90 seconds is three times the 30-second handler time limit. A pending record older than that belongs to a hand-off that ended without saving an issue, so it no longer holds events back.
    • Waits of 30 seconds use at most 4 attempts, within the dispatcher's 5.
  • Other events still skip: these are still reported as not_tracked straight away:
    • other issues in the same repository
    • other repositories
    • events in a repository with no pending hand-off
    • events that never sync back (taskStep now checks this before looking anything up, so a follow-up task's start no longer waits)
  • Same path for pull requests: a pull request event that finds its ticket from the branch name goes through the same check, so an opening that arrives during a hand-off waits too.

Tests (test/linear.test.ts)

  • The finding's sequence: issue creation is paused after GitHub has the issue but before the plugin saves its number. The start event and a pull request opening are each retried. After intake finishes, each posts its comment once, and a redelivery says done.
  • No unneeded waits: while a hand-off is under way, an unrelated issue (including one titled ENG-1234: … next to ticket ENG-123), another repository and a follow-up start all skip at once. An issue that can't be read waits. A pending record older than 90 seconds holds nothing back.
  • I removed each of the three checks (pending, age, event type) in turn, and each time at least one new test failed.

Results: all 88 plugin tests pass, as do the core Linear webhook test and the state-update test. Plugin typecheck and zero-warning lint are clean.

Trade-offs

  • The dispatcher counts each retry as a failure, and three in a row marks the plugin Degraded. That needs an issue whose title matches a pending ticket and an intake that stays unfinished for a minute or more; normally the second attempt succeeds.
  • If someone edits the issue title on GitHub while intake is still running, the start event can still be skipped. That is a race with GitHub, not something the plugin can prevent.

Nothing visual changed, so there are no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/plugins/_shared/trackerRecords.ts (+14/−5)
    • packages/plugins/_shared/trackerSync.ts (+41/−3)
  • Low risk (1 file)
    • packages/plugins/test/linear.test.ts (+70/−4)

Validation evidence

  • No repository validation commands ran.

Diff size: 3 files changed, +125/−12 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 6m 53s
  • Tokens: 2,010,005 (1,994,589 in / 15,416 out)
  • Cost: $1.13

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…-off has saved the new issue number is now retried instead of being acknowledged and dropped. Once the hand-off saves the number, the retry posts the start comment once.

I fixed F9. A start event that arrives before Linear's hand-off has saved the new issue number is now retried instead of being acknowledged and dropped. Once the hand-off saves the number, the retry posts the start comment once.

**What changed**
- **One read per lookup** (`_shared/trackerRecords.ts`): `findTicketByIssue` reads each ticket shard once. It returns either the matching created ticket or the repository's tickets that are still pending. A ticket lives in one shard, so a record that finishes during the lookup is seen as pending or as created, never missed by both.
- **Retry on a likely match** (`_shared/trackerSync.ts`, new `ticketOfIssue`): if no ticket matches but a pending one in the same repository was reserved less than 90 seconds ago, the plugin reads the GitHub issue. If the issue's title starts with that ticket's reference (as the hand-off writes it), or the issue can't be read, the delivery fails and is retried. The wait is 30 seconds or the time left in the 90 seconds, whichever is shorter.
  - 90 seconds is three times the 30-second handler time limit. A pending record older than that belongs to a hand-off that ended without saving an issue, so it no longer holds events back.
  - Waits of 30 seconds use at most 4 attempts, within the dispatcher's 5.
- **Other events still skip:** these are still reported as `not_tracked` straight away:
  - other issues in the same repository
  - other repositories
  - events in a repository with no pending hand-off
  - events that never sync back (`taskStep` now checks this before looking anything up, so a follow-up task's start no longer waits)
- **Same path for pull requests:** a pull request event that finds its ticket from the branch name goes through the same check, so an opening that arrives during a hand-off waits too.

**Tests** (`test/linear.test.ts`)
- **The finding's sequence:** issue creation is paused after GitHub has the issue but before the plugin saves its number. The start event and a pull request opening are each retried. After intake finishes, each posts its comment once, and a redelivery says `done`.
- **No unneeded waits:** while a hand-off is under way, an unrelated issue (including one titled `ENG-1234: …` next to ticket `ENG-123`), another repository and a follow-up start all skip at once. An issue that can't be read waits. A pending record older than 90 seconds holds nothing back.
- I removed each of the three checks (pending, age, event type) in turn, and each time at least one new test failed.

**Results:** all 88 plugin tests pass, as do the core Linear webhook test and the state-update test. Plugin typecheck and zero-warning lint are clean.

**Trade-offs**
- The dispatcher counts each retry as a failure, and three in a row marks the plugin Degraded. That needs an issue whose title matches a pending ticket and an intake that stays unfinished for a minute or more; normally the second attempt succeeds.
- If someone edits the issue title on GitHub while intake is still running, the start event can still be skipped. That is a race with GitHub, not something the plugin can prevent.

Nothing visual changed, so there are no previews.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements Linear intake, sync-back, and service-loaded settings with substantial coverage. It needs a localized correctness fix before merge: progress retention can erase the protection against moving merged tickets backward.

✅ Atomic intake reservation — Ticket reservation uses ctx.state.update, preventing simultaneous deliveries from both creating an issue.

✅ Restricted configuration access — The options route checks durable administrator access and removes ProPR permissions from its handler context.

✅ Bounded issue descriptions — Escaping and truncation account for UTF-8 expansion while preserving entities and characters.

This review used static tracing only; no commands were run. Current checks report 34 passed, one pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F10: 🔴 Retain merge protection for linked pulls

  • Category: correctness

  • Required behavior: Retrying an opening delivery after its merge has synced must not move the ticket back to the opening state.

  • Evidence: packages/plugins/_shared/trackerRecords.ts:186, updateProgress; packages/plugins/_shared/trackerSync.ts:209, planSync; packages/plugins/linear/sync.ts:44, run.

    1. For a tracked ticket, an opening delivery’s comment fails while its state move succeeds. After retries exhaust, the delivery remains eligible for manual retry.
    2. Its pull request merges successfully. Progress now contains opened:1:move, merged:1:comment, and merged:1:move.
    3. Six subsequent pull requests for the same ticket each open and merge successfully, adding 24 markers. record.d.slice(-DONE_LIMIT) removes all three markers for the first pull request.
    4. The first pull request remains linked: seven linked pulls are below PULL_LIMIT = 10.
    5. An administrator retries the original failed opening delivery after the comment failure is resolved. Neither its opening-move marker nor its superseding merge marker exists. Both planSync and moveSuperseded therefore permit the opening move, changing the completed ticket back to “In Review.”

    The atomic updates prevent lost writes but intentionally discard the evidence these guards require. Existing retry tests retain that evidence and do not exercise marker exhaustion. static trace: the sequence follows the marker truncation, linked-pull retention, manual-retry contract, and both move checks supplied in this review. proposed regression: reproduce this sequence and assert that the retry posts the missing comment without sending an opening-state mutation.

  • Minimum fix: Preserve completion and supersession flags for every retained linked pull request independently of the rolling task-marker history, and add the retention-boundary regression above.

Suggestions

These are optional follow-ups and are not sent to /fix.

S8: 🟢 Align webhook troubleshooting with Activity

The new Linear documentation promises specific intake errors and mapping explanations in Activity, but webhookDiagnostics replaces webhook messages and errors with generic text. Adjust those troubleshooting instructions to match what administrators can actually see. This documentation cleanup does not affect the correctly retained event-handler warnings for missing workflow states.

S9: 🟢 Verify the live integration

The fixture coverage is extensive, but the supplied implementation history reports no real-workspace smoke test. Running the documented checklist would strengthen confidence in label-change payloads, API-key permissions, and MCP tool availability. This is supplementary integration evidence, not a demonstrated code blocker.

Score

The implementation has strong defensive handling and broad tests, but its bounded progress history can undo a completed workflow state on a supported retry path. The remaining pending check is not itself a blocker.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 38s
  • Tokens: 123,754 (121,971 in / 1,783 out)
  • Cost: $1.18

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F10 S8 S9

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit c9c75ca

Addressed 1 AI review comment (IDs: 6934302885)

Addressed finding F10

Summary of Changes

I fixed F10. A retried opening delivery no longer moves the ticket back to "In Review" when later pull requests on the same ticket have pushed its merge marker out of the done history.

Cause: the only record that a pull request merged was a marker in the done history, and that history keeps only the latest 24 markers. A pull request can stay linked after its markers have been dropped. The opening move then looked like it had never been made, and nothing showed that the merge had overtaken it.

Fix (packages/plugins/_shared/trackerRecords.ts, trackerSync.ts):

  • Separate field: each progress record now has a field f that holds the merge and close markers (merged:N:…, closed:N:…) of every pull request still linked. It is kept apart from the rolling history.

  • Where it is filled: updateProgress builds f from both the stored record and the new one. So callers that rebuild the record without f (such as linkPullRequest) can't wipe it. A pull request's flags are dropped when it is unlinked, so f stays bounded by PULL_LIMIT.

  • What reads it: a new doneMarkers() combines f and the history. Every check that relies on that evidence now uses it:

    • planSync's done and superseded checks
    • moveSuperseded, the re-read just before the move
    • markSyncDone
    • the finished-pull check used by withPullRequest and by shard eviction

    Before, those last two could also lose track of a finished pull request once its markers rolled out of the history.

  • Older records: records saved before this change, without f, still work. Their surviving merge and close markers are moved into f on their next update.

Tests:

  • linear.test.ts: reproduces the review's exact sequence. It asserts that the history no longer holds any marker for Epic: Web UI (3/4) - Frontend Dashboard Widgets #55 while Epic: Web UI (3/4) - Frontend Dashboard Widgets #55 is still linked. The retry then posts the missing opening comment and sends no opening-state change. With the source fix reverted, this test fails on "no move back to the opening state".
  • trackerShared.test.ts: checks that the merge markers survive the rolling history and records rebuilt by linkPullRequest, and that they are dropped with their pull request when it is unlinked.

Results: all 90 plugin tests and the core Linear webhook test pass. Typecheck and zero-warning lint on the plugin package are clean.

Separate finding, not changed: the "don't move back" guard depends on the merge's own move having happened. If no merged state is configured, the merge records no move marker, so a manual retry of the opening delivery can still move the ticket to the opening state. That was already the case before this PR's fixes and is outside F10.

There is no visual change, so I made no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (2 files)
    • packages/plugins/_shared/trackerRecords.ts (+36/−7)
    • packages/plugins/_shared/trackerSync.ts (+4/−4)
  • Low risk (2 files)
    • packages/plugins/test/linear.test.ts (+24/−1)
    • packages/plugins/test/trackerShared.test.ts (+21/−1)

Validation evidence

  • No repository validation commands ran.

Diff size: 4 files changed, +85/−13 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 1s
  • Tokens: 1,258,888 (1,249,208 in / 9,680 out)
  • Cost: $0.79
  • Subscription usage: Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… ticket back to "In Review" when later pull requests on the same ticket have pushed its merge marker out of the done history.

I fixed F10. A retried opening delivery no longer moves the ticket back to "In Review" when later pull requests on the same ticket have pushed its merge marker out of the done history.

**Cause:** the only record that a pull request merged was a marker in the done history, and that history keeps only the latest 24 markers. A pull request can stay linked after its markers have been dropped. The opening move then looked like it had never been made, and nothing showed that the merge had overtaken it.

**Fix** (`packages/plugins/_shared/trackerRecords.ts`, `trackerSync.ts`):
- **Separate field:** each progress record now has a field `f` that holds the merge and close markers (`merged:N:…`, `closed:N:…`) of every pull request still linked. It is kept apart from the rolling history.
- **Where it is filled:** `updateProgress` builds `f` from both the stored record and the new one. So callers that rebuild the record without `f` (such as `linkPullRequest`) can't wipe it. A pull request's flags are dropped when it is unlinked, so `f` stays bounded by `PULL_LIMIT`.
- **What reads it:** a new `doneMarkers()` combines `f` and the history. Every check that relies on that evidence now uses it:
  - `planSync`'s done and superseded checks
  - `moveSuperseded`, the re-read just before the move
  - `markSyncDone`
  - the finished-pull check used by `withPullRequest` and by shard eviction

  Before, those last two could also lose track of a finished pull request once its markers rolled out of the history.
- **Older records:** records saved before this change, without `f`, still work. Their surviving merge and close markers are moved into `f` on their next update.

**Tests:**
- **`linear.test.ts`:** reproduces the review's exact sequence. It asserts that the history no longer holds any marker for #55 while #55 is still linked. The retry then posts the missing opening comment and sends no opening-state change. With the source fix reverted, this test fails on "no move back to the opening state".
- **`trackerShared.test.ts`:** checks that the merge markers survive the rolling history and records rebuilt by `linkPullRequest`, and that they are dropped with their pull request when it is unlinked.

**Results:** all 90 plugin tests and the core Linear webhook test pass. Typecheck and zero-warning lint on the plugin package are clean.

**Separate finding, not changed:** the "don't move back" guard depends on the merge's own move having happened. If no merged state is configured, the merge records no move marker, so a manual retry of the opening delivery can still move the ticket to the opening state. That was already the case before this PR's fixes and is outside F10.

There is no visual change, so I made no previews.

PR: #3588
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements Linear intake, sync-back, and service-loaded settings through the existing plugin runtime. The shared tracker helpers fit the stated reuse objective. No merge-blocking defect was verified from the supplied diff and surrounding context; merge readiness remains conditional on the pending checks.

✅ Atomic ticket reservation — Intake reserves a ticket through ctx.state.update before creating its GitHub issue, preventing concurrent deliveries from both initiating creation.

✅ Restricted settings access — The options route requires durable administrator access and removes ProPR permissions from the handler’s starting context.

✅ Boundary coverage — Added tests cover signature rejection, concurrent reservations, escaped description limits, pending hand-offs, and delayed opening events after merges.

This was a static review only. No commands or tests were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S10: 🟢 Align Activity troubleshooting guidance

docs/docs/plugins/linear.md promises specific inbound failure messages and instructions in Activity, but the supplied webhookDiagnostics implementation replaces webhook error text and log messages with fixed placeholders. Update the troubleshooting guidance to describe what administrators actually see. This is an optional documentation correction; it does not affect signature verification or ticket handling.

S11: 🟢 Exercise separate database connections

packages/core/test/pluginStateUpdate.test.ts creates multiple stores using one Knex database instance. A follow-up test using separate connections to the same SQLite file would better substantiate the documented cross-process behavior, including contention and retry outcomes. The current tests establish concurrent store behavior, and no resulting data-corruption defect was demonstrated here.

Score

The implementation has substantial targeted coverage and no verified blocker in this static review. The supplied current-head status reports 29 passed checks, five pending, and no failures; live Linear behavior remains unverified.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 52s
  • Tokens: 125,725 (124,909 in / 816 out)
  • Cost: $1.16

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S10 S11

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met).

To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge.

@propr-dev
propr-dev Bot merged commit 3d0d141 into 3542-epic-plugin-system-xu8 Nov 17, 2026
50 checks passed
@propr-dev
propr-dev Bot deleted the 3556/claude-opus-5-5-official-plugin-linear-st-20261116-1828-z4f branch November 17, 2026 01:22
@propr-dev propr-dev Bot changed the title 🔨 [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) [3556 by Claude Opus 5.5] Official plugin: Linear (start work from a ticket, keep the ticket in sync) Nov 17, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 17, 2026
…each. The affected suites pass: 482 tests in the root ultrafix suites and 193 in core status/webhook, with no failures. Typecheck and the zero-warning lint pass for the root, `packages/core` and `packages/shared`.

1. `Last score` is now the real score. The loop usually stops right after a fix step, and a fix step has no score, so the notice always said `unknown`.
- The loop state now remembers the score of each review that reports one (`lastReviewScore`).
- When the loop stops, that score is used if the final step had none. It goes into the stop notice, the stored final score and the status line's `at 6/10`.
- The notice now prints `Last score: 6/10`. It says `unknown` only when no review in the loop produced a score.
- The CI-timeout stop notice uses the same score. It shares one header builder with the regular stop notice, in the new `src/jobs/ultrafixStopNotice.ts`.

2. One cycle count everywhere. Cycle counting is defined once in `packages/shared/src/ultrafixCycle.ts`: cycle N holds the Nth review and the Nth fix.
- While the loop runs, the status line shows the cycle of the step running or due next. This is the same number as before.
- When the loop stops, it records the cycle it stopped in. Normally that is the last completed step's cycle. For a fix that hit a blocker, or a review held back by CI, it is the cycle that step would have had.
- The stop notice now says `Stopped in cycle 5 of 10.`. The status line after the stop uses the same number: `Ultrafix stopped after 5 cycles at 6/10`, where #3588 said "after 4".
- Older loop states without the stored cycle fall back to the old number.
- I moved `getActionCounts` into the same shared file, mainly to keep `ultrafixOrchestrationService.ts` under the 400-line lint limit. It is still re-exported from the old place.

3. The leftover `ultrafix` label is removed on merge or close. This happens in the status sync's merged/closed branch, the same place that removes the status block and the title slot. The new code is `removeLeftoverUltrafixLabel` in `pullRequestStatusFacts.ts`.
- It is best-effort: if the removal fails, it is logged and the next status update tries again.
- It runs on any closed PR that has the label, not only ones ProPR created.

Tests added:
- In `test/ultrafixContinuationEntryPoint.test.ts`:
  - a loop that stops after its final fix reports `6/10` and cycle 2 of 2.
  - a #3588-style stop during a review reports the cycle the status line showed.
  - a loop that ends before any review scored still says `unknown`.
- In `packages/core/test/pullRequestStatusSync.test.ts`, one test checks that the running and stopped status lines agree, and one checks the label removal (merged, closed, and a failed first try).
- I updated the existing CI-timeout wording test in `test/ultrafixCiWait.test.ts` for the new format.

When to stop and how many cycles to run are unchanged. The only extra Redis write is the score stored on the state write that already happens after each review. I made no preview images because the changes are text in GitHub comments and the PR status line.
integry pushed a commit that referenced this pull request Nov 17, 2026
… score and a consistent cycle count (#3614)

* I fixed all three problems from #3593 and added regression tests for each. The affected suites pass: 482 tests in the root ultrafix suites and 193 in core status/webhook, with no failures. Typecheck and the zero-warning lint pass for the root, `packages/core` and `packages/shared`.

1. `Last score` is now the real score. The loop usually stops right after a fix step, and a fix step has no score, so the notice always said `unknown`.
- The loop state now remembers the score of each review that reports one (`lastReviewScore`).
- When the loop stops, that score is used if the final step had none. It goes into the stop notice, the stored final score and the status line's `at 6/10`.
- The notice now prints `Last score: 6/10`. It says `unknown` only when no review in the loop produced a score.
- The CI-timeout stop notice uses the same score. It shares one header builder with the regular stop notice, in the new `src/jobs/ultrafixStopNotice.ts`.

2. One cycle count everywhere. Cycle counting is defined once in `packages/shared/src/ultrafixCycle.ts`: cycle N holds the Nth review and the Nth fix.
- While the loop runs, the status line shows the cycle of the step running or due next. This is the same number as before.
- When the loop stops, it records the cycle it stopped in. Normally that is the last completed step's cycle. For a fix that hit a blocker, or a review held back by CI, it is the cycle that step would have had.
- The stop notice now says `Stopped in cycle 5 of 10.`. The status line after the stop uses the same number: `Ultrafix stopped after 5 cycles at 6/10`, where #3588 said "after 4".
- Older loop states without the stored cycle fall back to the old number.
- I moved `getActionCounts` into the same shared file, mainly to keep `ultrafixOrchestrationService.ts` under the 400-line lint limit. It is still re-exported from the old place.

3. The leftover `ultrafix` label is removed on merge or close. This happens in the status sync's merged/closed branch, the same place that removes the status block and the title slot. The new code is `removeLeftoverUltrafixLabel` in `pullRequestStatusFacts.ts`.
- It is best-effort: if the removal fails, it is logged and the next status update tries again.
- It runs on any closed PR that has the label, not only ones ProPR created.

Tests added:
- In `test/ultrafixContinuationEntryPoint.test.ts`:
  - a loop that stops after its final fix reports `6/10` and cycle 2 of 2.
  - a #3588-style stop during a review reports the cycle the status line showed.
  - a loop that ends before any review scored still says `unknown`.
- In `packages/core/test/pullRequestStatusSync.test.ts`, one test checks that the running and stopped status lines agree, and one checks the label removal (merged, closed, and a failed first try).
- I updated the existing CI-timeout wording test in `test/ultrafixCiWait.test.ts` for the new format.

When to stop and how many cycles to run are unchanged. The only extra Redis write is the score stored on the state write that already happens after each review. I made no preview images because the changes are text in GitHub comments and the PR status line.

* feat(ai): I fixed the Shard 4/4 failure with a one-line change to the test. The failure was a timing flake in `test/agentCapacityAliasOccupancy.test.ts` and has nothing to do with this PR's ultrafix changes: the test and the capacity code it checks weren't touched.

I fixed the Shard 4/4 failure with a one-line change to the test. The failure was a timing flake in `test/agentCapacityAliasOccupancy.test.ts` and has nothing to do with this PR's ultrafix changes: the test and the capacity code it checks weren't touched.

**What failed:** The subtest "a newer admission generation is not deferred by a live older-generation holder" stopped with `Missing expected rejection: an old-generation job is still deferred`.

**Cause:**
- The test keeps an old-generation holder alive on a short lease. The lease lasts 600 ms and is renewed every 200 ms.
- Partway through, the test calls `checkJobAgentCapacity` for the first time. That call loads `@propr/core` on demand.
- Loading `@propr/core` takes about 2.8 s and runs in chunks that pause everything else. Locally each pause was up to 124 ms, with the machine otherwise idle.
- On a busy CI machine those pauses can delay the renewals until the lease runs out. The old-generation check then sees a free slot and doesn't refuse, which is what the test expected it to do.
- The failed subtest took 2.07 s, which matches the module loading inside the test.

**Fix:** The test now runs `await import('@propr/core')` before the short lease starts, with a comment explaining why. The later call then finds the module already loaded and no longer stalls. The test still checks the same things.

**Verification:** I built Redis 7.2.7 from source and ran the suite 3 times through `scripts/run-test-suite.mjs` with `PROPR_REQUIRE_REDIS_INTEGRATION=1`, the setting CI uses. It passed each time, 5 of 5 tests. I couldn't recreate the CI load locally, so the original failure wasn't reproduced here. The cause above comes from the CI log and the pause timing I measured.

The "Run Full Test Suite" failure is only the summary of the failed shard, so it needs no separate fix. There are no preview images because nothing visible changed.

PR: #3614
Comment by: @propr-dev[bot] (ID: 6935539877)
Comment by: @propr-dev[bot] (ID: 6935560493)
Comment by: @github-actions[bot] (ID: 6935562083)
Model: Claude Opus 5.5

---------

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant