verify_staged
Run whitelisted checks on staged file writes via a temp copy before committing, so linting or typechecking sees new content without changing the target.
Instructions
Run a whitelisted command against a staged write WITHOUT touching the target file: the op's content is materialized to a temp file in the same directory (import/path resolution matches the real file), '{file}' in argv is replaced by the temp path (appended if absent), and the command runs under the command_whitelist. Use it to typecheck/lint a staged op before commit_write — running a checker on the original path sees the OLD on-disk content, not the stage. restore_paths lists files the command may rewrite (e.g. an auto-updated lint baseline) — snapshotted before, restored after. The temp file is always removed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (must be inside allowed roots); defaults to the file's directory | |
| argv | Yes | Whitelisted command argv; '{file}' is replaced by the materialized temp path | |
| op_id | Yes | ||
| timeout_s | No | Command timeout override (default: run_command_timeout_s config) | |
| restore_paths | No | Files to snapshot and restore after the run (e.g. auto-rewritten baseline files) |