Skip to content

Release v1.4.2: trust the gate checkout on a share, fail a blind secret scan, audit in the worktree - #27

Merged
RobHofmann merged 1 commit into
mainfrom
20-share-worktree-fixes
Nov 12, 2026
Merged

RobHofmann merged 1 commit into
mainfrom
20-share-worktree-fixes

Conversation

@RobHofmann

Copy link
Copy Markdown
Owner

Refs #20

Three fixes for a consumer on a network share, found while taking v1.4.1 on one.

What changed

  • Blind secret scan in the pre-push hook. On a share, the hook runs the gates in a local checkout whose git data stays on the share. Git refused that checkout as "dubious ownership", so gitleaks scanned 0 commits, printed "no leaks found", and the C03 gate passed. The hook now trusts the checkout folder through GIT_CONFIG_COUNT / GIT_CONFIG_KEY_0 / GIT_CONFIG_VALUE_0 (safe.directory), only for the gate processes. The git config of the machine is not changed. cygpath -m gives the C:/... form that git on Windows compares.
  • The gate itself refuses a blind scan. Test-GitleaksBaseline.ps1 checks git rev-parse HEAD before it scans. When git cannot read the folder, it exits 2 locally and 1 in GitHub Actions, never 0.
  • False audit failure after a good install. Update-AiSdlc.ps1 ran apm audit --ci on the share, where apm_modules does not exist, so the audit failed after a correct install and nothing was staged. Invoke-ApmInstall takes -AuditCode [ref] and runs the audit in the same folder as the install: the worktree on a share, the repository itself otherwise. A failed audit leaves the share as it was.

How it was tested

  • New Pester tests: the gate exits 1 or 2 in a folder git cannot read; the hook sets safe.directory to the checkout; the audit runs in the worktree, only after a good install, and a failed audit leaves the share unchanged. AiSdlcSetup 26/26, PrePushHook 34/34, Test-GitleaksBaseline all pass.
  • On a real consumer on a mapped network drive: in a worktree of it, the new gate exited 2 without the trust ("git cannot read the repository") and scanned 2 commits with no leaks with it. Invoke-ApmInstall -AuditCode ran a frozen install and the audit in the worktree: all 10 audit checks passed and the share was left unchanged.
  • Pre-flight: gates, tests, story check and gitleaks pass.

Release steps after the merge: tag v1.4.2 with Release v1.4.2 for #20, publish the release. #20 is already closed with its refined label.

@RobHofmann
RobHofmann merged commit e3970e6 into main Nov 12, 2026
16 checks passed
@RobHofmann
RobHofmann deleted the 20-share-worktree-fixes branch November 12, 2026 00:21
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.

1 participant