From e1534f32f3d4e89556bff3d1e0ffbb80caad6962 Mon Sep 17 00:00:00 2001 From: Rob Hofmann Date: Thu, 12 Nov 2026 01:40:56 +0100 Subject: [PATCH] Release v1.4.3: scan from the trunk of the remote, also when it is master --- .claude/skills/ai-sdlc-gates/SKILL.md | 2 +- .../scripts/Test-GitleaksBaseline.Tests.ps1 | 16 +++++++++++++ .../scripts/Test-GitleaksBaseline.ps1 | 14 ++++++++--- .../skills/ai-sdlc-gates/sync-manifest.json | 6 ++--- CHANGELOG.md | 8 +++++++ apm.lock.yaml | 24 +++++++++---------- core/.apm/skills/ai-sdlc-gates/SKILL.md | 2 +- .../scripts/Test-GitleaksBaseline.Tests.ps1 | 16 +++++++++++++ .../scripts/Test-GitleaksBaseline.ps1 | 14 ++++++++--- .../skills/ai-sdlc-gates/sync-manifest.json | 6 ++--- core/apm.yml | 2 +- packs/bicep/apm.yml | 2 +- packs/blazor/apm.yml | 2 +- packs/discovery/apm.yml | 2 +- packs/dotnet/apm.yml | 2 +- packs/github-issues/apm.yml | 2 +- packs/github/apm.yml | 2 +- packs/knowledge/apm.yml | 2 +- packs/sonarcloud/apm.yml | 2 +- 19 files changed, 91 insertions(+), 35 deletions(-) diff --git a/.claude/skills/ai-sdlc-gates/SKILL.md b/.claude/skills/ai-sdlc-gates/SKILL.md index 8eff90e..152575c 100644 --- a/.claude/skills/ai-sdlc-gates/SKILL.md +++ b/.claude/skills/ai-sdlc-gates/SKILL.md @@ -98,7 +98,7 @@ These sit in the same `scripts/` folder but are not gates: - `Create-GitleaksBaseline.ps1` makes a gitleaks baseline with the rule sets pinned in `gitleaks-rules.json`. `Test-GitleaksBaseline.ps1` runs gitleaks against that baseline, or without one when the repository has none. It is the blocking C03 gate of `gates.json`. On a pull request in - GitHub Actions it scans `PR_BASE_SHA..HEAD`, the commits of the pull request, and in a local run `origin/main..HEAD`. When git cannot read the folder, for example as "dubious ownership", it scans nothing and exits 2 locally and 1 in GitHub Actions, never 0. + GitHub Actions it scans `PR_BASE_SHA..HEAD`, the commits of the pull request, and in a local run `..HEAD` (`origin/main`, `origin/master` or `origin/HEAD`). When git cannot read the folder, for example as "dubious ownership", it scans nothing and exits 2 locally and 1 in GitHub Actions, never 0. - `Install-Gitleaks.ps1` installs the gitleaks release pinned in `gitleaks-version.json` and refuses it on a SHA-256 mismatch, as `Install-Apm.ps1` does for APM. - `GitleaksConfig.psm1` writes the gitleaks configuration of a scan: the rules plus an allowlist for diff --git a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 index 3fe6bb3..10ffa46 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 @@ -262,6 +262,22 @@ Describe 'Test-GitleaksBaseline' { } } + It 'scans ..HEAD in a local run when the trunk of the remote is , not the whole history' -ForEach @( + @{ Name = 'master'; Refs = @('refs/remotes/origin/master'); Trunk = 'origin/master' } + @{ Name = 'named only by origin/HEAD'; Refs = @('refs/remotes/origin/develop'); Head = 'refs/remotes/origin/develop'; Trunk = 'origin/HEAD' } + @{ Name = 'main, also when master exists'; Refs = @('refs/remotes/origin/main', 'refs/remotes/origin/master'); Trunk = 'origin/main' } + ) { + $repo = New-GitRepo + foreach ($ref in $Refs) { git -C $repo update-ref $ref HEAD } + if ($Head) { git -C $repo symbolic-ref refs/remotes/origin/HEAD $Head } + Set-Content -LiteralPath (Join-Path $repo 'gitleaks-baseline.json') -Value '[]' + + & $script:ScriptUnderTest -RepoRoot $repo -PinFile $script:PinFile *> $null + + $LASTEXITCODE | Should -Be 0 + Should -Invoke gitleaks -Times 1 -Exactly -ParameterFilter { $args -contains "--log-opts=$Trunk..HEAD" } + } + It 'is the blocking C03 gate of the core, so Invoke-LocalGates.ps1 runs it everywhere' { $entry = @((Get-Content -LiteralPath (Join-Path $PSScriptRoot '..' 'gates.json') -Raw | ConvertFrom-Json).gates | Where-Object { $_.script -eq 'scripts/Test-GitleaksBaseline.ps1' }) diff --git a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 index 5f0562f..14cfb4a 100644 --- a/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 +++ b/.claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 @@ -48,8 +48,9 @@ The git log range that gitleaks scans, passed as --log-opts. Without it the script picks the range. On a pull request in GitHub Actions (PR_BASE_SHA set by the shared action) it is ..HEAD, the commits the pull request adds, as the pre-flight scans ..HEAD. On any other workflow - run it is the history of every branch and tag. In a local run it is origin/main..HEAD, or the whole - history when there is no origin/main. An empty value scans the whole history. + run it is the history of every branch and tag. In a local run it is ..HEAD, where the trunk is + the first of origin/main, origin/master and origin/HEAD that exists, or the whole history when none + does. An empty value scans the whole history. .PARAMETER RepoRoot The repository to scan, where the baseline file is. Defaults to the current folder. @@ -152,7 +153,14 @@ if ($LASTEXITCODE -ne 0) { if (-not $PSBoundParameters.ContainsKey('LogOpts')) { if ($inPipeline -and $env:PR_BASE_SHA) { $LogOpts = "$($env:PR_BASE_SHA)..HEAD" } - elseif (-not $inPipeline -and (git -C $currentDirectory rev-parse --verify --quiet 'origin/main' 2>$null)) { $LogOpts = 'origin/main..HEAD' } + elseif (-not $inPipeline) { + # The trunk of the remote: main, or master, or whatever origin/HEAD names. A repository whose trunk is + # master had no origin/main, so the scan read the whole history; on a share that took very long. + foreach ($trunk in 'origin/main', 'origin/master', 'origin/HEAD') { + $null = git -C $currentDirectory rev-parse --verify --quiet $trunk 2>$null + if ($LASTEXITCODE -eq 0) { $LogOpts = "$trunk..HEAD"; break } + } + } } Import-Module (Join-Path $PSScriptRoot 'GitleaksConfig.psm1') -Force diff --git a/.claude/skills/ai-sdlc-gates/sync-manifest.json b/.claude/skills/ai-sdlc-gates/sync-manifest.json index 629d8f7..1105263 100644 --- a/.claude/skills/ai-sdlc-gates/sync-manifest.json +++ b/.claude/skills/ai-sdlc-gates/sync-manifest.json @@ -97,8 +97,8 @@ ".claude/skills/ai-sdlc-gates/scripts/Sync-AgentsFile.Tests.ps1": "87533e139944a9dcc50eb45a5109e2ff5f16e63b", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.ps1": "0466893efb2128502dfe5367058d70231a1c14c3", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.Tests.ps1": "93de3d86a94954e2a57b6ab417454018efebf041", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "5f0562f1a1143c8c4e19ef4a7ab446604591ec8d", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "3fe6bb3be599eb4da41a97d3a16cbd66b0da7c4a", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "14cfb4ad6a08856a275bf073b8a969da858d270a", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "10ffa466e2cf244f65b260ab03923fff17ff7b29", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.ps1": "54ec6a3e42d488994ee91d0f4993ba5d3366d96a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1": "74968692c13e072622dcc86e75759a5de35a62b4", ".claude/skills/ai-sdlc-gates/scripts/Test-PushSendsNothingNew.ps1": "79da28786523f1f0c908c66032cce19d5b07f541", @@ -106,7 +106,7 @@ ".claude/skills/ai-sdlc-gates/scripts/ToolOutput.psm1": "1175b499e53dbe8b8ee25a177f65940eed07a492", ".claude/skills/ai-sdlc-gates/scripts/ToolOutput.Tests.ps1": "b3f0d8b2ee24547cc0299cff7ecf9163b583b4c5", ".claude/skills/ai-sdlc-gates/skill-catalog.json": "47720be4bb78fa80ba3be4546765c66c0ab313ba", - ".claude/skills/ai-sdlc-gates/SKILL.md": "8eff90e97ef2585101554b5df5e141cb222c0fc7", + ".claude/skills/ai-sdlc-gates/SKILL.md": "152575c17ebfbb8ffa1b5e2abf8d146bf4dd3e3d", ".claude/skills/ai-sdlc-handbook/references/artifact-graph.md": "8e16413affc7aa745d6626d424f637113c9b31cf", ".claude/skills/ai-sdlc-handbook/references/autolearn.md": "a48ad70673bb2e67448628d23d2df7bd972eaccc", ".claude/skills/ai-sdlc-handbook/references/comments.md": "f3da979003caab216d22cf35c0ead91238232a82", diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cd797a..6bffa07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ merge is ready to tag, and no second pull request is needed to name the version. Each entry names its issue, as `#42`. +## v1.4.3 - 2026-11-12 + +- In a local run, `Test-GitleaksBaseline.ps1` scans `..HEAD`, where the trunk is the first of + `origin/main`, `origin/master` and `origin/HEAD` that exists. A repository whose trunk is `master` had + no `origin/main`, so the C03 gate scanned the whole history. On a network share, where every blob is + read over the network, that made the pre-push hook run for a very long time. v1.4.2 made it visible: + before, git refused the checkout and the scan read nothing (#20). + ## v1.4.2 - 2026-11-12 - On a network share, the pre-push hook runs the gates in a local checkout whose git data stays on the diff --git a/apm.lock.yaml b/apm.lock.yaml index ba33da1..19ec400 100644 --- a/apm.lock.yaml +++ b/apm.lock.yaml @@ -3,7 +3,7 @@ apm_version: 0.31.0 dependencies: - repo_url: _local/core name: ai-sdlc-core - version: 1.4.2 + version: 1.4.3 package_type: apm_package deployed_files: - .claude/agents/architect.md @@ -246,7 +246,7 @@ dependencies: .claude/skills/adopt-docs/scripts/Test-DocCandidate.Tests.ps1: sha256:7e033f52e49f213fff6237299cc0c9ce103b5955861f50ab5923b73da57c713c .claude/skills/adopt-docs/scripts/Test-DocCandidate.ps1: sha256:0c54a3f64241f5a7af12f552dde3dee7b844fad0f88db2980ce87eca42431946 .claude/skills/adr-conventions/SKILL.md: sha256:819d4d4e8f584dc0dddd8a32cc16669317fe13a89acca9c190ff565f7923340b - .claude/skills/ai-sdlc-gates/SKILL.md: sha256:7d0c9edfcb926c58c2e46b03cdf0d5671f2e9a686ae7c6f470127710f559dac2 + .claude/skills/ai-sdlc-gates/SKILL.md: sha256:54efa6cab6cb8bcd75e79b08ea06707dcca852c0fefed55060b3ef628715d522 .claude/skills/ai-sdlc-gates/assets/actions/ai-sdlc-pr/action.yml: sha256:ee6430668f2f44b6256275645e10f8ab2167b8b6d49990465c5527d1b334abac .claude/skills/ai-sdlc-gates/assets/agents-core.md: sha256:544bb5b78ceaa2ee9eb20203ecdef5d380ecd9b10265cc90d10385d96ed72509 .claude/skills/ai-sdlc-gates/gates.json: sha256:4f2b4947786c623788a7853675754822b7ed8bd55717ad9c47f7c699a0252928 @@ -319,8 +319,8 @@ dependencies: .claude/skills/ai-sdlc-gates/scripts/Sync-AgentsFile.ps1: sha256:26d154d3a0e17c5d2e84bc1d388ac7fe292dcf08933e696293b7801cf1a21cd1 .claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.Tests.ps1: sha256:f5fcd4a5d50f6e617802eaf7ddabf6ec4ae4530dc2f7a4bc7105d4e1b96ee70f .claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.ps1: sha256:85c9eb910410b46d70124159a7a58599adf0537b3c6200c67de05e40b2d9ed20 - .claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1: sha256:c7bc96388df2b0a6c33a35a8b35bacf96d487375f34e567c00ec1c638f26aeaa - .claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1: sha256:e8b8f218a3886fa25c8a84916dd005ab30169e2983679b4498bbbfd049827826 + .claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1: sha256:d6519f82d47dde56fd9ca7961d494a08ce3f7a0e762a4ee9cbd8b00638944328 + .claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1: sha256:1a69124fce3fa6bc0172e32d50da079b91db41d9122718b8a349b5225e1aec69 .claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1: sha256:54ed79f8f67be5481ee9613a12bbfa4b71aa508f2d143e661afbe518db8f40ef .claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.ps1: sha256:12cb640a6acf0d1966b43798f9bbde65bffc76ad05781e5dfc8338599f329158 .claude/skills/ai-sdlc-gates/scripts/Test-PushSendsNothingNew.Tests.ps1: sha256:a47e96755dba99b448c287c9fcb2f584713b31927022a28490e8d04c333b634b @@ -335,7 +335,7 @@ dependencies: .claude/skills/ai-sdlc-gates/scripts/gitleaks-rules.json: sha256:6a8a75c5dbcf2378a1c52d046e34ce275aac7ce08a0ae61408d25c18e1e27014 .claude/skills/ai-sdlc-gates/scripts/gitleaks-version.json: sha256:c54acb854f87a1bbdf0e90c670b72b5de3cd37f7e460d82eca599c3c7af23a84 .claude/skills/ai-sdlc-gates/skill-catalog.json: sha256:5537684656bf189a740ba7e9e7050083af05668d00501ce1e9c6909cb8b91203 - .claude/skills/ai-sdlc-gates/sync-manifest.json: sha256:e96ed9ae2d913ec0c7014f1c43254003b32af1dda025ffa108ae7ac14851c55f + .claude/skills/ai-sdlc-gates/sync-manifest.json: sha256:3916b24872ae37a3eed9c554aaff794a758018a465c38da1aaecd8be1d18d2a1 .claude/skills/ai-sdlc-handbook/SKILL.md: sha256:548e6b9ad79d3d2afa2f5779835988eeb12c49cda08917c4bbaa9ac0486a47a0 .claude/skills/ai-sdlc-handbook/references/README.md: sha256:654afcaa2b81f560eff93dbdef521b09ced06137a1dbb85d70a4e14ef7502248 .claude/skills/ai-sdlc-handbook/references/artifact-graph.md: sha256:d7ddfe20e5ee6565bcf25f9cef0f578da2a4ab1590033d791b8814d4688fd1f0 @@ -431,7 +431,7 @@ dependencies: local_path: ./core - repo_url: _local/discovery name: ai-sdlc-discovery - version: 1.4.2 + version: 1.4.3 package_type: apm_package deployed_files: - .claude/skills/draw-customer-journey @@ -448,7 +448,7 @@ dependencies: local_path: ./packs/discovery - repo_url: _local/github name: ai-sdlc-github - version: 1.4.2 + version: 1.4.3 package_type: apm_package deployed_files: - .claude/skills/fix-pr-feedback @@ -538,7 +538,7 @@ dependencies: local_path: ./packs/github - repo_url: _local/github-issues name: ai-sdlc-github-issues - version: 1.4.2 + version: 1.4.3 package_type: apm_package deployed_files: - .claude/agents/draft-reviewer.md @@ -772,7 +772,7 @@ deployments: owners: - ./core active_owner: ./core - content_hash: sha256:7d0c9edfcb926c58c2e46b03cdf0d5671f2e9a686ae7c6f470127710f559dac2 + content_hash: sha256:54efa6cab6cb8bcd75e79b08ea06707dcca852c0fefed55060b3ef628715d522 - kind: project-relative target: claude value: .claude/skills/ai-sdlc-gates/assets/actions/ai-sdlc-pr/action.yml @@ -1429,7 +1429,7 @@ deployments: owners: - ./core active_owner: ./core - content_hash: sha256:c7bc96388df2b0a6c33a35a8b35bacf96d487375f34e567c00ec1c638f26aeaa + content_hash: sha256:d6519f82d47dde56fd9ca7961d494a08ce3f7a0e762a4ee9cbd8b00638944328 - kind: project-relative target: claude value: .claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 @@ -1438,7 +1438,7 @@ deployments: owners: - ./core active_owner: ./core - content_hash: sha256:e8b8f218a3886fa25c8a84916dd005ab30169e2983679b4498bbbfd049827826 + content_hash: sha256:1a69124fce3fa6bc0172e32d50da079b91db41d9122718b8a349b5225e1aec69 - kind: project-relative target: claude value: .claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1 @@ -1573,7 +1573,7 @@ deployments: owners: - ./core active_owner: ./core - content_hash: sha256:e96ed9ae2d913ec0c7014f1c43254003b32af1dda025ffa108ae7ac14851c55f + content_hash: sha256:3916b24872ae37a3eed9c554aaff794a758018a465c38da1aaecd8be1d18d2a1 - kind: project-relative target: claude value: .claude/skills/ai-sdlc-handbook diff --git a/core/.apm/skills/ai-sdlc-gates/SKILL.md b/core/.apm/skills/ai-sdlc-gates/SKILL.md index 8eff90e..152575c 100644 --- a/core/.apm/skills/ai-sdlc-gates/SKILL.md +++ b/core/.apm/skills/ai-sdlc-gates/SKILL.md @@ -98,7 +98,7 @@ These sit in the same `scripts/` folder but are not gates: - `Create-GitleaksBaseline.ps1` makes a gitleaks baseline with the rule sets pinned in `gitleaks-rules.json`. `Test-GitleaksBaseline.ps1` runs gitleaks against that baseline, or without one when the repository has none. It is the blocking C03 gate of `gates.json`. On a pull request in - GitHub Actions it scans `PR_BASE_SHA..HEAD`, the commits of the pull request, and in a local run `origin/main..HEAD`. When git cannot read the folder, for example as "dubious ownership", it scans nothing and exits 2 locally and 1 in GitHub Actions, never 0. + GitHub Actions it scans `PR_BASE_SHA..HEAD`, the commits of the pull request, and in a local run `..HEAD` (`origin/main`, `origin/master` or `origin/HEAD`). When git cannot read the folder, for example as "dubious ownership", it scans nothing and exits 2 locally and 1 in GitHub Actions, never 0. - `Install-Gitleaks.ps1` installs the gitleaks release pinned in `gitleaks-version.json` and refuses it on a SHA-256 mismatch, as `Install-Apm.ps1` does for APM. - `GitleaksConfig.psm1` writes the gitleaks configuration of a scan: the rules plus an allowlist for diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 index 3fe6bb3..10ffa46 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1 @@ -262,6 +262,22 @@ Describe 'Test-GitleaksBaseline' { } } + It 'scans ..HEAD in a local run when the trunk of the remote is , not the whole history' -ForEach @( + @{ Name = 'master'; Refs = @('refs/remotes/origin/master'); Trunk = 'origin/master' } + @{ Name = 'named only by origin/HEAD'; Refs = @('refs/remotes/origin/develop'); Head = 'refs/remotes/origin/develop'; Trunk = 'origin/HEAD' } + @{ Name = 'main, also when master exists'; Refs = @('refs/remotes/origin/main', 'refs/remotes/origin/master'); Trunk = 'origin/main' } + ) { + $repo = New-GitRepo + foreach ($ref in $Refs) { git -C $repo update-ref $ref HEAD } + if ($Head) { git -C $repo symbolic-ref refs/remotes/origin/HEAD $Head } + Set-Content -LiteralPath (Join-Path $repo 'gitleaks-baseline.json') -Value '[]' + + & $script:ScriptUnderTest -RepoRoot $repo -PinFile $script:PinFile *> $null + + $LASTEXITCODE | Should -Be 0 + Should -Invoke gitleaks -Times 1 -Exactly -ParameterFilter { $args -contains "--log-opts=$Trunk..HEAD" } + } + It 'is the blocking C03 gate of the core, so Invoke-LocalGates.ps1 runs it everywhere' { $entry = @((Get-Content -LiteralPath (Join-Path $PSScriptRoot '..' 'gates.json') -Raw | ConvertFrom-Json).gates | Where-Object { $_.script -eq 'scripts/Test-GitleaksBaseline.ps1' }) diff --git a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 index 5f0562f..14cfb4a 100644 --- a/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 +++ b/core/.apm/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1 @@ -48,8 +48,9 @@ The git log range that gitleaks scans, passed as --log-opts. Without it the script picks the range. On a pull request in GitHub Actions (PR_BASE_SHA set by the shared action) it is ..HEAD, the commits the pull request adds, as the pre-flight scans ..HEAD. On any other workflow - run it is the history of every branch and tag. In a local run it is origin/main..HEAD, or the whole - history when there is no origin/main. An empty value scans the whole history. + run it is the history of every branch and tag. In a local run it is ..HEAD, where the trunk is + the first of origin/main, origin/master and origin/HEAD that exists, or the whole history when none + does. An empty value scans the whole history. .PARAMETER RepoRoot The repository to scan, where the baseline file is. Defaults to the current folder. @@ -152,7 +153,14 @@ if ($LASTEXITCODE -ne 0) { if (-not $PSBoundParameters.ContainsKey('LogOpts')) { if ($inPipeline -and $env:PR_BASE_SHA) { $LogOpts = "$($env:PR_BASE_SHA)..HEAD" } - elseif (-not $inPipeline -and (git -C $currentDirectory rev-parse --verify --quiet 'origin/main' 2>$null)) { $LogOpts = 'origin/main..HEAD' } + elseif (-not $inPipeline) { + # The trunk of the remote: main, or master, or whatever origin/HEAD names. A repository whose trunk is + # master had no origin/main, so the scan read the whole history; on a share that took very long. + foreach ($trunk in 'origin/main', 'origin/master', 'origin/HEAD') { + $null = git -C $currentDirectory rev-parse --verify --quiet $trunk 2>$null + if ($LASTEXITCODE -eq 0) { $LogOpts = "$trunk..HEAD"; break } + } + } } Import-Module (Join-Path $PSScriptRoot 'GitleaksConfig.psm1') -Force diff --git a/core/.apm/skills/ai-sdlc-gates/sync-manifest.json b/core/.apm/skills/ai-sdlc-gates/sync-manifest.json index 629d8f7..1105263 100644 --- a/core/.apm/skills/ai-sdlc-gates/sync-manifest.json +++ b/core/.apm/skills/ai-sdlc-gates/sync-manifest.json @@ -97,8 +97,8 @@ ".claude/skills/ai-sdlc-gates/scripts/Sync-AgentsFile.Tests.ps1": "87533e139944a9dcc50eb45a5109e2ff5f16e63b", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.ps1": "0466893efb2128502dfe5367058d70231a1c14c3", ".claude/skills/ai-sdlc-gates/scripts/Sync-AllowRules.Tests.ps1": "93de3d86a94954e2a57b6ab417454018efebf041", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "5f0562f1a1143c8c4e19ef4a7ab446604591ec8d", - ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "3fe6bb3be599eb4da41a97d3a16cbd66b0da7c4a", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.ps1": "14cfb4ad6a08856a275bf073b8a969da858d270a", + ".claude/skills/ai-sdlc-gates/scripts/Test-GitleaksBaseline.Tests.ps1": "10ffa466e2cf244f65b260ab03923fff17ff7b29", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.ps1": "54ec6a3e42d488994ee91d0f4993ba5d3366d96a", ".claude/skills/ai-sdlc-gates/scripts/Test-PushReceipt.Tests.ps1": "74968692c13e072622dcc86e75759a5de35a62b4", ".claude/skills/ai-sdlc-gates/scripts/Test-PushSendsNothingNew.ps1": "79da28786523f1f0c908c66032cce19d5b07f541", @@ -106,7 +106,7 @@ ".claude/skills/ai-sdlc-gates/scripts/ToolOutput.psm1": "1175b499e53dbe8b8ee25a177f65940eed07a492", ".claude/skills/ai-sdlc-gates/scripts/ToolOutput.Tests.ps1": "b3f0d8b2ee24547cc0299cff7ecf9163b583b4c5", ".claude/skills/ai-sdlc-gates/skill-catalog.json": "47720be4bb78fa80ba3be4546765c66c0ab313ba", - ".claude/skills/ai-sdlc-gates/SKILL.md": "8eff90e97ef2585101554b5df5e141cb222c0fc7", + ".claude/skills/ai-sdlc-gates/SKILL.md": "152575c17ebfbb8ffa1b5e2abf8d146bf4dd3e3d", ".claude/skills/ai-sdlc-handbook/references/artifact-graph.md": "8e16413affc7aa745d6626d424f637113c9b31cf", ".claude/skills/ai-sdlc-handbook/references/autolearn.md": "a48ad70673bb2e67448628d23d2df7bd972eaccc", ".claude/skills/ai-sdlc-handbook/references/comments.md": "f3da979003caab216d22cf35c0ead91238232a82", diff --git a/core/apm.yml b/core/apm.yml index 9acf0dc..5b8baa0 100644 --- a/core/apm.yml +++ b/core/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-core -version: "1.4.2" +version: "1.4.3" description: The AI-SDLC core for every repository - workflow skills, review agents, hooks, core gates and the handbook. diff --git a/packs/bicep/apm.yml b/packs/bicep/apm.yml index 7f7b429..543f67a 100644 --- a/packs/bicep/apm.yml +++ b/packs/bicep/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-bicep -version: "1.4.2" +version: "1.4.3" description: The Bicep pack - Bicep conventions for infrastructure templates. diff --git a/packs/blazor/apm.yml b/packs/blazor/apm.yml index 1fb4236..251cf01 100644 --- a/packs/blazor/apm.yml +++ b/packs/blazor/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-blazor -version: "1.4.2" +version: "1.4.3" description: The Blazor pack - portal UI conventions, component authorization and the Razor gates. diff --git a/packs/discovery/apm.yml b/packs/discovery/apm.yml index b93fc8f..0b021d4 100644 --- a/packs/discovery/apm.yml +++ b/packs/discovery/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-discovery -version: "1.4.2" +version: "1.4.3" description: The discovery pack - the discovery workflows that write a research summary, a journey map and a hypothesis canvas as markdown files in the repository. diff --git a/packs/dotnet/apm.yml b/packs/dotnet/apm.yml index a05b235..2e6f987 100644 --- a/packs/dotnet/apm.yml +++ b/packs/dotnet/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-dotnet -version: "1.4.2" +version: "1.4.3" description: The .NET pack - C# conventions, test-first, the .NET gates and the code graph. diff --git a/packs/github-issues/apm.yml b/packs/github-issues/apm.yml index 40bb71c..87ea1fb 100644 --- a/packs/github-issues/apm.yml +++ b/packs/github-issues/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-github-issues -version: "1.4.2" +version: "1.4.3" description: The GitHub Issues pack - issue conventions and the issue contract gates. diff --git a/packs/github/apm.yml b/packs/github/apm.yml index 5dce184..b64088e 100644 --- a/packs/github/apm.yml +++ b/packs/github/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-github -version: "1.4.2" +version: "1.4.3" description: The GitHub pack - pull requests, review threads, pull request delivery metrics and the GitHub Actions workflows. diff --git a/packs/knowledge/apm.yml b/packs/knowledge/apm.yml index 72bfe11..69282d2 100644 --- a/packs/knowledge/apm.yml +++ b/packs/knowledge/apm.yml @@ -1,3 +1,3 @@ name: ai-sdlc-knowledge -version: "1.4.2" +version: "1.4.3" description: The knowledge pack - the conventions and the workflow for platform knowledge notes in the knowledge repository. diff --git a/packs/sonarcloud/apm.yml b/packs/sonarcloud/apm.yml index 2e11918..c104c57 100644 --- a/packs/sonarcloud/apm.yml +++ b/packs/sonarcloud/apm.yml @@ -1,5 +1,5 @@ name: ai-sdlc-sonarcloud -version: "1.4.2" +version: "1.4.3" description: The SonarQube Cloud pack - the SonarQube MCP server for the agent session, and the gate that keeps the token and the organization out of the repository. dependencies: mcp: