Skip to content

feat: Plugin developer guide and CI coverage for example plugins #6

Description

@gmh5225

Background

NeverD exposes a pure C plugin ABI (NeverDPlugin.h) with loader/processor/UI plugin types and session events. An example plugin ships under plugins/example/, built with -DNEVERD_BUILD_PLUGINS=ON (default OFF).

The CLI supports listing and running plugins (neverd plugins), and load paths are documented in README (<neverd-dir>/plugins, ~/.neverd/plugins, $NEVERD_PLUGIN_PATH). However:

  • There is no plugin developer guide
  • Plugins are not built or tested in CI
  • Integrators lack a minimal “hello plugin” walkthrough beyond the example source

Roadmap §4 mentions expanding the plugin ABI for new formats/loaders over time.

Goal

Make the plugin system discoverable, documented, and regression-tested so third parties (and AI agents) can extend NeverD without forking core code.

Current state

Item Location
Plugin header include/neverd/sdk/NeverDPlugin.h
C API include/neverd/sdk/NeverDCAPI.h
Example plugin plugins/example/example_plugin.c
Build flag NEVERD_BUILD_PLUGINS (default OFF)
CLI neverd plugins command

Acceptance criteria

Documentation

  • Add docs/plugins.md (or section in architecture docs) covering:
    • Plugin types (NEVERD_PLUGIN_LOADER, PROCESSOR, UI, GENERIC)
    • Required exported symbol: neverd_pluginneverd_plugin_t
    • Event model (NEVERD_EVT_BINARY_LOADED, ANALYSIS_DONE, PATCH_APPLIED, …)
    • Build instructions: -DNEVERD_BUILD_PLUGINS=ON, link against libneverd
    • Install / load paths and $NEVERD_PLUGIN_PATH
    • Minimal step-by-step: build example → copy to plugins dir → neverd plugins list/run

CI integration (depends on #1)

  • CI job (or matrix leg) builds with -DNEVERD_BUILD_PLUGINS=ON
  • Smoke test: load example plugin via CLI (neverd plugins list shows it, or run a documented subcommand)
  • Plugin build works on Linux, macOS, and Windows (or document platform gaps explicitly)

Example plugin quality

  • Example plugin demonstrates at least one event handler with clear comments
  • Optional: tiny integration test under unittests/ that loads the plugin in-process if a stable test hook exists; otherwise CLI smoke test in CI is sufficient

README

  • Link to plugin docs from README SDK and plugins section

Implementation notes (for implementers / AI agents)

  1. Read NeverDPlugin.h, plugins/example/example_plugin.c, and CLI plugin command implementation under tools/neverd/
  2. Keep the plugin API pure C — no C++ in plugin examples unless clearly isolated
  3. Do not break existing default builds (NEVERD_BUILD_PLUGINS=OFF remains default)
  4. If Windows DLL export requires __declspec(dllexport), document it in the guide

Out of scope

  • New plugin types or ABI breaking changes
  • GUI plugin hosting (no GUI in repo today)
  • Publishing plugins to a central registry
  • EVM/Solana loaders as plugins (separate roadmap issues)

Deliverables

  1. docs/plugins.md (+ README link)
  2. CI step building and smoke-testing the example plugin
  3. Any small fixes needed for cross-platform plugin loading

References

Metadata

Metadata

Assignees

Labels

docsDocumentation and contributor guidesdocumentationImprovements or additions to documentationenhancementNew feature or requestpluginsPlugin SDK and extensions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions