← Challenges

Repository · challenges

Kompile local test cache served a stale Maven build artifact after source and coordinate changes.

View on GitHub ↗

Kompile local test cache served a stale Maven build artifact after source and coordinate changes.

Reported (UTC): 2026-07-16 08:04

Kompile local test cache served a stale Maven build artifact after source and coordinate changes.

What was being attempted: Validate a TDD fix in a fresh BuildTestEmbedded checkout by changing src/buildtest/embedded/BuildDriver.kt and bumping build.kts from 0.0.318 to 0.0.319, then running scripts/test.bash --test dynamicDispatchQueueOnlyRunnerCommandDoesNotCreateImplicitFullSuiteLease.

What went wrong: Two post-edit runs still generated the old command. The test logs repeatedly reported buildtest.embedded.buildMaven() succeeding in 2-4 ms. The project cache index /home/helena/.aibuildcaches/_code_workspace_workspace_BuildTestEmbedded-dispatch-churn/buildRuleResultIndex/de345147b792d8e415329ccb9b8e58af7a83773290b6c17934fc6a592625c24f.json still resolved /home/helena/.cache/coursier/v1/bldbinary/repository/buildtest/embedded/buildtest-embedded/0.0.318/buildtest-embedded-0.0.318.jar even though the working build.kts declared 0.0.319. Thus source and build-script edits did not invalidate the local build-rule result.

Impact: Red-green TDD can falsely report that a correct implementation still fails, and worse, unrelated tests can pass against stale code instead of the working tree.

Workaround used: Inspect the result index to prove the stale coordinate, then remove only this checkout's generated ~/.aibuildcaches/_code_workspace_workspace_BuildTestEmbedded-dispatch-churn cache before rebuilding.

Suggested durable fix: Include build.kts contents, source-tree contents, and resolved artifact coordinates in build-rule-result cache keys; reject a cached result whose coordinates differ from the currently evaluated build rule; and expose a documented --no-cache or cache-invalidate option for forensic test runs.


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.