Skip to content

fix(plugins): carry pure applies into runs and honor grants - #6187

Open
itlackey wants to merge 2 commits into
nexu-io:mainfrom
itlackey:fix/plugin-snapshot-capabilities
Open

fix(plugins): carry pure applies into runs and honor grants#6187
itlackey wants to merge 2 commits into
nexu-io:mainfrom
itlackey:fix/plugin-snapshot-capabilities

Conversation

@itlackey

Copy link
Copy Markdown

Fixes #6186

Why

I hit this while validating a custom pipeline plugin against an imported existing project. Pure apply correctly avoids persistence, but the web send path dropped the plugin identity when its snapshot ID was empty, so the subsequent run could omit the selected plugin or reuse an older project pin.

The same plugin also exposed a capability-state bug: restricted installs could not persist the derived pipeline:* requirement, and apply recomputed trust defaults instead of honoring stored grants and revocations.

What users will see

Selecting a plugin in an existing project now carries that plugin into the next run, where the daemon creates and pins the snapshot. Restricted pipeline plugins can persist pipeline:*, and apply respects the stored grant set without restoring revoked capabilities.

Surface area

  • UI - new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut - new or changed
  • CLI / env var - new od subcommand or flag, new tools-dev / tools-pack flag, or new OD_* env var
  • API / contract - new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point - new entry under skills/, design-systems/, design-templates/, or craft/, or change to the skills protocol
  • i18n keys - added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency - adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope. Include a paragraph on what we get vs. what bytes we ship (see CONTRIBUTING.md -> Code style)
  • Default behavior change - changes what existing users experience without opting in (default model, default setting, file/SQLite schema, auto-network on startup, auto-install)
  • None - internal refactor, docs, tests, or translation update only

Screenshots

Not applicable; this changes run transport and capability resolution without visual UI changes.

Bug fix verification

  • Test paths: apps/web/tests/providers/sse.test.ts, apps/web/tests/components/ProjectView.run-isolation.test.tsx, apps/daemon/tests/plugins-trust.test.ts, and apps/daemon/tests/plugins-apply.test.ts.
  • The focused specs failed on upstream/main and pass on this branch: yes.
  • An isolated daemon run also installed the real plugin, imported an existing project, persisted and pinned the snapshot, completed with a fake agent, and included the plugin skill in the prompt.

Validation

  • pnpm guard
  • pnpm typecheck
  • pnpm exec vitest run -c vitest.config.ts tests/providers/sse.test.ts tests/components/ProjectView.run-isolation.test.tsx --maxWorkers=2 from apps/web (126 passed)
  • pnpm exec vitest run -c vitest.config.ts tests/plugins-*.test.ts from apps/daemon (500 passed)
  • pnpm --filter @open-design/contracts test (246 passed)
  • pnpm --filter @open-design/daemon build
  • pnpm --filter @open-design/web build

@lefarcen

Copy link
Copy Markdown
Contributor

Thanks @itlackey — this is a nicely scoped fix for the two issue paths in #6186: carrying pure plugin applies into the next run, and preserving persisted capability grants instead of rebuilding defaults. I've routed it for pool review, and because it changes a user-facing run path we'll also keep the QA gate in place before merge.

💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …):
Take over nexu-io/open-design#6187 until it merges — read https://raw.githubusercontent.com/nexu-io/looper/main/skills/pr-takeover/SKILL.md and follow it.

@lefarcen
lefarcen requested a review from mrcfps July 28, 2026 17:38
@lefarcen lefarcen added size/M PR changes 100-300 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/bugfix Bug fix labels Jul 28, 2026
@lefarcen lefarcen added the needs-validation Runtime change detected; needs human or /explore agent validation. label Jul 28, 2026
@lefarcen

Copy link
Copy Markdown
Contributor

🧪 This PR has changes that need a manual QA pass before merge — please hold off self-merging for now; we’ll loop QA in once it’s merge-ready (and design/product have signed off, where applicable).

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@itlackey I reviewed the full changed-range diff and verified both bug paths: pure plugin applies now carry the plugin identity and inputs into run creation when no snapshot ID exists, while persisted capability grants and revocations remain authoritative with the prompt-injection floor intact. The shared request contract, both web send paths, daemon trust/apply behavior, and regression coverage are consistent. Local validation passed with repository guard, root typecheck, 126 focused web tests, 500 daemon plugin tests, and the contracts typecheck. Thank you for the tight reproduction and thoughtfully scoped fix—nice work! 🙌

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen

