fix(self-improvement): restore the shipped-source-models contract (unblocks cloud-runtime-artifact)

Merged
KH
8d ago
+33-19

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:

  1. #643 (mine). examples/self-improvement/self-improvement.flow.ts:322,325: attempt() spread caller options into f.agent and gave the repair agent a templated name. The static contract cannot prove that resolves to a supported CLI/model pair ("unprovable options overrides").
  2. Pre-existing, before #643. 639262cf removed workflows/watchdog.yaml, the flows-watchdog v1 schedule source, without updating the active-v1 counts. main has been failing activeV1Files: expected 3 to be 4 since 42f08e2a (runs on 42f08e2a, 4050ce04). Fixing only #643 would leave the build red.

What

  • Example (conforms to the contract; the test's static check is not loosened): CLI/MODEL are pinned as consts and the cli/model inputs 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:
    • currentFiles 7→8 and modelSteps 8→10. This is #643's example/issue-triage.flow.yaml, the example's intended target flow. Both of its agent steps are pinned to claude/claude-sonnet-5, and they pass the per-step supported-pair assertion that still runs.
    • activeV1Files 4→3 and activeV1ModelSteps 10→9. These follow the intended watchdog removal in 639262cf, 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 relayflowd rather 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


View with [code]smith Autofix with [code]smith
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/model as consts and spells out all four agent calls (analyst, analyst-repair, editor, editor-repair) literally; the cli/model inputs and the option spread in attempt() are removed.
  • The shipped-source test counts were stale: currentFiles and modelSteps missed the example's target flow (example/issue-triage.flow.yaml), and activeV1Files/activeV1ModelSteps still counted the intentionally removed workflows/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

  • claude session 05d0eca0 · opened via gh pr create · last active 2026-10-10
  • claude session de5aedc7 · contributor · ran gh pr commands · last active 2026-10-10