You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
memory_dir_exists is registered critical and only asserts the path exists and is a
directory. A memory directory that exists but cannot be written to passes it, and then
every save fails. Confirmed on a directory with the write bit cleared:
memory_dir_exists: passed=True sev=critical
real write: PermissionError
That is the state produced by a read-only bind mount, a volume whose ownership does not
match the running user, or a mode tightened by hand.
This adds a separate memory_dir_writable check rather than widening the existing one,
so the old name keeps describing what it does and the new failure gets its own message
and remediation. Same shape as audit_log_writable: os.access, no write probe.
Two details worth flagging.
It tests os.W_OK | os.X_OK, not W_OK alone. Creating a file inside a directory needs
search permission as well as write, so a directory that is -w- is unusable in practice. audit_log_writable checks W_OK alone on its parent and has the same gap; left alone
here, one check per PR.
An absent or non-directory path is a defined pass, not a skip, with a message saying the
check did not apply. memory_dir_exists already reports that case and one cause should
not produce two failures.
Five tests, on real directories and real mode bits. The permission tests restore the mode
in a finally, skip on Windows, and skip under root, where os.access reports success
regardless of mode.
Docs: a row and a section in DOCTOR.md, and a CHANGELOG entry under Unreleased.
No --fix action. Registering one needs a fixes.py whitelist edit, and making a user's
memory directory writable is not a change the tool should make on its own.
Merged — thank you, and sorry it sat as long as it did.
Three things I want to name. Adding a check rather than widening memory_dir_exists keeps the old name honest and gives the new failure its own message, which is the difference between a doctor that reports and one that explains. Requiring os.X_OK alongside W_OK is correct and is the part a reviewer would have missed — a directory you can write to but not search is unusable, and you found that audit_log_writable has the same gap and left it alone anyway. One check per PR is the right instinct; open that one when you want it.
And skipping the permission tests under root is the detail people forget: os.access reports success there regardless of mode, so without the skip those two tests fail in any root container and the failure reads as a problem with the check rather than with the environment.
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
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.
Closes #206.
memory_dir_existsis registeredcriticaland only asserts the path exists and is adirectory. A memory directory that exists but cannot be written to passes it, and then
every save fails. Confirmed on a directory with the write bit cleared:
That is the state produced by a read-only bind mount, a volume whose ownership does not
match the running user, or a mode tightened by hand.
This adds a separate
memory_dir_writablecheck rather than widening the existing one,so the old name keeps describing what it does and the new failure gets its own message
and remediation. Same shape as
audit_log_writable:os.access, no write probe.Two details worth flagging.
It tests
os.W_OK | os.X_OK, notW_OKalone. Creating a file inside a directory needssearch permission as well as write, so a directory that is
-w-is unusable in practice.audit_log_writablechecksW_OKalone on its parent and has the same gap; left alonehere, one check per PR.
An absent or non-directory path is a defined pass, not a skip, with a message saying the
check did not apply.
memory_dir_existsalready reports that case and one cause shouldnot produce two failures.
Five tests, on real directories and real mode bits. The permission tests restore the mode
in a
finally, skip on Windows, and skip under root, whereos.accessreports successregardless of mode.
Docs: a row and a section in
DOCTOR.md, and a CHANGELOG entry under Unreleased.No
--fixaction. Registering one needs afixes.pywhitelist edit, and making a user'smemory directory writable is not a change the tool should make on its own.