Skip to content

Add a granular scan-result cache opt-out for outer task caches #1804

Description

@jasonkuhrt

Problem

React Doctor 0.9.13's whole-scan result cache computes a repository identity
using git status --porcelain=v1 -z --untracked-files=all and the contents of
dirty files (buildScanResultCacheKeyresolveRepositoryCacheIdentity
buildWorktreeFingerprint). Vite Task automatically records child-process
filesystem accesses as inputs. Running Doctor inside a cached package task
therefore makes unrelated repository changes invalidate that package's verdict.

The outer task cache already replays the complete verdict. Doctor's per-file
lint and sidecar caches remain useful when a changed package actually runs.
REACT_DOCTOR_NO_CACHE switches all three off, so it is too broad here.

Requested behavior

Add REACT_DOCTOR_NO_SCAN_CACHE, with the same truthy-value convention as
REACT_DOCTOR_NO_CACHE, returning null from buildScanResultCacheKey before
isGitIdentityTrustworthy or repository fingerprint collection. Preserve normal
behavior when the flag is absent, and leave per-file and sidecar caches enabled.

Verified locally

A one-file React project in a real temporary Git repository, using 0.9.13,
serial lint, --no-score --no-supply-chain --no-dead-code, and Git's native
GIT_TRACE2_EVENT tracing:

Invocation Repository-wide git status Cache files created
Default, first and second run Once per run scan, per-file, sidecar
Granular opt-out, first and second run None per-file, sidecar

All four scans completed and analyzed the fixture file. A local patch implements
one early-return condition at buildScanResultCacheKey; it does not change any
per-file or sidecar cache code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions