What happened
npm run build compiles into each workspace's dist without removing output whose source no longer exists. After pulling a change that deletes a test file, the previously compiled copy stays in dist and test:dist keeps executing it.
Concretely, #5545 removed the Command Code GO provider along with packages/runtime/src/__tests__/commandcode-cli-language-model.test.ts and packages/runtime/src/__tests__/connection-usage.test.ts. In a working tree that had been built before that commit, npm run build afterwards left both compiled files in place, and npm --workspace @maka/runtime run test:dist ran them:
✖ resolves to the CLI wire with reasoning replayed as reasoning blocks
error: '"commandcode-go" is retired and can no longer resolve a model runtime.'
That is six failures in one suite, all from code the repository no longer contains. The failures are deterministic and identical on Node 22 and Node 24, so they do not look environmental; the obvious reading is a real regression in the change being tested. It took several rounds of bisecting an unrelated branch to notice that the failing test had no source file.
npm run rebuild clears it, because scripts/clean-build.mjs removes each workspace dist wholesale before building. The gap is that build alone never prunes, and nothing warns.
Expected: a build either prunes output whose source is gone, or says that stale output is present.
How to reproduce
- Check out a commit before
bd39677ec, then npm ci && npm run build.
- Check out current
main and run npm run build again (not rebuild).
ls packages/runtime/dist/__tests__/commandcode-cli-language-model.test.js — still present, with no source file.
npm --workspace @maka/runtime run test:dist — six failures from the deleted suite.
npm run rebuild — the file is gone and the suite passes.
Environment
- Maka commit:
9082cf144 (main)
- OS: macOS 26.5.2, arm64
- Node.js: v22.23.1 and v24.21.0 (identical results)
- npm: 11.19.0
- Surface: build tooling
Logs, screenshots, or additional context
This is most likely to bite long-lived worktrees, where a tree may have been built weeks earlier and is never cleaned.
Cheapest fix that keeps build incremental: after compiling a workspace, list dist/**/*.test.js whose src counterpart is missing and fail, or remove them. Alternatively, document rebuild as the expected command after pulling.
Analysis produced with Claude Code; the reproduction and the referenced commits were reviewed by me.
What happened
npm run buildcompiles into each workspace'sdistwithout removing output whose source no longer exists. After pulling a change that deletes a test file, the previously compiled copy stays indistandtest:distkeeps executing it.Concretely, #5545 removed the Command Code GO provider along with
packages/runtime/src/__tests__/commandcode-cli-language-model.test.tsandpackages/runtime/src/__tests__/connection-usage.test.ts. In a working tree that had been built before that commit,npm run buildafterwards left both compiled files in place, andnpm --workspace @maka/runtime run test:distran them:That is six failures in one suite, all from code the repository no longer contains. The failures are deterministic and identical on Node 22 and Node 24, so they do not look environmental; the obvious reading is a real regression in the change being tested. It took several rounds of bisecting an unrelated branch to notice that the failing test had no source file.
npm run rebuildclears it, becausescripts/clean-build.mjsremoves each workspacedistwholesale before building. The gap is thatbuildalone never prunes, and nothing warns.Expected: a build either prunes output whose source is gone, or says that stale output is present.
How to reproduce
bd39677ec, thennpm ci && npm run build.mainand runnpm run buildagain (notrebuild).ls packages/runtime/dist/__tests__/commandcode-cli-language-model.test.js— still present, with no source file.npm --workspace @maka/runtime run test:dist— six failures from the deleted suite.npm run rebuild— the file is gone and the suite passes.Environment
9082cf144(main)Logs, screenshots, or additional context
This is most likely to bite long-lived worktrees, where a tree may have been built weeks earlier and is never cleaned.
Cheapest fix that keeps
buildincremental: after compiling a workspace, listdist/**/*.test.jswhosesrccounterpart is missing and fail, or remove them. Alternatively, documentrebuildas the expected command after pulling.Analysis produced with Claude Code; the reproduction and the referenced commits were reviewed by me.