Skip to content

feat: plugin API, manifests and loader - #10

Merged
SizzleUnrlsd merged 2 commits into
mainfrom
feat/plugin-api
Sep 3, 2026
Merged

SizzleUnrlsd merged 2 commits into
mainfrom
feat/plugin-api

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Implements the plugin infrastructure of docs/architecture.md (§13 Plugin API, §14 Plugin Manifests, §23 Findings, §32 Stable API, §33 Versioning, §34 Plugin Isolation).

  • Acceptance tests first (test: define plugin API, manifest and loader behavior), implementation follows in this PR.
  • coretrace_python.plugins: Plugin base class with declarative requires and analyze(ctx), a PluginContext that only serves declared analyses and exposes module and functions(), run_plugins sharing one AnalysisManager across plugins.
  • coretrace_python.findings: immutable Finding with lightweight fields (rule, message, severity, confidence, span, function, metadata) and a schema version.
  • Manifests: plugin.toml with name, version, plugin_api compatibility range, requires, provides, entrypoint. Parsed with the standard library tomllib; TOML instead of the YAML shown in the document to avoid a runtime dependency.
  • Loader and registry: in-process, checks the API range, the entrypoint, registered analysis names and that manifest requires match the class.
  • Reference plugin plugins/syntax/dangerous_eval: reports calls resolving to python.builtins.eval / exec through SymbolAnalysis, so aliases and shadowing do not fool it.

Not in this PR: the stable accessors that need later phases (cfg, taint, abstract_value, ...), the specialised plugin base classes of §13, out-of-process isolation, and CLI reporting of findings (Phase 5 reporters).

Closes #9

🤖 Generated with Claude Code

Acceptance tests for typed plugins with declared requires, a narrow plugin
context, lightweight findings, TOML manifests with plugin_api ranges, an
in-process loader and registry, and the dangerous_eval reference plugin.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 3, 2026
Plugins declare requires and analyze a narrow PluginContext that only serves
declared analyses. Findings are immutable lightweight records. Manifests are
plugin.toml files with a plugin_api compatibility range, checked by an
in-process loader against the entrypoint class and the registered analyses.
The dangerous_eval reference plugin resolves eval and exec through
SymbolAnalysis, so aliases and shadowing do not fool it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SizzleUnrlsd
SizzleUnrlsd merged commit 548a476 into main Sep 3, 2026
6 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/plugin-api branch September 3, 2026 04:36
SizzleUnrlsd added a commit that referenced this pull request Sep 3, 2026
feat: plugin API, manifests and loader
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.

Define versioned plugin API, manifests and loader

1 participant