Skip to content

loader: Plugin<K> is !Clone; shared holders hold Arc<Plugin<K>> - #986

Merged
MattJackson merged 4 commits into
predevfrom
lane-cabi-plugin-not-clone
Oct 15, 2026
Merged

MattJackson merged 4 commits into
predevfrom
lane-cabi-plugin-not-clone

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

CONTRACT-ABI lane: Plugin<K> is !Clone.

THE DESIGN C.1 (docs/design/BUSBAR-1.6.0.md l.3864-3868, "Compiled-in uses the same table, Types"): Plugin<K> is !Clone. On predev crates/plugin-loader/src/dispatch/plugin.rs:1278 implemented Clone, documented as "cheap to clone; every clone is the same instance". That impl is deleted. A holder that shares an instance now shares an Arc<Plugin<K>>.

Call sites (every one that cloned a handle):

  • dispatch/plane_calls.rs PlaneInstance and dispatch/auth_outbound.rs OutboundInstance hold Arc<Plugin<K>>. Their constructors take impl Into<Arc<Plugin<K>>>, so a caller that hands its plugin over owned is unchanged. They stay Clone because they clone the Arc; OpenOnce hands them out.
  • busbar root boot.rs: DoorPlane is Arc<Plugin<Plane>>, wrapped once at load_door_planes. serve.rs compose_planes_over shares the boot's instance into the generation's PlaneInstance and its DoorApply, at the two plugin.clone() sites l.1427 and l.1571.
  • auth_door.rs: the instance's tick schedule (auth_ticks::spawn, which now takes Arc<Plugin<Auth>>) and its Shared hold one Arc. Before, plugin.clone() was at l.648.
  • hook_door.rs: State::Live holds Arc<Plugin<Hook>>, so live()/trial() hand out the shared instance (before, p.clone() at l.230 and l.292), and Submitted holds it.
  • conformance/mod.rs red_ready and conformance/store.rs fold hand their store plugin to LoadedStore::open by value and keep reading its crossing gate through the instance (crossings_of(&p.inner)), with no copy of the handle.
  • Tests: plane_driver.rs, hook_parity_driver/rig.rs, dispatch_tests.rs (the two hung-call REDs), and the root serve_*/door_steps rigs that build a DoorPlane.

Generic dispatcher calls on a now-shared handle pass &*plugin.

RED: plugin-loader tests::dispatch_tests::a_plugin_handle_is_not_clone. It is an ambiguity probe (the assert_not_impl_any construction) that does not compile while Plugin<K>: Clone, so it is red on predev and green here.

Shared files (rule 20): git merge-tree is clean against predev and against every non-draft open PR that edits these files: #946, #943, #922, #921, #913, #910, #887, #876, #848, #841, #833, #805, and the lane's own #952/#968. None of those PRs adds a Plugin clone, a DoorPlane or a PlaneInstance site that this change would break.

No dependency change. No behaviour change: every clone was the same instance before, and the Arc is that same instance.

…Arc<Plugin<K>>

THE DESIGN C.1 (BUSBAR-1.6.0.md l.3868): "Plugin<K> is !Clone". The Clone impl is deleted.
PlaneInstance and OutboundInstance hold Arc<Plugin<K>> (their constructors take
impl Into<Arc<Plugin<K>>>); the root's DoorPlane is Arc<Plugin<Plane>>, so compose_planes'
PlaneInstance and DoorApply share the boot's instance; the auth door's tick schedule and the
hook door's live/trial state share theirs; the conformance folds that hand a plugin on by value
read its crossing gate through the instance.

RED: dispatch_tests::a_plugin_handle_is_not_clone (does not compile while Plugin<K>: Clone).
@MattJackson

Copy link
Copy Markdown
Collaborator Author

Rule 20 note from #1030 (row 155): disjoint hunk in crates/busbar/tests/plane_driver.rs (zero_piece_out adds tap_fault: 0, _fault_reserved: [0; 2]). A test merge is clean.

@MattJackson

Copy link
Copy Markdown
Collaborator Author

Rule 20 note from #1031 (row 155, draft): one test appended to crates/busbar/src/root/tests/door_steps.rs. A test merge is clean.

MattJackson added a commit that referenced this pull request Oct 15, 2026
… through Arc in the quarantine RED; curated bindings cite by path; schema snapshot keeps DeployCfg.agents; cimd boxes its memory store

- busbar-plane-a2a (coordinator ruling 2026-10-15: the A2A push authentication.credentials is
  caller payload, not kernel-resolved secret material): DeliveryAuth holds a plane-local
  PushCredential (no Display, no Serialize, Debug [redacted]); its readers are header_value (the
  Authorization field request() writes) and the push_config record's serde form. busbar_contract::
  Redacted and its expose_secret leave the plane (secret-accessor-seal:no-reach, DECISIONS #40).
  RED: the credential reaches the Authorization field and no Debug or registration-refusal text.
- plugin-loader: #952's quarantine-on-Nth-breach RED shares its instance as Arc<Plugin<K>>, the
  handle #986 (Plugin<K> is !Clone, THE DESIGN C.1) gives a holder that shares one (E0599).
- design-bindings tables.rs: the nineteen curated refs a rehome twinned cite path.rs::name, so
  --write derives what qa/design-bindings.json and DESIGN-BINDINGS.md already say.
- config-schema snapshot: ModernCI's --write at 5645061: DeployCfg keeps its agents carrier.
- busbar-core-oauth2 cimd: Backend::Memory boxes MemoryStorage (clippy large_enum_variant).
@MattJackson
MattJackson merged commit 2595d69 into predev Oct 15, 2026
1 check was pending
@MattJackson
MattJackson deleted the lane-cabi-plugin-not-clone branch October 15, 2026 05:33
MattJackson added a commit that referenced this pull request Oct 15, 2026
…ased breaker port; the root rigs on the shared plane handle; law0 back at its row

From ModernCI's full logs at 5ad45bf:
- busbar-kernel walk_tests / probe_unit_tests (F25 rehome #905/#896): their private breaker
  adapters classify as the root's BreakerAdapter now does (the transport's fault reading, no
  number: busbar_kernel_breaker::port::UpstreamStatus { reading }), the four frame_with_upstream
  calls state their fault and retry_after, the head of answer() carries its class's fault
  reading as harness::frame does, and route_async answers Pick::Refused as the harness does
  (E0432/E0425/E0560/E0061/E0004).
- busbar root: compose_planes takes the shared Arc<Plugin<Plane>> (#986) in the session door
  rig and the a2a root cells; DoorReach states catalog in door_steps' own_reach and the a2a
  root cells (E0308/E0063).
- clippy: config_validate_cross_plane uses contains.
- kind-isolation:law0 busbar x plane 626 vs 620: the perf test's fixture and the test-linked
  comment named planes (+6); renamed fixtures/perf_mock_provider.yaml and reworded.
- linked-dropped-features: its four transport-http tokio rows are STALE (drained), struck.
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