Safely rejects incompatible plugins prior to binary execution and publishes a formal supported-version policy across the StarForge Plugin SDK, manifest schemas, and plugin loader engine.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to change)
- Documentation update
- Plugin SDK (
crates/starforge-plugin-sdk/src/lib.rs):- Updated
PluginMetastruct to track targetstarforge_version. - Added constructors
PluginMeta::new()andPluginMeta::with_starforge_version(). - Added helper
is_compatible_with()to query target core version alignment.
- Updated
- Manifests & Version Policy Engine (
src/plugins/manifest.rs):- Implemented
SupportedVersionPolicystruct with policy evaluation (evaluate()) and policy summary formatting (policy_summary()). - Added robust semver string parser (
parse_version_parts) supporting semver tags (e.g.,v1.0.0,0.1.0-alpha). - Enforced major version compatibility rules and version range bounds (
starforge_version_min/starforge_version_max). - Enhanced
PluginManifest::validate()andvalidate_for_core()to produce actionable error diagnostics.
- Implemented
- Pre-Load Loader Safety (
src/plugins/loader.rs):- Shifted
starforge-plugin.tomlmanifest discovery and compatibility validation to run before invokingLibrary::new(). - Guarantees incompatible plugin binaries are safely rejected prior to dynamic library loading or OS dynamic symbol linking.
- Shifted
- Integration Test Suite (
tests/plugin_version_compatibility_test.rs):- Added test suite covering happy paths (compatible manifest validation & load inspection), boundary cases (exact
starforge_version_min/starforge_version_maxbounds matchingCORE_VERSION, policy summary formatting), and failure paths (incompatible major version, min version violation, max version violation, missing required manifest fields, absent manifest error formatting).
- Added test suite covering happy paths (compatible manifest validation & load inspection), boundary cases (exact
- User Guidance & Documentation (
PLUGIN_TRUST.md):- Published comprehensive "Supported-Version Policy and Compatibility Requirements" section.
- Documented pre-load manifest verification, major version rules, version range bounds (
starforge_version_min/max), manifest schema examples, and developer migration guidance.
Executed dedicated integration test suite in tests/plugin_version_compatibility_test.rs via cargo test --test plugin_version_compatibility_test.
- Unit tests added/updated
- Integration tests added/updated
- Manual testing performed
- Happy path: Valid plugin manifest matching
CORE_VERSIONpasses validation and loading inspection. - Edge cases: Exact min/max bounds matching current
CORE_VERSION, policy summary generation, semver parsing logic (v1.0.0,0.1.0-alpha). - Error handling: Rejection of incompatible major versions (e.g.
1.0.0vs0.1.0), minimum version constraint violations (starforge_version_min), maximum version constraint violations (starforge_version_max), missing required fields, absent manifest file errors.
- My code follows the style guidelines of this project
- I have performed a self-review of my own code
- I have commented my code, particularly in hard-to-understand areas
- I have made corresponding changes to the documentation
- My changes generate no new warnings/errors
- I have added tests that prove my fix is effective or that my feature works
- New and existing unit/integration tests pass locally (8/8 tests passing)
- The CI checks pass
- No breaking changes (backward-compatible manifest validation and safe fallback checks).
-
PLUGIN_TRUST.mdupdated