fix(self-improvement): restore the shipped-source-models contract (unblocks cloud-runtime-artifact)
Why
main is red on cloud-runtime-artifact.yml → linux-x64-artifact → "Test SDK and type-level authoring contracts". That blocks promoting the runtime to Cloud and publishing 2.0.43. packages/sdk/tests/shipped-source-models.test.ts fails for two independent reasons:
- #643 (mine).
examples/self-improvement/self-improvement.flow.ts:322,325:attempt()spread caller options intof.agentand gave the repair agent a templated name. The static contract cannot prove that resolves to a supported CLI/model pair ("unprovable options overrides"). - Pre-existing, before #643.
639262cfremovedworkflows/watchdog.yaml, the flows-watchdog v1 schedule source, without updating the active-v1 counts.mainhas been failingactiveV1Files: expected 3 to be 4since42f08e2a(runs on42f08e2a,4050ce04). Fixing only #643 would leave the build red.
What
- Example (conforms to the contract; the test's static check is not loosened):
CLI/MODELare pinned as consts and thecli/modelinputs are dropped. All four agents (analyst,analyst-repair,editor,editor-repair) are spelled out literally, with inline options and no spread.attempt()now takes the pass as a closure. Behaviour is otherwise unchanged. - Counts (
shipped-source-models.test.ts), each with a comment saying why:currentFiles7→8 andmodelSteps8→10. This is #643'sexample/issue-triage.flow.yaml, the example's intended target flow. Both of its agent steps are pinned toclaude/claude-sonnet-5, and they pass the per-step supported-pair assertion that still runs.activeV1Files4→3 andactiveV1ModelSteps10→9. These follow the intended watchdog removal in639262cf, which had exactly one model step.
Verified locally
vitest run tests/shipped-source-models.test.ts: 2/2 pass. Before this change it failed on both the TS-pin and count assertions.examples/self-improvement: 21/21 helper tests pass, the embedded-helper drift check passes, and the examples typecheck is clean for the flow.- Full SDK suite (the CI step: typecheck, build, typecheck:tests, then vitest): typecheck and build pass. The remaining vitest failures are all kernel live tests, and come from running them against the installed 2.0.42
relayflowdrather than one built from source (unknown field "cli_identity",unknown field max_transport_retries,unknown journal protocol verb subscription.inspect). CI builds the kernel from source, so these won't occur there. A rerun against a source-built kernel follows in a comment.
No merge, no deploy.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Fixes the failing shipped-source-models contract test so the cloud runtime artifact promotion is unblocked, by making the self-improvement example's agent calls statically provable and updating the shipped-source counts for two intended changes.
- The self-improvement example now pins
cli/modelas consts and spells out all four agent calls (analyst,analyst-repair,editor,editor-repair) literally; thecli/modelinputs and the option spread inattempt()are removed. - The shipped-source test counts were stale:
currentFilesandmodelStepsmissed the example's target flow (example/issue-triage.flow.yaml), andactiveV1Files/activeV1ModelStepsstill counted the intentionally removedworkflows/watchdog.yaml.
[!NOTE]
Low Risk
Test and example-only changes that pin models and adjust CI contract counts; runtime behavior of self-improvement is intended to stay the same aside from no longer overridable CLI/model.
Overview
Unblocks cloud-runtime-artifact by fixing shipped-source-models.test.ts, which was failing on both the self-improvement example and stale declarative counts.
The self-improvement flow no longer accepts cli / model inputs; analyst and editor agents (including repair passes) use pinned claude / claude-sonnet-5 via module-level constants. attempt() now takes a closure that calls f.agent with literal step names and options instead of spreading dynamic config, so the TypeScript scanner can prove every agent the flow can start.
shipped-source-models.test.ts expectations are updated: current declarative file/step counts rise for example/issue-triage.flow.yaml; active v1 counts drop to match removal of workflows/watchdog.yaml. The README input table drops the removed cli / model row.
Reviewed by Cursor Bugbot for commit eec0cfc5ab03ed3f5920746fe8ce315def4e525b. Bugbot is set up for automated code reviews on this repo. Configure here.
Agent Relay sessions