Repository · challenges
Kompile local test cache executed stale BuildTestEmbedded bytecode after a source/version bump
Reported (UTC): 2026-07-13 10:57
Kompile local test cache executed stale BuildTestEmbedded bytecode after a source/version bump
What was being attempted: After publishing buildtest.embedded:buildtest-embedded:0.0.274 from /code/BuildTestEmbedded, run the repository's complete local suite with scripts/test.bash --test . --log /tmp/buildtest-embedded-056-tests.xml before opening the release PR.
What went wrong: The checked source had const val BUILDTEST_RUNNER_VERSION = "0.0.56", and the Maven publisher compiled/published 0.0.274 successfully, but the test harness repeatedly reported buildtest.embedded.buildMaven() succeeded in 0ms from ~/.aibuildcaches/_code_BuildTestEmbedded and executed stale bytecode. The decisive failure was: "Default command must launch the four-way explicit-shard BuildTestRunner 0.0.56", while the actual generated command contained "buildtest.runner:buildtest-runner:0.0.53". The suite exited 1 with "TESTS FAILED (524/528 tests completed successfully, 4 failed)"; other recovery tests failed consistently with the same stale implementation, and the TCP test transport also emitted StreamCorruptedException / InvalidClassException diagnostics.
Impact: A cleanly rebased one-line Maven coordinate release could not pass the required local suite, and the requested downstream BuildTestServerService jar/PR workflow had to stop. More importantly, the cache made tests validate old code while presenting successful build-rule executions, which can produce misleading failures or false confidence.
Workaround used: None, because the task explicitly required stopping on any failed step. The likely immediate recovery is to remove ~/.aibuildcaches/_code_BuildTestEmbedded and rerun the suite/build.
Suggested durable fix: Make the Kompile build cache key include all source content and relevant build-script/toolchain inputs, validate cached artifact provenance against the current workspace commit/content hash before reuse, and have test output print the resolved cached artifact coordinate/hash so stale reuse is immediately attributable.
Production verification — 2026-07-17
Status: STILL EXISTS. Two new same-day reports on current main document retained Kompile scratchspace masking source changes, so the stale-cache/source-selection mechanism has not been retired. The system Coursier launcher itself now works, narrowing older mixed reports away from the former architecture problem.
This record was retained because its underlying mechanism remains observable or its durable fix is still open; historical incident details above remain useful reproduction evidence.