espnet3.bin.atlas.stages.base.BaseStage
espnet3.bin.atlas.stages.base.BaseStage
class espnet3.bin.atlas.stages.base.BaseStage
Bases: ABC
Base class implementing idempotent, optionally lock-guarded stage execution.
Subclasses implement run(). execute() wraps it with success/failure marker files under the node run’s artifact directory so a re-dispatched node run short-circuits to the cached result instead of re-running, and with an optional study-wide file lock (study_lock_name) so only one worker executes a locked stage (such as SkillStage’s agent call) at a time.
execute(context) → StageResult
Run this stage once, idempotently, caching the result on disk.
- Parameters:context – The node run’s
StageContext(study/graph/trial state). - Returns: The cached result from a prior successful run, or the fresh result from calling
run(). - Return type:StageResult
Example
>>> result = SkillStage().execute(stage_context)
>>> result.status
'success'abstractmethod run(context) → StageResult
Run this stage’s logic once; subclasses must implement it.
- Parameters:context – The node run’s
StageContext(study/graph/trial state). - Returns: The stage’s status, message, and any payload or artifacts.
- Return type:StageResult
Example
>>> result = SkillStage().run(stage_context)
>>> result.status
'success'study_lock_name : str | None = None
Name of the study-wide lock file to hold while running, or None to run without a lock.
