Skip to content

chore(plugins): remove the unused trusted field from LoadedPlugin - #803

Draft
gmoncor wants to merge 1 commit into
bmad-code-org:mainfrom
gmoncor:fix/s01-04-remove-unused-trusted-field
Draft

gmoncor wants to merge 1 commit into
bmad-code-org:mainfrom
gmoncor:fix/s01-04-remove-unused-trusted-field

Conversation

@gmoncor

@gmoncor gmoncor commented Sep 17, 2026

Copy link
Copy Markdown

What: Remove the trusted: bool = True field from LoadedPlugin and the trusted=False kwarg passed at its one write site in registry.py, since nothing reads it anywhere in the plugins package.

Why: A repo-wide search of .trusted accesses in src/bmad_loop/plugins/ finds only the one write site and zero reads; real trust decisions already use lp.instance is not None and lp.manifest.python is None. The field is dead and could mislead a future reader into believing it gates something.

How:

  • Delete the trusted field from the LoadedPlugin dataclass in model.py.
  • Delete the trusted=False kwarg at its construction site in registry.py's _resolve.

Testing: Run the existing plugins pytest suite to confirm no test references .trusted; if one does, update it in this same PR. (Three assertions in tests/test_plugin_trust.py and tests/test_plugin_workflows.py did reference .trusted and were updated to assert on the real trust signals instead: lp.instance and lp.manifest.python.)

Changelog: Removed - Remove the unused trusted field from LoadedPlugin and the trusted=False kwarg passed at its one write site in registry.py, since nothing reads it anywhere in the plugins package.

Related to #496 (plugins/trust.py::require_enabled name-gate and plugins/loader.py overlay precedence) — same subsystem, different defect; not affected by this dead-code removal.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant