-
Notifications
You must be signed in to change notification settings - Fork 6
RPC Rework: Part 6: add _connect_module_refs #1143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…lueprint to be consistent with docs
…o jeff/blueprint/3
…imos into jeff/blueprint/6
Greptile OverviewGreptile SummaryThis PR implements Part 6 of the RPC rework, introducing a module reference system that enables Protocol/Spec-based dependency injection for inter-module RPC communication. Key Changes
Issues Found
TestingComprehensive test coverage added including Spec validation tests, module reference resolution tests, and ambiguity handling tests Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Blueprint
participant ModuleCoordinator
participant RPCClient
participant Module1
participant Module2
User->>Blueprint: autoconnect(Module1.blueprint(), Module2.blueprint())
Blueprint->>Blueprint: _BlueprintAtom.create() - extract StreamRefs & ModuleRefs
User->>Blueprint: .build()
Blueprint->>Blueprint: _check_requirements()
Blueprint->>Blueprint: _verify_no_name_conflicts()
Blueprint->>Blueprint: _start_rerun()
Blueprint->>ModuleCoordinator: start()
Blueprint->>ModuleCoordinator: _deploy_all_modules()
ModuleCoordinator->>RPCClient: deploy(Module1)
RPCClient-->>ModuleCoordinator: ModuleProxy(Module1)
ModuleCoordinator->>RPCClient: deploy(Module2)
RPCClient-->>ModuleCoordinator: ModuleProxy(Module2)
Blueprint->>Blueprint: _connect_transports()
Note over Blueprint: Match StreamRefs by name+type<br/>Handle remappings<br/>Set transports on proxies
Blueprint->>Blueprint: _connect_rpc_methods()
Note over Blueprint: Register RPC methods<br/>Handle interface methods<br/>Set method references
Blueprint->>Blueprint: _connect_module_refs()
Note over Blueprint: Match ModuleRefs to Spec<br/>Structural compliance check<br/>Annotation compliance check
alt Spec match found
Blueprint->>RPCClient: setattr(proxy1, "module_ref", proxy2)
Blueprint->>Module1: set_module_ref("module_ref", proxy2)
else Ambiguous or missing
Blueprint-->>User: Exception with remapping suggestion
end
Blueprint->>ModuleCoordinator: start_all_modules()
ModuleCoordinator->>Module1: start()
Module1->>Module2: RPC call via module_ref
Module2-->>Module1: RPC response
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 2 comments
I'll fix the test in just a bit