Task runnerConceptsAuto-Fingerprinting

Auto-Fingerprinting

Vite Task-style automatic input detection

Auto-Fingerprinting

Auto-fingerprinting eliminates the need for manual input configuration. Instead of declaring which files affect a task, the runner automatically tracks which files a task actually accesses during execution.

How It Works

  1. First run - Execute the task while tracking file system access
  2. Record fingerprint - Store content hashes of all accessed files
  3. Subsequent runs - Validate the fingerprint against current file state
  4. Cache hit - If all files are unchanged, replay cached result
  5. Cache miss - Re-execute and update the fingerprint

Enable Auto-Fingerprinting

const results = await defaultTaskRunner(tasks, {
    autoFingerprint: true,
    fingerprintEnvPatterns: ["VITE_*", "NODE_ENV"],
    cacheDiagnostics: true,
}, context);

What Gets Tracked

The fingerprint captures:

  • File reads - Content hashes of all files opened during execution
  • Missing files - Files that were probed but didn't exist (creating them later invalidates the cache)
  • Directory listings - If a command scans a directory (e.g., glob for *.test.ts), adding/removing files invalidates the cache
  • Environment variables - Matching the configured patterns
  • Command arguments - Task overrides and configuration

File Access Tracking

On Linux, file accesses are tracked via strace (intercepting open, openat, stat, getdents syscalls). On other platforms, a preload script patches fs module calls.

Cache Miss Diagnostics

When cacheDiagnostics is enabled, the runner explains exactly why a cache miss occurred:

Cache miss reasons:
  - File modified: src/index.ts
  - Environment variable changed: NODE_ENV
  - Directory contents changed: src/components

Untracked Environment Variables

Some env vars should be available to tasks but not affect the cache (e.g., CI build IDs):

{
    autoFingerprint: true,
    fingerprintEnvPatterns: ["VITE_*", "CI_*"],
    untrackedEnvVars: ["CI_BUILD_ID", "CI_JOB_URL"],
}

Comparison with Nx-style

AspectNx-styleAuto-fingerprint
ConfigurationManual input declarationsZero-config
AccuracyMay miss files or include too manyTracks exact files
First runHash computed upfrontMust execute to build fingerprint
PerformanceFaster cache checksSlightly slower (validates all files)
Remote cacheFull supportLocal only
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues