You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(scripts): build leaves compiled tests for deleted sources in dist, and they still run #5641
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.
changed the title [-]npm run build leaves compiled tests for deleted sources in dist, and they still run[/-][+]bug(scripts): build leaves compiled tests for deleted sources in dist, and they still run[/+]on Sep 23, 2026
Activity
[-]npm run build leaves compiled tests for deleted sources in dist, and they still run[/-][+]bug(scripts): build leaves compiled tests for deleted sources in dist, and they still run[/+]seekskyworld commentedon Sep 23, 2026
take