Aismit
624fdeecee
Run patch hooks for intercepted apply_patch commands ( #65077 )
...
## Why
Codex can intercept an `apply_patch` heredoc passed to `exec_command`
and apply the patch directly. That path ran shell hooks but bypassed
`apply_patch` hooks, so patch-specific rules could miss the same edit
when it was submitted through the shell tool.
## What changed
- Run `apply_patch` `PreToolUse` after shell hooks and before file
verification. Hooks can block or rewrite the patch, and the final
patch is checked against the selected environment's permissions.
- Report the executed patch through `apply_patch` `PostToolUse`. Link
the patch hook events to the outer shell call with
`parent_tool_use_id` and provide working-directory and filesystem
metadata for hooks that inspect patch targets.
- Apply the same block and rewrite rules in recorded Guardian reviews.
Mark those hook requests with `review_only` and review the resulting
patch without executing it or publishing hook-provided context.
## Testing
Add coverage for hook blocks and rewrites, effective working directories,
environment permissions, and cancellation before and after a patch write.
Cover recorded reviews of rewritten patches and reviews stopped by a hook.
GitOrigin-RevId: 2115f26261a20d4a512669bc9e277a764b8f42f4
2026-12-01 20:18:13 +00:00
..
2026-12-01 20:16:42 +00:00
2026-11-13 00:29:24 +00:00
2026-11-17 03:28:51 +00:00
2026-12-01 16:51:26 +00:00
2026-12-01 13:42:02 +00:00
2026-11-24 23:55:40 +00:00
2026-11-03 02:37:20 +00:00
2026-10-30 18:20:57 +00:00
2026-12-01 20:18:13 +00:00
2026-11-15 00:39:00 +00:00
2026-11-26 14:27:37 +00:00
2026-11-24 10:47:15 +00:00
2026-11-18 15:24:29 +00:00
2026-11-18 15:24:29 +00:00
2026-11-18 04:41:01 +00:00
2026-11-19 00:17:19 +00:00
2026-12-01 20:16:42 +00:00
2026-12-01 15:16:03 +00:00
2026-12-01 15:16:03 +00:00
2026-11-25 02:31:14 +00:00
2026-12-01 20:18:13 +00:00
2026-12-01 06:25:16 +00:00
2026-12-01 16:54:12 +00:00
2026-11-14 05:00:21 +00:00
2026-12-01 20:16:42 +00:00
2026-11-04 16:34:49 +00:00
2026-11-26 02:32:11 +00:00
2026-11-23 05:39:53 +00:00
2026-10-26 21:15:23 +00:00
2026-10-26 21:15:23 +00:00
2026-11-14 15:44:38 +00:00
2026-11-23 16:52:47 +00:00
2026-11-06 22:27:23 +00:00
2026-12-01 04:47:08 +00:00
2026-11-14 15:44:38 +00:00
2026-11-19 01:14:54 +00:00
2026-12-01 04:47:08 +00:00
2026-11-24 04:29:16 +00:00
2026-11-19 09:37:29 +00:00
2026-11-24 04:29:16 +00:00
2026-11-24 11:05:19 +00:00
2026-12-01 00:40:48 +00:00
2026-12-01 15:16:03 +00:00
2026-11-14 19:40:12 +00:00
2026-11-04 13:03:01 +00:00
2026-11-20 02:59:58 +00:00
2026-11-23 17:11:57 +00:00
2026-11-06 04:33:14 +00:00
2026-11-25 14:22:54 +00:00
2026-11-04 00:19:12 +00:00
2026-11-04 00:19:12 +00:00
2026-11-30 20:29:59 +00:00
2026-11-13 18:46:13 +00:00
2026-11-21 03:14:33 +00:00
2026-11-17 05:35:07 +00:00
2026-11-30 20:29:59 +00:00
2026-11-25 14:34:40 +00:00
2026-11-25 14:34:40 +00:00
2026-11-13 21:51:53 +00:00
2026-11-13 21:51:53 +00:00
2026-11-25 00:11:12 +00:00
2026-11-30 18:16:01 +00:00
2026-11-04 09:51:28 +00:00
2026-11-20 05:17:34 +00:00
2026-11-26 02:32:11 +00:00
2026-11-25 22:53:05 +00:00
2026-11-20 00:44:31 +00:00
2026-11-13 00:29:24 +00:00
2026-11-03 11:14:59 +00:00
2026-11-19 22:32:56 +00:00
2026-11-19 01:16:07 +00:00
2026-11-19 00:17:19 +00:00
2026-11-14 23:53:23 +00:00
2026-11-30 18:29:43 +00:00
2026-12-01 20:18:13 +00:00
2026-11-17 16:56:34 +00:00
2026-11-24 00:13:03 +00:00
2026-12-01 20:18:13 +00:00
2026-11-13 18:44:31 +00:00
2026-11-17 13:38:34 +00:00
2026-12-01 06:25:16 +00:00
2026-11-20 05:17:34 +00:00
2026-12-01 03:06:11 +00:00
2026-11-26 02:32:11 +00:00
2026-11-27 16:25:10 +00:00
2026-11-11 23:36:19 +00:00
2026-11-20 17:46:32 +00:00
2026-12-01 04:09:45 +00:00
2026-11-14 23:50:12 +00:00
2026-11-07 07:45:36 +00:00
2026-11-18 11:01:02 +00:00
2026-11-18 09:55:30 +00:00
2026-11-23 18:44:09 +00:00
2026-11-17 04:08:00 +00:00
2026-11-10 11:17:06 +00:00
2026-11-14 02:23:37 +00:00
2026-11-25 02:31:54 +00:00
2026-11-25 02:31:54 +00:00
2026-11-18 15:24:29 +00:00
2026-11-18 15:24:29 +00:00
2026-11-23 01:06:41 +00:00
2026-11-17 01:59:51 +00:00
2026-11-19 21:06:08 +00:00
2026-12-01 04:47:08 +00:00
2026-11-19 17:46:53 +00:00
2026-11-07 10:41:36 +00:00
2026-11-07 10:41:36 +00:00
2026-11-19 03:03:32 +00:00
2026-11-18 06:22:36 +00:00
2026-11-26 02:32:11 +00:00
2026-11-13 18:48:18 +00:00
2026-12-01 04:09:45 +00:00
2026-11-07 02:01:23 +00:00
2026-11-16 23:26:42 +00:00
2026-11-25 00:28:07 +00:00
2026-11-15 00:03:59 +00:00
2026-12-01 20:18:13 +00:00
2026-11-19 21:06:08 +00:00
2026-10-30 18:34:10 +00:00
2026-11-30 09:40:54 +00:00
2026-12-01 00:40:48 +00:00
2026-11-30 09:40:54 +00:00
2026-11-30 09:40:54 +00:00
2026-11-30 16:12:41 +00:00
2026-11-18 12:55:14 +00:00
2026-11-16 14:18:24 +00:00
2026-11-16 14:18:24 +00:00
2026-11-24 05:33:38 +00:00
2026-11-30 20:29:59 +00:00
2026-11-30 19:56:54 +00:00
2026-12-01 06:25:16 +00:00
2026-11-18 17:09:03 +00:00