[codex] secure extension hot reload control#4
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens node cluster-control by introducing HMAC-signed control payloads and shifts extension updates to extension-scoped reloads, while improving reliability of per-node control delivery across restarts.
Changes:
- Added
Legion::Extensions::Node::ControlAuthand applied signing to cluster-control messages. - Made per-node cluster-control queues durable/non-auto-delete and prevented immediate beat execution at actor construction.
- Updated
update_gemto install viaLegion::Extensions::GemSourceand reload a single extension instead of reloading the whole daemon; bumped version/changelog.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
lib/legion/extensions/node/control_auth.rb |
Introduces signing/verification for cluster-control payloads. |
lib/legion/extensions/node/actors/cluster_control.rb |
Adds verification hook for incoming cluster-control messages. |
lib/legion/extensions/node/transport/messages/cluster_settings.rb |
Signs settings broadcast payloads. |
lib/legion/extensions/node/transport/messages/cluster_killswitch.rb |
Signs killswitch payloads. |
lib/legion/extensions/node/transport/queues/cluster_control.rb |
Makes per-node control queues durable and non-auto-delete. |
lib/legion/extensions/node/actors/beat.rb |
Disables immediate run on boot. |
lib/legion/extensions/node/runners/node.rb |
Routes gem install through GemSource and performs extension-scoped reload. |
lib/legion/extensions/node/version.rb |
Version bump to 0.3.8. |
spec/legion/extensions/node/control_auth_spec.rb |
Adds tests for signing/verification. |
spec/legion/extensions/node/runners/node_spec.rb |
Updates update_gem specs for GemSource + extension reload. |
spec/legion/extensions/node/actors/beat_spec.rb |
Aligns spec with new run_now? behavior. |
spec/legion/extensions/node/transport/queues/cluster_control_spec.rb |
Aligns spec with new queue durability semantics. |
CHANGELOG.md |
Documents changes for 0.3.8. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Hardens lex-node cluster-control messages and aligns extension update behavior with extension-scoped hot reload instead of whole-daemon reload.
What changed
Legion::Extensions::Node::ControlAuthfor HMAC-signed control payloads with timestamp and nonce fields.ClusterSettingsandClusterKillswitchmessages and verified them inClusterControlbefore runner dispatch.update_gemto install throughLegion::Extensions::GemSourceand callLegion::Extensions.reload_extensioninstead ofLegion.reload.lex-nodeto0.3.8and updatedCHANGELOG.md.Why
The adversarial review found the rollout/control path assumed an authorization boundary that did not exist, offline nodes could miss commands permanently, beat could race startup, and
update_gemstill performed full daemon reloads through rawGem.install.Validation
bundle exec rubocop -Abundle exec rspec --format json --out tmp/rspec_results.json --format progress --out tmp/rspec_progress.txt