feat(framework): Add can_execute hook to FederationManager#6908
feat(framework): Add can_execute hook to FederationManager#6908
can_execute hook to FederationManager#6908Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a typed authorization boundary for “execution” decisions in the SuperLink federation layer by adding an ActionType enum and a new FederationManager.can_execute(...) hook, with a permissive implementation in NoOpFederationManager.
Changes:
- Added
ActionType(currently includingSTART_RUN) toflwr.supercore.constant. - Extended the
FederationManagerABC with a new abstractcan_execute(flwr_aid, action, federation, run_type) -> boolmethod. - Implemented
can_executeinNoOpFederationManager(always returnsTrue) and added a corresponding unit test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| framework/py/flwr/superlink/federation/noop_federation_manager.py | Implements the new can_execute hook permissively for no-op mode. |
| framework/py/flwr/superlink/federation/noop_federation_manager_test.py | Adds test coverage asserting can_execute always returns True. |
| framework/py/flwr/superlink/federation/federation_manager.py | Adds the abstract can_execute method to the FederationManager interface. |
| framework/py/flwr/supercore/constant.py | Introduces the ActionType enum alongside existing RunType. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a207699d3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c2278f068
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Introduce a typed authorization boundary for execution checks by adding
ActionTypeand updatingFederationManager.can_executeto acceptflwr_aid,action,federation, andrun_type. KeepNoOpFederationManagerpermissive and update federation manager tests accordingly.