Skip to main content

Module bootstrap

Module bootstrap 

Source
Expand description

Engine bootstrap state — consolidated owner of every bootstrap field the engine reads during install + poll.

Host-driven: install records targets on install_order + module_bootstraps but leaves pending disarmed. The host arms the queue via crate::node::Node::run_bootstrap (empty slice) to drive every install-order target, or supplies one or more BootstrapInputs to fire named targets with staged inputs.

§Field roles

  • install_order — append-only target-name sequence the install path stamps when a module_phase = bootstrap FunctionProto lands. Drives the seeder front-to-back so multi-target installs surface one BootstrapComplete per target in the order the host supplied to bytesandbrains::install.
  • module_bootstraps — per-target metadata (function key) keyed on the target name. Install stamps each entry as the module_phase = bootstrap FunctionProto lands; the engine reads it to resolve target → FunctionKey at seed time.
  • current_exec_idSome(ExecId) while a bootstrap body is in-flight; None otherwise. Single-target body gate — the collapsed shape replaces the prior per-Component touch-set conflict queue.
  • next_idx — seed pointer into install_order. Bumps each time Engine::maybe_complete_bootstrap observes a phase drained. Engine::seed_bootstrap_call reads it to pick the next target once the host kicks the queue (empty-slice run_bootstrap).
  • pending — single body-op gate. Armed by [Self::arm_install_order] (empty-slice host kick) or by the engine’s per-target staging path (non-empty run_bootstrap). Cleared once every queued phase drains.

Structs§

BootstrapInput
Host-supplied bootstrap input staging request — borrowed shape. The host hands the engine a target name plus an ordered (input_name, value_bytes) slice; the engine validates against the target’s declared formal input ports and runs the Principle 1a copy (cap-check → try_reserve_exactextend_from_slice) so the caller’s borrowed buffers can drop the moment crate::node::Node::run_bootstrap returns.
ModuleBootstrap
Per-target Module bootstrap metadata. Stamped into the engine bootstrap state when the install path sees a module_phase = bootstrap FunctionProto.
OwnedBootstrapInput
Owned-form mirror of BootstrapInput. Kept around because callers (and tests) may want an owned shape, but the new flat run_bootstrap path stages each entry directly without parking it on a queue.

Enums§

BootstrapKind
Discriminator carried over from earlier shapes. Module is the only kind today; the enum is kept so external introspection that matched on BootstrapKind::Module keeps compiling.
BootstrapStatus
Host-facing bootstrap lifecycle status. Returned by Node::bootstrap_status so the caller can decide whether to keep polling or surface a “wait for input” prompt.