Skip to content

fix(filetracking): exclude build caches from tracked paths - #602

Open
solvemproblr wants to merge 1 commit into
mainfrom
asa/file-tracker-build-cache-excludes
Open

fix(filetracking): exclude build caches from tracked paths#602
solvemproblr wants to merge 1 commit into
mainfrom
asa/file-tracker-build-cache-excludes

Conversation

@solvemproblr

@solvemproblr solvemproblr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Rollouts that compile inside the workspace record their compiler scratch as file changes. On a trace we looked at this week, a single Go build cache under .tmp/go-build<random>/ produced thousands of patches and ~22 MB of the trace's 31 MB span payload, burying the nine files the agent actually edited and making the trace viewer unusable.

This extends DEFAULT_EXCLUDE_PATTERNS with tool/framework caches (.tmp/, go-build*, .gradle/, .tox/, .pytest_cache/, .mypy_cache/, .ruff_cache/, .terraform/, .next/, .nuxt/, .svelte-kit/, .output/, .turbo/, .parcel-cache/) and a few more compiled artifacts (*.pyo, *.class, *.dll, *.dylib, *.exe). List-only change, 19 lines.

Notes for review

Go's cache is matched as a name glob, not a directory entry. _matches compares trailing-slash patterns by exact name (name == dir_name / substring), so it does not glob. Since the cache is named go-build<random>, go-build*/ would silently never match — it has to be written without the slash, where fnmatch runs against the entry name and still prunes the directory in _walk_directory. Worth keeping in mind when adding entries later.

The list is deliberately conservative. Exclusions here are unrecoverable: the patches are never emitted, so nothing downstream can opt back in. Names that are sometimes genuine source directories — build, dist, target, coverage, tmp — are therefore not added, even though the trace viewer filters them. The viewer's filter is presentation-only and has a toggle, so it can afford to be aggressive; this one cannot.

I did not touch the size caps (_MAX_DIFF_BYTES is 50 MiB per scan, _MAX_DIFF_FILE_BYTES 1 MiB per file). Those are what allowed the payload to grow this large even with noise present, and are worth revisiting, but they change behavior for legitimate large diffs too, so they felt like a separate call.

Test plan

  • pytest hud/environment/tests/{test_file_tracker,test_file_tracking,test_manifest}.py — 25 passed, no changes needed to existing expectations
  • ruff check and ruff format --check clean
  • Confirm no eval environment in use depends on tracking a path now excluded (all added names are dotdirs, the Go cache glob, or compiled artifacts, so I believe not)

Rollouts that compile inside the workspace record their compiler scratch as
file changes. A single Go build cache can contribute thousands of patches and
tens of megabytes of diffs to one trace, which buries the agent's actual edits.

Extend DEFAULT_EXCLUDE_PATTERNS with tool and framework caches and a few more
compiled artifacts. Go's cache is named go-build<random>, so it is matched as a
name glob; trailing-slash entries only match a directory by exact name.

Names that are sometimes real source directories (build, dist, target,
coverage, tmp) stay tracked and are filtered in the viewer instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@solvemproblr
solvemproblr force-pushed the asa/file-tracker-build-cache-excludes branch from a17c263 to 252a4f8 Compare August 20, 2026 01:34

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 252a4f8. Configure here.

# HUD CLI state written into env dirs (e.g. deploy's .hud/config.json).
".hud/",
".tmp/",
"go-build*",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glob excludes non-cache go-build names

Medium Severity

go-build* is matched with fnmatch on every entry basename, so it is not limited to Go compile-cache directories. Any file or directory whose name starts with go-build is skipped and never appears in patches. That silently hides real source such as go-build.go, go-build.sh, or a go-builder package, and those exclusions cannot be recovered downstream.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 252a4f8. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant