Commit 5113681
authored
refactor: version plugin component effective names (#889)
#### Overview
Relay creates effective names for dynamically registered plugin components so runtime discovery and middleware gates can unambiguously identify their owner. This change replaces the ambiguous dunder naming with a versioned, parsed format that carries the plugin kind, an always-present one-based component ordinal, and the local registration name. It makes singleton and multi-component registrations follow the same contract while retaining structured discovery as the stable client-facing identity.
- [x] I confirm this contribution is my own work, or I have the right to submit it under this project license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.
#### Details
- Replace the ambiguous dunder key with the versioned v1 grammar: `nemo-relay-plugin.v1.{percent-encoded-kind}:{one-based-ordinal}:{percent-encoded-local-name}`.
- Percent-encode UTF-8 component kinds and local names using RFC 3986 unreserved-character rules, and strictly decode only canonical v1 names. Invalid, legacy, and ordinary global names retain the global-API fallback.
- Preserve the existing discovery, worker, FFI, Python, Node, and Go owner transport. Relay-created plugin-component discovery now consistently reports `component_ordinal: Some(1)` for a singleton.
- Preserve encoding for PII child contexts and native runtime-created conditional-middleware gate names.
- Update exact cross-language expectations and the conditional-middleware guide.
Breaking behavior: effective names for Relay-created plugin components change from the unmerged dunder format to the v1 format. The structured discovery identity remains the public contract; clients must discover effective names and must not construct or persist them.
#### Where should the reviewer start?
Start with `crates/core/src/plugin.rs` for the namespace encoder/decoder, then `crates/core/src/api/registry.rs` for strict ownership discovery and `crates/core/tests/unit/plugin_tests.rs` for encoded-field and global-fallback coverage.
#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
- Relates to: #886
## Summary by CodeRabbit
* **New Features**
* Introduced versioned, encoded registration names for plugin components.
* Plugin registrations now provide clearer ownership metadata, including component kind and one-based ordinal.
* Improved namespace handling for nested plugin components and conditional middleware guardrails.
* Preserved reliable registration behavior for profile-scoped integrations and singleton plugins.
* **Documentation**
* Documented plugin component ownership, ordinals, and registration naming rules.
* **Tests**
* Expanded coverage for encoded namespaces, component discovery, ownership metadata, disabled components, and singleton plugins.
Authors:
- Bryan Bednarski (https://github.com/bbednarski9)
Approvers:
- Will Killian (https://github.com/willkill07)
URL: #8891 parent 4b3e66e commit 5113681
12 files changed
Lines changed: 387 additions & 68 deletions
File tree
- crates
- core
- src
- api
- plugin/dynamic
- tests
- integration
- unit
- observability
- pii-redaction/src
- plugin/tests
- types
- src/api
- tests
- docs/about-nemo-relay/concepts
- python/tests/plugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 156 | | |
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
170 | 160 | | |
171 | 161 | | |
172 | 162 | | |
173 | | - | |
| 163 | + | |
174 | 164 | | |
175 | 165 | | |
176 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| |||
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
423 | | - | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
424 | 460 | | |
425 | 461 | | |
426 | 462 | | |
| |||
431 | 467 | | |
432 | 468 | | |
433 | 469 | | |
434 | | - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
435 | 474 | | |
436 | 475 | | |
437 | 476 | | |
438 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
439 | 485 | | |
440 | 486 | | |
441 | 487 | | |
| |||
2653 | 2699 | | |
2654 | 2700 | | |
2655 | 2701 | | |
2656 | | - | |
2657 | 2702 | | |
2658 | 2703 | | |
2659 | 2704 | | |
| |||
2673 | 2718 | | |
2674 | 2719 | | |
2675 | 2720 | | |
2676 | | - | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
| 2721 | + | |
2681 | 2722 | | |
2682 | 2723 | | |
2683 | 2724 | | |
| |||
2729 | 2770 | | |
2730 | 2771 | | |
2731 | 2772 | | |
2732 | | - | |
| 2773 | + | |
2733 | 2774 | | |
2734 | 2775 | | |
2735 | 2776 | | |
| |||
2804 | 2845 | | |
2805 | 2846 | | |
2806 | 2847 | | |
2807 | | - | |
2808 | | - | |
2809 | | - | |
2810 | | - | |
2811 | | - | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
2812 | 2927 | | |
2813 | 2928 | | |
2814 | 2929 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| 532 | + | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| |||
3935 | 3936 | | |
3936 | 3937 | | |
3937 | 3938 | | |
3938 | | - | |
| 3939 | + | |
| 3940 | + | |
3939 | 3941 | | |
3940 | 3942 | | |
| 3943 | + | |
3941 | 3944 | | |
3942 | 3945 | | |
3943 | 3946 | | |
| |||
4060 | 4063 | | |
4061 | 4064 | | |
4062 | 4065 | | |
4063 | | - | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
4064 | 4075 | | |
4065 | 4076 | | |
4066 | 4077 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6736 | 6736 | | |
6737 | 6737 | | |
6738 | 6738 | | |
6739 | | - | |
| 6739 | + | |
6740 | 6740 | | |
6741 | 6741 | | |
6742 | 6742 | | |
| |||
6757 | 6757 | | |
6758 | 6758 | | |
6759 | 6759 | | |
6760 | | - | |
| 6760 | + | |
6761 | 6761 | | |
6762 | 6762 | | |
6763 | 6763 | | |
| |||
6767 | 6767 | | |
6768 | 6768 | | |
6769 | 6769 | | |
| 6770 | + | |
6770 | 6771 | | |
6771 | 6772 | | |
6772 | 6773 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
1514 | | - | |
| 1514 | + | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| |||
1547 | 1547 | | |
1548 | 1548 | | |
1549 | 1549 | | |
1550 | | - | |
| 1550 | + | |
1551 | 1551 | | |
1552 | 1552 | | |
1553 | 1553 | | |
| |||
1583 | 1583 | | |
1584 | 1584 | | |
1585 | 1585 | | |
1586 | | - | |
| 1586 | + | |
1587 | 1587 | | |
1588 | 1588 | | |
1589 | 1589 | | |
| |||
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | | - | |
| 1638 | + | |
1639 | 1639 | | |
1640 | 1640 | | |
1641 | 1641 | | |
| |||
2576 | 2576 | | |
2577 | 2577 | | |
2578 | 2578 | | |
2579 | | - | |
| 2579 | + | |
2580 | 2580 | | |
2581 | 2581 | | |
2582 | 2582 | | |
| |||
3703 | 3703 | | |
3704 | 3704 | | |
3705 | 3705 | | |
3706 | | - | |
| 3706 | + | |
3707 | 3707 | | |
3708 | 3708 | | |
3709 | 3709 | | |
3710 | | - | |
| 3710 | + | |
3711 | 3711 | | |
3712 | 3712 | | |
3713 | 3713 | | |
| |||
3918 | 3918 | | |
3919 | 3919 | | |
3920 | 3920 | | |
3921 | | - | |
| 3921 | + | |
3922 | 3922 | | |
3923 | 3923 | | |
3924 | 3924 | | |
| |||
3994 | 3994 | | |
3995 | 3995 | | |
3996 | 3996 | | |
3997 | | - | |
| 3997 | + | |
3998 | 3998 | | |
3999 | 3999 | | |
4000 | 4000 | | |
| |||
0 commit comments