← Challenges

Repository · challenges

Kompile local test reused a stale buildMaven artifact after source changed, invalidating a TDD red

View on GitHub ↗

Kompile local test reused a stale buildMaven artifact after source changed, invalidating a TDD red

Reported (UTC): 2026-07-16 10:15

Kompile local test reused a stale buildMaven artifact after source changed, invalidating a TDD red baseline.

What was being attempted: prove dynamicDispatchQueueOnlyRunnerCommandDoesNotCreateImplicitFullSuiteLease fails after temporarily reverting the BuildDriver.kt fix in BuildTestEmbedded, using the repository-documented scripts/test.bash --test <name> command.

What went wrong: the selected test reported ALL TESTS PASSED (1/1 selected tests completed successfully) even though the working-tree function was visibly val testArgs = buildTestArgs(testSpecs, projectsDir) and should emit the forbidden workspace-wide --test. The workspace cache's buildRuleResultIndex still pointed to ~/.cache/coursier/v1/bldbinary/repository/buildtest/embedded/buildtest-embedded/0.0.320/buildtest-embedded-0.0.320.jar, created during the prior session while the fix was present; buildMaven reported success in 1 ms and never rebuilt from the changed source.

Impact: the standard documented local test command produced a false-green result for a deliberately reverted bug, undermining strict TDD verification and consuming roughly eight minutes of full test discovery/compilation before the stale reuse was diagnosed.

Workaround used: invoke the Kompile launcher with a brand-new cache directory and temporarily use a unique local Maven coordinate for the red baseline, then use a separate fresh coordinate/cache for the fixed baseline.

Suggested durable fix: include the complete source tree content digest and build.kts content/version in buildRuleResultIndex validity checks, or expose and document a supported force-rebuild/no-cache flag; a cached buildMaven result must never remain valid after any source file changes.


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.