Skip to content

pkg/taskproto broke an exported API in a PATCH release (v0.111.1); no gate knows it has external consumers #679

Closed

Description

@scttfrdmn

Found while investigating why spore-host-mcp's Dependabot PR (#44 there) has been red for six days. The bump was not at fault: it breaks the build because v0.111.1 changed an exported function's signature in a PATCH release.

v0.111.0: func GenerateWrapper(spec *TaskSpec, resultsBucket, region string) string
v0.111.1: func GenerateWrapper(spec *TaskSpec, resultsBucket, region string, gpu bool) string      <-- PATCH
v0.112.0: func GenerateWrapper(spec *TaskSpec, resultsBucket, region string, gpu bool, runID string) string

spore-host-mcp/launch.go:219 calls it with three arguments, so bumping spawn from v0.111.0 to v0.111.1 fails with:

./launch.go:219:60: not enough arguments in call to taskproto.GenerateWrapper

The v0.112.0 change (adding runID) is compliant — this repo's stated policy is "pre-1.0, breaking changes bump MINOR". Only the v0.111.1 one violates it.

Why this is worth more than a version bump

pkg/taskproto is a cross-repo wire contract, not an internal helper. CompletionRecord alone is parsed by six workflow adapters, and GenerateWrapper is called by at least spore-host-mcp. A consumer following SemVer is entitled to treat a patch bump as safe, and Dependabot is configured across these repos on exactly that assumption — so a breaking patch turns an automated bump into a red CI run in another repository, days later, with no obvious link back to the cause. That is how this one was found.

It is also silent at the source: nothing in spawn's CI knows that pkg/taskproto has external callers, so removing or re-shaping an exported symbol looks like an ordinary refactor.

Suggested fix

  1. Nothing to revert — v0.116.0 is well past it and consumers must move to the current signature regardless. This issue is about preventing the next one.
  2. An exported-API diff gate. gorelease or apidiff against the previous tag, run in CI, reporting whether the change is patch-, minor-, or major-compatible. That turns "did I break a consumer?" into a check rather than a memory exercise.
  3. Name the public surface. pkg/taskproto, pkg/launcher and pkg/aws are imported by other repos; CLAUDE.md should say so, so the SemVer rule has something concrete to attach to. Everything else can stay internal-by-convention.
  4. Consider whether GenerateWrapper should take an options struct. It has gained two parameters in two releases, both of which are "the caller must decide this per launch" (gpu from the sized instance type, runID freshly minted per attempt). A struct makes the next addition non-breaking, and makes a missing runID visible rather than positional.

Point 4 matters for correctness as much as compatibility: runID of "" emits an empty run_id, which reads downstream as unattributable and reintroduces the #608 false negative. A positional parameter makes that the easy mistake for a consumer catching up on two releases at once — which is exactly what spore-host-mcp has to do now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions