Repository navigation
fix(#888): disclose the real v2 cache filename and clean up the v1 orphan - #959
Merged
Merged
Conversation
…phan #864 bumped the config-flatten cache's on-disk name to `remember-config-cache-v2-<key>` so an old-format cache is never opened, but left two gaps: README's #857 disclosure still named the pre-#864 filename, and nothing ever removed the file an older build wrote under that old name -- an install upgrading across #864 kept it in $TMPDIR forever. `tests/test_readme_discloses_854.py` could not catch the README drift because its check was a substring match on the shared `remember-config-cache-` prefix, which both names satisfy; it now requires the real `-v2-` name. scripts/log.sh's `_remember_cfg_flatten_cache_publish` now best-effort removes the leftover v1-named orphan for the same REMEMBER_DIR every time it writes the v2 cache, via a new `_remember_cfg_flatten_cache_path_v1` helper that mirrors the real path function minus the `-v2-` segment. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…laim Self-review found two findings: - The jit-context curation log at .claude/jit-context/paths/00-manual/00-README.md still described the README disclosure drift as "still true at HEAD" and pointed at #888 as the open issue tracking it. Marked that entry as fixed by this commit instead of leaving it to read as an open bug once this merges; also corrected its own pre-existing mix-up of #864 (the format bump) and #875 (the follow-up PR that landed it). - scripts/log.sh's comment on the v1-orphan cleanup said it runs "every time it writes the v2 cache", but the cleanup also runs when the preceding mv -f of the v2 cache itself failed. Harmless (the cleanup only ever targets the fixed v1 path), but the wording overclaimed; reworded to say what actually happens. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…udget CI's check_release_tree_sh900 budget check failed on the built scripts/session-start-hook.sh: 123059 bytes, 179 over the 122880-byte hook-script budget, caused by the #888 addition to scripts/log.sh. Shrinks the fix without changing its behavior: - _remember_cfg_flatten_cache_path_v1() now derives the v1 path by substituting the literal `-v2-` out of _remember_cfg_flatten_cache_path()'s own output, instead of duplicating that function's slug-derivation logic. - _remember_cfg_flatten_cache_publish()'s cleanup now derives the v1 path from its own already-computed $_f (string substitution) instead of calling the helper function in a second subshell. Both changes are comment-stripped-build-tree real-code reductions, not comment trimming -- the build already strips whole-line comments before measuring the budget, so only non-comment lines count against it. Verified locally: `pytest tests/test_strip_shell_comments_900.py -k test_this_repository_built_tree_has_no_check_failures` is green against this commit (it builds from git HEAD, so it needs the shrink committed to see it). tests/test_v1_cache_orphan_cleanup_888.py and tests/test_readme_discloses_854.py both still pass unchanged (6 passed) -- this commit only changes how the v1 path is derived internally, not what it resolves to or when it is removed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
fdaviddpt
added a commit
that referenced
this pull request
Oct 7, 2026
…h derivation Found during tick review of PR #959 (fix commit b3bc223): the byte-budget shrink derives the pre-#864 v1 cache path via a bare ${var/-v2-/-} substring substitution over the full path, not anchored to the slug segment -- a TMPDIR containing the literal substring "-v2-" would make the substitution fire there instead, silently missing the real orphan file. Non-blocking (best-effort cleanup, reasoned not observed), ranked fails-to-preserve per findings.md. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
#857 added a README disclosure naming the persistent config-flatten cache file
remember-config-cache-<key>. #864 later bumped the real on-disk name toremember-config-cache-v2-<key>(deliberately, so an old-format cache is never reopened), but nothing ever updated the README disclosure or cleaned up the old-named file an upgrading install leaves behind.tests/test_readme_discloses_854.pykept passing because its check was a substring match on the sharedremember-config-cache-prefix, which both names satisfy.What changed
README.md: updated the$TMPDIR/remember-*disclosure line to name the realremember-config-cache-v2-<key>filename, attribute the rename to Directory warning RUNTIME_FETCH_EXEC (download-and-run) rose from 2 to 3 findings on v0.38.0; find the real matches #864, and describe the new one-time best-effort cleanup of the pre-Directory warning RUNTIME_FETCH_EXEC (download-and-run) rose from 2 to 3 findings on v0.38.0; find the real matches #864 orphan.scripts/log.sh: added_remember_cfg_flatten_cache_path_v1(), mirroring the existing path helper's slug derivation minus the-v2-segment, and a call at the end of_remember_cfg_flatten_cache_publish()that best-effortrm -fs a file at that v1 path if one exists.tests/test_readme_discloses_854.py: tightened the required-name check from the loose substringremember-config-cache-to the realremember-config-cache-v2-, since the loose form is exactly what let this drift pass silently.tests/test_v1_cache_orphan_cleanup_888.py(new): three tests, including a positive control that an unrelatedremember-env-*file is left untouched by the cleanup.changelog.d/888.fixed.md(new fragment)..claude/jit-context/paths/00-manual/00-README.md's curation-log entry for this bug claimed it was still open and misattributed the format bump to fix(#864): remove real eval calls from log.sh config cache, reword CHANGELOG/RUNTIME_FETCH_EXEC triggers #875 instead of Directory warning RUNTIME_FETCH_EXEC (download-and-run) rose from 2 to 3 findings on v0.38.0; find the real matches #864; corrected both.Testing
Red before the fix, green after, on the four targeted files (
test_v1_cache_orphan_cleanup_888.py,test_readme_discloses_854.py,test_config_flatten_cache_eval_removed_864.py,test_locale_ranges_695.py): 47 passed. Full suite not run locally (CI is the matrix gate per this repo's own doctrine); targeted tests cover the change directly.Closes #888
🤖 Generated with Claude Code
[AI-generated]