Skip to content

feat: Unified Module Storage — Arc sharing fix, gRPC transport symmetry, feature gate decoupling#45

Open
bkrabach wants to merge 17 commits intomainfrom
feat/unified-module-storage
Open

feat: Unified Module Storage — Arc sharing fix, gRPC transport symmetry, feature gate decoupling#45
bkrabach wants to merge 17 commits intomainfrom
feat/unified-module-storage

Conversation

@bkrabach
Copy link
Collaborator

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 Coordinatorhooks: HookRegistryhooks: Arc<HookRegistry>, new hooks_shared() accessor enables shared ownership for binding layers
  • Node bindings fixed — Deleted create_coordinator()/create_hook_registry() factory methods (which created disconnected copies), replaced with getters that share the real Arc<Coordinator> and Arc<HookRegistry> from the Session
  • gRPC transport symmetry — Added load_grpc_provider, load_grpc_hook, load_grpc_context, load_grpc_approval to transport.rs, completing all 6 module types
  • Feature gate decouplingLoadedModule, ModuleManifest, Transport, and resolve_module() no longer require --features wasm. WASM-specific code stays gated.
  • Doc-tests/// # Examples on hooks_shared(), all 4 new transport functions, and LoadedModule dispatch pattern
  • Warning cleanup — All 39 unused_must_use warnings in test code suppressed, 2 maturin unnecessary mut warnings fixed

Design 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_points dict, mount()/get()/unmount() API, hooks, capabilities — all preserved unchanged. 495 Python tests pass.

Test counts

Suite Count Status
Rust unit tests 438 ✅ PASS
Rust doc-tests 19 ✅ PASS
Rust integration tests 12 ✅ PASS
Node.js Vitest 68 ✅ PASS
Python pytest 495 passed, 1 skipped ✅ PASS
Clippy Clean
Rustfmt Clean

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

bkrabach added 17 commits March 9, 2026 18:12
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`
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