Skip to content

fix: Hash tracked outputs as task inputs - #14831

Open
anthonyshew wants to merge 1 commit into
mainfrom
shew/hash-tracked-outputs
Open

anthonyshew wants to merge 1 commit into
mainfrom
shew/hash-tracked-outputs

Conversation

@anthonyshew

Copy link
Copy Markdown
Contributor

Description

Closes #14820.

A tracked file can match a task's outputs without matching its explicit inputs. Editing and committing that file leaves the task hash unchanged, so a cache hit can overwrite the edit with older bytes.

Include Git-tracked output files in the task's file hashes. Respect output exclusions and keep untracked generated outputs out of the added input set. Include output patterns in hash deduplication so tasks with different outputs do not share the wrong file hashes.

 calculate_file_hashes
 	file_hashes_for_inputs
+	SCM::get_tracked_output_hashes

Deferred input hashing retains these tracked-output hashes.

Testing Instructions

The new caching regression warms the cache, commits an edit to dist/LICENSE, and requires a cache miss with a different hash. It then deletes the untracked generated artifact and checks that a cache hit restores the artifact without changing the committed LICENSE.

Additional regression cases cover output exclusions, distinct output selections, staged and deleted files, nested repository roots, and deferred inputs.

@anthonyshew
anthonyshew requested review from a team and tknickman October 16, 2026 22:59
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
examples-basic-web Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-designsystem-docs Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-gatsby-web Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-kitchensink-blog Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-nonmonorepo Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-svelte-web Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-tailwind-web Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
examples-vite-web Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
turbo-site Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC
turborepo-factory Ready Ready Preview, v0 Oct 16, 2026 11:00pm UTC

This branch was successfully deployed

1 active deployment
Preview – turborepo-factory — ca8d5619 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing and committing a tracked file under outputs gives a stale cache hit that restores the old bytes

1 participant