Repository navigation
Conversation
Same class as #517/#519: bash's own glob only recognises "/" as a path separator, and REMEMBER_DIR arrives backslash-separated on Git Bash/MSYS2. The gate-3 release audit ahead of v0.26.0 found three more sites in the same two files #517 already normalized, still calling the raw variable before the glob: - doctor.sh's _SESSION_END_FIRED glob (~line 469) silently stayed 0, misreporting SessionEnd as never having fired for a project that genuinely has a session-end-*.log. A second, independent path to the same misreport was also found and recorded in the changelog fragment: eced1f3's age-keyed retention sweep reclaims these same log files after thresholds.autonomous_log_retention_days -- that sweep is unrelated behaviour and is left untouched here. - doctor.sh's operator-facing memory-file count (~line 617), the third counter of this shape in the file, undercounted to 0. - run-consolidation.sh's .tail-*/.prefix-* stray-sibling cleanup (~line 242) globbed a staging_path that inherits REMEMBER_DIR's backslashes, leaking one inert temp file per failed consolidation split. All three now route through _remember_forward_slash the same way the other sites in these files already do. Regression tests use the same extracted-block technique as tests/test_windows_glob_backslash_517.py, with a synthetic backslash-laden REMEMBER_DIR/staging_path and $OSTYPE shadowed via `local` -- real Git Bash was not available to verify this directly, so the cross-platform mechanism is reasoned, not observed. Renamed doctor.sh's new _remember_memory_files_glob_dir to _remember_memory_glob_dir so its own extraction marker ("fi") does not collide with the substring "files". Co-Authored-By: Max <noreply>
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.
Same class as #517/#519: bash's own glob only recognises
/as a path separator, andREMEMBER_DIRarrives backslash-separated on Git Bash/MSYS2 (perresolve-paths.sh's own_remember_normalize_win_path). The gate-3 release audit ahead of v0.26.0 found three more sites in the same two files #517 already normalized, still calling the raw variable before the glob.scripts/doctor.sh's_SESSION_END_FIREDglob (~line 469, closes scripts/doctor.sh:467-469 globs REMEMBER_DIR raw, misreporting SessionEnd as never-fired on msys/Git Bash #524) silently stayed 0, so/remember:doctorfell through to its transcript heuristic and misreported a hook-registration problem that did not exist for a project that genuinely has asession-end-*.log. A second, independent path to the same misreport was found and is recorded (not fixed here, it is separate, already-working behaviour):eced1f3's age-keyed retention sweep (thresholds.autonomous_log_retention_days, default 7 days) reclaims the samelogs/autonomous/session-end-*.logfiles after the retention window, so a project idle longer than that also reproduces this report through a second path.scripts/doctor.sh's operator-facing memory-file count (~line 617, closes scripts/doctor.sh:617 globs REMEMBER_DIR raw, undercounting the memory-file total on msys/Git Bash #525), the third counter of this shape in the file -- Bash's glob never splits on backslash: 7 more REMEMBER_DIR sweeps/checks silently miss on Windows (same class as #487) #517's own fragment named only the other two ("both printed directly to the operator") -- silently undercounted to 0.scripts/run-consolidation.sh's.tail-*/.prefix-*stray-sibling cleanup (~line 242, closes scripts/run-consolidation.sh:242 leaks .tail-*/.prefix-* staging temp files on msys/Git Bash #526) globbed astaging_paththat inheritsREMEMBER_DIR's backslashes, leaking one inert temp file per failed consolidation split.All three now route through the shared
_remember_forward_slashhelper (scripts/resolve-paths.sh) the same way the other sites in these files already do, rather than inventing a new mechanism.Regression tests (
tests/test_windows_glob_backslash_524_525_526.py) use the same extracted-block technique astests/test_windows_glob_backslash_517.py: real bash pulled verbatim out of the owning script and run standalone with a synthetic backslash-ladenREMEMBER_DIR/staging_pathand$OSTYPEshadowed via alocal, since a real Git Bash/MSYS2 host was not available to verify this directly (the cross-platform mechanism is reasoned, not observed -- though CI's ownwindows-latestleg runs real Git Bash and will observe the$OSTYPE=msysbranch these tests exercise). Each of the three new fixes was manually confirmed red against the pre-fix code (_SESSION_END_FIREDread0instead of1with a real log present; the memory count read0:0instead of1:5with a real file present; the stray.tail-*sibling survived the sweep) before the corresponding test was written, then green after.The #525 site's loop sits inside an
if [ -d "$REMEMBER_DIR" ]; then ... figuard that the sibling #517 sites (_STAGING_BYTES,$_RT_PENDING) do not have; that guard is a real syscall check that resolves a backslash path fine on actual Windows but cannot be faked on this POSIX test host, so its own test extracts only the loop body (seeding the two counters via setup) rather than the wholeif/fiwrapper -- the wrapper itself is untouched and untested here, same as it was before this PR.Below the bar, recorded rather than fixed: while updating the README paragraph documenting these normalization sites, found the pre-existing "10
_remember_forward_slashcall sites in total" claim there already undercounts reality (actually 12, before this PR's own 3 additions) -- plausibly because the storage-mode[[ == ]]comparison calls the helper twice per occurrence and appears twice in the file. Left as-is rather than silently rewritten (logged intrap.d/524.readme-call-site-count-stale.md); this PR's own added sentence deliberately does not restate a new absolute total, to avoid compounding a wrong base number into a wrong new one.Closes #524. Closes #525. Closes #526.