Skip to main content

Module step_naming

Module step_naming 

Source
Expand description

StepNaming — GH #23: the Blueprint-declared step-projection naming table.

Before this module, a dispatched Step was addressable under two independent, occasionally-colliding names: the flow.ir data-plane producer name (Step.ref / AgentDef.name) and the result_ref ctx-path key (Step.out’s top-level path segment). Consumers (ContextPolicy.steps filter / StepPointer.name / the REST :step resolver / FileProjectionAdapter’s file stem) resolved the union of both, data-plane winning on collision — see crates/mlua-swarm-server/src/projection.rs’s enumerate_steps for the pre-GH-#23 runtime union rule this table statically replaces.

StepNaming collapses that union into a single addressing space, built ONCE per Blueprint at blueprint::compiler::Compiler::compile time (the sole construction site — see StepNaming::from_blueprint), then threaded read-only from there: EngineDispatcher stashes an Arc<StepNaming> per dispatched task (EngineState.step_namings, keyed by StepId), and Engine::step_naming_for is the accessor later consumers pull from.

GH #23 subtask-2/3 completed the 5-consumer switch-over this module’s table backs — Engine::submit_output/materialize_final_submission (data-plane write + file stem), ContextPolicy.allows_step (crates/mlua-swarm-server/src/worker.rs’s allows_step_canonical seam), StepPointer/StepSummary assembly, and the REST :step resolver all resolve through StepNaming::canonical_of_producer / StepNaming::resolve instead of re-deriving the pre-GH-#23 union rule at read time. crate::store::output::OutputStore::get_latest_by_name_in_run (Layer 2) closed the cross-Run same-name race this table’s canonicalization alone could not: a declared or undeclared name is now resolved Run-scoped regardless. An undeclared step’s canonical stays its raw Step.ref and its aliases still include the result_ref top-level segment, so the pre-GH-#23 union’s observable behavior is unchanged for any Blueprint that never declares AgentMeta.projection_name.

Structs§

StepNameEntry
One step’s resolved canonical projection name plus every alias name consumers may still address it by.
StepNaming
GH #23 — the single addressing-space table for one Blueprint’s dispatched steps. See the module doc for the construction site and storage/accessor threading; this doc covers the resolution rules.
StepNamingError
Fatal collision: at least one side of the clash declared name via AgentMeta.projection_name. Rejected at registration time — the same “Blueprint validation error” family as blueprint::compiler::CompileError’s existing fail-fast checks (DuplicateAgent / UnresolvedMetaRef / …).
StepNamingWarning
Non-fatal collision detected while building a StepNaming table: two UNDECLARED steps’ canonical/alias name sets intersect. Registration still proceeds — the pre-GH-#23 union rule’s “data-plane wins” tie-break applies (see StepNaming::from_blueprint) — but the caller is expected to surface this via tracing::warn!. This type carries no logging side effect itself, matching the crate’s existing convention (blueprint::compiler’s static-walk helpers) of returning data and letting the caller decide how to report it.