-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathturbo.json
More file actions
187 lines (187 loc) · 11.5 KB
/
Copy pathturbo.json
File metadata and controls
187 lines (187 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{
"$schema": "https://turborepo.com/schema.json",
"tasks": {
"//#typecheck": {
"dependsOn": ["@loopover/engine#build"],
// Root tsconfig.json's own "include" list ("src", "test", plus a handful of named config files) is
// NOT a complete accounting of what tsc actually type-checks: "include" only seeds the starting file
// set, and tsc's real surface expands to everything transitively imported from there, regardless of
// whether the imported file physically lives inside src/ or test/. test/** (deliberately included so
// Codecov's codecov/patch has one source of truth, see the plan doc referenced in ci.yml) turned out
// to reach via relative-path imports into four other workspace packages/apps -- confirmed by grepping
// every import in src/+test/ that crosses a packages/**or apps/** boundary, not just spot-checked:
// packages/loopover-miner/{lib,bin}/**, packages/loopover-mcp/package.json (JSON import), packages/
// discovery-index/src/**, and apps/loopover-ui/src/lib/**. Before this was added, none of those four
// were hashed, so an edit to (say)
// packages/loopover-miner/lib/opportunity-fanout.js could silently leave a stale cache HIT here even
// though a real `tsc --noEmit` would fail -- exactly the class of bug PR #5082 (see ci.yml's "Build
// engine package" comment) already burned this repo on once. packages/loopover-mcp/bin/** is
// deliberately NOT listed: every test reference to it is a runtime path string
// (`join(process.cwd(), "packages/loopover-mcp/bin/loopover-mcp.js")`, spawned as a subprocess or
// read as raw text), never a static import, so its contents don't affect tsc's type-checked surface.
// This list is a snapshot of test/'s real cross-package reach as of the audit that added it, not a
// structural guarantee -- a future test file importing from a NOT-yet-listed package/app would
// reopen the same silent-stale-cache gap. Re-run the same grep (every src/+test/ import crossing a
// packages/**or apps/** boundary) before trusting this list again, especially before ever wiring the
// "Typecheck" ci.yml step through this task (it still calls plain `npm run typecheck` today,
// specifically because tsc's own --incremental engine already tracks this exact transitive graph
// precisely and correctly, without needing a hand-maintained approximation of it here at all -- see
// that step's own comment in ci.yml).
"inputs": [
"src/**",
"test/**",
"scripts/check-engine-parity.ts",
"worker-configuration.d.ts",
"vitest.config.ts",
"vitest.workers.config.ts",
"drizzle.config.ts",
"tsconfig.json",
"package.json",
"package-lock.json",
"packages/loopover-miner/lib/**",
"packages/loopover-miner/bin/**",
"packages/loopover-mcp/package.json",
"packages/discovery-index/src/**",
"apps/loopover-ui/src/lib/**"
],
"outputs": []
},
"@loopover/engine#build": {
"outputs": ["dist/**"]
},
"@loopover/ui-kit#build": {
"outputs": ["dist/**"]
},
"@loopover/ui-kit#typecheck": {
"outputs": []
},
"@loopover/discovery-index#build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
// apps/loopover-ui/src also imports three files this app has no formal package.json dependency on:
// root src/signals/redaction.ts (from lib/browser-sentry.ts), root src/signals/focus-manifest.ts (from
// lib/registration-workspace.ts) -- both real, always-bundled production imports -- and
// packages/loopover-engine/src/miner/driver-factory.ts (from a .test.tsx file, so typecheck-only, not
// build). None of these were hashed before, so a change to any of them with apps/loopover-ui itself
// unchanged could give a false cache HIT on this task -- the same class of bug already found and fixed
// in the root //#typecheck task, just missed here during that audit. Confirmed via grep: `grep -rn
// "\.\./\.\./\.\./\.\./" apps/loopover-ui/src` finds exactly these three cross-boundary imports, no
// others. @loopover/engine#build is added as an explicit dependsOn edge (rather than hand-listing
// driver-factory.ts as an input) since engine has no default inputs override -- its whole src/** is
// already hashed by that task, so depending on it transitively covers this file (and any other engine
// file a future test might import) without needing to track individual paths here too.
"@loopover/ui#typecheck": {
"dependsOn": ["^build", "@loopover/engine#build"],
"inputs": [
"$TURBO_DEFAULT$",
"$TURBO_ROOT$/worker-configuration.d.ts",
"$TURBO_ROOT$/src/env.d.ts",
"$TURBO_ROOT$/src/signals/redaction.ts",
"$TURBO_ROOT$/src/signals/focus-manifest.ts"
],
"outputs": []
},
"@loopover/ui#lint": {
"outputs": []
},
// Same two root src/signals files as @loopover/ui#typecheck above -- both real production imports
// (src/client.ts and src/routes/__root.tsx transitively pull them in), so vite's actual bundle depends
// on them. Previously had no inputs override at all (bare $TURBO_DEFAULT$, own directory only). Does
// NOT need the engine dependsOn edge @loopover/ui#typecheck has: the only file reaching into
// packages/loopover-engine is imported from a .test.tsx file, which isn't part of the production build.
"@loopover/ui#build": {
"dependsOn": ["^build"],
"inputs": [
"$TURBO_DEFAULT$",
"$TURBO_ROOT$/src/signals/redaction.ts",
"$TURBO_ROOT$/src/signals/focus-manifest.ts"
],
"outputs": ["dist/**"]
},
// apps/loopover-miner-ui/src (typecheck) imports from packages/loopover-miner/lib/chat-action-registry
// /chat-action-dispatch/chat-governor-actions -- 5 files reaching in via relative path, with no
// package.json dependency on @loopover/miner to create a ^build edge, and no existing inputs override
// (bare $TURBO_DEFAULT$). Same class of bug as @loopover/ui#typecheck above. Scoped to the whole
// packages/loopover-miner/lib/** directory (not the 5 specific files) to match the same "don't
// hand-track an ever-growing cross-package surface" reasoning already applied to //#typecheck's fix --
// this UI already imports 5 files from that one directory, more is a matter of when, not if.
// @loopover/engine#build is an explicit dependsOn edge for the same reason @loopover/ui#typecheck
// declares it above: those reached-into packages/loopover-miner/lib/** files import @loopover/engine,
// whose "types" resolve to packages/loopover-engine/dist/index.d.ts -- and miner-ui has no package.json
// dependency on engine to create the edge via ^build. 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 -- a scheduling race, so it only bit when the engine cache missed AND the
// scheduler interleaved the two tasks the wrong way).
"@loopover/ui-miner#typecheck": {
"dependsOn": ["^build", "@loopover/engine#build"],
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/packages/loopover-miner/lib/**"],
"outputs": []
},
"@loopover/ui-miner#lint": {
"outputs": []
},
// apps/loopover-miner-ui's root-level vite-*-api.ts dev-server plugins (vite-attempt-api.ts,
// vite-chat-api.ts, and 7 others) contain 14 dynamic import()s reaching into
// packages/loopover-miner/lib/** and one into packages/loopover-engine/dist/index.js -- same
// directory added defensively as @loopover/ui-miner#typecheck above. These execute inside vite's
// configureServer request-handler hooks (vite dev only), so they likely don't affect this task's
// actual `vite build` bundle output -- but that's inference from reading the plugin code, not proven
// the way the typecheck gap above was, so the input is added here too rather than left asymmetric.
"@loopover/ui-miner#build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", "$TURBO_ROOT$/packages/loopover-miner/lib/**"],
"outputs": ["dist/**"]
},
"@loopover/mcp#build": {
"dependsOn": ["^build"],
// Was `[]` (log-only caching, correct back when bin/lib's compiled .js was always committed --
// present via git regardless of whether turbo actually ran tsc or replayed a cached log). Now that
// compiled output is gitignored (build(mcp,miner): stop committing compiled .js/.d.ts entirely),
// `[]` means a cache HIT never restores the real files turbo never snapshotted, only replays the
// log text -- confirmed live: validate-tests' 3 parallel shards share one turbo-tests- cache key,
// and whichever shard's Save lands first can make a LATER shard's Restore see a "hit" for content
// it never actually built on that runner, leaving bin/lib empty while the log claims success
// (#7705 CI, shard 2 vs. shard 1/3 on the same commit). Declaring the real outputs makes a hit
// restore the actual files instead of only the log. dist/ prefix since the 2026-07-24 out-of-place
// emit migration (was bin/lib in-place; see tsconfig.json's outDir comment). .tsbuildinfo included
// so a cache HIT restores it alongside dist/, keeping tsc's own incremental state consistent with
// what's on disk -- reproduced locally (not a real CI incident: actions/checkout's default clean:
// true already wipes any stale .tsbuildinfo before every job) that a tsc invocation seeing a stale
// .tsbuildinfo with an empty/missing dist/ silently no-ops, believing everything is already built.
"outputs": ["dist/bin/**/*.js", "dist/lib/**/*.js", ".tsbuildinfo"]
},
"@loopover/miner#build:tsc": {
"dependsOn": ["^build"],
// Was `cache: false` -- historically to avoid a cache restore stomping this package's hand-written
// .js files while the #7290 migration was still in-flight (see ci.yml's "Build miner CLI" comment).
// #7317 closed that migration out (every bin/lib file is compiler-owned), and the 2026-07-24 dist/
// migration removed the original in-place-emit hazard entirely -- dist/ is a clean build directory
// turbo fully owns, with no hand-written file a bad restore could ever clobber. Enabling caching now
// (the outputs below mirror @loopover/mcp#build's own #7705-incident-driven declaration: dist/'s
// .js -- plus miner-specific .d.ts, since unlike mcp this package has declaration: true -- and the
// dist/package.json tsc itself emits for that same setting, see check-miner-package.ts's allowlist
// comment) so a cache HIT restores every real file, not just the log.
// .tsbuildinfo included so a cache HIT restores it alongside dist/, keeping tsc's own incremental
// state consistent with what's on disk (same reasoning as @loopover/mcp#build's own outputs above).
"outputs": [
"dist/bin/**/*.js",
"dist/bin/**/*.d.ts",
"dist/lib/**/*.js",
"dist/lib/**/*.d.ts",
"dist/package.json",
".tsbuildinfo"
]
},
"@loopover/miner#build:verify": {
"dependsOn": ["@loopover/miner#build:tsc"],
"inputs": ["dist/bin/**/*.js", "dist/lib/**/*.js"],
"outputs": []
},
"@loopover/miner#build": {
"dependsOn": ["@loopover/miner#build:tsc", "@loopover/miner#build:verify"],
"cache": false
}
}
}