[Bounty $5k] [Registry] Filter handlers by data locality — regional worker pools#3940
Open
neuralmint wants to merge 1 commit into
Open
[Bounty $5k] [Registry] Filter handlers by data locality — regional worker pools#3940neuralmint wants to merge 1 commit into
neuralmint wants to merge 1 commit into
Conversation
…ools Add LocalityPolicy and LocalityResolver classes to enforce data locality constraints during agent registration and resolution: - LocalityPolicy: defines valid regions, capacity limits, and type-to-region locking rules. Rejects invalid or policy-violating locality assignments. - LocalityResolver: maintains a locality-agent index and enforces invariant checks during lifecycle changes. Invalidates cache entries on locality updates so stale entries are never served. - AgentRegistry integration: register() accepts an optional 'locality' parameter; list() supports locality filtering; delete() cleans up the locality index; update_agent_locality() enables re-assignment with cache invalidation. - All decisions are logged and metric counters track registrations, updates, deletions, cache invalidations, and handler resolution counts. Closes orchestration-agent#3933
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
Fixes #3933 — enforces data locality filtering during handler registration and resolution for regional worker pools.
Changes
LocalityPolicy: defines valid regions, capacity limits, and type-to-region locking rules. Rejects invalid or policy-violating locality assignments withLocalityViolationError.LocalityResolver: maintains a locality→agent index and enforces invariant checks during lifecycle changes. On locality updates, the old cache entries are invalidated so stale entries are never served.AgentRegistryintegration:register()now accepts an optionallocalityparameterlist()supportslocalityfiltering alongside existingstatusandgroupfiltersdelete()cleans up the locality indexupdate_agent_locality()enables re-assignment with full cache invalidationAcceptance Criteria
TestLocalityResolver,TestLocalityPolicy,TestAgentRegistryLocality)Test Output
All 36 registry tests pass (8 original + 28 new locality tests):
Also verified:
test_config(5 passed),test_scheduler(5 passed).