Skip to content

fix(#907): forward-slash both sides of bootstrap-dirs.sh's legacy-store notice - #926

Merged
fdaviddpt merged 3 commits into
mainfrom
fix/907
Oct 6, 2026
Merged

fdaviddpt merged 3 commits into
mainfrom
fix/907

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

bootstrap-dirs.sh's legacy in-project .remember/ notice compared REMEMBER_DIR and the computed legacy directory as raw strings. On Git Bash (OSTYPE=msys/cygwin), where the two can arrive with different path-separator styles for the same directory, the "store already lives inside the legacy dir" (#132) prefix check could miss and print a spurious notice telling the operator to move a store that is already in the right place.

Fixed by normalizing both sides via _remember_forward_slash_into (from scripts/resolve-paths.sh) before the comparison -- the same fix doctor.sh's matching WARN check already received in #899/#517. The legacy directory value is overwritten in place (same pattern as doctor.sh's _legacy_store), so the filesystem checks and the printed notice text that follow also read the normalized value; REMEMBER_DIR itself stays raw, matching doctor.sh's existing precedent.

TDD

Wrote tests/test_migration.py::TestLegacyStoreNoticeMsysBackslash first: a must-stay-silent case for the #132 scenario and a must-fire positive control in the same fixture shape. Confirmed genuine RED before the fix (the silent-case test failed with the exact spurious notice the issue describes), then GREEN after (2 passed for -k Msys; 11 passed for the full tests/test_migration.py file, including the 9 pre-existing tests). The full repository pytest suite was not run locally, per policy -- CI is the matrix gate across 3 OSes and 4 interpreters.

Review

Two independent self-review passes (an Explore agent and oss:auditor) converged on the same single finding: a new comment overstated which values stay raw after the fix. Fixed in a follow-up commit. No other issues found; oss:auditor graded platform coverage for this fix as covered (CI forces the msys branch via env var on all three OSes).

Closes #907.

[AI-generated]

fdaviddpt and others added 3 commits October 6, 2026 16:53
…re notice

The notice compared REMEMBER_DIR and the legacy .remember/ directory as
raw strings. On Git Bash (OSTYPE=msys/cygwin), where the two can arrive
with different separator styles for the same directory, the "store
already lives inside the legacy dir" (#132) check could miss and print
a spurious notice for a session opened in $HOME. Both sides are now
forward-slashed via _remember_forward_slash_into before the comparison,
matching doctor.sh's own WARN check (already fixed in #899/#517).

Filesystem checks (-d/-e/-f) still read the paths unnormalized; only the
comparison form changed.

Fixes test_migration.py's _source_bootstrap harness, which no longer
sources resolve-paths.sh's PROJECT_DIR autodetection (it sets
PROJECT_DIR/PIPELINE_DIR directly) but still needs
_remember_forward_slash_into now that bootstrap-dirs.sh calls it -- the
one function is lifted out via sed, same convention as
test_injection_guard_backslash_walk.py.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Self-review (both the Explore reviewer and oss:auditor, independently)
flagged the same stale claim: the previous comment said filesystem
checks after the normalization "still use the raw (unnormalized)
values." That is true for REMEMBER_DIR but not for _legacy_dir, which
_remember_forward_slash_into overwrites in place (same pattern as
doctor.sh's _legacy_store) -- so the -d/-f checks and the printed
notice text that follow all read the normalized value. Not a
behavioral bug (forward-slash paths resolve fine on msys/cygwin,
matching doctor.sh precedent), just a comment that overstated what was
left untouched.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
CI (job 112342749034, every OS, every Python version) failed 12 tests
with "_remember_forward_slash_into: command not found" (exit 127).
bootstrap-dirs.sh's own USAGE header claims every caller sources
resolve-paths.sh first, but that is not true of every REAL caller --
several test files (and this repo's own #519 fix, a few lines below
this one in the same file) source only detect-tools.sh and
bootstrap-dirs.sh. The #907 fix called the shared
_remember_forward_slash_into (resolve-paths.sh) directly, so in those
callers the function was undefined and the whole script aborted under
set -e.

Fixed the same way #519 already fixed the identical problem for its
own gitignore-glob comparison a few lines below: duplicate the
OSTYPE=msys/cygwin backslash-to-forward-slash substitution inline
rather than depending on the shared helper being defined. Simplified
the test harnesses back down accordingly -- the sed-extraction dance
they picked up in the previous commit is no longer needed now that the
fix has no resolve-paths.sh dependency at all.

Verified: tests/test_migration.py (11/11), plus every other test file
sourcing bootstrap-dirs.sh (620 tests across ~75 files) -- all green.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@fdaviddpt
fdaviddpt merged commit 3493b60 into main Oct 6, 2026
19 checks passed
@fdaviddpt
fdaviddpt deleted the fix/907 branch October 6, 2026 16:36
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.

bootstrap-dirs legacy-store notice compares paths raw: a Windows session in $HOME can print a spurious notice

1 participant