Register badblueprint plugin in registry#3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 971b924742
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| from .portfolioiq import PortfolioIQPlugin | ||
| from .thingularity import ThingularityPlugin | ||
| from .example_medical import MedicalRecordsPlugin | ||
| from ..submissions.purple_vanguard.badblueprint.plugin import BadblueprintPlugin |
There was a problem hiding this comment.
Use absolute import for submissions package
When the orchestrator runs, it prepends scenarios/security_arena to sys.path and imports plugins.registry as a top-level package (see scenarios/security_arena/orchestrator.py). In that execution mode, plugins has no parent package, so from ..submissions... attempts to traverse beyond the top level and will raise ImportError: attempted relative import beyond top-level package, preventing the arena from starting. This should be an absolute import like from submissions.purple_vanguard.badblueprint.plugin import BadblueprintPlugin, or the package layout/sys.path should be adjusted so ..submissions is valid.
Useful? React with 👍 / 👎.
Motivation
badblueprintsubmission available at import-time rather than via lazy-loading or placeholders.submissionstree succeed.Description
from ..submissions.purple_vanguard.badblueprint.plugin import BadblueprintPlugininscenarios/security_arena/plugins/registry.py.SCENARIO_PLUGINSas"badblueprint": BadblueprintPlugin.scenarios/security_arena/submissions/__init__.py,scenarios/security_arena/submissions/purple_vanguard/__init__.py, andscenarios/security_arena/submissions/purple_vanguard/badblueprint/__init__.pyto enable direct imports.scenarios/security_arena/plugins/registry.pyand the three__init__.pyfiles were added/modified.Testing
python -c "from scenarios.security_arena.plugins.registry import load_scenario; print('ok')"and it printedokindicating imports and registry loading succeeded.python -c "from scenarios.security_arena.plugins.registry import SCENARIO_PLUGINS; print('badblueprint' in SCENARIO_PLUGINS)"and it printedTrueconfirming the plugin is registered.Codex Task