Skip to content

fix(hooks): track script directories through shell wrappers - #433

Merged
P4suta merged 3 commits into
mainfrom
fix/hook-directory-flow
Oct 25, 2026
Merged

P4suta merged 3 commits into
mainfrom
fix/hook-directory-flow

Conversation

@P4suta

@P4suta P4suta commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Why

The inspector could use the original directory after a shell wrapper changed location, causing it to inspect the wrong relative script or omit a policy check.

Changes

Carry one typed invocation directory through legacy policy and script linting, and accept only supported location transitions whose control flow establishes success.
Refuse relative reads while the directory remains uncertain, including extensionless script probes, rather than inferring a destination.
Classify PowerShell cd.., cd~, and drive-letter functions as unresolved location changes, while preserving caller-directory, shell-boundary, and absolute-entry behavior.
Keep mandatory body checks and existing inspection limits intact.

Validation

Fifteen directory-flow tests passed on Windows.
Strict all-target Clippy for dotfiles and rules, workspace formatting, and git diff --check passed.
Native CLI probes selected the expected script at a stable directory and after a supported PowerShell location change.
An unresolved location produced an explicit unavailable-inspection diagnostic without a planted-script finding.
The existing GitHub body restriction also refuses multi-command input.
The added Kani property and rejecting probes remain unrun, as does local Linux/macOS verification.
Native initial command bindings, filesystem identity, and the external execution bridge remain explicit assumptions.

Closes #426.

@coderabbitai ignore

@P4suta
P4suta marked this pull request as ready for review October 25, 2026 01:57
@P4suta
P4suta merged commit d6d1c97 into main Oct 25, 2026
6 checks passed
@P4suta
P4suta deleted the fix/hook-directory-flow branch October 25, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): track script directories through shell wrappers

1 participant