Handoff: BuildTestServer dynamic dispatch and tail acceleration blocked on unpublished Embedded artifact
Written 2026-07-16 UTC.
RE-VERIFY: Everything below is a write-time snapshot. Before acting, query the Maven metadata and direct 0.0.323 POM again, check the BuildTestEmbedded c7da2e0 check run, and fetch the BuildTestServerService feature branch. Fresh Maven/GitHub/Git state always wins over this document.
STATUS UPDATE 2026-07-16 ~17:00 UTC — blocker RESOLVED, work resumed and nearly complete
All state below this point in the original document is superseded. Live state at update time:
buildtest.embedded:buildtest-embedded:0.0.323 WAS published from BuildTestEmbedded main @ c7da2e0 (POM returns 200; maven-metadata <latest>0.0.323</latest>).
- The blocked server work was resumed and completed through to an open, green, unmerged PR:
https://github.com/CodexCoder21Organization/BuildTestServerService/pull/227 (kotlin.build (remote) SUCCESS, mergeStateStatus CLEAN, canary plan in body). It supersedes the pin-only
https://github.com/CodexCoder21Organization/BuildTestServerService/pull/226 (coordination comment left there).
- Remaining before this handoff completes: the test-comprehensiveness + adversarial review passes on PR 227 (in flight now) and the supervising session's final review. The supervising session is actively driving these; this handoff will be completed when they pass.
Mission summary
Enable dynamic lease dispatch and tail acceleration in BuildTestServerService. The production motivation is the flat tail in buildtest run 3974870e, where one 330-second test ran alone without speculative duplication. The requested server change is to consume the first published BuildTestEmbedded artifact at or above 0.0.323, default both features on, expose environment-variable kill switches, log the effective values, add tests, and open?but not merge?a green PR with a canary rollout plan.
What was found and done
- The server checkout was clean at
2a59929 on main. build.kts pinned buildtest.embedded:buildtest-embedded:0.0.321, and src/buildtest/server/Main.kt explicitly passed dynamicDispatch = false under a stale comment about waiting for the implicit-first-lease fix. No tail-rescue/acceleration flag was passed.
- The upstream fix is verified in source: BuildTestEmbedded PR fixing queue-only runner launch merged as
7cfb0fc. BuildTestEmbedded main at c7da2e0 still declares artifact coordinate 0.0.323; its constructor names are dynamicDispatch and tailRescueEnabled.
- A feature branch,
enable-dynamic-dispatch-tail-acceleration, contains preserved WIP commit 3eb2265. It:
- pins BuildTestEmbedded
0.0.323 and bumps the server Maven coordinate to 0.0.177, with history comments;
- adds strict, case-insensitive boolean parsing and a map-driven
DispatchConfiguration loader for BUILDTEST_DYNAMIC_DISPATCH and BUILDTEST_TAIL_ACCELERATION, both defaulting to true;
- logs both effective flags at startup and passes them to
dynamicDispatch / tailRescueEnabled (with a comment explaining the upstream tail-acceleration rename);
- documents both variables in
README.md;
- adds
tests/dispatchEnvironmentConfigurationContract.kts, covering defaults, blanks, independent kill switches, case/whitespace, and full invalid-value messages.
- TDD red was verified before implementation:
scripts/test.bash --test dispatchEnvironmentConfigurationContract failed because DispatchConfiguration, its loader, and the two env constants did not yet exist. The implementation was then added. A post-implementation compile cannot yet run because the requested Maven dependency is absent.
- The artifact precondition is false as of write time.
https://kotlin.directory/buildtest/embedded/buildtest-embedded/maven-metadata.xml reports latest/release 0.0.321, lastUpdated=20260716120549. A direct request for 0.0.323/buildtest-embedded-0.0.323.pom returns HTTP/1.1 401 Unauthorized, and coursier fetch -r https://kotlin.directory buildtest.embedded:buildtest-embedded:0.0.323 --classpath reports unauthorized ... (Authentication Required). The same direct request for 0.0.321 returns 200.
- The upstream post-merge BuildTest run
bd5e708c was monitored to completion with build-watchman and passed 100/100 tests at 2026-07-16T15:02:38Z. It did not make 0.0.323 resolvable. This test-success-versus-publication mismatch is recorded in the merged PlanRepository challenge.
- No BuildTestServerService PR was opened because it would knowingly fail dependency resolution and violate the requirement that
kotlin.build (remote) stay green. No code PR was merged.
Relevant PRs and refs
| Reference | Write-time state |
| --- | --- |
| BuildTestServerService feature branch / 3eb2265 | Pushed, no PR, WIP preserved |
| BuildTestEmbedded queue-only fix PR | Merged; merge-commit check failed during an old-service restart, later main superseded it |
| BuildTestEmbedded tail-rescue scenario PR / c7da2e0 | Merged; current main source |
| BuildTestEmbedded main build | Green, 100/100; artifact still absent afterward |
| Publication-gap challenge | Merged |
| Motivating flat-tail run | Historical production evidence |
Next steps
- Re-verify current state first:
curl -fsSL 'https://kotlin.directory/buildtest/embedded/buildtest-embedded/maven-metadata.xml?nocache=<timestamp>' | rg '<latest>|<release>|0.0.323|lastUpdated'
curl -sSI https://kotlin.directory/buildtest/embedded/buildtest-embedded/0.0.323/buildtest-embedded-0.0.323.pom | head -1
coursier fetch -r https://kotlin.directory buildtest.embedded:buildtest-embedded:0.0.323 --classpath
- If
0.0.323 is still absent, obtain user authorization before publishing a Maven artifact from the separate BuildTestEmbedded repository. Use the publish-maven-artifact skill if authorized. Do not downgrade the server to 0.0.321: it predates the queue-only runner fix and would recreate the production re-execution risk.
- Once the artifact resolves, fetch the server branch and immediately run
git fetch origin && git rebase origin/main before any build. The current checkout required git -c credential.helper='!gh auth git-credential' fetch origin because plain HTTPS Git authentication was not configured.
- Run the targeted test:
scripts/test.bash --test dispatchEnvironmentConfigurationContract. It must flip from the pre-implementation red to green.
- Run the full local suite:
scripts/test.bash --test .. Investigate and fix any failure; do not weaken tests, retry flakes, or raise timeouts.
- Review all changed files, remove generated artifacts, run
git diff --check, and perform the required test-comprehensiveness and adversarial reviews. One review point to retain: tailAcceleration=true while dynamicDispatch=false is allowed and logged; upstream documents that tail rescue is simply meaningful only when dynamic dispatch is enabled.
- Immediately before opening the PR, fetch/rebase
origin/main again, rerun all tests, and check for an existing PR. Force-push with lease if the rebase rewrites the preserved branch.
- Open the BuildTestServerService PR without merging it. Its body must include:
- motivation link: https://buildtest.kotlin.build/run?id=3974870e;
- canary deploy after merge;
- on the first few dynamic-dispatch runs, verify started-test events are approximately the discovered test count;
- explain that a small number of intentional duplicate starts for tail stragglers is expected, unlike the prior full-suite churn in runs
56ce8190 and ee73b602 (11x churn);
- rollback without redeploy: set
BUILDTEST_DYNAMIC_DISPATCH=false and/or BUILDTEST_TAIL_ACCELERATION=false, then restart.
- Use the
watch-build skill to monitor the PR through all checks. Do not merge the code PR.
Reusable and operational knowledge
kotlin.directory returns HTTP 401 for a missing private-repository path, so use Maven metadata plus Coursier resolution to distinguish absence from a transient client error. A known published coordinate (0.0.321) returned 200 under the same unauthenticated request.
- A green BuildTestEmbedded
kotlin.build (remote) run verifies build/tests, not necessarily remote Maven publication. Verify the coordinate itself before bumping a downstream repository.
- The upstream public constructor still uses
tailRescueEnabled; ?tail acceleration? is the operator-facing rename requested for this server release.
- The target test intentionally passes explicit maps into the production config loader. It never reads ambient environment and does not start production P2P services.