Include tool versions and declared environment in the cache key
The cache reused a successful check after the TypeScript version changed. Define a canonical cache key that captures the command, inputs, dependency results, and supported environment.
- Focused work estimate
- 2h 30m + prerequisites
- Priority in the scenario
- High
- Engineering practice
- Content hashing · Build reproducibility · Cache invalidation
Estimated field mix
- Developer tooling80%
- Storage systems20%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A product team waits for every package to rebuild after small changes. An experimental cache is faster but occasionally returns success after a shared type changed. Build a small, auditable task runner around fixture packages.
Setup prerequisites
- Prepare four fixture packages with one shared library and two applications.
- Use only trusted fixture commands in local tests.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
Acceptance criteria
- Changing input bytes, lockfile, command arguments, tool version, or a declared environment value changes the key.
- File enumeration order and path separators do not change an otherwise equivalent key.
- Undeclared environment dependence is documented as unsupported and such tasks can disable caching.
Implementation constraints
- Hash values rather than logging environment contents.
- Use content hashes, not modification times, as input identity.
Verification to include
- Reorder file enumeration and assert the key is unchanged.
- Change each declared input dimension independently and assert a cache miss.
Deliverables
- Cache-key specification and canonicalization tests
Rollout and recovery
Version the cache namespace and discard entries produced by the old key algorithm.
Value of the work
For the engineer: Practice incremental computation, dependency scheduling, cache correctness, and cancellation.
For the team: Inspect whether faster checks preserve the guarantees reviewers depend on.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.