Copy link
Copy Markdown
Contributor

Thanks @itlackey — the current head is approved on code review now. I’ve queued QA on the affected run/plugin path next, and once that validation is in this should be in good shape to merge.

@lefarcen
lefarcen requested a review from AmyShang-alt July 28, 2026 17:50
@itlackey

Copy link
Copy Markdown
Author

Thank you for the quick response and getting this into the queue. Let me know if you need anything from me.

@lefarcen

Copy link
Copy Markdown
Contributor

Thanks @itlackey — nothing else needed from you at the moment. We’re just waiting on the QA pass for this head now, and we’ll follow up here if anything comes up during validation.

@AmyShang-alt AmyShang-alt added validated Runtime change validated (via /explore Pass or manual QA). and removed needs-validation Runtime change detected; needs human or /explore agent validation. labels Jul 29, 2026

@AmyShang-alt AmyShang-alt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

QA 验收通过。\n\n验证证据:\n- Web 定向测试:126/126 passed\n- daemon 插件测试:69 files,500/500 passed\n- contracts:build + 246/246 tests passed\n- pnpm guard passed\n- 全仓 pnpm typecheck passed\n- daemon build passed\n- Electron + daemon 真实运行验证通过\n- 官方插件 design-system-airtable:pure apply 返回空 snapshotId,POST /api/runs 携带 pluginId/pluginInputs,创建并 pin 新 snapshot\n- 真实 Open Design AMR/deepseek-v4-flash run 成功,产出并预览 airtable-landing-test.html\n- Codex CLI 真实 run 也成功,聊天记录已持久化可见\n\nPR head: 0c5bf38

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@itlackey friendly reminder: this PR appears to be waiting on author action (failing CI) and has had no human activity for more than 3 days.

When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes.

@itlackey

itlackey commented Aug 3, 2026

Copy link
Copy Markdown
Author

@mrcfps or @AmyShang-alt can someone re-run the skipped CI to unblock this PR?

@lefarcen

lefarcen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for flagging this, @itlackey — I’ve re-ran the CI workflow for the current head so the skipped jobs can be evaluated again. Once the new run settles, we’ll have a clearer read on whether anything else is needed to unblock merge.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Visual regression review

Head: 13ddd70 · Base: 4e47119

4 changed · 42 unchanged · 0 new without baseline · 0 failed

Changed cases

Case Main PR Diff
visual-home-plugin-use-staged
4,653 px (0.36%)
main pr diff
visual-home-staged-attachment
4,633 px (0.36%)
main pr diff
visual-topbar-execution-switcher
3,340 px (0.26%)
main pr diff
visual-topbar-open-design-model-picker
1,805 px (0.14%)
main pr diff
Unchanged cases
Case Main PR Diff
visual-avatar-local-agent-list
0 px (0.00%)
main pr diff
visual-avatar-local-agent-list-panel
0 px (0.00%)
main pr diff
visual-avatar-menu
0 px (0.00%)
main pr diff
visual-avatar-menu-panel
0 px (0.00%)
main pr diff
visual-avatar-open-design-model-picker
0 px (0.00%)
main pr diff
visual-critical-settings
0 px (0.00%)
main pr diff
visual-critical-workspace
0 px (0.00%)
main pr diff
visual-critical-workspace-preview
0 px (0.00%)
main pr diff
visual-design-system-detail
1 px (0.00%)
main pr diff
visual-design-systems
1 px (0.00%)
main pr diff
visual-home
118 px (0.01%)
main pr diff
visual-home-catalog
0 px (0.00%)
main pr diff
visual-home-context-picker
118 px (0.01%)
main pr diff
visual-home-context-picker-popover
0 px (0.00%)
main pr diff
visual-home-plugin-filter
0 px (0.00%)
main pr diff
visual-home-plugin-use-with-query
0 px (0.00%)
main pr diff
visual-integrations-use-everywhere
0 px (0.00%)
main pr diff
visual-new-project-modal
0 px (0.00%)
main pr diff
visual-plugin-details
0 px (0.00%)
main pr diff
visual-plugin-share-menu
0 px (0.00%)
main pr diff

Visual diff is advisory only and does not block merging.

@itlackey

itlackey commented Aug 4, 2026

Copy link
Copy Markdown
Author

@lefarcen could you push this through the last check?

@lefarcen

