Orchestrata Ultimate › Tests › Reference › claude › test_intercept_guards
Tests reference — tests/claude/test_intercept_guards.py
Module of tests/claude, split out because the directory page would be too large.
Prose pending.
tests/claude/test_intercept_guards.py
source · 14 tests · 319 lines
Tests for the three PreToolUse intercept guards.
| Kind | Name | Line | Description |
|---|---|---|---|
| function | test_write_new_file_is_allowed |
76 | The exact call the broken guard denied five times in one session. |
| function | test_write_over_existing_file_is_blocked |
85 | DELIBERATE POLICY (user ruling): an existing file goes through Edit — |
| function | test_write_to_context_json_is_blocked |
102 | context.json/context.md belong to the session CLI, never direct writes. |
| function | test_write_with_malformed_payload_steps_aside |
112 | A guard that cannot see its input must not deny the tool wholesale. |
| function | test_write_legacy_top_level_shape_still_works |
122 | Direct/legacy invocation puts file_path at the top level; the fallback |
| function | test_bash_write_through_patterns_are_blocked |
139 | The guard's whole purpose — and it allowed every one of these while it |
| function | test_bash_ordinary_commands_are_allowed |
152 | |
| function | test_the_block_message_names_the_escape_that_actually_exists |
158 | A stated affordance that does not exist costs more turns than none. |
| function | test_the_block_message_says_a_matched_literal_may_be_only_text |
189 | The matcher reads the RAW command, not parsed shell. |
| function | test_bash_redirect_into_scratchpad_is_allowed |
207 | The block message has always promised a scratch escape ("For a |
| function | test_bash_redirect_mixing_repo_and_scratch_targets_still_blocks |
221 | ALL extractable targets must be scratch — one repo-file target in |
| function | test_bash_empty_or_malformed_payload_allows |
234 | No command visible -> nothing to judge -> step aside. |
| function | test_edit_checkpoint_creates_no_commit_and_moves_no_ref |
251 | The checkpoint must be recoverable WITHOUT touching history. |
| function | test_edit_outside_a_repo_still_allows |
310 | The checkpoint is best-effort; the edit itself must never be held up. |