﻿# Flyte 2 automatic caching: unchanged code and a stable URI do not prove unchanged data

Interpret Flyte 2 cache keys when a model task reads mutable external data, separating function version, typed inputs and explicit data-content identity.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-flyte-two-auto-cache-mutable-data-location/
Language: en

## A validation URI keeps its name

A scoring task reads a validation file from a stable storage location. The file is corrected without changing the task function or its URI argument. A reused task result can therefore describe the earlier data while the analyst expects a new evaluation. The cache is following its key; the experiment's dependency was not expressed fully.

Distinguish a locator from an immutable data identity. That distinction is especially important for labels, where an unobtrusive correction can change the meaning of every reported score without changing the file format or model.

## Read the documented cache components

The [Flyte 2 caching guide](https://www.union.ai/docs/v2/flyte/user-guide/tasks/task-configuration/caching/) describes inputs, task name, interface hash and cache version. Automatic behavior derives a version from function source according to its policy. It does not imply that every object reachable through an external string is inspected for changes.

Choose a data revision or explicit content identity as part of the computational input when that identity controls correctness. A manually changed cache version can be useful, but its meaning should be explained rather than treated as evidence that data stayed fixed.

## Typed file references still need a content policy

The [file and directory guide](https://www.union.ai/docs/v2/flyte/user-guide/tasks/task-programming/files-and-directories/) explains data references between tasks. A storage reference and its bytes are different concepts. The caching documentation separately describes content-based hashing for file-like inputs, including where that policy is attached.

Use the mechanism appropriate to the installed SDK and execution mode. Do not assume that converting a string into a typed file reference automatically establishes content immutability. Preserve [dataset lineage](/journal/data-guide-dvc-data-pipeline-lock/) independently of a cache-hit observation.

## Keep task boundaries meaningful

The [Flyte 2 task guide](https://www.union.ai/docs/v2/flyte/user-guide/get-started/core-concepts/tasks/) describes typed inputs and outputs across task calls. Put data acquisition or revision resolution at a deliberate boundary so the scoring task consumes the intended resolved input.

This also makes review clearer: a model evaluator should identify which label population it scored. A report that merely names a mutable bucket path cannot explain whether the corrected labels participated in the cached result.

## Test the dependency change

Run a controlled evaluation, change a recognizable label and repeat under the declared data-identity policy. Verify whether the evaluator recomputes when required and whether the output records the corrected identity.

Use [dataset evidence documentation](/journal/data-guide-datasheets-dataset-evidence-gaps/) to explain the labels' scope and limitations. Cache configuration governs result reuse; it does not establish that a revised dataset is valid or suitable for the target model comparison.
