plexus.cli.procedure.reset_service module

Reset service for procedure checkpoint management.

Handles clearing checkpoints for testing and development.

plexus.cli.procedure.reset_service.clone_state_for_branch(client, source_procedure_id: str, target_procedure_id: str, truncate_to_cycle: int) Dict[str, Any]

Clone S3 state from source procedure to target, truncated to cycle N.

Used to implement branching: the target procedure starts from cycle N of the source, with empty checkpoints (fresh execution), so the optimizer detects continuation at cycle N and runs additional cycles from there.

The source procedure is never modified.

Returns:

Dict with source_procedure_id, target_procedure_id, truncated_to_cycle, iterations_copied.

plexus.cli.procedure.reset_service.reset_checkpoints(client, procedure_id: str, after_step: str | None = None) Dict[str, Any]

Clear procedure checkpoints.

Args:

client: PlexusDashboardClient procedure_id: Procedure ID after_step: If provided, clear this step and all subsequent ones.

If None, clear all checkpoints.

Returns:
Dict with:
  • cleared_count: int - Number of checkpoints cleared

  • remaining_count: int - Number of checkpoints remaining

plexus.cli.procedure.reset_service.reset_checkpoints_only(client, procedure_id: str) Dict[str, Any]

Clear procedure checkpoints while preserving accumulated State.

Used before re-dispatching a procedure for continuation: Tactus must not replay cached steps, but the optimizer State (iterations, baselines, etc.) must survive so the optimizer can detect continuation and skip init.

Returns:

Dict with cleared_count and remaining_count