Repository navigation
Cache misses when Go testdata/embed, Node .mjs/.css/config, or other read files change - #337
Open
calvin-archastro wants to merge 3 commits into
Open
calvin-archastro wants to merge 3 commits into
calvin-archastro wants to merge 3 commits into
Conversation
Contributor
Author
|
ArchDev is watching this pull request. State: watching (cycle 6 of 6 for head 129ea25).
Paused by the |
calvin-archastro
force-pushed
the
factory/tsk_3ZcmMUQxEMT4HknMopt8Eo-f85a43d3-b633-480d-84fb-
branch
from
November 1, 2026 12:44
b4a0225 to
abffbeb
Compare
…or other read files change
…or other read files change
- check Action: action/test/fixture/app/aster.toml excludes runs.txt, which the command writes and the new **/* key hashed; action tests 15/15 pass (fixed) Archdev-Job: job_f6dd266080f2e084aed38fd7 Co-Authored-By: ArchDev <archdev@archastro.ai> Archdev-Model: anthropic/claude-opus-5.5
calvin-archastro
force-pushed
the
factory/tsk_3ZcmMUQxEMT4HknMopt8Eo-f85a43d3-b633-480d-84fb-
branch
from
November 1, 2026 16:55
abffbeb to
129ea25
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Review on ArchCode
Epic: Aster bug bash fixes
Task: Cache misses when Go testdata/embed, Node .mjs/.css/config, or other read files change
Problem and author intent
Inferred Go, Node.js, Elixir, Rust, and Python targets hashed only narrow source globs (
**/*.go,src/**/*.{ts,tsx,js,jsx}pluslib/**/*.{ts,js},lib/**/*.ex/lib/**/*.exswithtest/**/*.exsonly for test,src/**/*.rsplusbuild.rsand test/bench globs, and*.py). The hasher walked those globs, honored.gitignore, and skipped some dependency directories, but a file the toolchain actually reads that did not match the glob never entered the key.Before this change, editing Go
testdata/or a//go:embedfile, a Node.mjs/.css/.vuemodule or tool config such asvite.config.js, Elixirpriv/ortest/support, a Rustinclude_str!asset orrustfmt.toml/clippy.toml, or a Python test-data file left the cache key unchanged. The nextasterbuild, test, or lint could hit while the real tool would fail or emit different output.cache.includecould paper over a single path, but defaults were expected to cover what those targets read.The intent is to use a project-wide
**/*input for every non-depstarget of those five plugins, keepdepslockfile- and toolchain-file-only so a source edit does not reinstall dependencies, let userexcludewin, and keep a build from invalidating itself by hashing its own outputs or tool caches.What changed
Non-
depscache_inputsfor Go, Node.js, Elixir, Rust, and Python now usePROJECT_FILES_GLOB(**/*) instead of language-specific source lists. Target-specific extra globs (Node test files, Elixirtest/**/*.exs, Rusttests/andbenches/, Python test modules) are no longer appended, because those paths are already project files.depsstill has an emptysource_globslist; Python deps can still name.venv/pyvenv.cfgas a config file.The walker still skips gitignored directories, does not follow symlinks, and prunes nested project roots. It now also prunes tool caches even when they are not gitignored:
.git,.aster,node_modules,__pycache__,.venv,.pytest_cache, and*.egg-infoat any depth, andtarget,_build,deps,dist, andbuildonly as children of the project root.src/buildandinternal/diststay inputs. A catch-all**/*does not count as naming a pruned directory. A config-file pattern or userincludethat names a file inside one of those directories still walks that directory, and the matcher keeps only the named file. Declared[targets.*.cache] outputsare dropped by the matcher, including a barebin/app. Userexcludeis applied first and wins over a named include.Watch uses the same matcher. A project file now owns every non-
depstarget, so a non-source edit fires both build and test unless it is excluded. Default watch ignores gain**/.pytest_cache/**,**/__pycache__/**, and**/*.egg-info/**. Tooling paths such asnode_modulesand rootdist/are ignored before cache inputs are consulted. Declared outputs do not own a watch target; a nestedsrc/buildfile still does.A second revision on the same base adjusts fixtures that became self-invalidating once every project file is an input. A command that writes an undeclared marker (
runs.txt,gen_ran) changes the post-run key, so the result is never stored. Those fixtures nowexcludethe marker. A lint target that shares a lookup with build excludesout/**, because restoring build's output would otherwise change lint's key after the shared lookup. Remote-cache assertions also surface stderr when a lookup count fails.README documents the new default, the root-only output-dir prune,
excludewinning,depsstaying narrow, andincludebeing able to name a file inside a pruned directory.Scope
Two frozen revisions share base
0c4b2857395fc0db905afdc1069771f4787d16ba. Neither patch listing omitted hunks or paths. Diagnostics are truncated at the source/check-log layer, so this summary is from the supplied excerpts, not from a claim of complete CI logs.a64dd59559af772ebf34199441e397129840cdb4: 15 paths, 55 hunks, +703 / −90. Cache hasher and matcher, five language plugins, plugin registry constant, watch ignore/plan/event loop, workspace ignore comment, README,tests/integration.rs,tests/watch_tests.rs.00c6d328d56f6c78af7f2335fab24a57a2a0eafd: 19 paths, 64 hunks, +729 / −99. Same tree plussrc/executor/runner.rs,tests/cache_login_e2e.rs,tests/cache_remote.rs, andtests/cache_remote_e2e.rsfor the marker/out/**excludes.Out of scope, and not changed here: files-read tracing or sandboxing,
depsinput policy, and Go dependency-edge behavior.Risk assessment
High. Every cache key for the five plugins' non-
depstargets changes, so the first run after upgrade is a miss and shared or remote caches must repopulate. Wider inputs lower hit rate when generated files are not gitignored, not in the prune list, and not declared outputs. Hash cost grows with project size. Root-only pruning ofdist,build,target,_build, anddepsis intentional so nested source trees stay inputs, but a nested output directory that is not gitignored can still self-invalidate. A file the command writes that is not a declared output changes the post-run key and prevents store; that is why the fixture excludes were required.User impact
A change to testdata, embeds, styles, Vue/mjs modules, tool configs, Elixir
priv/test/support, or similar project files misses build, test, lint, format, and check for these plugins.depsstill does not rerun on a source edit. Userexcludestill removes paths;includecan pull one file out of a pruned directory or a declared output. Watch reruns on those newly covered files unless they are excluded or ignored. A no-op rerun after declared outputs exist should still hit. Users who relied on non-source files not busting the cache, or on test-only paths not firing build, will see more misses and more watch cycles.Testing
The patches add or retarget tests. Presence in the diff is not proof they passed.
Hasher unit tests:
non_source_files_change_the_key,user_exclude_removes_a_project_file_from_the_key,declared_outputs_do_not_change_the_key,tool_caches_do_not_change_the_key_even_when_not_gitignored,include_can_name_a_file_inside_a_root_output_dir,deps_still_hashes_venv_config_when_not_gitignored. Matcher:tool_cache_and_outputs_are_not_inputs_unless_named,user_exclude_wins_over_a_named_tool_cache_file. Plugin registry:inferred_languages_hash_every_project_file_except_deps. Rust plugin:test_cache_inputs_cover_tests_and_benches. Watch:user_exclude_file_is_noop,project_file_fires_build_and_test,declared_output_does_not_own_a_watch_target, plus ignore assertions for__pycache__and.pytest_cache. Integration:tests/integration.rs::default_cache_keys_cover_files_targets_read(Go- and Node-shaped fixtures, no compiler; second run hit, excludednotes.txtstays hit, each named edit misses only that project's build,depsstays cached, no-op after outputs exist hits).tests/watch_tests.rs::watch_ignores_non_input_file_changesnow excludesREADME.mdinstead of assuming it is outside the default globs.Advisory pipeline outcomes, all reported succeeded with exit 0: format, lint, test, fix, reformat, verify-lint, verify-test, commit (
No remediation files to commit). The fix excerpt namescargo fmt --all --check,cargo clippy --locked --workspace --all-targets --all-features -- -D warnings, andcargo test --locked --workspace --all-targets --all-featuresas succeeded, and says no files were edited. Check excerpts are truncated and do not name the new hasher, matcher, plugin, watch, integration, or remote-cache tests, so those logs do not independently confirm those functions ran. Author notes claim the canonical integration test andtests/cache_remote.rspassed after the fixture excludes; that is author-reported, not visible in the truncated check excerpts.Follow-ups and known issues
dist/,build/,target/,_build/, anddeps/are inputs on purpose. Projects that emit outputs there without declaring them, or without gitignoring them, can still miss on a no-op rerun.pattern_names_cache_diris a prefix check after stripping a leading**/, not a full glob match. Unusual include patterns may not force a walk of a pruned directory.exclude, a declared output, or gitignore.default_cache_keys_cover_files_targets_readand the hasher/matcher/plugin/watch tests if those names must be confirmed in CI.