How to determine where a rake task is enhanced

I had to figure out where yarn:install was being added.

From the rake installation, find the source of the gem file gems/rake-13.0.6/lib/rake/task.rb and modify the enhance method to have this DEBUG UPDATE.

Then run your rake task, or even something like rake -T to see where the enhance happens.

    def enhance(deps=nil, &block)

# DEBUG UPDATE  
      if deps && deps.include?("yarn:install")
        puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
        puts "deps = #{deps.ai}"
        puts "STACK TRACE for where adding dependency yarn:install"
        puts caller
        puts "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
      end
# END DEBUG UPDATE  

      @prerequisites |= deps if deps
      @actions << block if block_given?
      self
    end

And after running this code, I saw that where yarn:install was getting added to assets:precompile.