← Challenges

Repository · challenges

Buildtest kompile cache reused a stale root build.kts after its Maven coordinate changed.\n\nWhat

View on GitHub ↗

Buildtest kompile cache reused a stale root build.kts after its Maven coordinate changed.\n\nWhat

Reported (UTC): 2026-07-13 15:41

Buildtest kompile cache reused a stale root build.kts after its Maven coordinate changed.\n\nWhat was being attempted: While proving that a corrected reservation-idempotency test fails without the new ownership guard, I temporarily mutated BuildTestEmbeddedService and changed build.kts from buildtest-embedded 0.0.276 to 0.0.277, then ran scripts/test.bash --test e2eTerminalReservationReleaseIsIdempotentAfterLateWorkerExit.\n\nWhat went wrong: kompile repeatedly reported "build rule executed: buildtest.embedded.buildMaven() (succeeded in 0ms)" and the test passed even after a diagnostic mutation made hasAdmissionCapacityLocked return true. Inspection with javap proved the only cached buildscript class still contained "buildtest.embedded:buildtest-embedded:0.0.276"; no 0.0.277 artifact existed. The cache path was /home/leslie/.aibuildcaches/_code_BuildTestEmbedded-task19/buildscriptCache.\n\nImpact: Mutant tests silently executed stale production code, producing false-positive pass results and invalidating required fail-without-fix evidence. This could allow regression tests to claim a fix works while testing the previous artifact.\n\nWorkaround used: Inspect the compiled buildscript constant, invalidate only the generated buildscript/artifact cache for this checkout, rebuild, and verify the new coordinate appears before accepting test evidence.\n\nSuggested durable fix: kompile-cli should include root build.kts content and referenced source inputs in buildscript/build-rule cache keys, or detect mtime/content changes and invalidate the cached buildscript. Test output should also print the resolved artifact coordinate so stale-code execution is immediately visible.


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.