Repository navigation
Conversation
…tatus #899 removed the legacy-migration suite, which was the only place this function was exercised with no git binary on PATH at all (distinct from the existing TestGitTrackedCheckFailsClosed, which has git present but failing). Added a direct-call test asserting could-not-tell (fail-closed) when git is absent and an enclosing .git is found by filesystem walk, paired with a positive control asserting untracked when git is present and the file is genuinely untracked -- both via a new helper that calls _remember_config_tracked_status directly rather than through the full haiku-config merge, which cannot distinguish the two cases (both strip the same fields). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Self-review's Explore pass found that the first commit only tested one of the no-git branch's two outcomes (could-not-tell when an enclosing .git is found); the other outcome (untracked, when the filesystem walk finds no .git anywhere) was never exercised directly, so a degenerate no-git branch that always answers could-not-tell regardless of what the walk finds would have passed the whole suite. Added a third test pinning that outcome directly, and corrected the class docstring and changelog fragment, which had overclaimed that both outcomes were already pinned. 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.
#909: _remember_config_tracked_status in scripts/lib-memory-dir.sh has a no-git-binary branch that walks the filesystem by hand when git is absent from PATH, answering could-not-tell (fail-closed) if an enclosing .git is found, or untracked if not. This branch lost its only test coverage when #899 removed the legacy-migration suite (tests/test_migration_hardening_766.py).
This is a test-only change. Added to tests/test_untrusted_project_haiku_config_726.py:
TDD: wrote the tests, watched green, mutated each pinned assertion to the wrong value and confirmed red, then reverted. Full file: 50 passed both times (python3 -m pytest tests/test_untrusted_project_haiku_config_726.py -v). Full repo pytest was not run locally; CI is this repo's gate.
Review round: an Explore reviewer (no edit grant) found that the original two tests never exercised the no-git branch's own untracked fallthrough -- a degenerate implementation that always answers could-not-tell would have passed. Fixed by adding the third test and correcting overclaiming prose in the docstring and changelog fragment. An oss:auditor pass confirmed the platform skip (pytest.mark.skipif(sys.platform == "win32"), pre-existing, inherited by the new tests) is honest rather than vacuous, and CI covers this via the repo's 12-leg matrix.
Docs: .oss.json's docs_targets is README.md only; grepped for the mechanism's terms there, zero hits -- no-change-needed, test-only fix with no user-facing behavior change.
Closes #909
[AI-generated]