lefarcen commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thanks @itlackey — I checked the current head and the rerun is green again, and QA is already validated here.

I don’t see anything else pending from your side at this point; this is on the maintainer side for the final merge step.

@lefarcen

lefarcen commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@itlackey — there's a merge conflict blocking this PR from landing. GitHub's merge state is currently CONFLICTING (the base main has moved since this branch was last pushed). mrcfps's review and QA validation are still in good standing on the current head, so the only thing left is resolving the conflict.

To unblock:

git fetch upstream main
git rebase upstream/main
# resolve any conflicts that surface, then
git push --force-with-lease origin fix/plugin-snapshot-capabilities

Once the rebase lands and CI passes green, this should be merge-ready — no further review needed from your side.

@itlackey
itlackey force-pushed the fix/plugin-snapshot-capabilities branch from d7aae41 to 13ddd70 Compare August 6, 2026 16:40
@itlackey

itlackey commented Aug 6, 2026

Copy link
Copy Markdown
Author

@lefarcen I have rebased and pushed. Let me know if you see any issues.

@lefarcen
lefarcen requested a review from mrcfps August 6, 2026 16:44
@lefarcen

lefarcen commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@itlackey — the rebase landed cleanly, thanks for turning that around quickly. I've re-requested mrcfps's review on this head since the previous approval was on the old commit; CI is running and should resolve shortly.

Nothing else needed from your side at this point.


💡 To drive this PR to merge hands-free, paste this to your AI coding agent (Claude Code / Codex / opencode / Cursor …):
Take over nexu-io/open-design#6187 until it merges — read https://raw.githubusercontent.com/nexu-io/looper/main/skills/pr-takeover/SKILL.md and follow it.

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@itlackey Thanks for a focused, well-tested fix on a high-impact plugin path. I reviewed the full changed-range diff for pure-apply run transport and capability grant/revoke behavior.

What I verified

  • Pure apply with an empty snapshotId now forwards pluginId + pluginInputs from both ProjectView send paths through streamViaDaemon, so /api/runs can create and pin a snapshot instead of dropping the selection or reusing an old pin.
  • applyPlugin treats persisted capabilitiesGranted as authoritative (with the prompt:inject floor), so restricted pipeline grants stick and trusted revocations are not resurrected.
  • pipeline:* is accepted by validateCapabilityList, matching the capability required for plugins with pipeline stages.
  • Contracts, web provider, and daemon behavior stay aligned; regression coverage on web + daemon covers both bug paths.

No actionable findings from this implementation pass — nice work. 🙌

🔁 Powered by Looper · runner=reviewer · agent=grok-build · An autonomous AI dev team for your GitHub repos.

@itlackey

itlackey commented Aug 7, 2026

Copy link
Copy Markdown
Author

@lefarcen can we push this through before the main branch changes again? It seems like its stuck in a loop of approvals/CI for a while. I wasn't sure if you could kick off the final approval/checks, but thought I'd ping you in case we can get this one merged.

@github-actions

Copy link
Copy Markdown
Contributor

@itlackey friendly reminder: this PR appears to be waiting on author action (merge conflict) and has had no human activity for more than 3 days.

When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes.

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

@itlackey friendly reminder: this PR appears to be waiting on author action (merge conflict) and has had no human activity for more than 3 days.

When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes.

@github-actions

Copy link
Copy Markdown
Contributor

@itlackey friendly reminder: this PR appears to be waiting on author action (merge conflict) and has had no human activity for more than 3 days.

When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes.

@itlackey

Copy link
Copy Markdown
Author

I will update this when we are sure it will be merged

@lefarcen

Copy link
Copy Markdown
Contributor

Got it. I checked the current head and there isn’t a new code-side issue I need to flag here — the blocker at the moment is that GitHub is still reporting this branch as conflicting with main.

Once that conflict is cleared again, this should be back in mergeable shape.

@github-actions

Copy link
Copy Markdown
Contributor

@itlackey friendly reminder: this PR appears to be waiting on author action (outstanding trusted reviewer or maintainer feedback, merge conflict) and has had no human activity for more than 3 days.

When you have a chance, please reply here or push an update. To keep the queue manageable, PRs with no human activity for more than 5 days may be closed automatically, but they can be reopened when work resumes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/M PR changes 100-300 lines type/bugfix Bug fix validated Runtime change validated (via /explore Pass or manual QA).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Existing-project plugin selection is dropped and restricted pipeline grants are ignored

4 participants