Views: checkout policy discovery skips ignored folders; non-file policy names are absent; I/O errors name their path

Merged
AF
5d ago
+865-159

This fixes the views overload that saturated AFT's request queue tonight and the view loader [driver]: Is a directory failure on the aft checkout.

Cause. views::verification::policy_inputs recursively listed every directory of a checkout except .git, ignored target/, node_modules and cloned repositories included, to find .gitattributes/.gitignore/.ignore/.aftignore names. It runs on every v3 reconcile and verification. A live profile at 344% CPU had 88% of thread samples inside it, and core's worker preflight queued past its 3 s deadline. Separately, a tracked turborepo fixture directory named .ignore, inside the gitignored benchmark clones, was read as a file, so the view failed with EISDIR.

Fix.

  • Policy discovery walks with the existing project walk builder, so it never descends into a directory the checkout's own ignore rules exclude. Git and ripgrep never read ignore files there either. On a 128-directory/2,048-file ignored-tree fixture it visits 2 directories / 3 entries, against 131 / 2,181 before.
  • A policy name that is a directory or another non-regular entry is treated as absent, as git and ripgrep do. A real read failure of a regular policy file still refuses, naming its path.
  • Standard I/O failures across checkout verification, Git queries, v3 storage, pins, reader markers and segments now name their operation and path, instead of a bare Is a directory.

No policy-inventory cache was added: reusing an old list safely would need directory invalidation and a delivery cut, so every verification still walks, just not into excluded trees.

Tests. A large ignored tree is pruned, with visit counts. A broken entry under an ignored parent is never visited, checked through the real reconcile. Tracked directories named .ignore and .gitignore load and verify, with the ignore rules still applied. A regular-file read failure still refuses with its path. Each new test fails alone when only its fix is reverted. 898 views/v3/alias/pins/git-reader library tests pass, plus the Windows target check.

Views stay off by default. They stay off on the operator's Mac until a load check on a large real project under parallel searches passes.


Summary by cubic

Fixes views checkout policy discovery, which saturated AFT's request queue and caused the view loader [driver]: Is a directory failure on the aft checkout. Policy discovery previously listed every directory except .git, ignoring the checkout's own exclude rules, and ran on every v3 reconcile and verification; a live profile at 344% CPU had 88% of thread samples inside it. A tracked directory named .ignore was also read as a file, failing the view with EISDIR.

  • Policy discovery now walks with the existing project walk builder, so it never descends into a directory excluded by the checkout's own ignore rules; on a 128-directory/2,048-file ignored-tree fixture it visits 2 directories / 3 entries instead of 131 / 2,181.
  • A policy name that is a directory or another non-regular entry is treated as absent, matching git and ripgrep; a real read failure of a regular policy file still refuses and names its path.
  • I/O failures across checkout verification, Git queries, v3 storage, pins, reader markers, and segments now name their operation and path instead of a bare Is a directory. The v3 reservation lock names its file while keeping its timeout classification typed, so retention still treats a busy lock as a skip, not a failure.

No policy-inventory cache was added: reusing an old list safely would need directory invalidation and a delivery cut, so every verification still walks, just not into excluded trees. Views stay off by default.