computesdk
computesdk copied to clipboard
feat(bench): add task cleanup hooks
Summary
- add defineTask cleanup hooks that run after success or failure
- pass cleanup the same assignment, taskIndex, and shared task state as steps
- document cleanup usage and add a patch changeset
Tests
- pnpm --filter @computesdk/bench test
- pnpm --filter @computesdk/bench typecheck
- pnpm --filter @computesdk/bench lint
- pnpm --filter @computesdk/bench build
Contributor License Agreement
All contributors are covered by a CLA.
Superagent didn't find any vulnerabilities or security issues in this PR.
Addressed Copilot review comments in a1063177:
- Cleanup now preserves the original step/task error if cleanup also throws. Cleanup errors only become the task failure when the task otherwise succeeded.
- README cleanup example now uses typed task state with defineTask
/defineStep so state.sandbox access type-checks.
Re-ran:
- pnpm --filter @computesdk/bench test
- pnpm --filter @computesdk/bench typecheck
- pnpm --filter @computesdk/bench lint
- pnpm --filter @computesdk/bench build