Skip to content

ci(turbo): three typecheck tasks lack a build edge to @loopover/contract, failing validate-code on any cache miss #9560

Description

@JSONbored

Summary

validate-code fails intermittently with errors in files the PR never touched:

../../src/mcp/server.ts(22,8): error TS2307: Cannot find module '@loopover/contract/tools' or its corresponding type declarations.
../../src/mcp/server.ts(2239,14): error TS7006: Parameter 'input' implicitly has an 'any' type.
...four more implicit-any errors, all downstream of the first

#9530 added @loopover/contract, and src/mcp/server.ts imports @loopover/contract/tools. Three turbo typecheck tasks pull that file into their compilation program with no build edge to the package:

task how it reaches src/mcp/server.ts why ^build does not cover it
@loopover/ui#typecheck apps/loopover-ui/tsconfig.json includes $TURBO_ROOT$/worker-configuration.d.ts, which imports ./src/index — so the entire Worker is in the UI's program (src/index.tssrc/api/routes.tssrc/mcp/server.ts) apps/loopover-ui has no package.json dependency on @loopover/contract
//#typecheck root tsconfig includes src/** directly a root (//#) task gets no build edge from a root package.json dependency
@loopover/ui-miner#typecheck reaches packages/loopover-miner/lib/**, which imports the package miner-ui has no dependency on it either

The UI chain was confirmed with tsc --explainFiles, not inferred.

Why it reads as flakiness

Turbo caches these tasks, so the failure only appears on a cache miss. PRs that hit the cache are green, which is why this presents as an unrelated PR "randomly" failing.

Prior art — this exact class is already documented in the file

All three tasks already carry an explicit @loopover/engine#build edge, and turbo.json's own comment on @loopover/ui-miner#typecheck describes the identical scheduling race for engine:

Without it, turbo runs engine build CONCURRENTLY with this typecheck; on an engine-build cache miss the typecheck can race ahead of the dist emit and fail with phantom "Cannot find module '@loopover/engine'" errors (observed intermittently in CI's validate-code job [...]).

@loopover/contract reintroduced the same gap for a new package.

Fix

Add @loopover/contract#build to all three tasks' dependsOn.

Verified both directions from a clean contract build state (dist/ and .tsbuildinfo removed — turbo caches both, so removing only dist/ produces a state turbo never creates, and tsc then silently no-ops):

  • with the edges: 4 tasks successful, contract built first, typecheck passes
  • without them: the identical six errors CI reported

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions