Extend cache hashing to cover config file and template file contents#284
Merged
Conversation
5 tasks
- Include config file content in compute_input_hash so any config change invalidates the transform cache - Include template file content in compute_output_hash so template edits invalidate the output cache without path changes - Update build.rs to read config content at hash time and read template content for each output before hashing - Update all tests for new function signatures - Add tests: config change causes cache miss, template content changes output hash Agent-Logs-Url: https://github.com/egohygiene/renderflow/sessions/91f3fa04-4c19-43d0-b904-51e96f343594 Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Agent-Logs-Url: https://github.com/egohygiene/renderflow/sessions/91f3fa04-4c19-43d0-b904-51e96f343594 Co-authored-by: szmyty <14865041+szmyty@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add file-based caching for input, config, and templates
Extend cache hashing to cover config file and template file contents
Apr 11, 2026
szmyty
approved these changes
Apr 11, 2026
Pull Request Summary by devActivityMetricsAchievements
|
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.
The transform and output caches only hashed input file content and variable values — changes to the config file structure or template files were invisible to the cache, causing stale outputs to be served.
Changes
src/cache.rscompute_input_hash: Addedconfig_content: &strparameter — raw config YAML bytes are now mixed into the transform cache key, so any config change (not justvariables) triggers a cache misscompute_output_hash: Addedtemplate_content: Option<&str>parameter — actual template file bytes are now part of the output hash, so editing a template invalidates its cached render even when the path is unchangedsrc/commands/build.rscompute_input_hashcompute_output_hash; logs aWARNif the file is unreadable so cache degradation is visibleTests
""/Nonefor the new params preserves prior behavior)test_different_config_content_produces_different_hash,test_output_hash_different_template_content_differs,test_cache_miss_when_config_changed