Skip to content

fix(#888): disclose the real v2 cache filename and clean up the v1 orphan - #959

Merged
fdaviddpt merged 3 commits into
mainfrom
fix-888-config-cache-v2-disclosure
Oct 7, 2026
Merged

fdaviddpt merged 3 commits into
mainfrom
fix-888-config-cache-v2-disclosure

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

#857 added a README disclosure naming the persistent config-flatten cache file remember-config-cache-<key>. #864 later bumped the real on-disk name to remember-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.py kept passing because its check was a substring match on the shared remember-config-cache- prefix, which both names satisfy.

What changed

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]

fdaviddpt and others added 3 commits October 7, 2026 11:48
…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]>
@fdaviddpt
fdaviddpt merged commit 3fcb2bf into main Oct 7, 2026
19 checks passed
@fdaviddpt
fdaviddpt deleted the fix-888-config-cache-v2-disclosure branch October 7, 2026 11:40
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.

#864 bumped the config-flatten cache path to v2 but README's #857 disclosure and cleanup don't know about it; v1 cache file orphaned on upgrade

1 participant