Repository navigation
fix: build no Muse Code session map in read-only mode - #62
Open
leninworld wants to merge 1 commit into
Open
leninworld wants to merge 1 commit into
leninworld wants to merge 1 commit into
Conversation
`build_pack` wrote muse-code-packs/ (folder, lock and pack) into the data folder even under --read-only or GRAPHICLE_READ_ONLY=1, which promise to leave the data folder unchanged. It now returns the read-only refusal before it touches the folder. Signed-off-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
2 tasks done
This branch has not been deployed
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.
Summary
docs/configuration.mdsays--read-only(orGRAPHICLE_READ_ONLY=1) opens the data folder without changing it. Muse Code's session map build did not check the mode:graphicle --read-only hook muse pack --project <id>, which a Muse Code session start runs detached (and which getsGRAPHICLE_READ_ONLY=1since fix: pass --read-only on to the processes graphicle starts itself #59), createdmuse-code-packs/with its.lockand the<project>-<tokens>.mdpack in the data folder. This was the leftover named in fix: pass --read-only on to the processes graphicle starts itself #59.muse_code::build_packnow returns the read-only refusal (db::READ_ONLY_REFUSAL) before it opens the session or touches the folder. The hook drops the error as before, so it still exits 0 and prints nothing.docs/configuration.md: Muse Code's session map is added to what read-only mode does not write.Not changed:
session_packstill starts the detached build when no fresh pack is kept; in read-only mode that build is now refused at once. Skipping the start in read-only mode would save a process per session start; I kept this to one check.Test plan
read_only::a_read_only_muse_pack_build_writes_nothing(tests/it/read_only.rs): two data folders after a normalsync. The plainhook muse pack --project <id>writes one pack holdingprice_with_taxinto the first (so the command reaches the build). On the second,--read-only packanswers (the store opens read-only), then--read-only hook muse packand the same hook withGRAPHICLE_READ_ONLY=1leave every file and folder unchanged byte for byte. Onmainit fails with "the muse pack build changed the read-only data folder".cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo clippy --locked --all-targets --features local-inference -- -D warningsandcargo test --locked --all-targetsincrates/graphicle(lib 557 passed; it 576 passed, 3 ignored; extension 27 passed; Rust 1.95.0, macOS). Linux and Windows run in CI.