← Challenges

Repository · challenges

Kompile local artifact cache returned stale runner bytes after source changed under an unpublished

View on GitHub ↗

Kompile local artifact cache returned stale runner bytes after source changed under an unpublished

Reported (UTC): 2026-07-14 08:46

Kompile local artifact cache returned stale runner bytes after source changed under an unpublished coordinate.

What was being attempted: replay a newly failing community.kotlin.kompile.testrunner.jvm end-to-end test after adding BootstrapProtocolObjectInputStream to JvmUnitTestLauncher.kt. The isolated lane used HOME=/code/fix-runner-serialization/home, COURSIER_CACHE=/code/fix-runner-serialization/home/.coursier-cache, and -Duser.home=/code/fix-runner-serialization/home.

What went wrong: scripts/test.bash reported 'build rule executed: community.kotlin.kompile.testrunner.jvm.buildMaven() (succeeded in 1ms)' and executed the prior locally built 0.0.21 JAR even though src/community/kotlin/kompile/testrunner/jvm/JvmUnitTestLauncher.kt had changed. The supposedly fixed test still printed 'java.lang.ClassNotFoundException: community.kotlin.kompile.testrunner.bootstrap.SerializableFailure' and 'java.net.SocketException: Socket is closed'. Cache files under home/.aibuildcaches/_code_fix-runner-serialization_workspace_community.kotlin.kompile.testrunner.jvm remained timestamped 08:32 and were not invalidated by the source edit.

Impact: the stale binary made a correct source change appear ineffective and could let developers test or publish bytes that do not match their worktree when iterating without changing Maven coordinates.

Workaround used: rename the entire workspace-specific .aibuildcaches directory, then rerun scripts/test.bash. buildMaven took 11780ms and the identical setup-failure reproducer passed.

Suggested durable fix: include every source/build input digest in buildRuleResultIndex and artifactBinaryCache keys, or validate cached artifact provenance before returning it; also print the concrete cached artifact path/hash when a build rule is served from cache.


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.