Python SDK and Tool Bridge Development SOP
Prerequisites
Read the module overview, then confirm the business owner, inputs, outputs, failure conditions, and permission boundary.
Procedure
- Create and reuse one client.
- Initialize before registering Python tools.
- Annotate callable parameters and provide truthful
effect.operationsandeffect.reversible. - Subscribe to events, handle approvals, and exhaustively consume all six RunOutcome terminal states.
- Use resume_run only for paused or interrupted runs deemed safe.
- Compare explicit Loop state order, pause-resume, exhaustion, and effect receipts with TypeScript.
- Inject one tool-registration failure and confirm the client terminates the partially started worker; still close normal runs in a context manager or finally block.
- Compare the Python snapshot with a TypeScript sample. Tampering with operation, outcome, metrics, trace, checkpoint, or artifact fields must produce stable
invalid_run_snapshotfailure. - Run the listed module tests and
npm run check:modules. - Preserve trace, evaluation, and owner-approval evidence; do not publish without explicit authorization.
Stop conditions
Stop for unconfirmed business rules, non-reversible side effects, access outside the workspace, unavailable real credentials, or failed security gates. Ask the owner instead of expanding scope.