|
| 1 | +--- |
| 2 | +name: maintain-dynamic-plugins |
| 3 | +description: Maintain NeMo Relay dynamic plugin loaders, manifests, Rust native SDKs, gRPC worker protocol, Python worker SDK, docs, tests, and release workflow coverage |
| 4 | +author: NVIDIA Corporation and Affiliates |
| 5 | +license: Apache-2.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Maintain Dynamic Plugins |
| 9 | + |
| 10 | +## Companion Guidance |
| 11 | + |
| 12 | +Use `karpathy-guidelines`, `validate-change`, `maintain-packaging`, and |
| 13 | +`contribute-docs` alongside this skill when implementation, packaging, CI, or |
| 14 | +documentation changes are involved. |
| 15 | + |
| 16 | +Use this skill for `plugin.kind = "rust_dynamic"`, `plugin.kind = "worker"`, |
| 17 | +`nemo-relay-plugin`, `nemo-relay-worker`, `nemo-relay-worker-proto`, |
| 18 | +`nemo-relay-types`, and the Python `nemo-relay-plugin` package. |
| 19 | + |
| 20 | +## Rules |
| 21 | + |
| 22 | +- Keep the stable boundary explicit: native plugins cross a C ABI; worker |
| 23 | + plugins cross `grpc-v1`. |
| 24 | +- Do not pass Rust runtime types, trait objects, futures, or allocator-owned |
| 25 | + strings across the native dynamic-library boundary. |
| 26 | +- Keep worker protocol DTOs in `JsonEnvelope`; protobuf owns control flow, not |
| 27 | + duplicated Relay data models. |
| 28 | +- Keep `relay-plugin.toml` dynamic records separate from generic runtime |
| 29 | + components. Enabled dynamic records may synthesize internal component specs; |
| 30 | + disabled records stay inspectable but unloaded. |
| 31 | +- Treat plugin Relay compatibility as normal SemVer. Use `>=0.5,<1.0` in |
| 32 | + examples unless a plugin intentionally declares a narrower range. |
| 33 | +- Do not add tests under `src`; Rust tests belong in crate `tests/` trees and |
| 34 | + Python SDK tests belong under `python/tests`. |
| 35 | +- Native and worker plugins are trusted extensions. Document that native plugins |
| 36 | + are in-process and unsandboxed; worker plugins provide process isolation but |
| 37 | + not a security sandbox. |
| 38 | + |
| 39 | +## Checklist |
| 40 | + |
| 41 | +- [ ] Manifest validation covers kind, compatibility, load contract, integrity, |
| 42 | + capability mismatch, and disabled-plugin behavior. |
| 43 | +- [ ] Native loader keeps libraries alive until registered callbacks are cleared |
| 44 | + and deregisters plugin kinds before unload. |
| 45 | +- [ ] Worker activation covers process launch, token auth, handshake, validation, |
| 46 | + declarative registration, proxy rollback, cancellation, and shutdown. |
| 47 | +- [ ] Rust and Python SDKs expose every supported registration surface. |
| 48 | +- [ ] Runtime helpers cover marks, scopes, continuations, and isolated scope |
| 49 | + stacks. |
| 50 | +- [ ] CLI `plugins list/inspect/validate/doctor` diagnostics include native ABI |
| 51 | + and worker protocol status without leaking secret config. |
| 52 | +- [ ] Docs include separate Rust native, Python worker, and `grpc-v1` protocol |
| 53 | + pages. |
| 54 | +- [ ] `justfile`, Codecov, and CI package/test workflows include new plugin |
| 55 | + crates and packages. |
| 56 | + |
| 57 | +## Validation |
| 58 | + |
| 59 | +```bash |
| 60 | +cargo test -p nemo-relay-types |
| 61 | +cargo test -p nemo-relay-plugin |
| 62 | +cargo test -p nemo-relay-worker-proto |
| 63 | +cargo test -p nemo-relay-worker |
| 64 | +cargo test -p nemo-relay --test native_plugin_tests --test worker_plugin_tests |
| 65 | +uv run pytest python/tests/plugin |
| 66 | +just test-rust |
| 67 | +just test-python |
| 68 | +just docs |
| 69 | +``` |
| 70 | + |
| 71 | +For broad runtime or public API changes, run the full `validate-change` matrix. |
| 72 | + |
| 73 | +## References |
| 74 | + |
| 75 | +- `crates/core/src/plugin/dynamic/` |
| 76 | +- `crates/plugin` |
| 77 | +- `crates/worker` |
| 78 | +- `crates/worker-proto` |
| 79 | +- `crates/types` |
| 80 | +- `python/plugin` |
| 81 | +- `examples/rust-native-plugin` |
| 82 | +- `docs/build-plugins` |
| 83 | +- `examples/python-grpc-worker-plugin` |
0 commit comments