Skip to content

new_feature.hook_policy

new_feature.hook_policy

Evaluate provider-neutral managed-worktree hook requests.

GitContext dataclass

Describe the repository and branch that own a target path.

WriteTarget dataclass

Distinguish content writes from changes to a directory entry itself.

blocks_target_edit(targets: tuple[Path | WriteTarget, ...], *, cwd: Path) -> bool

Protect both the named entry and any content destination it follows.

record_target_changes(command: str, *, cwd: Path, call_id: str | None) -> None

Remember tracked changes on the target branch before a shell command runs.

target_changed_since_record(command: str, *, cwd: Path, call_id: str | None) -> bool

Check whether tracked target-branch files changed since this call's record.

parse_worktree_action(command: str) -> WorktreeAction | None

Return the direct managed-worktree action invoked by a shell command.

blocks_target_merge(command: str, *, cwd: Path) -> bool

Reject starting a direct merge on the configured target branch.

shell_write_targets(command: str, *, cwd: Path) -> tuple[WriteTarget, ...]

Return files that common shell redirections and file utilities would write.