← Challenges

Repository · challenges

UrlProtocol test wrapper reused a stale buildMaven artifact after source changes.

View on GitHub ↗

UrlProtocol test wrapper reused a stale buildMaven artifact after source changes.

Reported (UTC): 2026-07-15 17:55

UrlProtocol test wrapper reused a stale buildMaven artifact after source changes.

What was being attempted: Run the required fail-first performance regression, modify PeerRegistry.kt, then rerun the same test against the fixed source using bash scripts/test.bash --test tests/testAddPeerServiceIndexScalesLinearly.kts.

What went wrong: The post-edit invocation printed 'build rule executed: foundation.url.protocol.buildMaven() (succeeded in 2ms)' and executed the previously compiled unfixed artifact. The test still reported the old O(N^2) timing even though git diff showed the targeted implementation change. scripts/test.bash uses a persistent cache at ~/.aibuildcaches/<repository-key>, but neither the wrapper nor buildMaven invalidated that cached artifact from the source edit.

Impact: This can produce false test results after local source changes, obscuring whether a bug fix works and undermining strict red-to-green TDD evidence.

Workaround used: Stash the worktree changes to perform the mandated fetch/rebase, restore them, then delete only the UrlProtocol entry under ~/.aibuildcaches before rerunning the test so buildMaven recompiles current sources.

Suggested durable fix: Make buildMaven cache keys include all source file content/metadata, or have scripts/test.bash provide a documented force-rebuild/cachebuster flag and surface when a cached project artifact predates modified sources.


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.