Skip to content

Plugin dev emit reaches panels; trim the plugin authoring skill - #37026

Merged
nwparker merged 2 commits into
mainfrom
nwparker/plugin-dx-emit-panels
Nov 1, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/plugin-dx-emit-panels

Conversation

@nwparker

@nwparker nwparker commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​85 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​70
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​570 $\color{#cf222e}{\Huge{\mathbf{−}}}$​502 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68

ELI5

orca plugin dev emit lets a plugin author fire a test event at their plugin. It used to reach only the background worker; now it also reaches the plugin's open panels. The plugin authoring skill also gets shorter, so agents load less of it each time and read the details only when they need them.

What Changed

dev emit reaches panels

  • PluginPanelBridge.publishEvent takes an optional { pluginKey } filter and returns how many panels heard the event. Existing callers ignore the count.
  • dev emit:
    • checks dev plugin, approval and capability first, and delivers nothing if any fail;
    • then delivers to the worker, if it declares the event, and to the plugin's subscribed open panels;
    • reports real delivered: { worker, panels } counts;
    • works for panel-only plugins without starting a worker;
    • refuses with "Nothing in listens for " and next steps when neither the worker nor a panel listens.

Authoring skill, trimmed with progressive disclosure

  • The main orca-plugin-authoring guide goes from 299 to 121 lines. It keeps:
    • the decision table;
    • the build-less rules;
    • the core loop: create → dev watch --check --shot → read the PNG → test → check → release-entry;
    • shipping, approval and the top gotchas.
  • Details move into two hand-written references, each with a "read when" pointer from the main guide:
    • references/workflow.md: dev watch events, shot options, test and check output, and orca/testing for panels and workers;
    • references/recipes.md: panel plus worker, storage and settings, live agent status, worker events.
  • A new worker-testing section covers mountWorker, worker.request, posts, emit and dev emit.
  • Tests:
    • The guide-command test now scans the hand-written references too, so every command they name must exist.
    • A new test keeps the main guide at 150 lines or fewer.

Why

Linked Issue

N/A (maintainer change).

Visual Proof

N/A: a CLI and docs change. dev emit replies { pluginKey, event, delivered: { worker, panels } }.

Testing

  • Unit:

    • worker plus 2 panels → { worker: true, panels: 2 }, with the publish filtered to the plugin;
    • a panel-only plugin reaches its panel without a worker;
    • the nothing-listens, not-granted and not-approved refusals deliver nothing;
    • the bridge returns counts.
  • Skill: guide, bundling and skills tests.

  • Gates: pnpm tc and the full pnpm lint pass. The plugin e2e set passes, 26/26 (macOS).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c4b7421-a091-4b40-a911-79936b7c6d95
Commits

Reviewing files that changed from the base of the PR and between 93f166e and c3c7b5d.

Files selected for processing: 4
  • config/scripts/generate-bundled-skill-guides.test.mjs
  • skill-guides/orca-plugin-authoring.md
  • skill-guides/orca-plugin-authoring/references/workflow.md
  • src/cli/bundled-skill-guides.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

Development test events can now reach eligible workers and subscribed open panels. Panel delivery returns a count and can be restricted to a plugin key. The plugin-authoring guide is shorter and links to new recipe and workflow references. The bundled guide includes those references, and tests check their registration, command-name coverage, and guide length.

Merge Risk: Moderate · up to c3c7b

Address the execution warning and migration guidance before merging; the guide also needs corrections for windowless hosts and worker networking.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies both primary changes: panel delivery for plugin development events and reduction of the plugin authoring skill.
Description check Passed The description covers the required sections and clearly explains the user-facing changes, implementation, rationale, testing, visual proof, compatibility, and checklist status. The linked issue is ma…
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.
Full details: Description check

Explanation

The description covers the required sections and clearly explains the user-facing changes, implementation, rationale, testing, visual proof, compatibility, and checklist status. The linked issue is marked N/A with a maintainer exception, which is consistent with the template guidance.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 9 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ca97ee2-800b-4165-adb8-fa6f68845c23
Commits

Reviewing files that changed from the base of the PR and between 1392c8e and 93f166e.

Files selected for processing: 15
  • config/scripts/generate-bundled-skill-guides.test.mjs
  • config/scripts/generate-plugin-authoring-skill-references.test.mjs
  • docs/reference/plugin-authoring.md
  • skill-guides/orca-cli/references/plugins.md
  • skill-guides/orca-plugin-authoring.md
  • skill-guides/orca-plugin-authoring/references/cli.md
  • skill-guides/orca-plugin-authoring/references/recipes.md
  • skill-guides/orca-plugin-authoring/references/workflow.md
  • src/cli/bundled-skill-guides.ts
  • src/cli/specs/plugin.ts
  • src/main/plugins/panels/plugin-panel-bridge.test.ts
  • src/main/plugins/panels/plugin-panel-bridge.ts
  • src/main/plugins/plugin-dev-event-emit.test.ts
  • src/main/plugins/plugin-dev-event-emit.ts
  • src/main/runtime/rpc/methods/plugin-dev-emit.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

3. Edit and save. Each save prints `reloaded`, a `check` of what each panel drew or threw, and a
`shot` whose `path` is a PNG of the panel exactly as Orca draws it: read the image and fix
what looks wrong. Fix every `log` error (`[frame] <file>:<line>`) and `check` issue.
4. `ORCA plugin test <dir> --json` after changes, and `ORCA plugin check <dir> --json` before you

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.

Major · Security & Privacy · Quick win

Restore the unsandboxed execution warning.

plugin test, plugin check, and the watch's --check run plugin code with the local user's access. The main guide now directs agents to run them without the prior trust warning. Restore that warning before these commands, including for existing plugin folders. (raw.githubusercontent.com)

the user's machine: show them that list, and re-run with `--approve` only when they asked for
exactly this plugin and this access. Never approve on their behalf otherwise, and never pass a
fingerprint Orca did not give you. New capabilities or changed commands print a new approval.
`plugin_system_disabled`: ask the user to click "Turn on plugins" in Settings → Plugins.

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.

Minor · Functional Correctness · Quick win

Restore the windowless-host recovery.

An orca serve host has no Settings window. Users cannot follow this instruction there. Restore the plugin system on alternative for that case. (raw.githubusercontent.com)

- `update(atom, fn)` takes an updater only; `set(atom, value)` stores a value. Both throw while
rendering. Components panels have no hooks and no DOM: state lives in atoms.
- Keyed atoms (`atom('draft', '')`) survive a hot reload; unkeyed ones and module variables reset.
`persist` values must be plain JSON; bump `version` (with `migrate`) when the shape changes.

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.

Major · Data Integrity & Integration · Quick win

Exclude storage-backed atoms from this migration advice.

persist: 'storage' does not apply version or migrate. Following this instruction for a changed storage-backed shape leaves existing values in the old shape, which can break the upgraded plugin. Specify that authors must migrate those values explicitly. (raw.githubusercontent.com)

- Keyed atoms (`atom('draft', '')`) survive a hot reload; unkeyed ones and module variables reset.
`persist` values must be plain JSON; bump `version` (with `migrate`) when the shape changes.
- A save that fails to load keeps the last good render with an inline `file:line:col` error.
- No network: requests outside the plugin's files fail. Ship assets and load them relatively.

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.

Minor · Functional Correctness · Quick win

Limit the network restriction to panels and frames.

Trusted workers run in Node and can use Node networking. This instruction can cause an agent to reject a plugin that needs a remote API, even though a worker can implement it. Restore the surface qualifier. (raw.githubusercontent.com)

orca plugin dev emit now publishes through the panel bridge to that dev plugin's open panels
that subscribed with orca.on, under the same approval and capability rules as the worker, and
reports delivered.panels. The bridge's publishEvent takes an optional pluginKey filter and
returns how many panels heard it. A panel-only plugin no longer needs a worker; an event
nothing listens for is refused.
…nces

The main guide drops from 299 to 121 lines: the decision table, build-less rules, core loop
(create → dev watch --check --shot → read the PNG → test → check → release-entry), approval
and top gotchas. Test/check and orca/testing (panels and workers), dev watch events, shot,
open and dev emit move to a hand-written references/workflow.md; the panel/worker/data and
agent status recipes to references/recipes.md, each with a read-when row. The guide test now
also scans hand-written references for commands and caps the main guide at 150 lines.
@nwparker
nwparker force-pushed the nwparker/plugin-dx-emit-panels branch from 93f166e to c3c7b5d Compare November 1, 2026 13:46
@nwparker
nwparker merged commit a37a5b3 into main Nov 1, 2026
52 checks passed
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