Record one step's result under the run lock. Routing the mutation through the lock keeps it from racing a concurrent ``save()`` that is iterating ``step_results`` (e.g. during a concurrent fan-out). For a sequential run this is an uncontended lock.
(self, step_id: str, data: dict[str, Any])
| 435 | return self.project_root / ".specify" / "workflows" / "runs" / self.run_id |
| 436 | |
| 437 | def record_step_result(self, step_id: str, data: dict[str, Any]) -> None: |
| 438 | """Record one step's result under the run lock. |
| 439 | |
| 440 | Routing the mutation through the lock keeps it from racing a concurrent |
| 441 | ``save()`` that is iterating ``step_results`` (e.g. during a concurrent |
| 442 | fan-out). For a sequential run this is an uncontended lock. |
| 443 | """ |
| 444 | with self._lock: |
| 445 | self.step_results[step_id] = data |
| 446 | |
| 447 | def set_step_output(self, step_id: str, output: Any) -> None: |
| 448 | """Replace an already-recorded step's ``output`` under the run lock. |