feat: Unified Module Storage — Arc sharing fix, gRPC transport symmetry, feature gate decoupling#45
Open
feat: Unified Module Storage — Arc sharing fix, gRPC transport symmetry, feature gate decoupling#45
Conversation
Design for making Rust the single source of truth for module storage across non-Python transports. Five components: 1. Arc<HookRegistry> in Coordinator for shared ownership 2. Fix Node bindings to share real Arc instances 3. Complete gRPC transport symmetry (4 missing load functions) 4. Decouple LoadedModule from wasm feature gate 5. Documentation via docstrings, not prose examples Establishes Python-from-Rust-host pattern via gRPC adapters. Preserves 100% Python backward compatibility.
- Add `let _ =` before 39 unused .register() return values in tests (hooks.rs: 31, grpc_server.rs: 4, session.rs: 3, coordinator.rs: 1) - Auto-fix 2 `variable does not need to be mutable` warnings in bindings/python/src/lib.rs via `cargo fix --lib -p amplifier-core-py`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes Rust the single source of truth for module storage across all non-Python transports, fixes Arc sharing for binding layers, and completes the gRPC transport surface.
What changed
Arc<HookRegistry>in Coordinator —hooks: HookRegistry→hooks: Arc<HookRegistry>, newhooks_shared()accessor enables shared ownership for binding layerscreate_coordinator()/create_hook_registry()factory methods (which created disconnected copies), replaced with getters that share the realArc<Coordinator>andArc<HookRegistry>from the Sessionload_grpc_provider,load_grpc_hook,load_grpc_context,load_grpc_approvaltotransport.rs, completing all 6 module typesLoadedModule,ModuleManifest,Transport, andresolve_module()no longer require--features wasm. WASM-specific code stays gated./// # Examplesonhooks_shared(), all 4 new transport functions, andLoadedModuledispatch patternunused_must_usewarnings in test code suppressed, 2 maturinunnecessary mutwarnings fixedDesign doc
docs/plans/2026-03-09-unified-module-storage-design.md— covers architecture, rejected alternatives, and the Python-from-Rust-host pattern (gRPC adapter approach).Python backward compatibility
Zero Python changes. The
mount_pointsdict,mount()/get()/unmount()API, hooks, capabilities — all preserved unchanged. 495 Python tests pass.Test counts
Commits
14 commits covering: design doc, TDD red→green cycle for Arc sharing, Node binding refactor, gRPC transport functions, feature gate decoupling, doc-tests, and warning cleanup.
🤖 Generated with Amplifier