Skip to content

fix(site-audit): build files miscategorized as config; summary truncated counts; SPECKIT_VERSION absent from output#2

Merged
markhazleton merged 2 commits intomainfrom
copilot/fix-build-files-misclassified
Mar 30, 2026
Merged

fix(site-audit): build files miscategorized as config; summary truncated counts; SPECKIT_VERSION absent from output#2
markhazleton merged 2 commits intomainfrom
copilot/fix-build-files-misclassified

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 30, 2026

Three bugs in scripts/powershell/site-audit.ps1: workflow .yml files always counted as config (never build), summary output capped counts at the sample limit instead of true totals, and .documentation/SPECKIT_VERSION data was absent from pre-scan output.

Bug 1 — Build files always 0

Get-ChildItem without -Force silently skips hidden directories (.github) on Linux. Additionally, the config extension check (.yml/.yaml) ran before the build path check, so workflow files were claimed by config and never reached the build branch.

# Before: .yml claimed by config; .github never traversed without -Force
$allFiles = Get-ChildItem -Path $RepoRoot -Recurse -File ...
if ($ext -in $configExtensions ...) { $categories.config += ...; continue }
if ($relativePath -match '\.github/workflows/') { $categories.build += ... }  # unreachable

# After: hidden dirs included; build path checked first with continue
$allFiles = Get-ChildItem -Path $RepoRoot -Recurse -File -Force ...
if ($relativePath -match '(^|[/\\])\.github[/\\]workflows[/\\]' ...) { $categories.build += ...; continue }
if ($ext -in $configExtensions ...) { $categories.config += ...; continue }

Bug 2 — Summary counts capped at sample limit

The summary block read .Count on the already-truncated sample arrays instead of the pre-computed _total properties, silently capping displayed counts at $LargeFileLimit/$PatternSampleLimit (default 20–25).

  • $result.metrics.large_files.Count$result.metrics.large_files_total
  • $result.patterns.security.hardcoded_secrets.Count$result.patterns.security.hardcoded_secrets_total
  • Same fix for insecure_patterns and todo_comments

Bug 3 — SPECKIT_VERSION absent from pre-scan output

Added Get-SpeckitVersion helper that reads .documentation/SPECKIT_VERSION (three-line format: version, installed:, agent:) and returns structured data. Result is included as a top-level speckit key in JSON output and as a Spec Kit Version: line in summary output.

"speckit": {
  "stamp_exists": true,
  "installed_version": "1.5.1",
  "installed_date": "2026-03-30",
  "agent": "copilot"
}

…truncated counts; SPECKIT_VERSION not in pre-scan output

Agent-Logs-Url: https://github.com/markhazleton/spec-kit/sessions/f307b665-081f-4698-97e4-ba94d606ecc1

Co-authored-by: markhazleton <223906+markhazleton@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix miscategorized build files and truncated summary counts fix(site-audit): build files miscategorized as config; summary truncated counts; SPECKIT_VERSION absent from output Mar 30, 2026
Copilot AI requested a review from markhazleton March 30, 2026 13:22
@markhazleton markhazleton marked this pull request as ready for review March 30, 2026 13:24
@markhazleton markhazleton merged commit f6ab365 into main Mar 30, 2026
1 check passed
@markhazleton markhazleton deleted the copilot/fix-build-files-misclassified branch March 30, 2026 13:24
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(site-audit): build files miscategorized as config; summary shows truncated counts; SPECKIT_VERSION not in pre-scan output

2 participants