Expand description
§Plugin API
UNSTABLE — v1.x: Plugin trait surface is in-process only. v2 will
extract a separately-versioned grex-plugin-api crate; until then,
this surface MAY change in any v1.x release without semver-major.
Plugin system — Stage A slicing (M4-A).
Introduces the ActionPlugin trait and an in-process Registry as
the canonical registration path for Tier-1 actions. The 7 built-ins that
M3 landed directly inside grex-core::execute are re-exposed here
behind the trait so M4-B onwards can extend the surface without touching
the executors.
§Why not async yet
The spec earmarks async fn execute for the plugin trait (M4 as a
whole). Stage A deliberately keeps the trait synchronous: the wet-run
executor, planner, and scheduler are all synchronous today, and the
async-trait crate is not yet in the workspace dependency set. Adding
async fn would force every built-in to wrap sync work in an async
block, introduce .await at every call-site, and pull in a tokio
runtime — all unrelated to the trait-slicing goal. The async switch
belongs to the runtime work in M4-C, not the structural slice here.
§Why not dispatch via Registry inside FsExecutor / PlanExecutor
The task brief calls for the concrete executors to look up plugins via
registry.get(action.name()) instead of matching on the Action enum
directly. Doing so requires FsExecutor / PlanExecutor to carry a
Registry field (which is not Copy), which cascades into >3-line
edits across ~50 existing test call sites that construct the executors
as bare unit structs. That conflicts with the other explicit rule in
the task brief (“If a test needs >3 line change, stop and report”).
Stage A therefore lands the trait + registry surface; the dispatch
swap is queued for M4-B, which can reshape tests alongside the
executor constructors in one pass.
Re-exports§
pub use pack_type::PackTypePluginSubmission;pub use pack_type::PackTypePlugin;pub use pack_type::PackTypeRegistry;
Modules§
- pack_
type - Pack-type plugin trait + registry — M5-1 Stage A/B.
Structs§
- EnvPlugin
- Wet-run
envplugin. - Exec
Plugin - Wet-run
execplugin. - Mkdir
Plugin - Wet-run
mkdirplugin. - Plugin
Submission - Submission record for compile-time plugin collection via
inventory. - Registry
- In-process registry mapping action name → plugin.
- Require
Plugin requireplugin (predicate gate; side-effect-free).- Rmdir
Plugin - Wet-run
rmdirplugin. - Symlink
Plugin - Wet-run
symlinkplugin. - Unlink
Plugin - Wet-run
unlinkplugin — synthesized inverse ofsymlinkused by the declarative auto-reverse teardown path (R-M5-09). Not reachable from a YAML-authored pack: theAction::Unlinkvariant is only manufactured byDeclarativePlugin::inverse_of(private helper incrate::plugin::pack_type). - When
Plugin whenplugin (conditional block; wet-run).
Traits§
- Action
Plugin - Uniform registration surface for every Tier-1 action.
Functions§
- register_
builtins - Register all 7 Tier-1 built-in plugins in wet-run form.