fix: require resource usage on completed and timed out executions

Merged
HA
6d ago
+24-45

First step of the nullable-field cleanup on the execution result path, after closing #96.

resource_usage is required on execution_completed and execution_timeout now. The pod monitor only builds those events after it parsed the pod's logs, and the parsed logs always carry usage, so the field was never missing in practice. That lets the result processor's missing-usage guard and the notification's zero fallback go. execution_failed keeps it optional, since the k8s worker sends that event for a pod that never started.

ExecutionResultDomain.metadata was set by the result processor but never stored or read, so it's removed. The API execution result's status is always present, so the schema marks it required. The spec and client are regenerated with deploy.sh openapi and types, and one frontend test cast follows the new type.

stdout, stderr and exit_code were already non-null on these events. Tested locally: ruff, mypy strict, grimp, 505 backend unit and contract tests, svelte-check, eslint, prettier, 1139 frontend tests and the Generated API check.


Summary by cubic

Makes resource_usage required on execution_completed and execution_timeout events, the first step of the nullable-field cleanup started in #96. The pod monitor only builds those events after parsing pod logs, which always carry usage, so the field was never missing in practice; execution_failed keeps it optional since the k8s worker sends that event for a pod that never started.

The result processor's missing-usage guard and the notification's zero fallback are removed. ExecutionResultDomain.metadata was set but never stored or read, so it's gone, and the API execution result's status is always present, so the schema now marks it required. The spec and client are regenerated, and tests are updated for the new required fields.