WASM Plugin Trait Contracts #6

Open
opened 2026-05-18 08:27:18 -04:00 by n8k99 · 0 comments
n8k99 commented 2026-05-18 08:27:18 -04:00
Owner

Description

Define the WASM plugin interface: stable trait contracts between Bastion core and external plugins.

Development Tasks (☿ Nova)

  • Define Plugin trait in plugin/contract.rs
  • Define WidgetPlugin trait extension for UI plugins
  • Define CommandPlugin trait extension for command plugins
  • Create wit-bindgen interface definitions (.wit files)
  • Plugin manifest parser: plugin.toml (name, version, exports)

Testing Criteria (☿ Nova)

  • Trait contract: mock plugin implements all required methods
  • Manifest parse: valid plugin.toml parses without error
  • Rejection test: invalid trait impls rejected at load time
  • Host test: core successfully loads minimal WASM module
  • Version test: plugin with compatible version loads, incompatible rejected

Completion Criteria (🜔 Claudian Review)

  • All traits have docstrings + usage examples
  • Interface is semver-stable (v1.0 traits frozen)
  • Plugin loading is fallible with human-readable error messages
  • Documented: docs/PLUGIN_CONTRACT.md for third-party plugin authors

Blockers

  • #1 (Calendar Widget) - reference widget implementation
  • #3 (Command Dispatcher) - command trait overlap

Assignees: @Nova
Labels: plugin, wasm, contract

## Description Define the WASM plugin interface: stable trait contracts between Bastion core and external plugins. ## Development Tasks (☿ Nova) - [ ] Define `Plugin` trait in `plugin/contract.rs` - [ ] Define `WidgetPlugin` trait extension for UI plugins - [ ] Define `CommandPlugin` trait extension for command plugins - [ ] Create `wit-bindgen` interface definitions (`.wit` files) - [ ] Plugin manifest parser: `plugin.toml` (name, version, exports) ## Testing Criteria (☿ Nova) - [ ] Trait contract: mock plugin implements all required methods - [ ] Manifest parse: valid `plugin.toml` parses without error - [ ] Rejection test: invalid trait impls rejected at load time - [ ] Host test: core successfully loads minimal WASM module - [ ] Version test: plugin with compatible version loads, incompatible rejected ## Completion Criteria (🜔 Claudian Review) - [ ] All traits have docstrings + usage examples - [ ] Interface is semver-stable (v1.0 traits frozen) - [ ] Plugin loading is fallible with human-readable error messages - [ ] Documented: `docs/PLUGIN_CONTRACT.md` for third-party plugin authors ## Blockers - [ ] #1 (Calendar Widget) - reference widget implementation - [ ] #3 (Command Dispatcher) - command trait overlap Assignees: @Nova Labels: plugin, wasm, contract
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
n8k99/bastion#6
No description provided.