pub struct Engine<'a> { /* private fields */ }Expand description
Implementations§
Source§impl Engine<'_>
impl Engine<'_>
Sourcepub fn diffless(
&self,
op: Verb,
checkout: &Path,
pre: &[PluginRef],
post: &[PluginRef],
) -> Result<(), OpError>
pub fn diffless( &self, op: Verb, checkout: &Path, pre: &[PluginRef], post: &[PluginRef], ) -> Result<(), OpError>
Run a DIFFLESS op (§8 “skip steps 1/3/5”): pre/post against the checkout
(the STORE for sync, §13), no worktree, no seal. Tier 1 is empty, so the
unwind is reverse plugin rollback only (§13/§14). Unlike the seal path
there is no commit to land, but the op can still MOVE the anvil tip — a
pre participant (sync ff) advances tasks_branch. So balls reads the tip
before pre and after it and threads those as the §13
previous_commit/commit facts to post (and any post-phase rollback),
metadata-less: a diffless op authors no §5 message, so message is None
and the wire omits metadata. No shipped plugin reads them yet; a sync/post
cache-rebuild participant will.
Sourcepub fn prime(
&self,
pre_dir: &Path,
post_dir: &Path,
pre: &[PluginRef],
post: &[PluginRef],
step: &mut dyn FnMut() -> Result<Option<String>>,
) -> Result<(), OpError>
pub fn prime( &self, pre_dir: &Path, post_dir: &Path, pre: &[PluginRef], post: &[PluginRef], step: &mut dyn FnMut() -> Result<Option<String>>, ) -> Result<(), OpError>
Run prime’s split-checkout pass (§12, bl-698d): pre ONCE against
pre_dir (the LANDING — the store may not be materialized yet), then
step, core’s between-phase work: materialize the store for the
configured tasks_branch and report the dial — None ⇒ it held, Some
carries the value that moved. A moved dial ABORTS: no conformant plugin
rewrites tasks_branch in prime/pre (config crosses only by install,
§12/§13), so the check ENFORCES the consent rule — fail, not silent — the
error naming the rule and the moved value. When the dial held, post runs
against post_dir (the materialized store — the tracker’s fetch-ff +
push). step’s failure is an OpError::Substrate abort; any abort
unwinds the run plugins in reverse (no seal, no §7 facts — prime’s push
reads neither). A PLUGIN abort is rendered as the §12 catalog’s E7 —
“plugin failed during prime, rolled back K prior” (K = the plugins that
had run and were unwound) — not the generic abort (bl-3ddb). The whole op
logs one begin/done/abort.
Source§impl<'a> Engine<'a>
impl<'a> Engine<'a>
Sourcepub fn new(anvil: &'a dyn Anvil, plugins: &'a dyn Plugins, log: &'a Log) -> Self
pub fn new(anvil: &'a dyn Anvil, plugins: &'a dyn Plugins, log: &'a Log) -> Self
Build an engine over an anvil, a plugin chain, and the op’s log sink.
Sourcepub fn seal(
&self,
base: &dyn BaseChange,
op: Verb,
change_dir: &Path,
pre: &[PluginRef],
post: &[PluginRef],
) -> Result<String, OpError>
pub fn seal( &self, base: &dyn BaseChange, op: Verb, change_dir: &Path, pre: &[PluginRef], post: &[PluginRef], ) -> Result<String, OpError>
Run a MUTATING op (§8 steps 1–6): Author → Pre → Seal → Post → Teardown,
with §14 rollback on any abort. pre/post are the committed [hooks]
plugin sets resolved at op-start (§6). Logs begin/seal/abort (§6); returns the sha.