fix(acp): isolate permission.rs tests from real acp-permissions.toml#6514
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 19, 2026 21:30
bug-ops
force-pushed
the
fix/6512-acp-permission-test-isolation
branch
5 times, most recently
from
July 19, 2026 22:07
7633b21 to
c1500de
Compare
permission.rs's test suite constructed AcpPermissionGate::new(conn, None), which falls back to the developer's real permission config file instead of a fixture. Every allow_always/reject_always test persisted a real entry to that file, which the live zeph --acp binary also reads. Add temp_perm_path() and back every gate in the test module with an isolated tempfile::tempdir(), mirroring the pattern already used in terminal.rs (#6511).
bug-ops
force-pushed
the
fix/6512-acp-permission-test-isolation
branch
from
July 19, 2026 22:16
c1500de to
c1ddcba
Compare
7 tasks
bug-ops
added a commit
that referenced
this pull request
Jul 19, 2026
…introduction (#6524) A None second argument falls back to the developer's real acp-permissions.toml instead of an isolated test path, silently persisting AllowAlways/RejectAlways decisions across unrelated test runs (#6512, fixed for both terminal.rs and permission.rs by PR #6514). Adds a self-testing bash guard, check_acp_permission_gate.sh, wired into the lint-shellcheck CI job, that fails the build if the pattern reappears in crates/zeph-acp/src. Closes #6515
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
permission.rs's test suite constructedAcpPermissionGate::new(conn, None)in 9 places, which falls back to the developer's realacp-permissions.tomlconfig file instead of a test fixture, persisting test-injected allow/reject decisions to a file the livezeph --acpbinary also reads.temp_perm_path()helper and backs every gate in the test module with an isolatedtempfile::tempdir(), mirroring the pattern already used interminal.rs(fix(security): close quarantine fail-open and ACP shell permission cache gaps #6511).default_permission_file()is untouched.Closes #6512
Test plan
cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" -E 'package(zeph-acp)' --lib --bins— 168/168 passedcargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 14703/14703 passed~/Library/Application Support/zeph/acp-permissions.tomlmtime predates the test run (untouched)AcpPermissionGate::new(_, None)call sites inpermission.rs; workspace-wide grep confirms no other affected sitescargo +nightly fmt --checkcleancargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscleanRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"cleangitleaks protect --stagedclean