Skip to content

FEAT Breaking: Registry protocol + ScorerRegistry#1308

Merged
rlundeen2 merged 15 commits intomicrosoft:mainfrom
rlundeen2:users/rlundeen/2026_01_05_registry
Jan 11, 2026
Merged

FEAT Breaking: Registry protocol + ScorerRegistry#1308
rlundeen2 merged 15 commits intomicrosoft:mainfrom
rlundeen2:users/rlundeen/2026_01_05_registry

Conversation

@rlundeen2
Copy link
Copy Markdown
Contributor

Refactored registry logic into a shared pyrit.registry module and added a new ScorerRegistry for managing pre-configured scorer instances.

Changes

  • Abstracted common registry patterns into registry module with base classes for class registries (Type[T]) and instance registries (pre-configured objects)
  • Migrated ScenarioRegistry and InitializerRegistry to inherit from BaseClassRegistry
  • Added ScorerRegistry extending BaseInstanceRegistry for managing scorer instances
  • Added documentation in registry with overview and usage examples

Copy link
Copy Markdown
Contributor

@romanlutz romanlutz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsurprisingly, I like practically everything about this 😆

Comment thread doc/code/registry/0_registry.md
Comment thread doc/code/registry/2_instance_registry.ipynb
Comment thread pyrit/registry/__init__.py Outdated
Comment thread pyrit/registry/instance_registries/base_instance_registry.py Outdated
Copy link
Copy Markdown
Contributor

@ValbuenaVC ValbuenaVC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I think we may want to add before merging is encoding/decoding logic for registries. The protocol choice is fantastic, but it requires every registry to store classes or instances differently. Aside from that looks great!

Comment thread pyrit/registry/base.py
Comment thread doc/code/registry/0_registry.md
Comment thread pyrit/registry/base.py
Comment thread pyrit/registry/class_registries/base_class_registry.py
Comment thread pyrit/registry/class_registries/base_class_registry.py
Comment thread pyrit/registry/instance_registries/base_instance_registry.py
Comment thread pyrit/registry/instance_registries/base_instance_registry.py
Comment thread pyrit/registry/instance_registries/base_instance_registry.py
Comment thread pyrit/registry/instance_registries/scorer_registry.py
Comment thread pyrit/registry/instance_registries/base_instance_registry.py
@rlundeen2 rlundeen2 merged commit b029f02 into microsoft:main Jan 11, 2026
20 checks passed
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.

4 participants